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.
@@ -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
- this.kv = await js.views.kv(KV_BUCKET);
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(manifest)));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-node-harness",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "One-command installer for the OpenClaw node layer — identity, skills, souls, daemon, and Mission Control.",
5
5
  "bin": {
6
6
  "openclaw-node": "./cli.js"