@jskit-ai/assistant-core 0.1.233 → 0.1.234

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.
@@ -8,7 +8,7 @@
8
8
  "build": "vite build"
9
9
  },
10
10
  "dependencies": {
11
- "@jskit-ai/assistant-core": "0.1.233",
11
+ "@jskit-ai/assistant-core": "0.1.234",
12
12
  "@jskit-ai/http-runtime": "0.1.242",
13
13
  "@jskit-ai/kernel": "0.1.244",
14
14
  "@mdi/js": "^7.4.47",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-core",
3
- "version": "0.1.233",
3
+ "version": "0.1.234",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test --test-concurrency=1"
@@ -130,8 +130,9 @@ export function createConversationStorage({ readRecord, writeRecord, deleteRecor
130
130
 
131
131
  // Saved records are shared and never changed in place. A transaction copies
132
132
  // the turn map and each turn it changes, then commits that new record.
133
+ // Adapter fields the transaction does not manage are carried unchanged.
133
134
  function transaction(saved) {
134
- const draft = { metadata: saved.metadata, turns: saved.turns };
135
+ const { index: _index, ...draft } = saved;
135
136
  const added = new Map();
136
137
  let ownTurns = false;
137
138
  const owned = new Set();
@@ -81,6 +81,15 @@ test("message adaptation retains progress, attachments, system actions and SQL m
81
81
  assert.equal(turns[2].assistant.sql, "select 1");
82
82
  });
83
83
 
84
+ test("record storage carries adapter fields it does not manage through writes", async () => {
85
+ let record = { turns: new Map(), metadata: {}, rewound: [{ turnId: "000001" }] };
86
+ const storage = createConversationStorage({ readRecord: () => record, writeRecord: (_scope, next) => { record = next; } });
87
+ await storage.write("conversation", transaction => transaction.appendMessage("000002",
88
+ { role: "user", at: "2026-10-01T01:00:00.000Z", text: "Hello", messageId: "m1" }));
89
+ assert.deepEqual(record.rewound, [{ turnId: "000001" }]);
90
+ assert.equal(record.turns.get("000002").messages[0].text, "Hello");
91
+ });
92
+
84
93
  test("record storage preserves original role, timestamp and message-id overwrite identity", async () => {
85
94
  let record = { turns: new Map(), metadata: {} };
86
95
  const storage = createConversationStorage({ readRecord: () => record, writeRecord: (_scope, next) => { record = next; } });