openclaw-node-harness 2.0.3 → 2.0.4
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/bin/mesh-agent.js +214 -81
- package/bin/mesh-bridge.js +274 -10
- package/bin/mesh-deploy-listener.js +119 -97
- package/bin/mesh-deploy.js +8 -0
- package/bin/mesh-task-daemon.js +190 -15
- package/bin/mesh.js +20 -5
- package/install.sh +7 -0
- package/lib/kanban-io.js +50 -10
- package/lib/mesh-collab.js +53 -3
- package/lib/mesh-registry.js +11 -2
- package/package.json +1 -1
package/lib/mesh-registry.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* mesh-registry.js — NATS KV tool registry for OpenClaw mesh.
|
|
3
3
|
*
|
|
4
|
+
* STATUS: UNUSED — fully implemented but no callers exist yet. Kept for
|
|
5
|
+
* future tool-mesh integration. Review before adopting; remove if still
|
|
6
|
+
* uncalled by next major release.
|
|
7
|
+
*
|
|
4
8
|
* Shared library for:
|
|
5
9
|
* - Registering tools in MESH_TOOLS KV bucket
|
|
6
10
|
* - Heartbeat refresh (keeps tools alive via TTL)
|
|
@@ -36,7 +40,9 @@ class MeshRegistry {
|
|
|
36
40
|
|
|
37
41
|
async init() {
|
|
38
42
|
const js = this.nc.jetstream();
|
|
39
|
-
|
|
43
|
+
// TTL: entries auto-expire after 120s if not refreshed by heartbeat (60s interval).
|
|
44
|
+
// Prevents stale entries from crashed services that never called shutdown().
|
|
45
|
+
this.kv = await js.views.kv(KV_BUCKET, { ttl: 120_000 });
|
|
40
46
|
return this;
|
|
41
47
|
}
|
|
42
48
|
|
|
@@ -111,7 +117,10 @@ class MeshRegistry {
|
|
|
111
117
|
for (const [toolName, manifest] of this.manifests) {
|
|
112
118
|
const kvKey = `${this.nodeId}.${toolName}`;
|
|
113
119
|
try {
|
|
114
|
-
await this.kv.put(kvKey, sc.encode(JSON.stringify(
|
|
120
|
+
await this.kv.put(kvKey, sc.encode(JSON.stringify({
|
|
121
|
+
...manifest,
|
|
122
|
+
last_heartbeat: new Date().toISOString(),
|
|
123
|
+
})));
|
|
115
124
|
} catch (err) {
|
|
116
125
|
console.error(`[mesh-registry] heartbeat failed for ${kvKey}: ${err.message}`);
|
|
117
126
|
}
|
package/package.json
CHANGED