@pellux/goodvibes-sdk 1.2.0 → 1.3.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.
Files changed (120) hide show
  1. package/dist/contracts/artifacts/operator-contract.json +26 -2
  2. package/dist/platform/companion/companion-chat-manager.d.ts +6 -12
  3. package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
  4. package/dist/platform/companion/companion-chat-manager.js +8 -2
  5. package/dist/platform/config/index.d.ts +2 -1
  6. package/dist/platform/config/index.d.ts.map +1 -1
  7. package/dist/platform/config/index.js +1 -0
  8. package/dist/platform/config/manager.d.ts +35 -0
  9. package/dist/platform/config/manager.d.ts.map +1 -1
  10. package/dist/platform/config/manager.js +98 -2
  11. package/dist/platform/config/shared-config-tier.d.ts +51 -0
  12. package/dist/platform/config/shared-config-tier.d.ts.map +1 -0
  13. package/dist/platform/config/shared-config-tier.js +127 -0
  14. package/dist/platform/control-plane/operator-contract-schemas-knowledge.d.ts.map +1 -1
  15. package/dist/platform/control-plane/operator-contract-schemas-knowledge.js +6 -1
  16. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
  17. package/dist/platform/control-plane/operator-contract-schemas-runtime.js +2 -1
  18. package/dist/platform/daemon/facade-composition.d.ts.map +1 -1
  19. package/dist/platform/daemon/facade-composition.js +1 -0
  20. package/dist/platform/daemon/homeassistant-chat.d.ts +4 -1
  21. package/dist/platform/daemon/homeassistant-chat.d.ts.map +1 -1
  22. package/dist/platform/daemon/homeassistant-chat.js +1 -1
  23. package/dist/platform/daemon/http/homeassistant-routes.d.ts.map +1 -1
  24. package/dist/platform/daemon/http/homeassistant-routes.js +28 -2
  25. package/dist/platform/integrations/webhooks.d.ts +15 -0
  26. package/dist/platform/integrations/webhooks.d.ts.map +1 -1
  27. package/dist/platform/integrations/webhooks.js +18 -0
  28. package/dist/platform/knowledge/extraction-policy.d.ts +12 -1
  29. package/dist/platform/knowledge/extraction-policy.d.ts.map +1 -1
  30. package/dist/platform/knowledge/extraction-policy.js +19 -1
  31. package/dist/platform/knowledge/graphql-schema.d.ts +1 -1
  32. package/dist/platform/knowledge/graphql-schema.d.ts.map +1 -1
  33. package/dist/platform/knowledge/graphql-schema.js +5 -0
  34. package/dist/platform/knowledge/home-graph/index.d.ts.map +1 -1
  35. package/dist/platform/knowledge/home-graph/index.js +4 -0
  36. package/dist/platform/knowledge/home-graph/link.d.ts +2 -2
  37. package/dist/platform/knowledge/home-graph/link.d.ts.map +1 -1
  38. package/dist/platform/knowledge/home-graph/link.js +60 -9
  39. package/dist/platform/knowledge/home-graph/refinement.d.ts +14 -9
  40. package/dist/platform/knowledge/home-graph/refinement.d.ts.map +1 -1
  41. package/dist/platform/knowledge/home-graph/refinement.js +18 -3
  42. package/dist/platform/knowledge/home-graph/reset.js +21 -4
  43. package/dist/platform/knowledge/home-graph/service.d.ts +10 -11
  44. package/dist/platform/knowledge/home-graph/service.d.ts.map +1 -1
  45. package/dist/platform/knowledge/home-graph/triage.d.ts +103 -0
  46. package/dist/platform/knowledge/home-graph/triage.d.ts.map +1 -0
  47. package/dist/platform/knowledge/home-graph/triage.js +362 -0
  48. package/dist/platform/knowledge/home-graph/types.d.ts +15 -0
  49. package/dist/platform/knowledge/home-graph/types.d.ts.map +1 -1
  50. package/dist/platform/knowledge/knowledge-api.d.ts +6 -0
  51. package/dist/platform/knowledge/knowledge-api.d.ts.map +1 -1
  52. package/dist/platform/knowledge/knowledge-api.js +5 -0
  53. package/dist/platform/knowledge/knowledge-history-types.d.ts +56 -0
  54. package/dist/platform/knowledge/knowledge-history-types.d.ts.map +1 -0
  55. package/dist/platform/knowledge/knowledge-history-types.js +1 -0
  56. package/dist/platform/knowledge/packet.d.ts.map +1 -1
  57. package/dist/platform/knowledge/packet.js +27 -3
  58. package/dist/platform/knowledge/scope-records.js +4 -2
  59. package/dist/platform/knowledge/semantic/answer-gaps.d.ts +8 -0
  60. package/dist/platform/knowledge/semantic/answer-gaps.d.ts.map +1 -1
  61. package/dist/platform/knowledge/semantic/answer-gaps.js +26 -6
  62. package/dist/platform/knowledge/semantic/enrichment.d.ts.map +1 -1
  63. package/dist/platform/knowledge/semantic/enrichment.js +15 -13
  64. package/dist/platform/knowledge/semantic/graph-index.d.ts.map +1 -1
  65. package/dist/platform/knowledge/semantic/graph-index.js +3 -1
  66. package/dist/platform/knowledge/semantic/service.d.ts +7 -0
  67. package/dist/platform/knowledge/semantic/service.d.ts.map +1 -1
  68. package/dist/platform/knowledge/semantic/service.js +10 -1
  69. package/dist/platform/knowledge/service-node-admin.d.ts +46 -0
  70. package/dist/platform/knowledge/service-node-admin.d.ts.map +1 -0
  71. package/dist/platform/knowledge/service-node-admin.js +72 -0
  72. package/dist/platform/knowledge/service.d.ts +24 -20
  73. package/dist/platform/knowledge/service.d.ts.map +1 -1
  74. package/dist/platform/knowledge/service.js +23 -47
  75. package/dist/platform/knowledge/store-config.d.ts +34 -0
  76. package/dist/platform/knowledge/store-config.d.ts.map +1 -1
  77. package/dist/platform/knowledge/store-config.js +23 -0
  78. package/dist/platform/knowledge/store-load.d.ts +3 -1
  79. package/dist/platform/knowledge/store-load.d.ts.map +1 -1
  80. package/dist/platform/knowledge/store-load.js +3 -1
  81. package/dist/platform/knowledge/store-node-history.d.ts +49 -0
  82. package/dist/platform/knowledge/store-node-history.d.ts.map +1 -0
  83. package/dist/platform/knowledge/store-node-history.js +331 -0
  84. package/dist/platform/knowledge/store-record-delete.d.ts +25 -0
  85. package/dist/platform/knowledge/store-record-delete.d.ts.map +1 -0
  86. package/dist/platform/knowledge/store-record-delete.js +84 -0
  87. package/dist/platform/knowledge/store-schema.d.ts +3 -1
  88. package/dist/platform/knowledge/store-schema.d.ts.map +1 -1
  89. package/dist/platform/knowledge/store-schema.js +66 -0
  90. package/dist/platform/knowledge/store.d.ts +19 -1
  91. package/dist/platform/knowledge/store.d.ts.map +1 -1
  92. package/dist/platform/knowledge/store.js +69 -108
  93. package/dist/platform/knowledge/types.d.ts +18 -0
  94. package/dist/platform/knowledge/types.d.ts.map +1 -1
  95. package/dist/platform/providers/registry.d.ts +18 -0
  96. package/dist/platform/providers/registry.d.ts.map +1 -1
  97. package/dist/platform/providers/registry.js +49 -3
  98. package/dist/platform/providers/runtime-snapshot.d.ts.map +1 -1
  99. package/dist/platform/providers/runtime-snapshot.js +14 -2
  100. package/dist/platform/runtime/memory-spine/client.d.ts +12 -0
  101. package/dist/platform/runtime/memory-spine/client.d.ts.map +1 -1
  102. package/dist/platform/runtime/memory-spine/client.js +14 -4
  103. package/dist/platform/runtime/memory-spine/index.d.ts +1 -0
  104. package/dist/platform/runtime/memory-spine/index.d.ts.map +1 -1
  105. package/dist/platform/runtime/memory-spine/index.js +1 -0
  106. package/dist/platform/runtime/memory-spine/recall-snapshot.d.ts.map +1 -1
  107. package/dist/platform/runtime/memory-spine/recall-snapshot.js +16 -3
  108. package/dist/platform/runtime/memory-spine/wire-verb-availability.d.ts +59 -0
  109. package/dist/platform/runtime/memory-spine/wire-verb-availability.d.ts.map +1 -0
  110. package/dist/platform/runtime/memory-spine/wire-verb-availability.js +114 -0
  111. package/dist/platform/runtime/services.d.ts.map +1 -1
  112. package/dist/platform/runtime/services.js +3 -12
  113. package/dist/platform/state/memory-recall-contract.d.ts +7 -0
  114. package/dist/platform/state/memory-recall-contract.d.ts.map +1 -1
  115. package/dist/platform/state/memory-recall-contract.js +2 -0
  116. package/dist/platform/utils/notify.d.ts +25 -1
  117. package/dist/platform/utils/notify.d.ts.map +1 -1
  118. package/dist/platform/utils/notify.js +29 -1
  119. package/dist/platform/version.js +1 -1
  120. package/package.json +9 -9
