Skip to main content

Documentation Index

Fetch the complete documentation index at: https://openclaw.zhcndoc.com/llms.txt

Use this file to discover all available pages before exploring further.

插件 SDK 以 openclaw/plugin-sdk/ 下的一组窄子路径形式暴露。 本页按用途整理了常用子路径。生成的 200+ 子路径完整列表位于 scripts/lib/plugin-sdk-entrypoints.json; 保留的 bundled-plugin helper 子路径也会出现在其中,但除非文档页面明确推广,否则它们都属于实现细节。 维护者可以使用 pnpm plugins:boundary-report:summary 审核当前启用的保留 helper 子路径;未使用的保留 helper 导出会让 CI 报告失败,而不会继续作为公共 SDK 中沉睡的兼容性债务存在。 有关插件编写指南,请参见 Plugin SDK overview

插件入口

子路径主要导出
plugin-sdk/plugin-entrydefinePluginEntry
plugin-sdk/coredefineChannelPluginEntry, createChatChannelPlugin, createChannelPluginBase, defineSetupPluginEntry, buildChannelConfigSchema, buildJsonChannelConfigSchema
plugin-sdk/config-schemaOpenClawSchema
plugin-sdk/provider-entrydefineSingleProviderPluginEntry
plugin-sdk/testing面向旧版插件测试的广泛兼容桶;新的扩展测试更推荐使用更聚焦的测试子路径
plugin-sdk/plugin-test-api用于直接插件注册单元测试的最小 OpenClawPluginApi mock 构建器
plugin-sdk/agent-runtime-test-contracts原生 agent-runtime 适配器契约夹具,用于认证档案、交付抑制、fallback 分类、tool hook、prompt overlay、schema 和 transcript repair
plugin-sdk/channel-test-helperschannel 账号生命周期、目录、发送配置、运行时 mock、hook、bundled channel 入口、信封时间戳、配对回复和通用 channel 契约测试 helper
plugin-sdk/channel-target-testing共享的 channel 目标解析错误场景测试套件
plugin-sdk/plugin-test-contracts插件注册、包清单、公共产物、运行时 API、导入副作用和直接导入契约 helper
plugin-sdk/plugin-test-runtime插件运行时、注册表、provider 注册、setup 向导和运行时任务流测试夹具
plugin-sdk/provider-test-contractsprovider 运行时、认证、发现、onboard、目录、媒体能力、replay 策略、实时 STT 直播音频、web-search/fetch 和向导契约 helper
plugin-sdk/provider-http-test-mocks用于测试 plugin-sdk/provider-http 的可选 Vitest HTTP/auth mocks
plugin-sdk/test-env测试环境、fetch/network、可释放 HTTP 服务器、入站请求、live-test、临时文件系统和时间控制夹具
plugin-sdk/test-fixtures通用 CLI、sandbox、skill、agent-message、system-event、模块重载、bundled plugin 路径、终端、分块、auth-token 和 typed-case 测试夹具
plugin-sdk/test-node-mocks供在 Vitest vi.mock("node:*") 工厂内部使用的聚焦版 Node 内置 mock helper
plugin-sdk/migration迁移 provider 项目 helper,例如 createMigrationItem、原因常量、项目状态标记、脱敏 helper 和 summarizeMigrationItems
plugin-sdk/migration-runtime运行时迁移 helper,例如 copyMigrationFileItemwithCachedMigrationConfigRuntimewriteMigrationReport
子路径主要导出
plugin-sdk/channel-coredefineChannelPluginEntry, defineSetupPluginEntry, createChatChannelPlugin, createChannelPluginBase
plugin-sdk/config-schemaopenclaw.json 的 Zod schema 导出(OpenClawSchema
plugin-sdk/channel-setupcreateOptionalChannelSetupSurface, createOptionalChannelSetupAdapter, createOptionalChannelSetupWizard,以及 DEFAULT_ACCOUNT_IDcreateTopLevelChannelDmPolicysetSetupChannelEnabledsplitSetupEntries
plugin-sdk/setup共享的 setup 向导 helper、allowlist 提示、setup 状态构建器
plugin-sdk/setup-runtimecreatePatchedAccountSetupAdapter, createEnvPatchedAccountSetupAdapter, createSetupInputPresenceValidator, noteChannelLookupFailure, noteChannelLookupSummary, promptResolvedAllowFrom, splitSetupEntries, createAllowlistSetupWizardProxy, createDelegatedSetupWizardProxy
plugin-sdk/setup-adapter-runtimecreateEnvPatchedAccountSetupAdapter
plugin-sdk/setup-toolsformatCliCommand, detectBinary, extractArchive, resolveBrewExecutable, formatDocsLink, CONFIG_DIR
plugin-sdk/account-core多账号配置/动作门控 helper、默认账号回退 helper
plugin-sdk/account-idDEFAULT_ACCOUNT_ID、账号 ID 规范化 helper
plugin-sdk/account-resolution账号查找 + 默认回退 helper
plugin-sdk/account-helpers窄范围账号列表/账号动作 helper
plugin-sdk/channel-pairingcreateChannelPairingController
plugin-sdk/channel-reply-pipelinecreateChannelReplyPipeline, resolveChannelSourceReplyDeliveryMode
plugin-sdk/channel-config-helperscreateHybridChannelConfigAdapter, resolveChannelDmAccess, resolveChannelDmAllowFrom, resolveChannelDmPolicy, normalizeChannelDmPolicy, normalizeLegacyDmAliases
plugin-sdk/channel-config-schema共享 channel config schema 基元以及 Zod 和直接 JSON/TypeBox 构建器
plugin-sdk/bundled-channel-config-schema仅供已维护的 bundled plugins 使用的 bundled OpenClaw channel config schemas
plugin-sdk/channel-config-schema-legacybundled-channel config schemas 的已弃用兼容别名
plugin-sdk/telegram-command-config带 bundled-contract 回退的 Telegram 自定义命令规范化/验证 helper
plugin-sdk/command-gating窄范围命令授权门控 helper
plugin-sdk/channel-policyresolveChannelGroupRequireMention
plugin-sdk/channel-lifecyclecreateAccountStatusSink, createChannelRunQueue, draft stream 生命周期/终结 helper
plugin-sdk/inbound-envelope共享入站 route + envelope 构建器 helper
plugin-sdk/inbound-reply-dispatch共享入站记录并分发 helper
plugin-sdk/messaging-targets目标解析/匹配 helper
plugin-sdk/outbound-media共享出站媒体加载 helper
plugin-sdk/outbound-send-deps面向 channel adapter 的轻量出站发送依赖查找
plugin-sdk/outbound-runtime出站交付、身份、发送委托、会话、格式化和 payload 规划 helper
plugin-sdk/poll-runtime窄范围 poll 规范化 helper
plugin-sdk/thread-bindings-runtime线程绑定生命周期和 adapter helper
plugin-sdk/agent-media-payload旧版 agent 媒体 payload 构建器
plugin-sdk/conversation-runtimeconversation/thread 绑定、配对和已配置绑定 helper
plugin-sdk/runtime-config-snapshot运行时 config 快照 helper
plugin-sdk/runtime-group-policy运行时 group-policy 解析 helper
plugin-sdk/channel-status共享 channel status 快照/摘要 helper
plugin-sdk/channel-config-primitives窄范围 channel config-schema 基元
plugin-sdk/channel-config-writeschannel config 写入授权 helper
plugin-sdk/channel-plugin-common共享 channel plugin prelude 导出
plugin-sdk/allowlist-config-editallowlist config 编辑/读取 helper
plugin-sdk/group-access共享 group-access 决策 helper
plugin-sdk/direct-dm共享 direct-DM 认证/守卫 helper
plugin-sdk/discord已弃用的 Discord 兼容门面,适用于已发布的 @openclaw/discord@2026.3.13 和受跟踪的 owner 兼容性;新的插件应使用通用 channel SDK 子路径
plugin-sdk/telegram-account已弃用的 Telegram 账号解析兼容门面,适用于受跟踪的 owner 兼容性;新的插件应使用注入式运行时 helper 或通用 channel SDK 子路径
plugin-sdk/zalouser已弃用的 Zalo Personal 兼容门面,适用于仍导入 sender 命令授权的已发布 Lark/Zalo 包;新的插件应使用 plugin-sdk/command-auth
plugin-sdk/interactive-runtime语义消息呈现、交付和旧版 interactive reply helper。参见 Message Presentation
plugin-sdk/channel-inbound用于入站 debounce、mention 匹配、mention-policy helper 和 envelope helper 的兼容桶
plugin-sdk/channel-inbound-debounce窄范围入站 debounce helper
plugin-sdk/channel-mention-gating不包含更宽泛 inbound runtime 表面的窄范围 mention-policy、mention marker 和 mention text helper
plugin-sdk/channel-envelope窄范围入站 envelope 格式化 helper
plugin-sdk/channel-locationchannel 位置上下文和格式化 helper
plugin-sdk/channel-logging用于入站丢弃以及 typing/ack 失败的 channel 日志 helper
plugin-sdk/channel-send-result回复结果类型
plugin-sdk/channel-actionschannel 消息动作 helper,以及为兼容插件保留的已弃用原生 schema helper
plugin-sdk/channel-route共享路由规范化、基于解析器的目标解析、thread-id 字符串化、去重/压缩 route key、parsed-target 类型,以及 route/target 比较 helper
plugin-sdk/channel-targets目标解析 helper;路由比较调用方应使用 plugin-sdk/channel-route
plugin-sdk/channel-contractchannel 契约类型
plugin-sdk/channel-feedback反馈/反应接线
plugin-sdk/channel-secret-runtime窄范围 secret 契约 helper,例如 collectSimpleChannelFieldAssignmentsgetChannelSurfacepushAssignment 和 secret target 类型
子路径主要导出
plugin-sdk/provider-entrydefineSingleProviderPluginEntry
plugin-sdk/lmstudio支持的 LM Studio provider 门面,用于 setup、目录发现和运行时模型准备
plugin-sdk/lmstudio-runtime支持的 LM Studio 运行时门面,用于本地服务器默认值、模型发现、请求头和已加载模型 helper
plugin-sdk/provider-setup精选的本地/自托管 provider setup helper
plugin-sdk/self-hosted-provider-setup聚焦的 OpenAI 兼容自托管 provider setup helper
plugin-sdk/cli-backendCLI 后端默认值 + watchdog 常量
plugin-sdk/provider-auth-runtime用于 provider 插件的运行时 API key 解析 helper
plugin-sdk/provider-auth-api-keyAPI key 上手/写入档案 helper,例如 upsertApiKeyProfile
plugin-sdk/provider-auth-result标准 OAuth 认证结果构建器
plugin-sdk/provider-auth-login面向 provider 插件的共享交互式登录 helper
plugin-sdk/provider-env-varsprovider 认证环境变量查找 helper
plugin-sdk/provider-authcreateProviderApiKeyAuthMethod, ensureApiKeyFromOptionEnvOrPrompt, upsertAuthProfile, upsertApiKeyProfile, writeOAuthCredentials
plugin-sdk/provider-model-sharedProviderReplayFamilybuildProviderReplayFamilyHooksnormalizeModelCompat、共享 replay 策略构建器、provider 端点 helper,以及模型 ID 规范化 helper,例如 normalizeNativeXaiModelId
plugin-sdk/provider-catalog-runtimeprovider 目录增强运行时钩子,以及用于契约测试的 plugin-provider 注册表缝合点
plugin-sdk/provider-catalog-sharedfindCatalogTemplate, buildSingleProviderApiKeyCatalog, buildManifestModelProviderConfig, supportsNativeStreamingUsageCompat, applyProviderNativeStreamingUsageCompat
plugin-sdk/provider-http通用 provider HTTP/端点能力 helper、provider HTTP 错误,以及音频转录 multipart form helper
plugin-sdk/provider-web-fetch-contract窄范围 web-fetch 配置/选择契约 helper,例如 enablePluginInConfigWebFetchProviderPlugin
plugin-sdk/provider-web-fetchweb-fetch provider 注册/缓存 helper
plugin-sdk/provider-web-search-config-contract适用于不需要插件启用接线的 provider 的窄范围 web-search 配置/凭据 helper
plugin-sdk/provider-web-search-contract窄范围 web-search 配置/凭据契约 helper,例如 createWebSearchProviderContractFieldsenablePluginInConfigresolveProviderWebSearchPluginConfig,以及作用域凭据 setter/getter
plugin-sdk/provider-web-searchweb-search provider 注册/缓存/运行时 helper
plugin-sdk/provider-toolsProviderToolCompatFamilybuildProviderToolCompatFamilyHooks、Gemini schema 清理 + 诊断,以及 xAI 兼容 helper,例如 resolveXaiModelCompatPatch / applyXaiModelCompat
plugin-sdk/provider-usagefetchClaudeUsage
plugin-sdk/provider-streamProviderStreamFamilybuildProviderStreamFamilyHookscomposeProviderStreamWrappers、流包装器类型,以及共享的 Anthropic/Bedrock/DeepSeek V4/Google/Kilocode/Moonshot/OpenAI/OpenRouter/Z.A.I/MiniMax/Copilot 包装器 helper
plugin-sdk/provider-transport-runtime原生 provider 传输 helper,例如受保护的 fetch、传输消息转换,以及可写传输事件流
plugin-sdk/provider-onboardonboard 配置补丁 helper
plugin-sdk/global-singleton进程本地单例/映射/缓存 helper
plugin-sdk/group-activation窄范围组激活模式和命令解析 helper
子路径主要导出
plugin-sdk/command-authresolveControlCommandGate,命令注册表 helper(包括动态参数菜单格式化),发送方授权 helper
plugin-sdk/command-status命令/帮助消息构建器,例如 buildCommandsMessagePaginatedbuildHelpMessage
plugin-sdk/approval-auth-runtime审批者解析以及同聊天动作授权 helper
plugin-sdk/approval-client-runtime原生 exec 审批档案/过滤 helper
plugin-sdk/approval-delivery-runtime原生审批能力/交付适配器
plugin-sdk/approval-gateway-runtime共享审批网关解析 helper
plugin-sdk/approval-handler-adapter-runtime用于热 channel 入口点的轻量原生审批适配器加载 helper
plugin-sdk/approval-handler-runtime更广泛的审批处理器运行时 helper;当更窄的适配器/网关分界足够时,优先使用它们
plugin-sdk/approval-native-runtime原生审批目标 + 账号绑定 helper
plugin-sdk/approval-reply-runtimeexec/plugin 审批回复 payload helper
plugin-sdk/approval-runtimeexec/plugin 审批 payload helper、原生审批路由/运行时 helper,以及结构化审批展示 helper,例如 formatApprovalDisplayPath
plugin-sdk/reply-dedupe窄范围入站回复去重重置 helper
plugin-sdk/channel-contract-testing无广泛 testing 桶的窄范围 channel 契约测试 helper
plugin-sdk/command-auth-native原生命令认证、动态参数菜单格式化以及原生会话目标 helper
plugin-sdk/command-detection共享命令检测 helper
plugin-sdk/command-primitives-runtime用于热 channel 路径的轻量命令文本谓词
plugin-sdk/command-surface命令正文规范化和命令表面 helper
plugin-sdk/allow-fromformatAllowFromLowercase
plugin-sdk/channel-secret-runtime面向 channel/plugin secret 表面的窄范围 secret 契约收集 helper
plugin-sdk/secret-ref-runtime面向 secret 契约/config 解析的窄范围 coerceSecretRef 和 SecretRef 类型 helper
plugin-sdk/security-runtime共享信任、DM 门控、外部内容、敏感文本脱敏、常量时间 secret 比较和 secret 收集 helper
plugin-sdk/ssrf-policy主机 allowlist 和私有网络 SSRF 策略 helper
plugin-sdk/ssrf-dispatcher无广泛 infra 运行时面的窄范围 pinned-dispatcher helper
plugin-sdk/ssrf-runtimepinned-dispatcher、SSRF 保护的 fetch、SSRF 错误和 SSRF 策略 helper
plugin-sdk/secret-inputsecret 输入解析 helper
plugin-sdk/webhook-ingresswebhook 请求/目标 helper 以及原始 websocket/body 强制转换
plugin-sdk/webhook-request-guards请求体大小/超时 helper
子路径主要导出
plugin-sdk/media-runtime共享媒体 fetch/转换/存储 helper、基于 ffprobe 的视频尺寸探测,以及媒体 payload 构建器
plugin-sdk/media-store窄范围媒体存储 helper,例如 saveMediaBuffer
plugin-sdk/media-generation-runtime共享媒体生成失败切换 helper、候选项选择和缺失模型提示
plugin-sdk/media-understanding媒体理解 provider 类型以及面向 provider 的图像/音频 helper 导出
plugin-sdk/text-runtime共享文本/markdown/日志 helper,例如 assistant 可见文本剥离、markdown 渲染/分块/表格 helper、脱敏 helper、directive-tag helper 和安全文本工具
plugin-sdk/text-chunking出站文本分块 helper
plugin-sdk/speech语音 provider 类型以及面向 provider 的 directive、注册表、校验、OpenAI 兼容 TTS 构建器和语音 helper 导出
plugin-sdk/speech-core共享语音 provider 类型、注册表、directive、规范化和语音 helper 导出
plugin-sdk/realtime-transcription实时转录 provider 类型、注册表 helper 和共享 WebSocket 会话 helper
plugin-sdk/realtime-voice实时语音 provider 类型和注册表 helper
plugin-sdk/image-generation图像生成 provider 类型,以及图像资产/data URL helper 和 OpenAI 兼容图像 provider 构建器
plugin-sdk/image-generation-core共享图像生成类型、失败切换、认证和注册表 helper
plugin-sdk/music-generation音乐生成 provider/请求/结果类型
plugin-sdk/music-generation-core共享音乐生成类型、失败切换 helper、provider 查找和 model-ref 解析
plugin-sdk/video-generation视频生成 provider/请求/结果类型
plugin-sdk/video-generation-core共享视频生成类型、失败切换 helper、provider 查找和 model-ref 解析
plugin-sdk/webhook-targetswebhook 目标注册表和路由安装 helper
plugin-sdk/webhook-pathwebhook 路径规范化 helper
plugin-sdk/web-media共享远程/本地媒体加载 helper
plugin-sdk/zod重新导出的 zod,供 plugin SDK 消费者使用
plugin-sdk/testing面向旧版插件测试的宽兼容桶。新的扩展测试应改为导入更聚焦的 SDK 子路径,例如 plugin-sdk/agent-runtime-test-contractsplugin-sdk/plugin-test-runtimeplugin-sdk/channel-test-helpersplugin-sdk/test-envplugin-sdk/test-fixtures
plugin-sdk/plugin-test-api用于直接插件注册单元测试的最小 createTestPluginApi helper,无需导入仓库测试 helper 桥接层
plugin-sdk/agent-runtime-test-contracts原生 agent-runtime 适配器契约夹具,用于认证、交付、fallback、tool-hook、prompt-overlay、schema 和 transcript projection 测试
plugin-sdk/channel-test-helpers面向 channel 的测试 helper,涵盖通用动作/setup/status 契约、目录断言、账号启动生命周期、send-config 线程、运行时 mock、状态问题、出站交付和 hook 注册
plugin-sdk/channel-target-testing面向 channel 测试的共享目标解析错误场景套件
plugin-sdk/plugin-test-contracts插件包、注册、公共产物、直接导入、运行时 API 和导入副作用契约 helper
plugin-sdk/provider-test-contractsprovider 运行时、认证、发现、onboard、目录、向导、媒体能力、重放策略、实时 STT 直播音频、web-search/fetch 和流契约 helper
plugin-sdk/provider-http-test-mocks用于测试 plugin-sdk/provider-http 的可选 Vitest HTTP/auth mocks
plugin-sdk/test-fixtures通用 CLI 运行时捕获、sandbox 上下文、skill writer、agent-message、system-event、模块重载、bundled plugin 路径、终端文本、分块、auth-token 和 typed-case 夹具
plugin-sdk/test-node-mocks供在 Vitest vi.mock("node:*") 工厂内部使用的聚焦版 Node 内置 mock helper
子路径主要导出
plugin-sdk/memory-core面向 manager/config/file/CLI helper 的 bundled memory-core helper 接口面
plugin-sdk/memory-core-engine-runtime内存索引/搜索运行时门面
plugin-sdk/memory-core-host-engine-foundationMemory host foundation engine 导出
plugin-sdk/memory-core-host-engine-embeddingsMemory host embedding 契约、注册表访问、本地 provider,以及通用批量/远程 helper
plugin-sdk/memory-core-host-engine-qmdMemory host QMD engine 导出
plugin-sdk/memory-core-host-engine-storageMemory host 存储引擎导出
plugin-sdk/memory-core-host-multimodalMemory host 多模态 helper
plugin-sdk/memory-core-host-queryMemory host 查询 helper
plugin-sdk/memory-core-host-secretMemory host secret helper
plugin-sdk/memory-core-host-eventsMemory host 事件日志 helper
plugin-sdk/memory-core-host-statusMemory host 状态 helper
plugin-sdk/memory-core-host-runtime-cliMemory host CLI 运行时 helper
plugin-sdk/memory-core-host-runtime-coreMemory host 核心运行时 helper
plugin-sdk/memory-core-host-runtime-filesMemory host 文件/运行时 helper
plugin-sdk/memory-host-core面向供应商中立的 memory host 核心运行时 helper 别名
plugin-sdk/memory-host-events面向供应商中立的 memory host 事件日志 helper 别名
plugin-sdk/memory-host-files面向供应商中立的 memory host 文件/运行时 helper 别名
plugin-sdk/memory-host-markdown面向内存相关插件的共享 managed-markdown helper
plugin-sdk/memory-host-search面向 search-manager 访问的活动内存运行时门面
plugin-sdk/memory-host-status面向供应商中立的 memory host 状态 helper 别名
当前没有保留的 bundled-helper SDK 子路径。owner 专用 helper 位于对应的插件包内部,而可复用的 host 契约则使用通用 SDK 子路径,例如 plugin-sdk/gateway-runtimeplugin-sdk/security-runtimeplugin-sdk/plugin-config-runtime

相关内容