@ponythewhite/base-context 1.0.10 → 1.0.11
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.
- package/CHANGELOG.md +11 -0
- package/dist/base-context-runtime/pyproject.toml +1 -1
- package/dist/base-context-runtime/uv.lock +1 -1
- package/dist/build-info.json +1 -1
- package/dist/bundle/{bundled-modules-MX6YNAM2.js → bundled-modules-PEFT72QN.js} +2 -2
- package/dist/bundle/{chunk-UHLGPYMI.js → chunk-JZHGOOFM.js} +68 -18
- package/dist/bundle/{chunk-CDXQNS5P.js → chunk-TOOVREMP.js} +498 -82
- package/dist/bundle/{cli-main-D7W3WWCV.js → cli-main-BRXGYTGK.js} +2 -2
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/{main-5J3QBZ5Y.js → main-POUXGEL6.js} +2 -2
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +85 -45
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/canonical-context.d.ts +19 -3
- package/dist/core/canonical-context.d.ts.map +1 -1
- package/dist/core/canonical-context.js +130 -9
- package/dist/core/canonical-context.js.map +1 -1
- package/dist/core/context-epoch-copy.d.ts +1 -1
- package/dist/core/context-epoch-copy.d.ts.map +1 -1
- package/dist/core/context-epoch-copy.js +18 -7
- package/dist/core/context-epoch-copy.js.map +1 -1
- package/dist/core/context-epoch.d.ts +4 -0
- package/dist/core/context-epoch.d.ts.map +1 -1
- package/dist/core/context-epoch.js +8 -1
- package/dist/core/context-epoch.js.map +1 -1
- package/dist/core/context-tree.d.ts +1 -1
- package/dist/core/context-tree.d.ts.map +1 -1
- package/dist/core/context-tree.js +98 -8
- package/dist/core/context-tree.js.map +1 -1
- package/dist/core/history-index-worker.d.ts.map +1 -1
- package/dist/core/history-index-worker.js +59 -6
- package/dist/core/history-index-worker.js.map +1 -1
- package/dist/core/history-index.d.ts +17 -0
- package/dist/core/history-index.d.ts.map +1 -1
- package/dist/core/history-index.js +22 -0
- package/dist/core/history-index.js.map +1 -1
- package/dist/core/inference-coordinator.d.ts.map +1 -1
- package/dist/core/inference-coordinator.js +5 -1
- package/dist/core/inference-coordinator.js.map +1 -1
- package/dist/core/request-view-selection.d.ts +2 -1
- package/dist/core/request-view-selection.d.ts.map +1 -1
- package/dist/core/request-view-selection.js +29 -2
- package/dist/core/request-view-selection.js.map +1 -1
- package/dist/core/session-fork-messages.d.ts +5 -0
- package/dist/core/session-fork-messages.d.ts.map +1 -1
- package/dist/core/session-fork-messages.js +44 -0
- package/dist/core/session-fork-messages.js.map +1 -1
- package/dist/core/session-history-index.d.ts +5 -0
- package/dist/core/session-history-index.d.ts.map +1 -1
- package/dist/core/session-history-index.js +7 -0
- package/dist/core/session-history-index.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +155 -13
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-tree.d.ts +9 -0
- package/dist/core/session-tree.d.ts.map +1 -1
- package/dist/core/session-tree.js +71 -11
- package/dist/core/session-tree.js.map +1 -1
- package/dist/modes/agent-connection/in-process-agent-connection.d.ts.map +1 -1
- package/dist/modes/agent-connection/in-process-agent-connection.js +4 -4
- package/dist/modes/agent-connection/in-process-agent-connection.js.map +1 -1
- package/dist/modes/daemon/daemon-mode.d.ts.map +1 -1
- package/dist/modes/daemon/daemon-mode.js +4 -4
- package/dist/modes/daemon/daemon-mode.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.11] - 2026-09-20
|
|
4
|
+
|
|
5
|
+
- Fixed recovery compaction in long-running sessions that use `prime_context` without a request-budget profile.
|
|
6
|
+
- Fixed automatic recovery after reopening a session without a saved replay contract.
|
|
7
|
+
- Fixed recovery summaries after an over-budget request or a previous compaction while preserving native replay checks.
|
|
8
|
+
- Fixed opening large sessions from the session tree, listing sessions, and loading snapshots when a journal exceeds 64 MiB.
|
|
9
|
+
- Fixed optional replay-contract capture rejecting otherwise valid full-native requests with payload-hook metadata.
|
|
10
|
+
- Fixed `/tree`, `/context`, and the fork-message picker reading unrelated private request bodies from large session journals.
|
|
11
|
+
- Fixed refinement history loading failing on large unrelated session archives.
|
|
12
|
+
- Fixed small selected forks failing because unrelated history exceeded the source-read limit, while preserving required copy dependencies and output limits.
|
|
13
|
+
|
|
3
14
|
## [1.0.10] - 2026-09-19
|
|
4
15
|
|
|
5
16
|
- Fixed session attachment disconnecting during concurrent transcript updates.
|
package/dist/build-info.json
CHANGED
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
oauth_exports,
|
|
52
52
|
runPrintMode,
|
|
53
53
|
runRpcMode
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-JZHGOOFM.js";
|
|
55
55
|
import {
|
|
56
56
|
AgentSession,
|
|
57
57
|
CURRENT_SESSION_VERSION,
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
withFileMutationQueue,
|
|
144
144
|
wrapRegisteredTool,
|
|
145
145
|
wrapRegisteredTools
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-TOOVREMP.js";
|
|
147
147
|
import "./chunk-CFNASUYO.js";
|
|
148
148
|
import "./chunk-QKIFBA7N.js";
|
|
149
149
|
import {
|
|
@@ -296,7 +296,7 @@ import {
|
|
|
296
296
|
readSessionBootstrap,
|
|
297
297
|
readSessionInfo,
|
|
298
298
|
readSessionJournalHeader,
|
|
299
|
-
|
|
299
|
+
readVisibleUserMessagesForForking,
|
|
300
300
|
renderDiff,
|
|
301
301
|
renderDiffSeparator,
|
|
302
302
|
renderRichDiff,
|
|
@@ -349,7 +349,7 @@ import {
|
|
|
349
349
|
watchWithErrorHandler,
|
|
350
350
|
workerRosterEntryFromSummary,
|
|
351
351
|
wrapTextWithAnsi
|
|
352
|
-
} from "./chunk-
|
|
352
|
+
} from "./chunk-TOOVREMP.js";
|
|
353
353
|
import {
|
|
354
354
|
array,
|
|
355
355
|
boolean,
|
|
@@ -31875,6 +31875,67 @@ function buildSessionTreeFromFlatNodes(flatNodes) {
|
|
|
31875
31875
|
}
|
|
31876
31876
|
return roots;
|
|
31877
31877
|
}
|
|
31878
|
+
function applyTreeUsageOverlays(entries2) {
|
|
31879
|
+
const assistants = new Map(entries2.filter((entry) => entry.type === "message" && entry.message.role === "assistant").map((entry) => [entry.id, entry]));
|
|
31880
|
+
for (const entry of entries2) {
|
|
31881
|
+
if (entry.type !== "child_usage_attributed")
|
|
31882
|
+
continue;
|
|
31883
|
+
const target = assistants.get(entry.targetId);
|
|
31884
|
+
if (target?.type === "message" && target.message.role === "assistant")
|
|
31885
|
+
target.message.usage = cloneUsage(entry.aggregateUsage);
|
|
31886
|
+
}
|
|
31887
|
+
}
|
|
31888
|
+
async function readVisibleSessionTreeFlatNodes(manager, limits = DEFAULT_SESSION_TREE_LIMITS) {
|
|
31889
|
+
const { maxEntries, maxSourceBytes } = limits;
|
|
31890
|
+
if (!Number.isSafeInteger(maxEntries) || maxEntries <= 0 || !Number.isSafeInteger(maxSourceBytes) || maxSourceBytes <= 0)
|
|
31891
|
+
throw new Error("Invalid history materialization limits");
|
|
31892
|
+
if (!manager.supportsCapturedHistoryReads())
|
|
31893
|
+
return readSessionTreeFlatNodes(manager, { maxEntries, maxSourceBytes });
|
|
31894
|
+
return manager.readSourceHistory(async (history) => {
|
|
31895
|
+
const entries2 = [];
|
|
31896
|
+
const visibleIds = /* @__PURE__ */ new Set();
|
|
31897
|
+
let sourceBytes = 0;
|
|
31898
|
+
let after = 0;
|
|
31899
|
+
for (; ; ) {
|
|
31900
|
+
const page = await history.page(after);
|
|
31901
|
+
if (page.indexedThrough < history.source.sourceSequence)
|
|
31902
|
+
throw new Error("Captured history has incomplete index coverage");
|
|
31903
|
+
for (const ref of page.events) {
|
|
31904
|
+
if (ref.kind === "request" || ref.kind === "tool_intent")
|
|
31905
|
+
continue;
|
|
31906
|
+
if (entries2.length >= maxEntries)
|
|
31907
|
+
throw new Error("History entry budget exceeded");
|
|
31908
|
+
if (sourceBytes + ref.locator.length > maxSourceBytes)
|
|
31909
|
+
throw new Error("History source byte budget exceeded");
|
|
31910
|
+
const hydrated = await history.hydrateEntry(ref.id, maxSourceBytes - sourceBytes);
|
|
31911
|
+
if (!hydrated)
|
|
31912
|
+
throw new Error("Session tree entry source is unavailable");
|
|
31913
|
+
sourceBytes += ref.locator.length;
|
|
31914
|
+
let parentId = ref.parentId;
|
|
31915
|
+
while (parentId !== null && !visibleIds.has(parentId)) {
|
|
31916
|
+
const parent = await history.get(parentId);
|
|
31917
|
+
if (!parent || parent.kind !== "request" && parent.kind !== "tool_intent")
|
|
31918
|
+
break;
|
|
31919
|
+
parentId = parent.parentId;
|
|
31920
|
+
}
|
|
31921
|
+
hydrated.entry.parentId = parentId;
|
|
31922
|
+
entries2.push(hydrated.entry);
|
|
31923
|
+
visibleIds.add(ref.id);
|
|
31924
|
+
}
|
|
31925
|
+
if (page.nextAfter === null)
|
|
31926
|
+
break;
|
|
31927
|
+
after = page.nextAfter;
|
|
31928
|
+
}
|
|
31929
|
+
applyTreeUsageOverlays(entries2);
|
|
31930
|
+
const result = { flatNodes: buildSessionTreeFlatNodes(entries2), leafId: history.source.leafId };
|
|
31931
|
+
stringifyBoundedJson(result, maxSourceBytes);
|
|
31932
|
+
return result;
|
|
31933
|
+
});
|
|
31934
|
+
}
|
|
31935
|
+
async function readVisibleSessionTree(manager, limits = DEFAULT_SESSION_TREE_LIMITS) {
|
|
31936
|
+
const { flatNodes, leafId } = await readVisibleSessionTreeFlatNodes(manager, limits);
|
|
31937
|
+
return { tree: buildSessionTreeFromFlatNodes(flatNodes), leafId };
|
|
31938
|
+
}
|
|
31878
31939
|
async function readSessionTreeFlatNodes(manager, limits = DEFAULT_SESSION_TREE_LIMITS) {
|
|
31879
31940
|
const capturedLimits = { ...limits };
|
|
31880
31941
|
let entries2;
|
|
@@ -31883,14 +31944,7 @@ async function readSessionTreeFlatNodes(manager, limits = DEFAULT_SESSION_TREE_L
|
|
|
31883
31944
|
const history = await manager.materializeSourceHistory(capturedLimits);
|
|
31884
31945
|
entries2 = history.entries.map(({ entry }) => entry);
|
|
31885
31946
|
leafId = history.source.leafId;
|
|
31886
|
-
|
|
31887
|
-
for (const entry of entries2) {
|
|
31888
|
-
if (entry.type !== "child_usage_attributed")
|
|
31889
|
-
continue;
|
|
31890
|
-
const target = assistants.get(entry.targetId);
|
|
31891
|
-
if (target?.type === "message" && target.message.role === "assistant")
|
|
31892
|
-
target.message.usage = cloneUsage(entry.aggregateUsage);
|
|
31893
|
-
}
|
|
31947
|
+
applyTreeUsageOverlays(entries2);
|
|
31894
31948
|
} else {
|
|
31895
31949
|
const history = manager.materializeResidentHistory(capturedLimits);
|
|
31896
31950
|
entries2 = history.entries;
|
|
@@ -31898,10 +31952,6 @@ async function readSessionTreeFlatNodes(manager, limits = DEFAULT_SESSION_TREE_L
|
|
|
31898
31952
|
}
|
|
31899
31953
|
return { flatNodes: buildSessionTreeFlatNodes(entries2), leafId };
|
|
31900
31954
|
}
|
|
31901
|
-
async function readSessionTree(manager, limits = DEFAULT_SESSION_TREE_LIMITS) {
|
|
31902
|
-
const { flatNodes, leafId } = await readSessionTreeFlatNodes(manager, limits);
|
|
31903
|
-
return { tree: buildSessionTreeFromFlatNodes(flatNodes), leafId };
|
|
31904
|
-
}
|
|
31905
31955
|
|
|
31906
31956
|
// dist/core/side-question.js
|
|
31907
31957
|
var SIDE_QUESTION_INSTRUCTION = "Answer this side question using only the conversation context above. Do not use tools. The user may send follow-up side questions; none of this side conversation is added to the main session.";
|
|
@@ -32405,7 +32455,7 @@ var InProcessAgentConnection = class {
|
|
|
32405
32455
|
return this.session.buildSessionContext();
|
|
32406
32456
|
}
|
|
32407
32457
|
async getSessionTree() {
|
|
32408
|
-
return
|
|
32458
|
+
return readVisibleSessionTree(this.session.sessionManager);
|
|
32409
32459
|
}
|
|
32410
32460
|
async listSavedSessions(scope, callbacks) {
|
|
32411
32461
|
const sessionDir = this.session.sessionManager.getSessionDir() || void 0;
|
|
@@ -32490,7 +32540,7 @@ var InProcessAgentConnection = class {
|
|
|
32490
32540
|
throw new Error("Agent messaging requires daemon mode");
|
|
32491
32541
|
}
|
|
32492
32542
|
async getUserMessagesForForking() {
|
|
32493
|
-
return
|
|
32543
|
+
return readVisibleUserMessagesForForking(this.session.sessionManager);
|
|
32494
32544
|
}
|
|
32495
32545
|
async getLastAssistantText() {
|
|
32496
32546
|
return this.session.getLastAssistantText();
|
|
@@ -64383,12 +64433,12 @@ var AgentDaemon = class {
|
|
|
64383
64433
|
}
|
|
64384
64434
|
case "get_session_tree": {
|
|
64385
64435
|
const state = this.getSessionState(command.activeSessionId);
|
|
64386
|
-
return success(command.id, "get_session_tree", await
|
|
64436
|
+
return success(command.id, "get_session_tree", await readVisibleSessionTreeFlatNodes(state.runtime.session.sessionManager));
|
|
64387
64437
|
}
|
|
64388
64438
|
case "get_user_messages_for_forking": {
|
|
64389
64439
|
const state = this.getSessionState(command.activeSessionId);
|
|
64390
64440
|
return success(command.id, "get_user_messages_for_forking", {
|
|
64391
|
-
messages: await
|
|
64441
|
+
messages: await readVisibleUserMessagesForForking(state.runtime.session.sessionManager)
|
|
64392
64442
|
});
|
|
64393
64443
|
}
|
|
64394
64444
|
case "get_last_assistant_text": {
|