@motebit/sdk 2.0.0 → 2.2.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.
@@ -33,6 +33,44 @@ export interface BrowserSessionInfo {
33
33
  */
34
34
  readonly control?: ControlState;
35
35
  }
36
+ /**
37
+ * Memory self-state — the typed truth about the motebit's own
38
+ * memory store THIS turn, surfaced so the AI reads it instead of
39
+ * inferring continuity from its architecture description.
40
+ *
41
+ * The hallucination this closes is the self-state sibling of the
42
+ * browser-state one: asked "are you forming memories?", the AI
43
+ * reads the `[INTERNAL REFERENCE]` line ("Memory graph: semantic
44
+ * memory with decay, consolidation…") and confabulates "yes, I'm
45
+ * forming memories" — even when zero formed this session and the
46
+ * newest is days old. The capability description is true; the
47
+ * runtime claim was not. The fix is the same as `BrowserSessionInfo`:
48
+ * give the AI the typed runtime signal so the answer is grounded in
49
+ * what the store actually holds, not what the architecture can do.
50
+ *
51
+ * Doctrine: `typed-truth-perception.md` — same four-part shape as
52
+ * the browser line (wire field + runtime producer + prompt clause +
53
+ * dispatch/test). The `[Now]` block is where the AI reads it.
54
+ */
55
+ export interface MemorySelfState {
56
+ /** Total non-tombstoned memory nodes this motebit currently holds. */
57
+ readonly total: number;
58
+ /**
59
+ * Age in ms of the most-recently-formed memory, or null when the
60
+ * store is empty. Lets the AI answer "how fresh is my memory?"
61
+ * from a number, not a guess ("9 days old", not "recently").
62
+ */
63
+ readonly newestAgeMs: number | null;
64
+ /**
65
+ * Memories formed since the current conversation began (the runtime
66
+ * stamps this at boot and re-stamps it on each `resetConversation`,
67
+ * so "this session" tracks what the user perceives when they ask
68
+ * "are you remembering this?" — not runtime uptime). The
69
+ * load-bearing field: a `0` here is the typed contradiction to
70
+ * "yes, I'm forming memories" when nothing has been written.
71
+ */
72
+ readonly formedThisSession: number;
73
+ }
36
74
  /**
37
75
  * Full runtime session-state snapshot — composed by the runtime
38
76
  * from per-surface browser info plus its own sensitivity and
@@ -79,5 +117,14 @@ export interface SessionStateSnapshot {
79
117
  * staleness, the AI doesn't have to cross-reference history).
80
118
  */
81
119
  readonly staleBytesOmissionReason?: import("./pixel-consent.js").PixelOmittedReason;
120
+ /**
121
+ * Memory self-state — runtime-owned. Present when the runtime has
122
+ * a memory store wired (it always does in production; absent only
123
+ * on surfaces/tests that construct a snapshot without one). When
124
+ * present, the `[Now]` block emits a `Memory:` line the AI reads to
125
+ * ground self-claims about its own memory instead of inferring them
126
+ * from the architecture description. See {@link MemorySelfState}.
127
+ */
128
+ readonly memory?: MemorySelfState;
82
129
  }
83
130
  //# sourceMappingURL=session-state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-state.d.ts","sourceRoot":"","sources":["../src/session-state.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;CACjC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,mFAAmF;IACnF,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,6DAA6D;IAC7D,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,oBAAoB,EAAE,kBAAk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2
  "name": "@motebit/sdk",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Developer contract for building Motebit-powered agents, services, and integrations — stable types, adapter interfaces, governance config. Re-exports @motebit/protocol.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -47,12 +47,12 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "@motebit/protocol": "2.0.0"
50
+ "@motebit/protocol": "3.0.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^22.0.0",
54
54
  "typescript": "^5.6.0",
55
- "vitest": "^2.1.0"
55
+ "vitest": "^4.1.8"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=20"