@cfio/cohort-sync 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -17
- package/dist/openclaw.plugin.json +10 -1
- package/dist/package.json +1 -1
- package/openclaw.plugin.json +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13426,7 +13426,7 @@ function dumpCtx(ctx) {
|
|
|
13426
13426
|
function dumpEvent(event) {
|
|
13427
13427
|
return dumpCtx(event);
|
|
13428
13428
|
}
|
|
13429
|
-
var PLUGIN_VERSION = true ? "0.
|
|
13429
|
+
var PLUGIN_VERSION = true ? "0.26.0" : "unknown";
|
|
13430
13430
|
function resolveGatewayToken(api) {
|
|
13431
13431
|
const token = api.config?.gateway?.auth?.token;
|
|
13432
13432
|
return typeof token === "string" ? token : null;
|
|
@@ -14375,23 +14375,15 @@ var plugin = definePluginEntry({
|
|
|
14375
14375
|
registerHookHandlers(api, api.logger, () => sharedHookState);
|
|
14376
14376
|
registerGatewayMethods(api, () => sharedHookState?.persistentGwClient ?? null);
|
|
14377
14377
|
const gatewayPort = api.config?.gateway?.port ?? 18789;
|
|
14378
|
-
api.
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
await handleGatewayStart({ ...event, port }, sharedHookState);
|
|
14386
|
-
} catch (err) {
|
|
14387
|
-
api.logger.error(`cohort-sync: handleGatewayStart THREW: ${err instanceof Error ? err.stack : String(err)}`);
|
|
14388
|
-
}
|
|
14389
|
-
},
|
|
14390
|
-
{
|
|
14391
|
-
name: "cohort-sync.gateway-startup",
|
|
14392
|
-
description: "Sync agents and start notification subscription on gateway startup"
|
|
14378
|
+
api.on("gateway_start", async (event, _ctx) => {
|
|
14379
|
+
const port = event?.port ?? gatewayPort;
|
|
14380
|
+
api.logger.info(`cohort-sync: gateway_start hook fired (port=${port})`);
|
|
14381
|
+
try {
|
|
14382
|
+
await handleGatewayStart({ ...event, port }, sharedHookState);
|
|
14383
|
+
} catch (err) {
|
|
14384
|
+
api.logger.error(`cohort-sync: handleGatewayStart THREW: ${err instanceof Error ? err.stack : String(err)}`);
|
|
14393
14385
|
}
|
|
14394
|
-
);
|
|
14386
|
+
});
|
|
14395
14387
|
api.registerTool((toolCtx) => {
|
|
14396
14388
|
const agentId = toolCtx.agentId ?? "main";
|
|
14397
14389
|
return {
|
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
"hook"
|
|
9
9
|
]
|
|
10
10
|
},
|
|
11
|
+
"contracts": {
|
|
12
|
+
"tools": [
|
|
13
|
+
"cohort_comment",
|
|
14
|
+
"cohort_context",
|
|
15
|
+
"cohort_task",
|
|
16
|
+
"cohort_transition",
|
|
17
|
+
"cohort_assign"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
11
20
|
"uiHints": {
|
|
12
21
|
"apiUrl": {
|
|
13
22
|
"label": "Cohort API URL",
|
|
@@ -63,5 +72,5 @@
|
|
|
63
72
|
}
|
|
64
73
|
}
|
|
65
74
|
},
|
|
66
|
-
"version": "0.
|
|
75
|
+
"version": "0.26.0"
|
|
67
76
|
}
|
package/dist/package.json
CHANGED
package/openclaw.plugin.json
CHANGED
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
"onStartup": true,
|
|
7
7
|
"onCapabilities": ["hook"]
|
|
8
8
|
},
|
|
9
|
+
"contracts": {
|
|
10
|
+
"tools": [
|
|
11
|
+
"cohort_comment",
|
|
12
|
+
"cohort_context",
|
|
13
|
+
"cohort_task",
|
|
14
|
+
"cohort_transition",
|
|
15
|
+
"cohort_assign"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
9
18
|
"uiHints": {
|
|
10
19
|
"apiUrl": {
|
|
11
20
|
"label": "Cohort API URL",
|
package/package.json
CHANGED