@framers/agentos-extensions-registry

中文文档
0.18.20发布于 2026/11/14Apache-2.0TypeScriptES Module零依赖构建来源已验证近 30 天下载 2.2万

Extension catalog for AgentOS — channel, tool, and provider metadata with dynamic loading via createCuratedManifest()

原始使用文档
文档目录14 节
  1. What this package is
  2. Architecture: catalog vs. source code
  3. Lazy and optional by design
  4. Layer 1: optional peerDependenciesMeta per extension
  5. Layer 2: import.meta.resolve() skips uninstalled packages a…
  6. Layer 3: per-extension requiredSecrets in catalog metadata
  7. Layer 4: heavy resources defer to SharedServiceRegistry
  8. What this looks like end-to-end
  9. Installation
  10. Main exports
  11. Usage
  12. createCuratedManifest(options?)
  13. Contributing and support
  14. License

AgentOS     Frame.dev

@framers/agentos-extensions-registry

Extension catalog for AgentOS — metadata, query helpers, and createCuratedManifest() factory.

npm

What this package is

This is the catalog and SDK for AgentOS extensions. It does not contain extension source code — it provides:

  • Static metadata catalogs (CHANNEL_CATALOG, TOOL_CATALOG, PROVIDER_CATALOG) describing every known extension: its name, package, SDK, required secrets, and capabilities.
  • Query helpers (getChannelEntry(), getToolEntry(), getProviderEntry()) for looking up catalog entries at runtime.
  • Dynamic loader (createCuratedManifest()) that resolves which extension packages are actually installed, then builds an ExtensionManifest the AgentOS runtime can consume.

Architecture: catalog vs. source code

PackageRole
@framers/agentos-extensionsSource code — the actual channel adapters, tool implementations, and extension packs
@framers/agentos-extensions-registry (this)Catalog/SDK — indexes the extensions above, stores metadata, and dynamically loads whichever packages are installed
@framers/agentosRuntime — provides ITool, IChannelAdapter, ExtensionManifest, and the agent kernel that consumes the manifest

Dependency direction: this package depends on @framers/agentos for runtime types (peer dep) and references extension packages from @framers/agentos-extensions as optional dependencies. Only installed extensions are loaded; missing packages are silently skipped.

Lazy and optional by design

The catalog and the runtime are decoupled on purpose. The four DI layers below operate independently, so a host pays for exactly what it installs and uses.

Layer 1: optional peerDependenciesMeta per extension

Every catalog entry in CHANNEL_CATALOG, TOOL_CATALOG, and PROVIDER_CATALOG references its npm package by name only. This package does not import them eagerly. peerDependenciesMeta.optional: true keeps npm install from pulling extension source unless the host explicitly adds the package to its own package.json.

Layer 2: import.meta.resolve() skips uninstalled packages at manifest build

createCuratedManifest() walks the requested filter (tools: 'all' | string[] | 'none', channels: ...) and calls import.meta.resolve(packageName) per entry. Failures are swallowed; the entry is dropped from the output manifest. The runtime never sees an unresolvable pack. getAvailableExtensions() and getAvailableChannels() expose this resolution state for hosts that want to surface installed extensions in their own UI or logs.

Layer 3: per-extension requiredSecrets in catalog metadata

CHANNEL_CATALOG and TOOL_CATALOG entries declare which secret keys an extension expects (mapped to environment variables via SECRET_ENV_MAP). When the runtime activates a descriptor, it consults requiredSecrets and skips activation if a non-optional secret is unresolvable. A pack can also read a secret its entry does not require. The LLM judge in pii-redaction is one: it runs only when the host sets the pack's llmJudge option, and when that option carries no apiKey the judge asks AgentOS for the secret <provider>.apiKey (from extensionSecrets, else that provider's environment variable, such as OPENAI_API_KEY), then pii.llm.apiKey (from extensionSecrets only). A key alone never turns the judge on. The LLM tiers of topicality and ml-classifiers take no secret: they run when the host passes an llmInvoker callback in the pack's options.

Layer 4: heavy resources defer to SharedServiceRegistry

The runtime's ExtensionLifecycleContext.services exposes a getOrCreate(key, factory) API. Nothing is registered at activation: a pack passes the factory with the key on the first call that needs the resource, the registry runs it then, and later calls for that key (other tools in the same pack, its guardrail, other packs on the same registry) share the cached instance. has(key) stays false until that factory has run. The BERT NER model in pii-redaction (about 109 MB at its default q8 weights, key agentos:nlp:ner-pipeline) and the NLI entailment pipeline in grounding-guard lazy-load this way. Two packs load their model on first use without the shared registry: ml-classifiers loads its one ONNX model (toxic-bert) inside its guardrail on the first classification, and topicality loads its embedding model (all-MiniLM-L6-v2) once per process on the first input it checks.

What this looks like end-to-end

// 1. Host installs the registry SDK + only the extensions it wants.
//    npm install @framers/agentos @framers/agentos-extensions-registry
//                @framers/agentos-ext-pii-redaction

import { AgentOS } from '@framers/agentos';
import { createCuratedManifest } from '@framers/agentos-extensions-registry';

