Skip to content

Commit 7641783

Browse files
committed
fix: enforce plugin tool manifest contracts
1 parent 7028f1b commit 7641783

26 files changed

Lines changed: 585 additions & 51 deletions

docs/plugins/building-plugins.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ and provider plugins have dedicated guides linked above.
7878
"id": "my-plugin",
7979
"name": "My Plugin",
8080
"description": "Adds a custom tool to OpenClaw",
81+
"contracts": {
82+
"tools": ["my_tool"]
83+
},
8184
"activation": {
8285
"onStartup": true
8386
},
@@ -89,9 +92,10 @@ and provider plugins have dedicated guides linked above.
8992
```
9093
</CodeGroup>
9194

92-
Every plugin needs a manifest, even with no config, and every plugin should
93-
declare `activation.onStartup` intentionally. Runtime-registered tools need
94-
startup import, so this example sets it to `true`. See
95+
Every plugin needs a manifest, even with no config. Runtime-registered tools
96+
must be listed in `contracts.tools` so OpenClaw can discover the owning
97+
plugin without loading every plugin runtime. Plugins should also declare
98+
`activation.onStartup` intentionally. This example sets it to `true`. See
9599
[Manifest](/plugins/manifest) for the full schema. The canonical ClawHub
96100
publish snippets live in `docs/snippets/plugin-publish/`.
97101

@@ -242,6 +246,17 @@ register(api) {
242246
}
243247
```
244248

249+
Every tool registered with `api.registerTool(...)` must also be declared in the
250+
plugin manifest:
251+
252+
```json
253+
{
254+
"contracts": {
255+
"tools": ["my_tool", "workflow_tool"]
256+
}
257+
}
258+
```
259+
245260
Users enable optional tools in config:
246261

247262
```json5

docs/plugins/manifest.md

Lines changed: 44 additions & 40 deletions
Large diffs are not rendered by default.

extensions/browser/openclaw.plugin.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"onStartup": true,
66
"onConfigPaths": ["browser"]
77
},
8+
"contracts": {
9+
"tools": ["browser"]
10+
},
811
"commandAliases": [{ "name": "browser" }],
912
"skills": ["./skills"],
1013
"configSchema": {

extensions/diffs/openclaw.plugin.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
},
66
"name": "Diffs",
77
"description": "Read-only diff viewer and file renderer for agents.",
8+
"contracts": {
9+
"tools": ["diffs"]
10+
},
811
"skills": ["./skills"],
912
"uiHints": {
1013
"viewerBaseUrl": {

extensions/feishu/openclaw.plugin.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@
44
"onStartup": false
55
},
66
"channels": ["feishu"],
7+
"contracts": {
8+
"tools": [
9+
"feishu_app_scopes",
10+
"feishu_bitable_create_app",
11+
"feishu_bitable_create_field",
12+
"feishu_bitable_create_record",
13+
"feishu_bitable_get_meta",
14+
"feishu_bitable_get_record",
15+
"feishu_bitable_list_fields",
16+
"feishu_bitable_list_records",
17+
"feishu_bitable_update_record",
18+
"feishu_chat",
19+
"feishu_doc",
20+
"feishu_drive",
21+
"feishu_perm",
22+
"feishu_wiki"
23+
]
24+
},
725
"channelEnvVars": {
826
"feishu": [
927
"FEISHU_APP_ID",

extensions/google-meet/openclaw.plugin.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"onCommands": ["googlemeet"],
1010
"onCapabilities": ["tool"]
1111
},
12+
"contracts": {
13+
"tools": ["google_meet"]
14+
},
1215
"uiHints": {
1316
"defaults.meeting": {
1417
"label": "Default Meeting",

extensions/llm-task/openclaw.plugin.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
},
66
"name": "LLM Task",
77
"description": "Generic JSON-only LLM tool for structured tasks callable from workflows.",
8+
"contracts": {
9+
"tools": ["llm-task"]
10+
},
811
"configSchema": {
912
"type": "object",
1013
"additionalProperties": false,

extensions/lobster/openclaw.plugin.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
},
66
"name": "Lobster",
77
"description": "Typed workflow tool with resumable approvals.",
8+
"contracts": {
9+
"tools": ["lobster"]
10+
},
811
"configSchema": {
912
"type": "object",
1013
"additionalProperties": false,

extensions/memory-core/openclaw.plugin.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
},
66
"kind": "memory",
77
"contracts": {
8-
"memoryEmbeddingProviders": ["local"]
8+
"memoryEmbeddingProviders": ["local"],
9+
"tools": ["memory_get", "memory_search"]
910
},
1011
"commandAliases": [
1112
{

extensions/memory-lancedb/openclaw.plugin.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"onStartup": false
55
},
66
"kind": "memory",
7+
"contracts": {
8+
"tools": ["memory_forget", "memory_recall", "memory_store"]
9+
},
710
"uiHints": {
811
"embedding.apiKey": {
912
"label": "Embedding API Key",

0 commit comments

Comments
 (0)