@jskit-ai/assistant-core 0.1.231 → 0.1.232

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.231",
11
+ "@jskit-ai/assistant-core": "0.1.232",
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.231",
3
+ "version": "0.1.232",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test --test-concurrency=1"
@@ -418,7 +418,9 @@ export function createConversationRuntime({ engine: defaultEngine = "api", defau
418
418
  ...(budget ? { maximumHistoryBytes: async options => {
419
419
  await access(context, entry.id, request.operation, entry);
420
420
  signal.throwIfAborted();
421
- const bytes = await budget({ ...options, context, signal });
421
+ // A host may free native context first; show that as compacting.
422
+ const bytes = await budget({ ...options, context, signal,
423
+ setPhase: phase => setPhase(entry, phase === "compacting" ? "compacting" : "preparing") });
422
424
  signal.throwIfAborted();
423
425
  return bytes;
424
426
  } } : {}),
@@ -2298,8 +2298,14 @@ test("bound Main history budget transfers more than 30 complete messages through
2298
2298
  f.binding.transcript.history = async () => history;
2299
2299
  await f.binding.state.write({ lastEngine: "codex", engines: { codex: { seen: {} } } });
2300
2300
  let reads = 0;
2301
- f.binding.maximumHistoryBytes = async ({ engineId, returning, context, signal, input }) => {
2301
+ const phases = [];
2302
+ const canonical = await f.runtime.open({ id: "lesson", context: f.toolContext });
2303
+ f.binding.maximumHistoryBytes = async ({ engineId, returning, context, signal, input, setPhase }) => {
2302
2304
  reads++;
2305
+ await setPhase("compacting");
2306
+ phases.push((await canonical.read()).phase);
2307
+ await setPhase("preparing");
2308
+ phases.push((await canonical.read()).phase);
2303
2309
  assert.equal(engineId, "claude");
2304
2310
  assert.equal(returning, false);
2305
2311
  assert.equal(context.actor.id, "owner");
@@ -2314,6 +2320,7 @@ test("bound Main history budget transfers more than 30 complete messages through
2314
2320
  };
2315
2321
  await sendCommon(f, "full-history");
2316
2322
  assert.equal(reads, 1);
2323
+ assert.deepEqual(phases, ["compacting", "preparing"], "a host freeing native context reports it as compacting");
2317
2324
  assert.ok(sent[0].length > 128_000);
2318
2325
  for (const message of history) assert.ok(sent[0].includes(JSON.stringify(message.text)), message.id);
2319
2326
  await f.frame({ type: "result", subtype: "success", result: "Received." });