@jskit-ai/assistant-core 0.1.235 → 0.1.236

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.235",
11
+ "@jskit-ai/assistant-core": "0.1.236",
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.235",
3
+ "version": "0.1.236",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test --test-concurrency=1"
@@ -442,13 +442,19 @@ export function createConversationRuntime({ engine: defaultEngine = "api", defau
442
442
  : Math.max(0, initialWindow - (request?.input.origin === "user" ? 1 : 0)),
443
443
  maximumInitialMessageCharacters: limits.maxInitialNativeHistoryMessageCharacters,
444
444
  ...(budget ? { maximumHistoryBytes: async options => {
445
- await access(context, entry.id, request.operation, entry);
446
- signal.throwIfAborted();
447
- // A host may free native context first; show that as compacting.
448
- const bytes = await budget({ ...options, context, signal,
449
- setPhase: phase => setPhase(entry, phase === "compacting" ? "compacting" : "preparing") });
450
- signal.throwIfAborted();
451
- return bytes;
445
+ try {
446
+ await access(context, entry.id, request.operation, entry);
447
+ signal.throwIfAborted();
448
+ // A host may free native context first; show that as compacting.
449
+ const bytes = await budget({ ...options, context, signal,
450
+ setPhase: phase => setPhase(entry, phase === "compacting" ? "compacting" : "preparing") });
451
+ signal.throwIfAborted();
452
+ return bytes;
453
+ } catch (error) {
454
+ // Sizing missed history precedes native dispatch, so this message
455
+ // was definitely not sent. Hosts and clients report it as such.
456
+ throw Object.assign(error, { delivery: "not-sent" });
457
+ }
452
458
  } } : {}),
453
459
  presentation: entry.conversation?.presentation || { unconfirmedCode: "conversation_delivery_uncertain",
454
460
  unconfirmedMessage: "The previous submission has uncertain delivery. Retry this message to check its native receipt; it will not be resent automatically." },
@@ -2361,7 +2361,8 @@ test("bound Main cannot dispatch or retain a pending prompt when its history bud
2361
2361
  f.binding.transcript.history = async () => [{ id: "earlier", version: "v1", role: "user", text: "Earlier work." }];
2362
2362
  await f.binding.state.write({ lastEngine: "codex", engines: { codex: { seen: {} } } });
2363
2363
  f.binding.maximumHistoryBytes = async () => { throw new Error("Current native context usage unavailable"); };
2364
- await assert.rejects(f.conversation.send({ messageId: "no-budget", text: "Continue" }), /Current native context usage unavailable/u);
2364
+ await assert.rejects(f.conversation.send({ messageId: "no-budget", text: "Continue" }), error =>
2365
+ /Current native context usage unavailable/u.test(error.message) && error.delivery === "not-sent");
2365
2366
  assert.equal(f.processes.length, 0);
2366
2367
  assert.equal(f.messages.length, 0);
2367
2368
  assert.equal((await f.binding.state.read())?.engines?.claude?.pending, undefined);