mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:30:44 +00:00
fix: enforce plugin tool manifest contracts
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user