Bridge server lifecycle:
- Move createBridgeServer() out of register() into an api.on("gateway_start", ...)
handler. register() runs in every CLI subprocess that loads plugins
(e.g. `openclaw completion`, `openclaw doctor`); eagerly binding the
bridge HTTP listener there could pin those processes when no gateway
is already holding the port.
- Call server.unref() so the listener never pins the host's event loop,
even if startup somehow runs outside the gateway.
Plugin SDK convention update:
- Wrap default export with definePluginEntry({ id, name, description, register })
per the current openclaw plugin authoring contract.
- Switch imports from the deprecated root barrel "openclaw/plugin-sdk" to
focused "openclaw/plugin-sdk/core" / "openclaw/plugin-sdk/plugin-entry".
- Modernize openclaw.plugin.json: drop version/main, add activation.onStartup
so gateway_start fires for this plugin at boot, declare commandAliases
for the contractor-agents CLI command.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
33 lines
871 B
JSON
33 lines
871 B
JSON
{
|
|
"id": "contractor-agent",
|
|
"name": "Contractor Agent",
|
|
"description": "Turns Claude Code into an OpenClaw-managed contractor agent",
|
|
"activation": {
|
|
"onStartup": true
|
|
},
|
|
"commandAliases": [
|
|
{ "name": "contractor-agents" }
|
|
],
|
|
"configSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"bridgePort": {
|
|
"type": "number",
|
|
"default": 18800,
|
|
"description": "Port for the contractor bridge sidecar HTTP server"
|
|
},
|
|
"bridgeApiKey": {
|
|
"type": "string",
|
|
"default": "contractor-bridge-local",
|
|
"description": "API key for the bridge sidecar (local use only)"
|
|
},
|
|
"permissionMode": {
|
|
"type": "string",
|
|
"default": "bypassPermissions",
|
|
"description": "Claude Code permission mode for contractor sessions"
|
|
}
|
|
}
|
|
}
|
|
}
|