// 2. Manifest build resolves only what's installed.
const manifest = await createCuratedManifest({ tools: 'all' });
// → manifest.packs.length === 1 (only the PII redaction pack made it).

// 3. AgentOS activates the pack. Nothing loads and nothing is registered:
//    services.has('agentos:nlp:ner-pipeline') is false.
//    The PII guard reads the final reply only (its evaluateStreamingChunks
//    option is false by default), so hold streamed output or the streamed
//    text reaches the person before the redaction. guardrailOutputMode (and
//    requiredGuardrails) exist from @framers/agentos 0.13.3; an older core
//    ignores the option and streams.
const agent = new AgentOS();
await agent.initialize({ extensionManifest: manifest, guardrailOutputMode: 'hold' });

// 4. The first scan that needs the NER tier asks the registry for
//    'agentos:nlp:ner-pipeline', and the model loads then. Later scans and
//    the pack's pii_scan and pii_redact tools share it.

For dispatcher mechanics (Phase 1 sequential sanitizers, Phase 2 parallel classifiers, worst-action aggregation, mid-stream override), see Guardrails. For the full lifecycle, see Extension Loading and Auto-Loading Extensions.

Installation

pnpm add @framers/agentos-extensions-registry

Then install whichever extension packages you need (e.g. @framers/agentos-ext-telegram). Only installed packages will be loaded by createCuratedManifest().

Main exports

ExportDescription
createCuratedManifest(options?)Builds an ExtensionManifest from installed extensions. Accepts channel/tool filters, secrets, and per-extension overrides.
CHANNEL_CATALOGStatic catalog of all 37 channel platform entries (platform, package, SDK, required secrets)
TOOL_CATALOGStatic catalog of tool extensions (web search, CLI executor, image search, etc.)
PROVIDER_CATALOGStatic catalog of 27 model-provider entries: 25 LLM + 2 image (provider name, models, base URLs). 11 LLM providers ship runtime adapters in core; the rest are catalog metadata for discovery and roadmap parity.
getAvailableExtensions()Returns only extensions whose npm packages are resolvable in the current environment
getAvailableChannels()Returns only channel adapters whose packages are installed
SECRET_ENV_MAPMaps secret keys (e.g. telegram.botToken) to environment variable names

Usage

import { createCuratedManifest } from '@framers/agentos-extensions-registry';

// Load all installed extensions
const manifest = await createCuratedManifest({ channels: 'all', tools: 'all' });

// Or selectively enable specific channels
const manifest = await createCuratedManifest({
  channels: ['telegram', 'discord', 'slack'],
  tools: 'all',
  secrets: {
    'telegram.botToken': process.env.TELEGRAM_BOT_TOKEN,
    'discord.botToken': process.env.DISCORD_BOT_TOKEN,
    'slack.botToken': process.env.SLACK_BOT_TOKEN,
  },
});

// Pass to AgentOS runtime
const agent = new AgentOS();
await agent.initialize({ extensionManifest: manifest });

createCuratedManifest(options?)

ParameterTypeDefaultDescription
channelsstring[] | 'all' | 'none''all'Which channel platforms to enable
toolsstring[] | 'all' | 'none''all'Which tool extensions to enable
secretsRecord<string, string>{}Secrets map (falls back to env vars)
basePrioritynumber0Base priority for all extensions
overridesRecord<string, Override>{}Per-extension overrides: { enabled?, priority?, options? }

Contributing and support

GuideWhat
ContributingDevelopment setup, commit and pull request rules, review threads, contribution licensing
Release guideHow the daily release at 10:17 UTC publishes master to npm
Agent instructionsCommands and conventions for coding agents
Code of ConductCommunity standards
Security PolicyReporting vulnerabilities privately
SupportWhere to get help

License

Apache 2.0 — see LICENSE.

版本与发布记录

@framers/agentos-extensions-registry 共发布 46 个版本,首次发布于 2026/02/07;过去 12 个月发布了 46 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.18.20latest2026/11/141 天前
0.18.192026/11/123 天前
0.18.182026/11/096 天前
0.18.172026/11/0510 天前
0.18.162026/11/0115 天前
0.18.152026/10/2125 天前

关于 @framers/agentos-extensions-registry 的常见问题

@framers/agentos-extensions-registry 是什么?

Extension catalog for AgentOS — channel, tool, and provider metadata with dynamic loading via createCuratedManifest()

如何安装 @framers/agentos-extensions-registry?

在项目目录运行 npm install @framers/agentos-extensions-registry,或使用 pnpm add / yarn add / bun add。

@framers/agentos-extensions-registry 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@framers/agentos-extensions-registry 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@framers/agentos-extensions-registry 可以商用吗?

@framers/agentos-extensions-registry 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@framers/agentos-extensions-registry 的下载量有多少?

根据 npm 官方下载统计,@framers/agentos-extensions-registry 在 2026/10/16 – 2026/11/14 这 30 天内被下载 21,515 次,日均约 717 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@framers/agentos-extensions-registry 还在维护吗?

最新版本 0.18.20 发布于 2026/11/14(1 天前);至今共发布 46 个版本,其中过去 12 个月发布了 46 个;首次发布于 2026/02/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。