@@ -57,6 +57,7 @@
57
57
  */
58
58
  import { logger } from '../../utils/logger.js';
59
59
  import { buildRecallSnapshot, emptyRecallSnapshot, DEFAULT_RECALL_SNAPSHOT_STALE_AFTER_MS, } from './recall-snapshot.js';
60
+ import { memoryVerbUnavailableError } from './wire-verb-availability.js';
60
61
  /** Wrap a local embedded store (e.g. a MemoryRegistry) as a full MemoryAccess. */
61
62
  export function createLocalMemoryAccess(store) {
62
63
  return {
@@ -205,16 +206,25 @@ export class MemorySpineClient {
205
206
  * transport's verb if it implements it, otherwise an HONEST rejection stating the
206
207
  * adopted daemon does not support it (never a silent local-file read, which would
207
208
  * break the single-writer invariant and misreport which store answered).
209
+ *
210
+ * TWO honesty layers, both landing on the same {@link memoryVerbUnavailableError}
211
+ * message:
212
+ * 1. COMPILE-TIME omission (here): a transport object that literally does not
213
+ * implement the verb (`call === undefined`) — a surface pinned to an adapter
214
+ * that predates the verb. Rejects immediately.
215
+ * 2. RUNTIME signal (the transports): a transport that DOES implement the verb but
216
+ * whose adopted daemon route answers a route-not-found 404 folds that 404
217
+ * through `foldMemoryWireExtendedError` in its own catch and rejects with the
218
+ * same message. That path — not this one — is what a live older daemon
219
+ * actually produces; this branch alone never sees it, because a real transport
220
+ * supplies a concrete function for every verb.
208
221
  */
209
222
  routeExtended(verb, local, wire) {
210
223
  if (this.transport === null)
211
224
  return local(this.local);
212
225
  const call = wire(this.transport);
213
226
  if (call === undefined) {
214
- return Promise.reject(new Error(`memory spine: the adopted daemon does not support the '${verb}' memory verb over the wire — `
215
- + 'upgrade the daemon to a build that serves it, or run this surface offline (no daemon adopted). '
216
- + 'A wire client will not read its own local store for this op, because that would break the '
217
- + 'single-writer invariant and report a divergent local copy as if it were the canonical store.'));
227
+ return Promise.reject(memoryVerbUnavailableError(verb));
218
228
  }
219
229
  return call;
220
230
  }
@@ -14,4 +14,5 @@
14
14
  */
15
15
  export { MemorySpineClient, createLocalMemoryAccess, type MemoryAccess, type MemoryCoreAccess, type MemoryExtendedAccess, type MemoryAccessMode, type MemoryTransport, type MemoryUpdatePatch, type LocalMemoryStore, type MemorySpineClientOptions, type MemoryRecallSnapshot, type MemoryRecallRefreshOptions, } from './client.js';
16
16
  export { buildRecallSnapshot, emptyRecallSnapshot, DEFAULT_RECALL_SNAPSHOT_STALE_AFTER_MS, } from './recall-snapshot.js';
17
+ export { classifyMemoryWireError, memoryVerbUnavailableError, foldMemoryWireExtendedError, type MemoryWire404Disposition, } from './wire-verb-availability.js';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/platform/runtime/memory-spine/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,GAChC,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sCAAsC,GACvC,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/platform/runtime/memory-spine/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,GAChC,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sCAAsC,GACvC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,wBAAwB,GAC9B,MAAM,6BAA6B,CAAC"}
@@ -14,3 +14,4 @@
14
14
  */
15
15
  export { MemorySpineClient, createLocalMemoryAccess, } from './client.js';
16
16
  export { buildRecallSnapshot, emptyRecallSnapshot, DEFAULT_RECALL_SNAPSHOT_STALE_AFTER_MS, } from './recall-snapshot.js';
17
+ export { classifyMemoryWireError, memoryVerbUnavailableError, foldMemoryWireExtendedError, } from './wire-verb-availability.js';
@@ -1 +1 @@
1
- {"version":3,"file":"recall-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/platform/runtime/memory-spine/recall-snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,kFAAkF;AAClF,eAAO,MAAM,sCAAsC,QAAS,CAAC;AAE7D,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,wFAAwF;IACxF,QAAQ,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACjD,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAID,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,oBAAoB,CAWhF;AA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gBAAgB,GAAG,oBAAoB,CAWhF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,GAAG,GAAE,MAAmB,GACvB,oBAAoB,CAkCtB"}
@@ -54,9 +54,22 @@ export function buildRecallSnapshot(search, mode, capturedAt, staleAfterMs, now
54
54
  const ageMs = Math.max(0, now - capturedAt);
55
55
  const stale = ageMs > staleAfterMs;
56
56
  const source = mode === 'client' ? 'over the wire from the adopted daemon' : 'from the local store';
57
+ // Humanized age, matching the TUI's established freshness vocabulary
58
+ // (session-picker-modal.ts: "may be stale, last synced Ns ago"): lowercase, a
59
+ // hedged "may be stale", and whole seconds — never raw milliseconds a reader
60
+ // cannot comfortably read.
61
+ const ageSeconds = Math.max(0, Math.round(ageMs / 1000));
62
+ const staleAfterSeconds = Math.max(0, Math.round(staleAfterMs / 1000));
57
63
  const freshness = stale
58
- ? `STALE — captured ${ageMs}ms ago (older than the ${staleAfterMs}ms freshness window); a refresh is due`
59
- : `captured ${ageMs}ms ago`;
64
+ ? `may be stale — captured ${ageSeconds}s ago (older than the ${staleAfterSeconds}s freshness window); a refresh is due`
65
+ : `captured ${ageSeconds}s ago`;
66
+ // Honest count clause: the snapshot's own recall flag decides what its count
67
+ // means. Only a recall-filtered capture (flagged + sub-floor records dropped)
68
+ // holds a "recall-eligible" count; an unfiltered browse capture holds the raw
69
+ // browse-set count and must NOT be labeled recall-eligible.
70
+ const countClause = search.recallFiltered
71
+ ? `${search.records.length} record(s) recall-eligible`
72
+ : `${search.records.length} record(s) in the browse set (unfiltered — recall floor not applied)`;
60
73
  const degraded = search.indexUnavailableReason
61
74
  ? ` Recall degraded to a literal scan: ${search.indexUnavailableReason}.`
62
75
  : '';
@@ -68,7 +81,7 @@ export function buildRecallSnapshot(search, mode, capturedAt, staleAfterMs, now
68
81
  ageMs,
69
82
  stale,
70
83
  mode,
71
- note: `memory recall snapshot ${source}, ${freshness}; ${search.records.length} record(s) recall-eligible.`
84
+ note: `memory recall snapshot ${source}, ${freshness}; ${countClause}.`
72
85
  + degraded + caveat,
73
86
  };
74
87
  }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * wire-verb-availability.ts — the runtime discriminator that lets a memory wire
3
+ * consumer tell "no such record" apart from "this daemon does not serve this verb".
4
+ *
5
+ * THE PROBLEM THIS SOLVES. A newer consumer may talk to an OLDER daemon that never
6
+ * registered an extended memory route (list / update / links / search-semantic /
7
+ * export …). Calling such a route hits the daemon's terminal route-not-found 404.
8
+ * A record-scoped verb (update / link) against a CURRENT daemon can ALSO 404 — when
9
+ * the addressed record genuinely does not exist. Both are HTTP 404, so a consumer
10
+ * that inspects only the status folds BOTH to `null` and then reports an existing
11
+ * record as "not found" against an older daemon — a silent data lie on the exact
12
+ * version-skew path the wire feature advertises as supported.
13
+ *
14
+ * THE RUNTIME SIGNAL. The daemon already distinguishes the two in the response BODY:
15
+ * a genuine record-miss carries `code: MEMORY_RECORD_NOT_FOUND_CODE`
16
+ * (daemon-sdk's memory handlers), while a route-not-found carries the terminal
17
+ * 404's `code: 'NOT_FOUND'`. So the disposition is read from the body code, NOT the
18
+ * transport object's shape:
19
+ * - 404 + record-missing code → 'record-missing' (safe to fold to null)
20
+ * - 404 + any OTHER code, or NO code → 'method-unavailable' (honest reject)
21
+ * - anything that is not a 404 → 'other' (propagate unchanged)
22
+ *
23
+ * THE LEGACY-404 RULING. A pre-error-unification daemon may answer a bare 404 with
24
+ * no structured code at all. That 404 is ambiguous — it could be either case — and
25
+ * we deliberately treat it as 'method-unavailable', NOT 'record-missing'. A loud
26
+ * wrong ("this daemon does not serve X" when the record was in fact simply absent)
27
+ * is recoverable and honest; a silent wrong (reporting an existing record as gone)
28
+ * is the exact dishonest-recall failure this whole design exists to prevent. Never
29
+ * silently null on an ambiguous 404.
30
+ */
31
+ /** How a caught wire error should be treated by an extended-verb call site. */
32
+ export type MemoryWire404Disposition = 'record-missing' | 'method-unavailable' | 'other';
33
+ /**
34
+ * Classify a caught memory wire error. Returns 'other' for anything that is not a
35
+ * 404 (network, auth, malformed body, 5xx) so the caller propagates it unchanged.
36
+ */
37
+ export declare function classifyMemoryWireError(error: unknown): MemoryWire404Disposition;
38
+ /**
39
+ * The single canonical "the adopted daemon does not serve this verb" rejection.
40
+ * Every consumer (the SDK client's own fallback plus each wire transport) throws
41
+ * THIS so the surfaced message is identical everywhere.
42
+ */
43
+ export declare function memoryVerbUnavailableError(verb: string, cause?: unknown): Error;
44
+ /**
45
+ * The fold a transport's extended-verb catch block runs. Given the caught wire
46
+ * error:
47
+ * - 'method-unavailable' → throw {@link memoryVerbUnavailableError} (the older
48
+ * daemon never served this route — a loud, honest reject);
49
+ * - 'record-missing' → return normally (the caller decides what a genuine
50
+ * record-miss means for its return type: `null` for a nullable verb, or a
51
+ * rethrow for a non-nullable one);
52
+ * - 'other' → rethrow the original error unchanged.
53
+ *
54
+ * A nullable record-scoped verb uses it as `foldMemoryWireExtendedError(v, e); return null;`
55
+ * — the fold throws for the version-skew case and only falls through to `null`
56
+ * for a genuine record-miss.
57
+ */
58
+ export declare function foldMemoryWireExtendedError(verb: string, error: unknown): void;
59
+ //# sourceMappingURL=wire-verb-availability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire-verb-availability.d.ts","sourceRoot":"","sources":["../../../../src/platform/runtime/memory-spine/wire-verb-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,+EAA+E;AAC/E,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,OAAO,CAAC;AA2DzF;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,CAIhF;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAQ/E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAK9E"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * wire-verb-availability.ts — the runtime discriminator that lets a memory wire
3
+ * consumer tell "no such record" apart from "this daemon does not serve this verb".
4
+ *
5
+ * THE PROBLEM THIS SOLVES. A newer consumer may talk to an OLDER daemon that never
6
+ * registered an extended memory route (list / update / links / search-semantic /
7
+ * export …). Calling such a route hits the daemon's terminal route-not-found 404.
8
+ * A record-scoped verb (update / link) against a CURRENT daemon can ALSO 404 — when
9
+ * the addressed record genuinely does not exist. Both are HTTP 404, so a consumer
10
+ * that inspects only the status folds BOTH to `null` and then reports an existing
11
+ * record as "not found" against an older daemon — a silent data lie on the exact
12
+ * version-skew path the wire feature advertises as supported.
13
+ *
14
+ * THE RUNTIME SIGNAL. The daemon already distinguishes the two in the response BODY:
15
+ * a genuine record-miss carries `code: MEMORY_RECORD_NOT_FOUND_CODE`
16
+ * (daemon-sdk's memory handlers), while a route-not-found carries the terminal
17
+ * 404's `code: 'NOT_FOUND'`. So the disposition is read from the body code, NOT the
18
+ * transport object's shape:
19
+ * - 404 + record-missing code → 'record-missing' (safe to fold to null)
20
+ * - 404 + any OTHER code, or NO code → 'method-unavailable' (honest reject)
21
+ * - anything that is not a 404 → 'other' (propagate unchanged)
22
+ *
23
+ * THE LEGACY-404 RULING. A pre-error-unification daemon may answer a bare 404 with
24
+ * no structured code at all. That 404 is ambiguous — it could be either case — and
25
+ * we deliberately treat it as 'method-unavailable', NOT 'record-missing'. A loud
26
+ * wrong ("this daemon does not serve X" when the record was in fact simply absent)
27
+ * is recoverable and honest; a silent wrong (reporting an existing record as gone)
28
+ * is the exact dishonest-recall failure this whole design exists to prevent. Never
29
+ * silently null on an ambiguous 404.
30
+ */
31
+ import { MEMORY_RECORD_NOT_FOUND_CODE } from '@pellux/goodvibes-errors';
32
+ function readNumber(value) {
33
+ return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
34
+ }
35
+ function readString(value) {
36
+ return typeof value === 'string' && value.length > 0 ? value : undefined;
37
+ }
38
+ function readBodyCode(body) {
39
+ return body !== null && typeof body === 'object'
40
+ ? readString(body.code)
41
+ : undefined;
42
+ }
43
+ /**
44
+ * Pull the (status, code) signal out of any of the error shapes the three memory
45
+ * transports actually throw:
46
+ * - an SDK `HttpStatusError` (TUI transport via `createTransportError`): `.status`
47
+ * + `.code`, with a `.transport.body.code` fallback;
48
+ * - an error carrying an explicit `.status`/`.code` (the agent transport stamps
49
+ * these onto its thrown error) or a `.body.code`;
50
+ * - a bare `Error` whose message embeds `HTTP <status>` (a legacy/hand-rolled
51
+ * transport) — status parsed out, code absent.
52
+ */
53
+ function extractWire404Signal(error) {
54
+ if (error === null || typeof error !== 'object') {
55
+ return { status: undefined, code: undefined };
56
+ }
57
+ const record = error;
58
+ const status = readNumber(record.status)
59
+ ?? readNumber(record.transport?.status)
60
+ ?? parseStatusFromMessage(record.message);
61
+ const code = readString(record.code)
62
+ ?? readBodyCode(record.transport?.body)
63
+ ?? readBodyCode(record.body);
64
+ return { status, code };
65
+ }
66
+ function parseStatusFromMessage(message) {
67
+ if (typeof message !== 'string')
68
+ return undefined;
69
+ const match = message.match(/\bHTTP (\d{3})\b/);
70
+ return match ? Number(match[1]) : undefined;
71
+ }
72
+ /**
73
+ * Classify a caught memory wire error. Returns 'other' for anything that is not a
74
+ * 404 (network, auth, malformed body, 5xx) so the caller propagates it unchanged.
75
+ */
76
+ export function classifyMemoryWireError(error) {
77
+ const { status, code } = extractWire404Signal(error);
78
+ if (status !== 404)
79
+ return 'other';
80
+ return code === MEMORY_RECORD_NOT_FOUND_CODE ? 'record-missing' : 'method-unavailable';
81
+ }
82
+ /**
83
+ * The single canonical "the adopted daemon does not serve this verb" rejection.
84
+ * Every consumer (the SDK client's own fallback plus each wire transport) throws
85
+ * THIS so the surfaced message is identical everywhere.
86
+ */
87
+ export function memoryVerbUnavailableError(verb, cause) {
88
+ return new Error(`memory spine: the adopted daemon does not support the '${verb}' memory verb over the wire — `
89
+ + 'upgrade the daemon to a build that serves it, or run this surface offline (no daemon adopted). '
90
+ + 'A wire client will not read its own local store for this op, because that would break the '
91
+ + 'single-writer invariant and report a divergent local copy as if it were the canonical store.', cause === undefined ? undefined : { cause });
92
+ }
93
+ /**
94
+ * The fold a transport's extended-verb catch block runs. Given the caught wire
95
+ * error:
96
+ * - 'method-unavailable' → throw {@link memoryVerbUnavailableError} (the older
97
+ * daemon never served this route — a loud, honest reject);
98
+ * - 'record-missing' → return normally (the caller decides what a genuine
99
+ * record-miss means for its return type: `null` for a nullable verb, or a
100
+ * rethrow for a non-nullable one);
101
+ * - 'other' → rethrow the original error unchanged.
102
+ *
103
+ * A nullable record-scoped verb uses it as `foldMemoryWireExtendedError(v, e); return null;`
104
+ * — the fold throws for the version-skew case and only falls through to `null`
105
+ * for a genuine record-miss.
106
+ */
107
+ export function foldMemoryWireExtendedError(verb, error) {
108
+ const disposition = classifyMemoryWireError(error);
109
+ if (disposition === 'method-unavailable')
110
+ throw memoryVerbUnavailableError(verb, error);
111
+ if (disposition === 'other')
112
+ throw error;
113
+ // 'record-missing' → fall through; the caller resolves it for its own return type.
114
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/platform/runtime/services.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAwB,MAAM,wBAAwB,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,mBA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AQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAClD,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IAChE,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;IACtD;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED,wBAAgB,gCAAgC,CAC9C,YAAY,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,WAAW,CAAC,EACjE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,GACvD,MAAM,IAAI,CAOZ;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAyjBtF"}
@@ -286,18 +286,9 @@ export function createRuntimeServices(options) {
286
286
  return record.id;
287
287
  },
288
288
  });
289
- const knowledgeStore = new KnowledgeStore({
290
- configManager,
291
- dbFileName: REGULAR_KNOWLEDGE_DB_FILE,
292
- });
293
- const agentKnowledgeStore = new KnowledgeStore({
294
- configManager,
295
- dbFileName: GOODVIBES_AGENT_KNOWLEDGE_DB_FILE,
296
- });
297
- const homeGraphKnowledgeStore = new KnowledgeStore({
298
- configManager,
299
- dbFileName: HOME_GRAPH_KNOWLEDGE_DB_FILE,
300
- });
289
+ const knowledgeStore = new KnowledgeStore({ configManager, dbFileName: REGULAR_KNOWLEDGE_DB_FILE, family: 'wiki' });
290
+ const agentKnowledgeStore = new KnowledgeStore({ configManager, dbFileName: GOODVIBES_AGENT_KNOWLEDGE_DB_FILE, family: 'agent' });
291
+ const homeGraphKnowledgeStore = new KnowledgeStore({ configManager, dbFileName: HOME_GRAPH_KNOWLEDGE_DB_FILE, family: 'home-graph' });
301
292
  const knowledgeSemanticLlm = createProviderBackedKnowledgeSemanticLlm(providerRegistry, {
302
293
  timeoutMs: 20_000,
303
294
  maxConcurrent: 1,
@@ -101,6 +101,13 @@ export interface HonestMemorySearchResult {
101
101
  readonly excludedBelowFloorCount: number;
102
102
  /** Result count BEFORE any recall-injection filtering — so a caller can tell "index empty" from "everything filtered out". */
103
103
  readonly totalBeforeRecallFilter: number;
104
+ /**
105
+ * The store's configured recall confidence floor (MIN_PROMPT_MEMORY_CONFIDENCE)
106
+ * this result was judged against — carried on the wire so a surface can state
107
+ * the floor in a label ("below the N% recall floor") without hardcoding it and
108
+ * silently drifting if the store's floor is retuned.
109
+ */
110
+ readonly recallFloor: number;
104
111
  }
105
112
  /**
106
113
  * Run a search that HONORS the recall-honesty contract end to end:
@@ -1 +1 @@
1
- {"version":3,"file":"memory-recall-contract.d.ts","sourceRoot":"","sources":["../../../src/platform/state/memory-recall-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACtG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC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BAAuB,EAAE,MAAM,CAAC;IACzC,8HAA8H;IAC9H,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,EACxB,MAAM,GAAE,kBAAuB,EAC/B,OAAO,GAAE,yBAA8B,GACtC,wBAAwB,CA+D1B"}
1
+ {"version":3,"file":"memory-recall-contract.d.ts","sourceRoot":"","sources":["../../../src/platform/state/memory-recall-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACtG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,sHAAsH;IACtH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAOD;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,YAAY,GAAG,uBAAuB,CAkB7F;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAKtF;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAKjF;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,EAAE,CAAC;IACnD,cAAc,CAAC,MAAM,EAAE,kBAAkB,GAAG,0BAA0B,EAAE,CAAC;IACzE,WAAW,IAAI,iBAAiB,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACvC;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,qHAAqH;IACrH,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAAC;IACtC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,8JAA8J;IAC9J,QAAQ,CAAC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+EAA+E;IAC/E,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,8HAA8H;IAC9H,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,EACxB,MAAM,GAAE,kBAAuB,EAC/B,OAAO,GAAE,yBAA8B,GACtC,wBAAwB,CAiE1B"}
@@ -139,6 +139,7 @@ export function runHonestMemorySearch(store, filter = {}, options = {}) {
139
139
  excludedFlaggedCount: 0,
140
140
  excludedBelowFloorCount: 0,
141
141
  totalBeforeRecallFilter,
142
+ recallFloor: MIN_PROMPT_MEMORY_CONFIDENCE,
142
143
  };
143
144
  }
144
145
  const kept = [];
@@ -166,5 +167,6 @@ export function runHonestMemorySearch(store, filter = {}, options = {}) {
166
167
  excludedFlaggedCount,
167
168
  excludedBelowFloorCount,
168
169
  totalBeforeRecallFilter,
170
+ recallFloor: MIN_PROMPT_MEMORY_CONFIDENCE,
169
171
  };
170
172
  }
@@ -6,8 +6,32 @@
6
6
  * @param title - Notification title
7
7
  * @param message - Notification body
8
8
  * @param durationMs - Turn duration in milliseconds
9
+ * @param options - Optional overrides (see {@link NotifyOptions}).
9
10
  */
10
11
  /** Escape a string for safe interpolation into an AppleScript string literal. */
11
12
  export declare function escapeAppleScript(s: string): string;
12
- export declare function notifyCompletion(title: string, message: string, durationMs: number): void;
13
+ export interface NotifyOptions {
14
+ /**
15
+ * Bypass test suppression for this call. Intended only for tests that
16
+ * exercise the notification shell-out layer itself (e.g. asserting the
17
+ * notify-send/osascript invocation or the terminal bell byte). Every
18
+ * other caller should leave this unset.
19
+ */
20
+ force?: boolean;
21
+ }
22
+ /**
23
+ * True when this call must be a no-op: real desktop notifications (and the
24
+ * terminal bell) must never fire from an automated test run and spam
25
+ * whoever's desktop the tests happen to execute on.
26
+ *
27
+ * Suppressed when either:
28
+ * - `NODE_ENV === 'test'` (set automatically by `bun test`), or
29
+ * - `GOODVIBES_SUPPRESS_NOTIFY` is set to a truthy value (explicit
30
+ * override for harnesses that don't run under NODE_ENV=test).
31
+ *
32
+ * `options.force: true` bypasses suppression entirely — the one sanctioned
33
+ * escape hatch, for tests that specifically exercise this shell-out layer.
34
+ */
35
+ export declare function isNotifySuppressed(force?: boolean): boolean;
36
+ export declare function notifyCompletion(title: string, message: string, durationMs: number, options?: NotifyOptions): void;
13
37
  //# sourceMappingURL=notify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../../src/platform/utils/notify.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAKrF;;;;;;;GAOG;AACH,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEnD;AAiCD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAmBzF"}
1
+ {"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../../src/platform/utils/notify.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAKrF;;;;;;;;GAQG;AACH,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAM3D;AAiCD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAwBlH"}
@@ -8,11 +8,35 @@ import { logger } from './logger.js';
8
8
  * @param title - Notification title
9
9
  * @param message - Notification body
10
10
  * @param durationMs - Turn duration in milliseconds
11
+ * @param options - Optional overrides (see {@link NotifyOptions}).
11
12
  */
12
13
  /** Escape a string for safe interpolation into an AppleScript string literal. */
13
14
  export function escapeAppleScript(s) {
14
15
  return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
15
16
  }
17
+ /**
18
+ * True when this call must be a no-op: real desktop notifications (and the
19
+ * terminal bell) must never fire from an automated test run and spam
20
+ * whoever's desktop the tests happen to execute on.
21
+ *
22
+ * Suppressed when either:
23
+ * - `NODE_ENV === 'test'` (set automatically by `bun test`), or
24
+ * - `GOODVIBES_SUPPRESS_NOTIFY` is set to a truthy value (explicit
25
+ * override for harnesses that don't run under NODE_ENV=test).
26
+ *
27
+ * `options.force: true` bypasses suppression entirely — the one sanctioned
28
+ * escape hatch, for tests that specifically exercise this shell-out layer.
29
+ */
30
+ export function isNotifySuppressed(force) {
31
+ if (force)
32
+ return false;
33
+ if (process.env.NODE_ENV === 'test')
34
+ return true;
35
+ const override = process.env.GOODVIBES_SUPPRESS_NOTIFY;
36
+ if (override && override !== '0' && override.toLowerCase() !== 'false')
37
+ return true;
38
+ return false;
39
+ }
16
40
  function trimNotificationOutput(value) {
17
41
  const trimmed = value.trim();
18
42
  return trimmed.length > 0 ? trimmed.slice(0, 500) : undefined;
@@ -43,7 +67,11 @@ function spawnNotification(command) {
43
67
  });
44
68
  }
45
69
  }
46
- export function notifyCompletion(title, message, durationMs) {
70
+ export function notifyCompletion(title, message, durationMs, options) {
71
+ if (isNotifySuppressed(options?.force)) {
72
+ logger.debug('Completion notification suppressed under test', { title, durationMs });
73
+ return;
74
+ }
47
75
  // Terminal bell for responses > 5s.
48
76
  // Surface-specific: this writes directly to stdout and is only meaningful
49
77
  // in a terminal context. Host surfaces that manage their own output stream
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- let version = '1.2.0';
3
+ let version = '1.3.0';
4
4
  try {
5
5
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
6
6
  version = pkg.version ?? version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pellux/goodvibes-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "TypeScript SDK for building GoodVibes operator, peer, web, mobile, and daemon-connected apps with typed contracts, auth, realtime events, and transport layers.",
5
5
  "keywords": [
6
6
  "goodvibes",
@@ -477,14 +477,14 @@
477
477
  "sideEffects": false,
478
478
  "type": "module",
479
479
  "dependencies": {
480
- "@pellux/goodvibes-contracts": "1.2.0",
481
- "@pellux/goodvibes-daemon-sdk": "1.2.0",
482
- "@pellux/goodvibes-errors": "1.2.0",
483
- "@pellux/goodvibes-operator-sdk": "1.2.0",
484
- "@pellux/goodvibes-peer-sdk": "1.2.0",
485
- "@pellux/goodvibes-transport-core": "1.2.0",
486
- "@pellux/goodvibes-transport-http": "1.2.0",
487
- "@pellux/goodvibes-transport-realtime": "1.2.0"
480
+ "@pellux/goodvibes-contracts": "1.3.0",
481
+ "@pellux/goodvibes-daemon-sdk": "1.3.0",
482
+ "@pellux/goodvibes-errors": "1.3.0",
483
+ "@pellux/goodvibes-operator-sdk": "1.3.0",
484
+ "@pellux/goodvibes-peer-sdk": "1.3.0",
485
+ "@pellux/goodvibes-transport-core": "1.3.0",
486
+ "@pellux/goodvibes-transport-http": "1.3.0",
487
+ "@pellux/goodvibes-transport-realtime": "1.3.0"
488
488
  },
489
489
  "optionalDependencies": {
490
490
  "@agentclientprotocol/sdk": "^0.21.0",