@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-context.d.ts","sourceRoot":"","sources":["../../src/core/public-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAgB7D,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAC1D,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,uGAAuG;AACvG,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,qBAAqB,EAC5B,QAAQ,EAAE,MAAM,GACd,aAAa,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAwDrC;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"public-context.d.ts","sourceRoot":"","sources":["../../src/core/public-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAgB7D,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAC1D,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,uGAAuG;AACvG,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,qBAAqB,EAC5B,QAAQ,EAAE,MAAM,GACd,aAAa,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAwDrC;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,CAyC1G","sourcesContent":["import type { AgentMessage } from \"@ponythewhite/base-context-agent\";\nimport { stringifyBoundedJson } from \"./bounded-json.js\";\nimport type { ToolContinuationGroup } from \"./context-epoch.js\";\nimport type { CustomMessage } from \"./messages.js\";\nimport type { SourceSnapshotRef } from \"./request-events.js\";\nimport { retainedToolOutput } from \"./retained-tool-output.js\";\n\nfunction retainedRecovery(message: AgentMessage, entryId: string) {\n\tif (message.role !== \"toolResult\") return undefined;\n\tconst retained = retainedToolOutput((message.details as { retainedOutput?: unknown } | undefined)?.retainedOutput);\n\treturn retained\n\t\t? {\n\t\t\t\tref: entryId,\n\t\t\t\tfield: retained.field,\n\t\t\t\tbyteLength: retained.byteLength,\n\t\t\t\tcaptureComplete: retained.captureComplete,\n\t\t\t}\n\t\t: undefined;\n}\n\nexport const PUBLIC_CONTEXT_RENDERER = \"public-history/1\";\nexport const PUBLIC_TOOL_CONTINUATION_RENDERER = \"public-tool-continuation/1\";\n\n/** Original public text and minimal recorded facts. Intent ACK says nothing about external effects. */\nexport function renderToolContinuation(\n\tmessage: AgentMessage,\n\tentryId: string,\n\tsource: SourceSnapshotRef,\n\tgroup: ToolContinuationGroup,\n\tmaxBytes: number,\n): CustomMessage & { content: string } {\n\tif (message.role !== \"assistant\" && message.role !== \"toolResult\")\n\t\tthrow new Error(\"Tool continuation requires its original replay group\");\n\tconst content: { type: \"text\"; text: string }[] = [];\n\tfor (const part of message.content) {\n\t\tif (part.type === \"text\") content.push({ type: \"text\", text: part.text });\n\t\telse if (part.type !== \"thinking\" && part.type !== \"toolCall\")\n\t\t\tthrow new Error(\"Tool continuation requires text-only public content\");\n\t}\n\tconst data = stringifyBoundedJson(\n\t\t{\n\t\t\tsource: { sessionId: source.sessionId },\n\t\t\tentryId,\n\t\t\t...(retainedRecovery(message, entryId) ? { recovery: retainedRecovery(message, entryId) } : {}),\n\t\t\trole: message.role,\n\t\t\tcontent,\n\t\t\t...(message.role === \"assistant\"\n\t\t\t\t? {\n\t\t\t\t\t\tcalls: group.calls.map((call, sourceOrder) =>\n\t\t\t\t\t\t\tcall.admission === \"absent\"\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tsourceOrder,\n\t\t\t\t\t\t\t\t\t\tadmission: \"not_recorded\",\n\t\t\t\t\t\t\t\t\t\tcapturedHistory: {\n\t\t\t\t\t\t\t\t\t\t\tsessionId: call.source.sessionId,\n\t\t\t\t\t\t\t\t\t\t\tleafId: call.source.leafId,\n\t\t\t\t\t\t\t\t\t\t\tsourceSequence: call.source.sourceSequence,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\texecutionId: call.executionId,\n\t\t\t\t\t\t\t\t\t\tintentEntryId: call.intent.id,\n\t\t\t\t\t\t\t\t\t\tintent: \"recorded\",\n\t\t\t\t\t\t\t\t\t\toutcome: call.outcome,\n\t\t\t\t\t\t\t\t\t\t...(call.result ? { resultEntryId: call.result.id } : {}),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t},\n\t\tmaxBytes,\n\t);\n\tconst rendered: CustomMessage & { content: string } = {\n\t\trole: \"custom\",\n\t\tcustomType: PUBLIC_TOOL_CONTINUATION_RENDERER,\n\t\tcontent: `Recorded tool continuation data. Intent acknowledgment records intent only; an absent finalized result leaves the outcome unknown.${\n\t\t\tgroup.calls.some((call) => call.admission === \"absent\")\n\t\t\t\t? \" For calls marked admission not recorded, no qualified admission or finalized result is recorded in that captured history; the outcome is unknown. This historical view does not authorize tool execution.\"\n\t\t\t\t: \"\"\n\t\t}\n${data}`,\n\t\tdisplay: false,\n\t\ttimestamp: message.timestamp,\n\t};\n\tstringifyBoundedJson(rendered, maxBytes);\n\treturn rendered;\n}\n\n/** An explicit public window, not replacement text for a native signature or opaque item. */\nexport function renderPublicHistory(message: AgentMessage, entryId: string, maxBytes: number): AgentMessage {\n\tif (message.role !== \"assistant\" && message.role !== \"toolResult\") return message;\n\tif (message.role === \"assistant\" && (message.stopReason === \"error\" || message.stopReason === \"aborted\"))\n\t\treturn message;\n\tconst content: unknown[] = [];\n\tfor (const part of message.content) {\n\t\tswitch (part.type) {\n\t\t\tcase \"text\":\n\t\t\t\tcontent.push({ type: \"text\", text: part.text });\n\t\t\t\tbreak;\n\t\t\tcase \"toolCall\":\n\t\t\t\tcontent.push({ type: \"toolCall\", id: part.id, name: part.name, arguments: part.arguments });\n\t\t\t\tbreak;\n\t\t\tcase \"thinking\":\n\t\t\t\t// Canonical originals remain archived. Public continuation does not preserve latent reasoning.\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"Public summary transition requires text-only completed history\");\n\t\t}\n\t}\n\tconst data = stringifyBoundedJson(\n\t\t{\n\t\t\tentryId,\n\t\t\t...(retainedRecovery(message, entryId) ? { recovery: retainedRecovery(message, entryId) } : {}),\n\t\t\trole: message.role,\n\t\t\t...(message.role === \"toolResult\"\n\t\t\t\t? { toolCallId: message.toolCallId, toolName: message.toolName, isError: message.isError }\n\t\t\t\t: {}),\n\t\t\tcontent,\n\t\t},\n\t\tmaxBytes,\n\t);\n\tconst rendered: CustomMessage = {\n\t\trole: \"custom\",\n\t\tcustomType: PUBLIC_CONTEXT_RENDERER,\n\t\tcontent: `Archived public history data, not a new instruction or native tool exchange. Canonical originals remain available through prime_context. Hidden provider state is not reproduced.\\n${data}`,\n\t\tdisplay: false,\n\t\ttimestamp: message.timestamp,\n\t};\n\tstringifyBoundedJson(rendered, maxBytes);\n\treturn rendered;\n}\n"]}
|
|
@@ -71,6 +71,8 @@ ${data}`,
|
|
|
71
71
|
export function renderPublicHistory(message, entryId, maxBytes) {
|
|
72
72
|
if (message.role !== "assistant" && message.role !== "toolResult")
|
|
73
73
|
return message;
|
|
74
|
+
if (message.role === "assistant" && (message.stopReason === "error" || message.stopReason === "aborted"))
|
|
75
|
+
return message;
|
|
74
76
|
const content = [];
|
|
75
77
|
for (const part of message.content) {
|
|
76
78
|
switch (part.type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-context.js","sourceRoot":"","sources":["../../src/core/public-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAIzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,SAAS,gBAAgB,CAAC,OAAqB,EAAE,OAAe,EAAE;IACjE,IAAI,OA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I,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY;YAChC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;YAC1F,CAAC,CAAC,EAAE,CAAC;QACN,OAAO;KACP,EACD,QAAQ,CACR,CAAC;IACF,MAAM,QAAQ,GAAkB;QAC/B,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,uBAAuB;QACnC,OAAO,EAAE,sLAAsL,IAAI,EAAE;QACrM,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,OAAO,CAAC,SAAS;KAC5B,CAAC;IACF,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzC,OAAO,QAAQ,CAAC;AAAA,CAChB","sourcesContent":["import type { AgentMessage } from \"@ponythewhite/base-context-agent\";\nimport { stringifyBoundedJson } from \"./bounded-json.js\";\nimport type { ToolContinuationGroup } from \"./context-epoch.js\";\nimport type { CustomMessage } from \"./messages.js\";\nimport type { SourceSnapshotRef } from \"./request-events.js\";\nimport { retainedToolOutput } from \"./retained-tool-output.js\";\n\nfunction retainedRecovery(message: AgentMessage, entryId: string) {\n\tif (message.role !== \"toolResult\") return undefined;\n\tconst retained = retainedToolOutput((message.details as { retainedOutput?: unknown } | undefined)?.retainedOutput);\n\treturn retained\n\t\t? {\n\t\t\t\tref: entryId,\n\t\t\t\tfield: retained.field,\n\t\t\t\tbyteLength: retained.byteLength,\n\t\t\t\tcaptureComplete: retained.captureComplete,\n\t\t\t}\n\t\t: undefined;\n}\n\nexport const PUBLIC_CONTEXT_RENDERER = \"public-history/1\";\nexport const PUBLIC_TOOL_CONTINUATION_RENDERER = \"public-tool-continuation/1\";\n\n/** Original public text and minimal recorded facts. Intent ACK says nothing about external effects. */\nexport function renderToolContinuation(\n\tmessage: AgentMessage,\n\tentryId: string,\n\tsource: SourceSnapshotRef,\n\tgroup: ToolContinuationGroup,\n\tmaxBytes: number,\n): CustomMessage & { content: string } {\n\tif (message.role !== \"assistant\" && message.role !== \"toolResult\")\n\t\tthrow new Error(\"Tool continuation requires its original replay group\");\n\tconst content: { type: \"text\"; text: string }[] = [];\n\tfor (const part of message.content) {\n\t\tif (part.type === \"text\") content.push({ type: \"text\", text: part.text });\n\t\telse if (part.type !== \"thinking\" && part.type !== \"toolCall\")\n\t\t\tthrow new Error(\"Tool continuation requires text-only public content\");\n\t}\n\tconst data = stringifyBoundedJson(\n\t\t{\n\t\t\tsource: { sessionId: source.sessionId },\n\t\t\tentryId,\n\t\t\t...(retainedRecovery(message, entryId) ? { recovery: retainedRecovery(message, entryId) } : {}),\n\t\t\trole: message.role,\n\t\t\tcontent,\n\t\t\t...(message.role === \"assistant\"\n\t\t\t\t? {\n\t\t\t\t\t\tcalls: group.calls.map((call, sourceOrder) =>\n\t\t\t\t\t\t\tcall.admission === \"absent\"\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tsourceOrder,\n\t\t\t\t\t\t\t\t\t\tadmission: \"not_recorded\",\n\t\t\t\t\t\t\t\t\t\tcapturedHistory: {\n\t\t\t\t\t\t\t\t\t\t\tsessionId: call.source.sessionId,\n\t\t\t\t\t\t\t\t\t\t\tleafId: call.source.leafId,\n\t\t\t\t\t\t\t\t\t\t\tsourceSequence: call.source.sourceSequence,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\texecutionId: call.executionId,\n\t\t\t\t\t\t\t\t\t\tintentEntryId: call.intent.id,\n\t\t\t\t\t\t\t\t\t\tintent: \"recorded\",\n\t\t\t\t\t\t\t\t\t\toutcome: call.outcome,\n\t\t\t\t\t\t\t\t\t\t...(call.result ? { resultEntryId: call.result.id } : {}),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t},\n\t\tmaxBytes,\n\t);\n\tconst rendered: CustomMessage & { content: string } = {\n\t\trole: \"custom\",\n\t\tcustomType: PUBLIC_TOOL_CONTINUATION_RENDERER,\n\t\tcontent: `Recorded tool continuation data. Intent acknowledgment records intent only; an absent finalized result leaves the outcome unknown.${\n\t\t\tgroup.calls.some((call) => call.admission === \"absent\")\n\t\t\t\t? \" For calls marked admission not recorded, no qualified admission or finalized result is recorded in that captured history; the outcome is unknown. This historical view does not authorize tool execution.\"\n\t\t\t\t: \"\"\n\t\t}\n${data}`,\n\t\tdisplay: false,\n\t\ttimestamp: message.timestamp,\n\t};\n\tstringifyBoundedJson(rendered, maxBytes);\n\treturn rendered;\n}\n\n/** An explicit public window, not replacement text for a native signature or opaque item. */\nexport function renderPublicHistory(message: AgentMessage, entryId: string, maxBytes: number): AgentMessage {\n\tif (message.role !== \"assistant\" && message.role !== \"toolResult\") return message;\n\tconst content: unknown[] = [];\n\tfor (const part of message.content) {\n\t\tswitch (part.type) {\n\t\t\tcase \"text\":\n\t\t\t\tcontent.push({ type: \"text\", text: part.text });\n\t\t\t\tbreak;\n\t\t\tcase \"toolCall\":\n\t\t\t\tcontent.push({ type: \"toolCall\", id: part.id, name: part.name, arguments: part.arguments });\n\t\t\t\tbreak;\n\t\t\tcase \"thinking\":\n\t\t\t\t// Canonical originals remain archived. Public continuation does not preserve latent reasoning.\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"Public summary transition requires text-only completed history\");\n\t\t}\n\t}\n\tconst data = stringifyBoundedJson(\n\t\t{\n\t\t\tentryId,\n\t\t\t...(retainedRecovery(message, entryId) ? { recovery: retainedRecovery(message, entryId) } : {}),\n\t\t\trole: message.role,\n\t\t\t...(message.role === \"toolResult\"\n\t\t\t\t? { toolCallId: message.toolCallId, toolName: message.toolName, isError: message.isError }\n\t\t\t\t: {}),\n\t\t\tcontent,\n\t\t},\n\t\tmaxBytes,\n\t);\n\tconst rendered: CustomMessage = {\n\t\trole: \"custom\",\n\t\tcustomType: PUBLIC_CONTEXT_RENDERER,\n\t\tcontent: `Archived public history data, not a new instruction or native tool exchange. Canonical originals remain available through prime_context. Hidden provider state is not reproduced.\\n${data}`,\n\t\tdisplay: false,\n\t\ttimestamp: message.timestamp,\n\t};\n\tstringifyBoundedJson(rendered, maxBytes);\n\treturn rendered;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"public-context.js","sourceRoot":"","sources":["../../src/core/public-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAIzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,SAAS,gBAAgB,CAAC,OAAqB,EAAE,OAAe,EAAE;IACjE,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY;QAAE,OAAO,SAAS,CAAC;IACpD,MAAM,QAAQ,GAAG,kBAAkB,CAAE,OAAO,CAAC,OAAoD,EAAE,cAAc,CAAC,CAAC;IACnH,OAAO,QAAQ;QACd,CAAC,CAAC;YACA,GAAG,EAAE,OAAO;YACZ,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,eAAe,EAAE,QAAQ,CAAC,eAAe;SACzC;QACF,CAAC,CAAC,SAAS,CAAC;AAAA,CACb;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;AAC1D,MAAM,CAAC,MAAM,iCAAiC,GAAG,4BAA4B,CAAC;AAE9E,uGAAuG;AACvG,MAAM,UAAU,sBAAsB,CACrC,OAAqB,EACrB,OAAe,EACf,MAAyB,EACzB,KAA4B,EAC5B,QAAgB,EACsB;IACtC,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY;QAChE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACzE,MAAM,OAAO,GAA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entMessage } from \"@ponythewhite/base-context-agent\";\nimport { stringifyBoundedJson } from \"./bounded-json.js\";\nimport type { ToolContinuationGroup } from \"./context-epoch.js\";\nimport type { CustomMessage } from \"./messages.js\";\nimport type { SourceSnapshotRef } from \"./request-events.js\";\nimport { retainedToolOutput } from \"./retained-tool-output.js\";\n\nfunction retainedRecovery(message: AgentMessage, entryId: string) {\n\tif (message.role !== \"toolResult\") return undefined;\n\tconst retained = retainedToolOutput((message.details as { retainedOutput?: unknown } | undefined)?.retainedOutput);\n\treturn retained\n\t\t? {\n\t\t\t\tref: entryId,\n\t\t\t\tfield: retained.field,\n\t\t\t\tbyteLength: retained.byteLength,\n\t\t\t\tcaptureComplete: retained.captureComplete,\n\t\t\t}\n\t\t: undefined;\n}\n\nexport const PUBLIC_CONTEXT_RENDERER = \"public-history/1\";\nexport const PUBLIC_TOOL_CONTINUATION_RENDERER = \"public-tool-continuation/1\";\n\n/** Original public text and minimal recorded facts. Intent ACK says nothing about external effects. */\nexport function renderToolContinuation(\n\tmessage: AgentMessage,\n\tentryId: string,\n\tsource: SourceSnapshotRef,\n\tgroup: ToolContinuationGroup,\n\tmaxBytes: number,\n): CustomMessage & { content: string } {\n\tif (message.role !== \"assistant\" && message.role !== \"toolResult\")\n\t\tthrow new Error(\"Tool continuation requires its original replay group\");\n\tconst content: { type: \"text\"; text: string }[] = [];\n\tfor (const part of message.content) {\n\t\tif (part.type === \"text\") content.push({ type: \"text\", text: part.text });\n\t\telse if (part.type !== \"thinking\" && part.type !== \"toolCall\")\n\t\t\tthrow new Error(\"Tool continuation requires text-only public content\");\n\t}\n\tconst data = stringifyBoundedJson(\n\t\t{\n\t\t\tsource: { sessionId: source.sessionId },\n\t\t\tentryId,\n\t\t\t...(retainedRecovery(message, entryId) ? { recovery: retainedRecovery(message, entryId) } : {}),\n\t\t\trole: message.role,\n\t\t\tcontent,\n\t\t\t...(message.role === \"assistant\"\n\t\t\t\t? {\n\t\t\t\t\t\tcalls: group.calls.map((call, sourceOrder) =>\n\t\t\t\t\t\t\tcall.admission === \"absent\"\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tsourceOrder,\n\t\t\t\t\t\t\t\t\t\tadmission: \"not_recorded\",\n\t\t\t\t\t\t\t\t\t\tcapturedHistory: {\n\t\t\t\t\t\t\t\t\t\t\tsessionId: call.source.sessionId,\n\t\t\t\t\t\t\t\t\t\t\tleafId: call.source.leafId,\n\t\t\t\t\t\t\t\t\t\t\tsourceSequence: call.source.sourceSequence,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\texecutionId: call.executionId,\n\t\t\t\t\t\t\t\t\t\tintentEntryId: call.intent.id,\n\t\t\t\t\t\t\t\t\t\tintent: \"recorded\",\n\t\t\t\t\t\t\t\t\t\toutcome: call.outcome,\n\t\t\t\t\t\t\t\t\t\t...(call.result ? { resultEntryId: call.result.id } : {}),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t},\n\t\tmaxBytes,\n\t);\n\tconst rendered: CustomMessage & { content: string } = {\n\t\trole: \"custom\",\n\t\tcustomType: PUBLIC_TOOL_CONTINUATION_RENDERER,\n\t\tcontent: `Recorded tool continuation data. Intent acknowledgment records intent only; an absent finalized result leaves the outcome unknown.${\n\t\t\tgroup.calls.some((call) => call.admission === \"absent\")\n\t\t\t\t? \" For calls marked admission not recorded, no qualified admission or finalized result is recorded in that captured history; the outcome is unknown. This historical view does not authorize tool execution.\"\n\t\t\t\t: \"\"\n\t\t}\n${data}`,\n\t\tdisplay: false,\n\t\ttimestamp: message.timestamp,\n\t};\n\tstringifyBoundedJson(rendered, maxBytes);\n\treturn rendered;\n}\n\n/** An explicit public window, not replacement text for a native signature or opaque item. */\nexport function renderPublicHistory(message: AgentMessage, entryId: string, maxBytes: number): AgentMessage {\n\tif (message.role !== \"assistant\" && message.role !== \"toolResult\") return message;\n\tif (message.role === \"assistant\" && (message.stopReason === \"error\" || message.stopReason === \"aborted\"))\n\t\treturn message;\n\tconst content: unknown[] = [];\n\tfor (const part of message.content) {\n\t\tswitch (part.type) {\n\t\t\tcase \"text\":\n\t\t\t\tcontent.push({ type: \"text\", text: part.text });\n\t\t\t\tbreak;\n\t\t\tcase \"toolCall\":\n\t\t\t\tcontent.push({ type: \"toolCall\", id: part.id, name: part.name, arguments: part.arguments });\n\t\t\t\tbreak;\n\t\t\tcase \"thinking\":\n\t\t\t\t// Canonical originals remain archived. Public continuation does not preserve latent reasoning.\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"Public summary transition requires text-only completed history\");\n\t\t}\n\t}\n\tconst data = stringifyBoundedJson(\n\t\t{\n\t\t\tentryId,\n\t\t\t...(retainedRecovery(message, entryId) ? { recovery: retainedRecovery(message, entryId) } : {}),\n\t\t\trole: message.role,\n\t\t\t...(message.role === \"toolResult\"\n\t\t\t\t? { toolCallId: message.toolCallId, toolName: message.toolName, isError: message.isError }\n\t\t\t\t: {}),\n\t\t\tcontent,\n\t\t},\n\t\tmaxBytes,\n\t);\n\tconst rendered: CustomMessage = {\n\t\trole: \"custom\",\n\t\tcustomType: PUBLIC_CONTEXT_RENDERER,\n\t\tcontent: `Archived public history data, not a new instruction or native tool exchange. Canonical originals remain available through prime_context. Hidden provider state is not reproduced.\\n${data}`,\n\t\tdisplay: false,\n\t\ttimestamp: message.timestamp,\n\t};\n\tstringifyBoundedJson(rendered, maxBytes);\n\treturn rendered;\n}\n"]}
|
|
@@ -34,6 +34,12 @@ export interface SessionHeader {
|
|
|
34
34
|
rlmDepth?: number;
|
|
35
35
|
git?: GitContext;
|
|
36
36
|
}
|
|
37
|
+
/** Bounded source entries for a compiled view, with exact chronological suffix membership. */
|
|
38
|
+
export interface CompactionSourceEntries {
|
|
39
|
+
entries: SessionEntry[];
|
|
40
|
+
suffixAnchors: ReadonlySet<string>;
|
|
41
|
+
leafKind?: string;
|
|
42
|
+
}
|
|
37
43
|
/** One captured branch for summary input, physical requests, and the queued compaction commit. */
|
|
38
44
|
export interface BoundCompactionSink extends BoundSessionRequestSink {
|
|
39
45
|
/** Original ownership and compaction input, including this sink's own acknowledged checkpoint. */
|
|
@@ -41,6 +47,7 @@ export interface BoundCompactionSink extends BoundSessionRequestSink {
|
|
|
41
47
|
/** Internal explicit-copy read on this same held source, never a provider-view capability. */
|
|
42
48
|
[readCopiedEpochSource]<T>(read: (history: SessionHistoryReadScope) => Promise<T>): Promise<T>;
|
|
43
49
|
readBranch(): Promise<SessionEntry[]>;
|
|
50
|
+
readCompactionEntries(entryIds: readonly string[]): Promise<CompactionSourceEntries>;
|
|
44
51
|
[appendContextEpoch](checkpoint: ContextEpochCheckpoint, tokensBefore: number | null, summary?: ContextEpochSummary, requestOutputSource?: object): Promise<string>;
|
|
45
52
|
appendCompaction<T = unknown>(summary: string, firstKeptEntryId: string, tokensBefore: number | null, details?: T, fromHook?: boolean, customInstructions?: string, usage?: Usage, requestOutputSource?: object): Promise<string>;
|
|
46
53
|
}
|
|
@@ -441,6 +448,7 @@ export declare class SessionManager {
|
|
|
441
448
|
readEntryRetention(id: string): Promise<JournalFrameRetention | undefined>;
|
|
442
449
|
readLabel(id: string, maxSourceBytes?: number): Promise<string | undefined>;
|
|
443
450
|
readEntries(limits?: SessionHistoryReadLimits): Promise<SessionEntry[]>;
|
|
451
|
+
private _readCompactionEntriesAt;
|
|
444
452
|
private _readBranchesAt;
|
|
445
453
|
private _residentParentPath;
|
|
446
454
|
readBranches(leafIds: readonly (string | null)[], limits?: SessionHistoryReadLimits): Promise<{
|