fix: enforce plugin tool manifest contracts

This commit is contained in:
Shakker
2026-05-01 22:23:10 +01:00
parent 7028f1b485
commit 7641783d6b
26 changed files with 585 additions and 51 deletions

View File

@@ -78,6 +78,9 @@ and provider plugins have dedicated guides linked above.
"id": "my-plugin",
"name": "My Plugin",
"description": "Adds a custom tool to OpenClaw",
"contracts": {
"tools": ["my_tool"]
},
"activation": {
"onStartup": true
},
@@ -89,9 +92,10 @@ and provider plugins have dedicated guides linked above.
```
</CodeGroup>
Every plugin needs a manifest, even with no config, and every plugin should
declare `activation.onStartup` intentionally. Runtime-registered tools need
startup import, so this example sets it to `true`. See
Every plugin needs a manifest, even with no config. Runtime-registered tools
must be listed in `contracts.tools` so OpenClaw can discover the owning
plugin without loading every plugin runtime. Plugins should also declare
`activation.onStartup` intentionally. This example sets it to `true`. See
[Manifest](/plugins/manifest) for the full schema. The canonical ClawHub
publish snippets live in `docs/snippets/plugin-publish/`.
@@ -242,6 +246,17 @@ register(api) {
}
```
Every tool registered with `api.registerTool(...)` must also be declared in the
plugin manifest:
```json
{
"contracts": {
"tools": ["my_tool", "workflow_tool"]
}
}
```
Users enable optional tools in config:
```json5