Lifecycle:
- Move runtime.start() and shutdown handlers out of register() into
api.on("gateway_start", ...) and api.on("gateway_stop", ...). register()
runs in every CLI subprocess that loads plugins (e.g. `openclaw completion`,
`openclaw doctor`); without this gate the runtime would open a network
connection / bind a listener every time those one-shot commands ran.
- Drop process.once("SIGTERM"/"SIGINT") in favour of the gateway_stop hook,
which is the documented way for plugins to react to shutdown.
- Stop relying on the non-standard `api.rootDir` field (not present on the
current OpenClawPluginApi); compute the per-plugin data directory as
~/.openclaw/yonexus-server and ensure it exists before use.
Plugin SDK convention update:
- Wrap default export with definePluginEntry({ id, name, description, register })
per the current openclaw plugin authoring contract.
- Re-type the register function to accept OpenClawPluginApi instead of the
hand-crafted { rootDir, pluginConfig, ... } shape.
- Use focused subpath imports openclaw/plugin-sdk/plugin-entry and
openclaw/plugin-sdk/core.
- Add openclaw as a devDependency (file:/usr/lib/node_modules/openclaw) so
tsc resolves the SDK type subpaths at build time.
- Modernize openclaw.plugin.json: drop version/entry/permissions, add
activation.onStartup so gateway_start fires for this plugin at boot.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 lines
742 B
JSON
28 lines
742 B
JSON
{
|
|
"id": "yonexus-server",
|
|
"name": "Yonexus.Server",
|
|
"description": "Yonexus central hub plugin for cross-instance OpenClaw communication",
|
|
"activation": {
|
|
"onStartup": true
|
|
},
|
|
"commandAliases": [
|
|
{ "name": "yonexus-server" }
|
|
],
|
|
"configSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"followerIdentifiers": {
|
|
"type": "array",
|
|
"items": { "type": "string" }
|
|
},
|
|
"notifyBotToken": { "type": "string" },
|
|
"adminUserId": { "type": "string" },
|
|
"listenHost": { "type": "string" },
|
|
"listenPort": { "type": "number" },
|
|
"publicWsUrl": { "type": "string" }
|
|
},
|
|
"required": ["notifyBotToken", "adminUserId", "listenPort"]
|
|
}
|
|
}
|