@ponythewhite/base-context 1.0.13 → 1.0.15
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 +18 -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/amazon-bedrock.js +3 -3
- package/dist/bundle/{anthropic-BJVPUMPB.js → anthropic-AXUXEET7.js} +1 -1
- package/dist/bundle/{azure-openai-responses-ERRMAXK6.js → azure-openai-responses-J3NTJKEO.js} +2 -2
- package/dist/bundle/{bundled-modules-URKVA3UB.js → bundled-modules-O67MEO74.js} +5 -5
- package/dist/bundle/{chunk-FOGKLC7V.js → chunk-72LSQYUV.js} +1 -1
- package/dist/bundle/{chunk-TXVF6Q5H.js → chunk-DGO66I3L.js} +87 -51
- package/dist/bundle/{chunk-MUFZODP5.js → chunk-EGFIZABJ.js} +1 -1
- package/dist/bundle/{chunk-AEMRBMI2.js → chunk-IEM74GZ5.js} +9 -9
- package/dist/bundle/{chunk-25VYRAC6.js → chunk-JKKXN6JE.js} +72 -0
- package/dist/bundle/{chunk-TKOBEJ5E.js → chunk-RQFC34FM.js} +151 -51
- package/dist/bundle/{chunk-Q6UAHLII.js → chunk-V6LOBH6X.js} +2 -2
- package/dist/bundle/{cli-main-ZTJM5EEH.js → cli-main-2RER6PBE.js} +4 -4
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/{google-4GA4YMUX.js → google-QLKV2ZLC.js} +2 -2
- package/dist/bundle/{google-vertex-7AMALD7D.js → google-vertex-UGLUZV6B.js} +2 -2
- package/dist/bundle/{main-53I74INO.js → main-YERLD3T4.js} +5 -5
- package/dist/bundle/{mistral-74BXMNRM.js → mistral-2ITSLHYF.js} +1 -1
- package/dist/bundle/{openai-codex-responses-COXNC4IH.js → openai-codex-responses-FRREQXS3.js} +5 -4
- package/dist/bundle/{openai-completions-BCSA5Q6S.js → openai-completions-HF6UPPLW.js} +1 -1
- package/dist/bundle/{openai-responses-ONCIZSJS.js → openai-responses-LRTMBDFW.js} +2 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +42 -25
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/autonomous.d.ts +2 -0
- package/dist/core/autonomous.d.ts.map +1 -1
- package/dist/core/autonomous.js +4 -0
- package/dist/core/autonomous.js.map +1 -1
- package/dist/core/canonical-context.d.ts.map +1 -1
- package/dist/core/canonical-context.js +7 -0
- package/dist/core/canonical-context.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +11 -9
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/inference-coordinator.d.ts.map +1 -1
- package/dist/core/inference-coordinator.js +13 -2
- package/dist/core/inference-coordinator.js.map +1 -1
- package/dist/core/kernel/repl-manager.d.ts.map +1 -1
- package/dist/core/kernel/repl-manager.js +5 -0
- package/dist/core/kernel/repl-manager.js.map +1 -1
- package/dist/core/public-context.d.ts.map +1 -1
- package/dist/core/public-context.js +2 -0
- package/dist/core/public-context.js.map +1 -1
- package/dist/core/session-manager.d.ts +8 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +57 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/view-units.d.ts.map +1 -1
- package/dist/core/view-units.js +3 -0
- package/dist/core/view-units.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/daemon/daemon-mode.d.ts.map +1 -1
- package/dist/modes/daemon/daemon-mode.js +21 -20
- package/dist/modes/daemon/daemon-mode.js.map +1 -1
- package/dist/modes/daemon/daemon-supervisor.d.ts.map +1 -1
- package/dist/modes/daemon/daemon-supervisor.js +11 -5
- package/dist/modes/daemon/daemon-supervisor.js.map +1 -1
- package/dist/modes/daemon/daemon-worker-client.d.ts +1 -0
- package/dist/modes/daemon/daemon-worker-client.d.ts.map +1 -1
- package/dist/modes/daemon/daemon-worker-client.js +8 -0
- package/dist/modes/daemon/daemon-worker-client.js.map +1 -1
- package/dist/modes/daemon/daemon-worker-protocol.d.ts +3 -0
- package/dist/modes/daemon/daemon-worker-protocol.d.ts.map +1 -1
- package/dist/modes/daemon/daemon-worker-protocol.js +2 -0
- package/dist/modes/daemon/daemon-worker-protocol.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +29 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +24 -21
- package/dist/modes/print-mode.js.map +1 -1
- package/docs/json.md +14 -1
- package/docs/long-running-agents.md +23 -2
- package/docs/providers.md +17 -0
- package/docs/upstream-1.0.15.md +83 -0
- package/package.json +4 -4
|
@@ -2012,6 +2012,10 @@ export class SessionManager {
|
|
|
2012
2012
|
isCurrent: () => isCurrent(currentRevision),
|
|
2013
2013
|
readHistory: (read) => sink.readHistory((history) => read(history.branchContext)),
|
|
2014
2014
|
[readCopiedEpochSource]: (read) => sink.readHistory(read),
|
|
2015
|
+
readCompactionEntries: (entryIds) => {
|
|
2016
|
+
const ids = [...new Set(entryIds)];
|
|
2017
|
+
return sink.readHistory((history) => this._readCompactionEntriesAt(history, ids, capturedLimits));
|
|
2018
|
+
},
|
|
2015
2019
|
readBranch: async () => {
|
|
2016
2020
|
if (indexed)
|
|
2017
2021
|
return sink.readHistory(async (history) => (await this._readBranchesAt(history, [history.source.leafId], capturedLimits)).branches[0]);
|
|
@@ -2893,6 +2897,59 @@ export class SessionManager {
|
|
|
2893
2897
|
return entries;
|
|
2894
2898
|
});
|
|
2895
2899
|
}
|
|
2900
|
+
async _readCompactionEntriesAt(history, entryIds, limits) {
|
|
2901
|
+
const { maxEntries, maxSourceBytes } = limits;
|
|
2902
|
+
if (!Number.isSafeInteger(maxEntries) ||
|
|
2903
|
+
maxEntries <= 0 ||
|
|
2904
|
+
!Number.isSafeInteger(maxSourceBytes) ||
|
|
2905
|
+
maxSourceBytes <= 0)
|
|
2906
|
+
throw new Error("Invalid compaction source limits");
|
|
2907
|
+
if (entryIds.length > maxEntries)
|
|
2908
|
+
throw new Error("Compaction entry budget exceeded");
|
|
2909
|
+
const selected = new Set(entryIds);
|
|
2910
|
+
const references = [];
|
|
2911
|
+
for (const id of entryIds) {
|
|
2912
|
+
const reference = await history.branchContext.get(id);
|
|
2913
|
+
if (!reference)
|
|
2914
|
+
throw new Error("Compaction entry is outside its captured branch");
|
|
2915
|
+
references.push(reference);
|
|
2916
|
+
}
|
|
2917
|
+
references.sort((a, b) => a.sequence - b.sequence);
|
|
2918
|
+
// Pinned older views cannot cross an omitted message to become a chronological cut.
|
|
2919
|
+
// Walk metadata only: excluded lifetime payloads must not consume the hydration budget.
|
|
2920
|
+
const suffixAnchors = new Set();
|
|
2921
|
+
const visited = new Set();
|
|
2922
|
+
let current = history.source.leafId;
|
|
2923
|
+
let leafKind;
|
|
2924
|
+
while (current !== null) {
|
|
2925
|
+
if (visited.has(current))
|
|
2926
|
+
throw new Error("Compaction parent path is unresolved");
|
|
2927
|
+
visited.add(current);
|
|
2928
|
+
const reference = await history.branchContext.get(current);
|
|
2929
|
+
if (!reference)
|
|
2930
|
+
throw new Error("Compaction parent path is unresolved");
|
|
2931
|
+
leafKind ??= reference.kind;
|
|
2932
|
+
if (["message", "custom_message", "branch_summary"].includes(reference.kind)) {
|
|
2933
|
+
if (!selected.has(reference.id))
|
|
2934
|
+
break;
|
|
2935
|
+
suffixAnchors.add(reference.id);
|
|
2936
|
+
}
|
|
2937
|
+
current = reference.parentId;
|
|
2938
|
+
}
|
|
2939
|
+
const entries = [];
|
|
2940
|
+
let sourceBytes = 0;
|
|
2941
|
+
for (const reference of references) {
|
|
2942
|
+
const remaining = maxSourceBytes - sourceBytes;
|
|
2943
|
+
sourceBytes += reference.locator.length;
|
|
2944
|
+
if (sourceBytes > maxSourceBytes)
|
|
2945
|
+
throw new Error("Compaction source byte budget exceeded");
|
|
2946
|
+
const value = await history.hydrateEntry(reference.id, remaining);
|
|
2947
|
+
if (!value)
|
|
2948
|
+
throw new Error("Compaction entry source is unavailable");
|
|
2949
|
+
entries.push(withEntryRetention(value.entry, value.source.retention, value.source.qualification));
|
|
2950
|
+
}
|
|
2951
|
+
return { entries, suffixAnchors, leafKind };
|
|
2952
|
+
}
|
|
2896
2953
|
async _readBranchesAt(history, leafIds, limits) {
|
|
2897
2954
|
const { maxEntries, maxSourceBytes } = limits;
|
|
2898
2955
|
if (!Number.isSafeInteger(maxEntries) ||
|