Plugin SDK Overview
Plugin SDK 是外掛與核心之間的類型合約。本頁是以下內容的參考指南:應該 import 什麼 以及 可以註冊什麼。Import 慣例
一律從具體 subpath import:Subpath 參考
最常見的 subpath,按用途分組。完整的 100+ subpath 清單在scripts/lib/plugin-sdk-entrypoints.json。
Plugin entry
Channel subpath
Channel subpath
Provider subpath
Provider subpath
Auth and security subpath
Auth and security subpath
Runtime and storage subpath
Runtime and storage subpath
Capability and testing subpath
Capability and testing subpath
註冊 API
register(api) 回調函式收到 OpenClawPluginApi 物件,提供這些方法:
能力註冊
工具與命令
基礎設施
獨佔插槽
事件與生命週期
API 物件欄位
內部模組慣例
在你的外掛內,使用本地 barrel 檔案供內部 import:相關
- Entry Points —
definePluginEntry和defineChannelPluginEntry選項 - Runtime 輔助函式 — 完整
api.runtimenamespace 參考 - Setup 與 Config — 打包、manifests、config schemas
- Testing — 測試工具與 lint 規則
- SDK 遷移 — 從舊有介面遷移
- 外掛內部 — 深度架構與能力模型