pi-agent-flow 1.8.39 → 2.0.0
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/README.md +33 -37
- package/agents/audit.md +18 -22
- package/agents/build.md +20 -22
- package/agents/craft.md +20 -27
- package/agents/debug.md +21 -28
- package/agents/ideas.md +18 -101
- package/agents/scout.md +15 -19
- package/dist/batch/batch-bash.d.ts +2 -2
- package/dist/batch/batch-bash.d.ts.map +1 -1
- package/dist/batch/batch-bash.js +3 -3
- package/dist/batch/batch-bash.js.map +1 -1
- package/dist/batch/constants.d.ts +19 -5
- package/dist/batch/constants.d.ts.map +1 -1
- package/dist/batch/constants.js +4 -3
- package/dist/batch/constants.js.map +1 -1
- package/dist/batch/execute.d.ts +0 -1
- package/dist/batch/execute.d.ts.map +1 -1
- package/dist/batch/execute.js +101 -10
- package/dist/batch/execute.js.map +1 -1
- package/dist/batch/fuzzy-edit.d.ts +0 -6
- package/dist/batch/fuzzy-edit.d.ts.map +1 -1
- package/dist/batch/fuzzy-edit.js +1 -1
- package/dist/batch/fuzzy-edit.js.map +1 -1
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js +87 -16
- package/dist/batch/index.js.map +1 -1
- package/dist/batch/render.d.ts +0 -1
- package/dist/batch/render.d.ts.map +1 -1
- package/dist/batch/render.js +7 -101
- package/dist/batch/render.js.map +1 -1
- package/dist/batch/summary.d.ts +5 -0
- package/dist/batch/summary.d.ts.map +1 -0
- package/dist/batch/summary.js +101 -0
- package/dist/batch/summary.js.map +1 -0
- package/dist/{config.d.ts → config/config.d.ts} +34 -2
- package/dist/config/config.d.ts.map +1 -0
- package/dist/{config.js → config/config.js} +157 -9
- package/dist/config/config.js.map +1 -0
- package/dist/config/log.d.ts +27 -0
- package/dist/config/log.d.ts.map +1 -0
- package/dist/config/log.js +104 -0
- package/dist/config/log.js.map +1 -0
- package/dist/{settings-resolver.d.ts → config/settings-resolver.d.ts} +9 -2
- package/dist/config/settings-resolver.d.ts.map +1 -0
- package/dist/config/settings-resolver.js +275 -0
- package/dist/config/settings-resolver.js.map +1 -0
- package/dist/core/agents.d.ts.map +1 -0
- package/dist/{agents.js → core/agents.js} +11 -10
- package/dist/core/agents.js.map +1 -0
- package/dist/core/delegation.d.ts +24 -0
- package/dist/core/delegation.d.ts.map +1 -0
- package/dist/core/delegation.js +55 -0
- package/dist/core/delegation.js.map +1 -0
- package/dist/core/depth.d.ts.map +1 -0
- package/dist/{depth.js → core/depth.js} +9 -8
- package/dist/core/depth.js.map +1 -0
- package/dist/{executor.d.ts → core/executor.d.ts} +13 -3
- package/dist/core/executor.d.ts.map +1 -0
- package/dist/{executor.js → core/executor.js} +79 -15
- package/dist/core/executor.js.map +1 -0
- package/dist/{flow.d.ts → core/flow.d.ts} +4 -1
- package/dist/core/flow.d.ts.map +1 -0
- package/dist/{flow.js → core/flow.js} +179 -25
- package/dist/core/flow.js.map +1 -0
- package/dist/{session-mode.d.ts → core/session-mode.d.ts} +2 -1
- package/dist/core/session-mode.d.ts.map +1 -0
- package/dist/{session-mode.js → core/session-mode.js} +1 -1
- package/dist/core/session-mode.js.map +1 -0
- package/dist/core/session-registry.d.ts +16 -0
- package/dist/core/session-registry.d.ts.map +1 -0
- package/dist/core/session-registry.js +30 -0
- package/dist/core/session-registry.js.map +1 -0
- package/dist/core/transitions.d.ts.map +1 -0
- package/dist/{transitions.js → core/transitions.js} +1 -1
- package/dist/core/transitions.js.map +1 -0
- package/dist/flow/command.d.ts +8 -0
- package/dist/flow/command.d.ts.map +1 -0
- package/dist/flow/command.js +189 -0
- package/dist/flow/command.js.map +1 -0
- package/dist/flow/continuation.d.ts +16 -0
- package/dist/flow/continuation.d.ts.map +1 -0
- package/dist/flow/continuation.js +151 -0
- package/dist/flow/continuation.js.map +1 -0
- package/dist/flow/index.d.ts +15 -0
- package/dist/flow/index.d.ts.map +1 -0
- package/dist/flow/index.js +22 -0
- package/dist/flow/index.js.map +1 -0
- package/dist/flow/settings-command.d.ts +51 -0
- package/dist/flow/settings-command.d.ts.map +1 -0
- package/dist/flow/settings-command.js +851 -0
- package/dist/flow/settings-command.js.map +1 -0
- package/dist/flow/store.d.ts +26 -0
- package/dist/flow/store.d.ts.map +1 -0
- package/dist/flow/store.js +158 -0
- package/dist/flow/store.js.map +1 -0
- package/dist/flow/template-strings.d.ts +8 -0
- package/dist/flow/template-strings.d.ts.map +1 -0
- package/dist/flow/template-strings.js +39 -0
- package/dist/flow/template-strings.js.map +1 -0
- package/dist/flow/types.d.ts +55 -0
- package/dist/flow/types.d.ts.map +1 -0
- package/dist/flow/types.js +5 -0
- package/dist/flow/types.js.map +1 -0
- package/dist/flow/warp-command.d.ts +9 -0
- package/dist/flow/warp-command.d.ts.map +1 -0
- package/dist/flow/warp-command.js +405 -0
- package/dist/flow/warp-command.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +115 -32
- package/dist/index.js.map +1 -1
- package/dist/{notify-state.d.ts → notify/notify-state.d.ts} +2 -1
- package/dist/notify/notify-state.d.ts.map +1 -0
- package/dist/notify/notify-state.js.map +1 -0
- package/dist/notify/notify.d.ts.map +1 -0
- package/dist/{notify.js → notify/notify.js} +3 -2
- package/dist/notify/notify.js.map +1 -0
- package/dist/{cli-args.d.ts → snapshot/cli-args.d.ts} +4 -2
- package/dist/snapshot/cli-args.d.ts.map +1 -0
- package/dist/{cli-args.js → snapshot/cli-args.js} +10 -1
- package/dist/snapshot/cli-args.js.map +1 -0
- package/dist/snapshot/index.d.ts +2 -0
- package/dist/snapshot/index.d.ts.map +1 -0
- package/dist/snapshot/index.js +2 -0
- package/dist/snapshot/index.js.map +1 -0
- package/dist/{reasoning-strip.d.ts → snapshot/reasoning-strip.d.ts} +0 -4
- package/dist/snapshot/reasoning-strip.d.ts.map +1 -0
- package/dist/{reasoning-strip.js → snapshot/reasoning-strip.js} +2 -2
- package/dist/snapshot/reasoning-strip.js.map +1 -0
- package/dist/{runner-events.d.ts → snapshot/runner-events.d.ts} +13 -1
- package/dist/snapshot/runner-events.d.ts.map +1 -0
- package/dist/{runner-events.js → snapshot/runner-events.js} +16 -4
- package/dist/snapshot/runner-events.js.map +1 -0
- package/dist/{snapshot.d.ts → snapshot/snapshot.d.ts} +29 -3
- package/dist/snapshot/snapshot.d.ts.map +1 -0
- package/dist/{snapshot.js → snapshot/snapshot.js} +347 -39
- package/dist/snapshot/snapshot.js.map +1 -0
- package/dist/{structured-output.d.ts → snapshot/structured-output.d.ts} +1 -1
- package/dist/snapshot/structured-output.d.ts.map +1 -0
- package/dist/{structured-output.js → snapshot/structured-output.js} +13 -0
- package/dist/snapshot/structured-output.js.map +1 -0
- package/dist/{flow-prompt.d.ts → steering/flow-prompt.d.ts} +2 -2
- package/dist/steering/flow-prompt.d.ts.map +1 -0
- package/dist/{flow-prompt.js → steering/flow-prompt.js} +3 -3
- package/dist/steering/flow-prompt.js.map +1 -0
- package/dist/{sliding-prompt.d.ts → steering/sliding-prompt.d.ts} +8 -7
- package/dist/steering/sliding-prompt.d.ts.map +1 -0
- package/dist/{sliding-prompt.js → steering/sliding-prompt.js} +15 -64
- package/dist/steering/sliding-prompt.js.map +1 -0
- package/dist/{tool-utils.d.ts → steering/tool-utils.d.ts} +1 -0
- package/dist/steering/tool-utils.d.ts.map +1 -0
- package/dist/{tool-utils.js → steering/tool-utils.js} +10 -3
- package/dist/steering/tool-utils.js.map +1 -0
- package/dist/{ask-user.d.ts → tools/ask-user.d.ts} +3 -15
- package/dist/tools/ask-user.d.ts.map +1 -0
- package/dist/tools/ask-user.js +778 -0
- package/dist/tools/ask-user.js.map +1 -0
- package/dist/{timed-bash.d.ts → tools/timed-bash.d.ts} +2 -7
- package/dist/tools/timed-bash.d.ts.map +1 -0
- package/dist/{timed-bash.js → tools/timed-bash.js} +2 -2
- package/dist/tools/timed-bash.js.map +1 -0
- package/dist/{web-tool.d.ts → tools/web-tool.d.ts} +1 -1
- package/dist/tools/web-tool.d.ts.map +1 -0
- package/dist/{web-tool.js → tools/web-tool.js} +8 -7
- package/dist/tools/web-tool.js.map +1 -0
- package/dist/tui/flow-colors.d.ts +55 -0
- package/dist/tui/flow-colors.d.ts.map +1 -0
- package/dist/tui/flow-colors.js +22 -0
- package/dist/tui/flow-colors.js.map +1 -0
- package/dist/{render-utils.d.ts → tui/render-utils.d.ts} +1 -1
- package/dist/tui/render-utils.d.ts.map +1 -0
- package/dist/{render-utils.js → tui/render-utils.js} +3 -3
- package/dist/tui/render-utils.js.map +1 -0
- package/dist/tui/render.d.ts +21 -0
- package/dist/tui/render.d.ts.map +1 -0
- package/dist/tui/render.js +813 -0
- package/dist/tui/render.js.map +1 -0
- package/dist/tui/scramble/algorithm.d.ts +7 -0
- package/dist/tui/scramble/algorithm.d.ts.map +1 -0
- package/dist/tui/scramble/algorithm.js +227 -0
- package/dist/tui/scramble/algorithm.js.map +1 -0
- package/dist/tui/scramble/constants.d.ts +99 -0
- package/dist/tui/scramble/constants.d.ts.map +1 -0
- package/dist/tui/scramble/constants.js +101 -0
- package/dist/tui/scramble/constants.js.map +1 -0
- package/dist/tui/scramble/index.d.ts +6 -0
- package/dist/tui/scramble/index.d.ts.map +1 -0
- package/dist/tui/scramble/index.js +6 -0
- package/dist/tui/scramble/index.js.map +1 -0
- package/dist/tui/scramble/manager.d.ts +48 -0
- package/dist/tui/scramble/manager.d.ts.map +1 -0
- package/dist/tui/scramble/manager.js +959 -0
- package/dist/tui/scramble/manager.js.map +1 -0
- package/dist/tui/scramble/utils.d.ts +18 -0
- package/dist/tui/scramble/utils.d.ts.map +1 -0
- package/dist/tui/scramble/utils.js +145 -0
- package/dist/tui/scramble/utils.js.map +1 -0
- package/dist/tui/single-select-layout.d.ts +17 -0
- package/dist/tui/single-select-layout.d.ts.map +1 -0
- package/dist/{single-select-layout.js → tui/single-select-layout.js} +8 -25
- package/dist/tui/single-select-layout.js.map +1 -0
- package/dist/types/flow.d.ts +110 -0
- package/dist/types/flow.d.ts.map +1 -0
- package/dist/{types.js → types/flow.js} +3 -54
- package/dist/types/flow.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/output.d.ts +104 -0
- package/dist/types/output.d.ts.map +1 -0
- package/dist/types/output.js +5 -0
- package/dist/types/output.js.map +1 -0
- package/dist/types/ui.d.ts +24 -0
- package/dist/types/ui.d.ts.map +1 -0
- package/dist/types/ui.js +55 -0
- package/dist/types/ui.js.map +1 -0
- package/package.json +7 -4
- package/dist/agents.d.ts.map +0 -1
- package/dist/agents.js.map +0 -1
- package/dist/ask-user.d.ts.map +0 -1
- package/dist/ask-user.js +0 -1405
- package/dist/ask-user.js.map +0 -1
- package/dist/batch.d.ts +0 -12
- package/dist/batch.d.ts.map +0 -1
- package/dist/batch.js +0 -11
- package/dist/batch.js.map +0 -1
- package/dist/cli-args.d.ts.map +0 -1
- package/dist/cli-args.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/depth.d.ts.map +0 -1
- package/dist/depth.js.map +0 -1
- package/dist/executor.d.ts.map +0 -1
- package/dist/executor.js.map +0 -1
- package/dist/flow-prompt.d.ts.map +0 -1
- package/dist/flow-prompt.js.map +0 -1
- package/dist/flow.d.ts.map +0 -1
- package/dist/flow.js.map +0 -1
- package/dist/notify-state.d.ts.map +0 -1
- package/dist/notify-state.js.map +0 -1
- package/dist/notify.d.ts.map +0 -1
- package/dist/notify.js.map +0 -1
- package/dist/reasoning-strip.d.ts.map +0 -1
- package/dist/reasoning-strip.js.map +0 -1
- package/dist/render-utils.d.ts.map +0 -1
- package/dist/render-utils.js.map +0 -1
- package/dist/render.d.ts +0 -24
- package/dist/render.d.ts.map +0 -1
- package/dist/render.js +0 -592
- package/dist/render.js.map +0 -1
- package/dist/runner-events.d.ts.map +0 -1
- package/dist/runner-events.js.map +0 -1
- package/dist/scramble.d.ts +0 -171
- package/dist/scramble.d.ts.map +0 -1
- package/dist/scramble.js +0 -2261
- package/dist/scramble.js.map +0 -1
- package/dist/session-mode.d.ts.map +0 -1
- package/dist/session-mode.js.map +0 -1
- package/dist/settings-resolver.d.ts.map +0 -1
- package/dist/settings-resolver.js +0 -148
- package/dist/settings-resolver.js.map +0 -1
- package/dist/single-select-layout.d.ts +0 -20
- package/dist/single-select-layout.d.ts.map +0 -1
- package/dist/single-select-layout.js.map +0 -1
- package/dist/sliding-prompt.d.ts.map +0 -1
- package/dist/sliding-prompt.js.map +0 -1
- package/dist/snapshot.d.ts.map +0 -1
- package/dist/snapshot.js.map +0 -1
- package/dist/spec-mode.d.ts +0 -13
- package/dist/spec-mode.d.ts.map +0 -1
- package/dist/spec-mode.js +0 -90
- package/dist/spec-mode.js.map +0 -1
- package/dist/structured-output.d.ts.map +0 -1
- package/dist/structured-output.js.map +0 -1
- package/dist/timed-bash.d.ts.map +0 -1
- package/dist/timed-bash.js.map +0 -1
- package/dist/tool-utils.d.ts.map +0 -1
- package/dist/tool-utils.js.map +0 -1
- package/dist/transitions.d.ts.map +0 -1
- package/dist/transitions.js.map +0 -1
- package/dist/types.d.ts +0 -208
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/web-tool.d.ts.map +0 -1
- package/dist/web-tool.js.map +0 -1
- /package/dist/{agents.d.ts → core/agents.d.ts} +0 -0
- /package/dist/{depth.d.ts → core/depth.d.ts} +0 -0
- /package/dist/{transitions.d.ts → core/transitions.d.ts} +0 -0
- /package/dist/{notify-state.js → notify/notify-state.js} +0 -0
- /package/dist/{notify.d.ts → notify/notify.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner-events.js","sourceRoot":"","sources":["../../src/snapshot/runner-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,iGAAiG;AACjG,MA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e,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;IAED,MAAM,WAAW,GAAG,gBAAgB,CAAC,MAAM,GAAG,CAAC;QAC9C,CAAC,CAAC,sBAAsB,GAAG,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC;QAC3D,CAAC,CAAC,EAAE,CAAC;IAEN,sDAAsD;IACtD,IAAI,SAAS,EAAE,CAAC;QACf,OAAO,SAAS,GAAG,WAAW,CAAC;IAChC,CAAC;IAED,gBAAgB;IAChB,IAAI,OAAO,EAAE,CAAC;QACb,uEAAuE;QACvE,MAAM,SAAS,GAAG,uBAAuB,CAAC,MAAM,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC;QAClE,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChE,OAAO,GAAG,SAAS,mBAAmB,SAAS,GAAG,WAAW,EAAE,CAAC;QACjE,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,uDAAuD;IACvD,IAAI,WAAW,EAAE,CAAC;QACjB,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,aAAa,CAAC;AACtB,CAAC"}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two JSONL protocols are used in this codebase:
|
|
3
|
+
*
|
|
4
|
+
* 1. Fork Snapshot Protocol (snapshot.ts):
|
|
5
|
+
* Types: session, model_change, thinking_level_change, system, message,
|
|
6
|
+
* compression-stats
|
|
7
|
+
* Purpose: Serialized session state passed to child flows via --session.
|
|
8
|
+
* Emitted by buildForkSessionSnapshotJsonl() and consumed by
|
|
9
|
+
* sanitizeForkSnapshot() before forking.
|
|
10
|
+
*
|
|
11
|
+
* 2. Streaming Stdout Protocol (runner-events.ts):
|
|
12
|
+
* Types: session, agent_start, turn_start, message_start, message_end,
|
|
13
|
+
* message_update
|
|
14
|
+
* Sub-events under message_update: thinking_start, thinking_delta, text_delta
|
|
15
|
+
* Purpose: Real-time events emitted by the pi process stdout during flow
|
|
16
|
+
* execution. Parsed by processFlowJsonLine().
|
|
17
|
+
*/
|
|
1
18
|
/**
|
|
2
19
|
* Session snapshot building, sanitization, and tool result compression.
|
|
3
20
|
*
|
|
4
21
|
* Extracted from index.ts for single-responsibility and testability.
|
|
5
22
|
*/
|
|
6
|
-
import {
|
|
23
|
+
import type { CompressedFlowResult } from "../types/output.js";
|
|
7
24
|
export interface SessionSnapshotSource {
|
|
8
25
|
getHeader: () => unknown;
|
|
9
26
|
getBranch: () => unknown[];
|
|
@@ -12,7 +29,7 @@ export declare function buildForkSessionSnapshotJsonl(sessionManager: SessionSna
|
|
|
12
29
|
/**
|
|
13
30
|
* Render a compressed flow result as compact text for child context.
|
|
14
31
|
*/
|
|
15
|
-
export declare function renderCompressedFlowResult(r: CompressedFlowResult): string;
|
|
32
|
+
export declare function renderCompressedFlowResult(r: CompressedFlowResult): string | undefined;
|
|
16
33
|
/**
|
|
17
34
|
* Compress tool results in a sanitized session snapshot.
|
|
18
35
|
*
|
|
@@ -44,5 +61,14 @@ export declare function stripBatchReadToolCalls(snapshot: string): string;
|
|
|
44
61
|
* sliding system prompts, assistant reasoning/thinking,
|
|
45
62
|
* batch_read tool calls, and compress flow/batch_read tool results.
|
|
46
63
|
*/
|
|
47
|
-
export
|
|
64
|
+
export interface SanitizeForkSnapshotOptions {
|
|
65
|
+
forkedFrom?: string;
|
|
66
|
+
forkedAt?: string;
|
|
67
|
+
parentFlow?: string;
|
|
68
|
+
depth?: number;
|
|
69
|
+
}
|
|
70
|
+
export declare function sanitizeForkSnapshot(snapshot: string | null, cache?: Map<string, CompressedFlowResult[]>, options?: SanitizeForkSnapshotOptions): {
|
|
71
|
+
result: string | null;
|
|
72
|
+
passesApplied: string[];
|
|
73
|
+
};
|
|
48
74
|
//# sourceMappingURL=snapshot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,EAAE,2BAA2B,GACnC;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAiSpD"}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Two JSONL protocols are used in this codebase:
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 1. Fork Snapshot Protocol (snapshot.ts):
|
|
5
|
+
* Types: session, model_change, thinking_level_change, system, message,
|
|
6
|
+
* compression-stats
|
|
7
|
+
* Purpose: Serialized session state passed to child flows via --session.
|
|
8
|
+
* Emitted by buildForkSessionSnapshotJsonl() and consumed by
|
|
9
|
+
* sanitizeForkSnapshot() before forking.
|
|
10
|
+
*
|
|
11
|
+
* 2. Streaming Stdout Protocol (runner-events.ts):
|
|
12
|
+
* Types: session, agent_start, turn_start, message_start, message_end,
|
|
13
|
+
* message_update
|
|
14
|
+
* Sub-events under message_update: thinking_start, thinking_delta, text_delta
|
|
15
|
+
* Purpose: Real-time events emitted by the pi process stdout during flow
|
|
16
|
+
* execution. Parsed by processFlowJsonLine().
|
|
5
17
|
*/
|
|
6
18
|
import { stripReasoningFromAssistantMessage } from "./reasoning-strip.js";
|
|
7
|
-
import { stripSteeringHintFromContent,
|
|
8
|
-
import { stripStrategicHintsFromContent } from "
|
|
19
|
+
import { stripSteeringHintFromContent, contentContainsSteeringHintTag, isJsonEqual, } from "../steering/sliding-prompt.js";
|
|
20
|
+
import { stripStrategicHintsFromContent } from "../steering/tool-utils.js";
|
|
21
|
+
import { logError } from "../config/log.js";
|
|
9
22
|
// ---------------------------------------------------------------------------
|
|
10
23
|
// Session snapshot serialization
|
|
11
24
|
// ---------------------------------------------------------------------------
|
|
@@ -14,7 +27,25 @@ export function buildForkSessionSnapshotJsonl(sessionManager) {
|
|
|
14
27
|
if (!header || typeof header !== "object")
|
|
15
28
|
return null;
|
|
16
29
|
const branchEntries = sessionManager.getBranch();
|
|
17
|
-
const lines = [
|
|
30
|
+
const lines = [];
|
|
31
|
+
// Emit session header once, unless getBranch() already includes it as the
|
|
32
|
+
// first entry (some session managers include the header in the branch).
|
|
33
|
+
const firstBranch = branchEntries[0];
|
|
34
|
+
const headerId = header?.id;
|
|
35
|
+
const firstId = firstBranch && typeof firstBranch === "object" ? firstBranch?.id : undefined;
|
|
36
|
+
const firstType = firstBranch && typeof firstBranch === "object" ? firstBranch?.type : undefined;
|
|
37
|
+
if (!firstBranch ||
|
|
38
|
+
typeof firstBranch !== "object" ||
|
|
39
|
+
(firstType !== "session" && firstType !== "header") ||
|
|
40
|
+
firstId !== headerId) {
|
|
41
|
+
lines.push(JSON.stringify(header));
|
|
42
|
+
}
|
|
43
|
+
// Emit system event so the JSONL is self-contained — parsers can reconstruct
|
|
44
|
+
// full context without needing the markdown section.
|
|
45
|
+
const systemPrompt = header.systemPrompt;
|
|
46
|
+
if (typeof systemPrompt === "string" && systemPrompt) {
|
|
47
|
+
lines.push(JSON.stringify({ type: "system", content: systemPrompt }));
|
|
48
|
+
}
|
|
18
49
|
for (const entry of branchEntries)
|
|
19
50
|
lines.push(JSON.stringify(entry));
|
|
20
51
|
return `${lines.join("\n")}\n`;
|
|
@@ -27,21 +58,63 @@ export function buildForkSessionSnapshotJsonl(sessionManager) {
|
|
|
27
58
|
*/
|
|
28
59
|
export function renderCompressedFlowResult(r) {
|
|
29
60
|
const parts = [`[Flow: ${r.type} ${r.status}]`];
|
|
61
|
+
if (r.intent)
|
|
62
|
+
parts.push(`Intent: ${r.intent}`);
|
|
63
|
+
if (r.aim)
|
|
64
|
+
parts.push(`Aim: ${r.aim}`);
|
|
65
|
+
if (r.summary)
|
|
66
|
+
parts.push(`Summary: ${r.summary}`);
|
|
30
67
|
if (r.files?.length) {
|
|
31
|
-
const fileLines = r.files
|
|
68
|
+
const fileLines = r.files
|
|
69
|
+
.map((f) => {
|
|
70
|
+
if (!f.path)
|
|
71
|
+
return undefined;
|
|
32
72
|
const role = f.role ? ` (${f.role})` : "";
|
|
33
73
|
const desc = f.description ? ` — ${f.description}` : "";
|
|
34
74
|
return ` ${f.path}${role}${desc}`;
|
|
35
|
-
})
|
|
75
|
+
})
|
|
76
|
+
.filter((line) => line !== undefined);
|
|
77
|
+
// Safety net: if >50% of file entries were invalid (no path), compression is
|
|
78
|
+
// producing garbage. Return undefined so caller falls back to truncated raw.
|
|
79
|
+
if (fileLines.length === 0 || fileLines.length < r.files.length / 2) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
36
82
|
parts.push(`Files:\n${fileLines.join("\n")}`);
|
|
37
83
|
}
|
|
84
|
+
if (r.actions?.length) {
|
|
85
|
+
const actionLines = r.actions.map((a) => {
|
|
86
|
+
const result = a.result ? ` → ${a.result}` : "";
|
|
87
|
+
const target = a.target ? ` (${a.target})` : "";
|
|
88
|
+
return ` [${a.type}] ${a.description}${target}${result}`;
|
|
89
|
+
});
|
|
90
|
+
parts.push(`Actions:\n${actionLines.join("\n")}`);
|
|
91
|
+
}
|
|
38
92
|
if (r.commands?.length) {
|
|
39
93
|
const cmdLines = r.commands.map((c) => ` ${c.tool ?? "cmd"}: ${c.command}`);
|
|
40
94
|
parts.push(`Commands:\n${cmdLines.join("\n")}`);
|
|
41
95
|
}
|
|
96
|
+
if (r.notDone?.length) {
|
|
97
|
+
const ndLines = r.notDone.map((n) => {
|
|
98
|
+
const reason = n.reason ? ` — ${n.reason}` : "";
|
|
99
|
+
return ` ${n.item}${reason}`;
|
|
100
|
+
});
|
|
101
|
+
parts.push(`Not done:\n${ndLines.join("\n")}`);
|
|
102
|
+
}
|
|
103
|
+
if (r.nextSteps?.length) {
|
|
104
|
+
parts.push(`Next steps:\n${r.nextSteps.map((s) => ` ${s}`).join("\n")}`);
|
|
105
|
+
}
|
|
106
|
+
if (r.reasoning?.length) {
|
|
107
|
+
parts.push(`Reasoning:\n${r.reasoning.map((s) => ` ${s}`).join("\n")}`);
|
|
108
|
+
}
|
|
109
|
+
if (r.notes?.length) {
|
|
110
|
+
parts.push(`Notes:\n${r.notes.map((s) => ` ${s}`).join("\n")}`);
|
|
111
|
+
}
|
|
42
112
|
if (r.error)
|
|
43
113
|
parts.push(`Error: ${r.error}`);
|
|
44
|
-
|
|
114
|
+
const text = parts.join("\n");
|
|
115
|
+
if (text.includes("undefined"))
|
|
116
|
+
return undefined;
|
|
117
|
+
return text;
|
|
45
118
|
}
|
|
46
119
|
// ---------------------------------------------------------------------------
|
|
47
120
|
// batch_read result compression
|
|
@@ -91,7 +164,7 @@ function logCompress(toolName, before, after) {
|
|
|
91
164
|
if (!DEBUG_CONTEXT)
|
|
92
165
|
return;
|
|
93
166
|
const reduction = before > 0 ? ((1 - after / before) * 100).toFixed(0) : "0";
|
|
94
|
-
|
|
167
|
+
logError(`[context-compress] ${toolName}: ${before} → ${after} bytes (${reduction}% reduction)`);
|
|
95
168
|
}
|
|
96
169
|
const KNOWN_SECTION_HEADERS = [
|
|
97
170
|
/^--- (.+) \((\d+) lines\) ---$/,
|
|
@@ -354,18 +427,37 @@ export function compressToolResults(snapshot, cache) {
|
|
|
354
427
|
if (toolName === "flow") {
|
|
355
428
|
const compressed = cache.get(toolCallId);
|
|
356
429
|
if (!compressed || compressed.length === 0) {
|
|
357
|
-
|
|
358
|
-
|
|
430
|
+
// Cache miss (never populated or evicted) — do NOT pass megabytes of raw
|
|
431
|
+
// flow output verbatim into child context. Render a minimal placeholder.
|
|
432
|
+
originalText = extractToolResultText(entry) ?? "";
|
|
433
|
+
const rawContent = entry.message?.content;
|
|
434
|
+
const contentSize = rawContent
|
|
435
|
+
? (typeof rawContent === "string" ? rawContent.length : JSON.stringify(rawContent).length)
|
|
436
|
+
: 0;
|
|
437
|
+
const size = originalText.length || contentSize || line.length;
|
|
438
|
+
rendered = `[flow] prior result · ${size} chars — full context unavailable (result not cached at this depth)`;
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
const renderResults = compressed.map(renderCompressedFlowResult);
|
|
442
|
+
const hasAnyUndefined = renderResults.some(r => r === undefined);
|
|
443
|
+
if (hasAnyUndefined) {
|
|
444
|
+
// Safety net: compression produced garbage, fall back to truncated raw.
|
|
445
|
+
originalText = extractToolResultText(entry) ?? "";
|
|
446
|
+
const size = originalText.length;
|
|
447
|
+
rendered = size > 2000
|
|
448
|
+
? originalText.slice(0, 2000) + "\n[truncated]"
|
|
449
|
+
: originalText;
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
rendered = renderResults.filter((r) => r !== undefined).join("\n\n");
|
|
453
|
+
}
|
|
359
454
|
}
|
|
360
|
-
rendered = compressed.map(renderCompressedFlowResult).join("\n\n");
|
|
361
455
|
}
|
|
362
|
-
//
|
|
456
|
+
// Note: batch_read tool results are now compressed in stripBatchReadToolCalls
|
|
457
|
+
// before compressToolResults runs, so this branch is no longer needed.
|
|
458
|
+
// Kept as a no-op safety net for any edge cases.
|
|
363
459
|
else if (toolName === "batch_read") {
|
|
364
|
-
|
|
365
|
-
const paths = extractBatchReadPaths(args);
|
|
366
|
-
rendered = paths.length > 0
|
|
367
|
-
? renderCompressedBatchReadResult(paths)
|
|
368
|
-
: "[batch_read] result compressed";
|
|
460
|
+
rendered = undefined; // handled upstream
|
|
369
461
|
}
|
|
370
462
|
// --- Compress batch tool results (selective: keep bash, truncate reads) ---
|
|
371
463
|
else if (toolName === "batch") {
|
|
@@ -386,11 +478,14 @@ export function compressToolResults(snapshot, cache) {
|
|
|
386
478
|
}
|
|
387
479
|
if (rendered !== undefined) {
|
|
388
480
|
logCompress(toolName ?? "unknown", originalText.length || line.length, rendered.length);
|
|
481
|
+
// Strip the 'details' field which carries UI metadata that children don't need.
|
|
482
|
+
// This eliminates ~98% of payload bloat from flow tool results.
|
|
483
|
+
const { details, ...messageWithoutDetails } = entry.message;
|
|
389
484
|
if (typeof entry.message.toolCallId === "string") {
|
|
390
485
|
entry = {
|
|
391
486
|
...entry,
|
|
392
487
|
message: {
|
|
393
|
-
...
|
|
488
|
+
...messageWithoutDetails,
|
|
394
489
|
content: [{ type: "text", text: rendered }],
|
|
395
490
|
},
|
|
396
491
|
};
|
|
@@ -399,7 +494,7 @@ export function compressToolResults(snapshot, cache) {
|
|
|
399
494
|
entry = {
|
|
400
495
|
...entry,
|
|
401
496
|
message: {
|
|
402
|
-
...
|
|
497
|
+
...messageWithoutDetails,
|
|
403
498
|
content: entry.message.content.map((part) => part.type === "toolResult" && part.toolCallId === toolCallId
|
|
404
499
|
? { ...part, content: rendered }
|
|
405
500
|
: part),
|
|
@@ -525,20 +620,61 @@ export function stripBatchReadToolCalls(snapshot) {
|
|
|
525
620
|
return `${result.join("\n")}\n`;
|
|
526
621
|
}
|
|
527
622
|
// ---------------------------------------------------------------------------
|
|
528
|
-
//
|
|
623
|
+
// Reparent orphans
|
|
529
624
|
// ---------------------------------------------------------------------------
|
|
530
625
|
/**
|
|
531
|
-
*
|
|
532
|
-
*
|
|
533
|
-
* sliding system prompts, assistant reasoning/thinking,
|
|
534
|
-
* batch_read tool calls, and compress flow/batch_read tool results.
|
|
626
|
+
* Fix parentId references that point to messages which no longer exist.
|
|
627
|
+
* Call this after any pass that drops messages.
|
|
535
628
|
*/
|
|
536
|
-
|
|
629
|
+
function reparentOrphans(snapshot) {
|
|
630
|
+
const lines = snapshot.trimEnd().split("\n");
|
|
631
|
+
const survivingIds = new Set();
|
|
632
|
+
for (const line of lines) {
|
|
633
|
+
try {
|
|
634
|
+
const entry = JSON.parse(line);
|
|
635
|
+
const id = entry?.message?.id ?? entry?.message?.messageId ?? entry?.id;
|
|
636
|
+
if (typeof id === "string" && id)
|
|
637
|
+
survivingIds.add(id);
|
|
638
|
+
const parentId = entry?.parentId ?? entry?.parentMessageId ?? entry?.message?.parentId ?? entry?.message?.parentMessageId;
|
|
639
|
+
if (typeof parentId === "string" && parentId && !(typeof id === "string" && id))
|
|
640
|
+
survivingIds.add(parentId);
|
|
641
|
+
}
|
|
642
|
+
catch { /* ignore */ }
|
|
643
|
+
}
|
|
644
|
+
for (let i = 0; i < lines.length; i++) {
|
|
645
|
+
try {
|
|
646
|
+
let entry = JSON.parse(lines[i]);
|
|
647
|
+
const entryParentId = entry.parentId ?? entry.parentMessageId;
|
|
648
|
+
const messageParentId = entry.message?.parentId ?? entry.message?.parentMessageId;
|
|
649
|
+
const parentId = entryParentId ?? messageParentId;
|
|
650
|
+
if (typeof parentId === "string" && parentId && !survivingIds.has(parentId)) {
|
|
651
|
+
let modified = false;
|
|
652
|
+
if (entry.parentId === parentId || entry.parentMessageId === parentId) {
|
|
653
|
+
const { parentId: _pid, parentMessageId: _pmid, ...restEntry } = entry;
|
|
654
|
+
entry = restEntry;
|
|
655
|
+
modified = true;
|
|
656
|
+
}
|
|
657
|
+
if (entry.message && (entry.message.parentId === parentId || entry.message.parentMessageId === parentId)) {
|
|
658
|
+
const { parentId: _pid, parentMessageId: _pmid, ...restMessage } = entry.message;
|
|
659
|
+
entry = { ...entry, message: restMessage };
|
|
660
|
+
modified = true;
|
|
661
|
+
}
|
|
662
|
+
if (modified) {
|
|
663
|
+
lines[i] = JSON.stringify(entry);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
catch { /* ignore */ }
|
|
668
|
+
}
|
|
669
|
+
return `${lines.join("\n")}\n`;
|
|
670
|
+
}
|
|
671
|
+
export function sanitizeForkSnapshot(snapshot, cache = new Map(), options) {
|
|
537
672
|
if (!snapshot)
|
|
538
|
-
return snapshot;
|
|
673
|
+
return { result: snapshot, passesApplied: [] };
|
|
539
674
|
const preBytes = snapshot.length;
|
|
540
675
|
const lines = snapshot.trimEnd().split("\n");
|
|
541
676
|
const sanitizedLines = [];
|
|
677
|
+
const subPasses = new Set();
|
|
542
678
|
for (let i = 0; i < lines.length; i++) {
|
|
543
679
|
const line = lines[i];
|
|
544
680
|
let entry;
|
|
@@ -550,18 +686,76 @@ export function sanitizeForkSnapshot(snapshot, cache = new Map()) {
|
|
|
550
686
|
continue;
|
|
551
687
|
}
|
|
552
688
|
let changed = false;
|
|
553
|
-
//
|
|
554
|
-
if (i === 0 && entry && typeof entry === "object"
|
|
555
|
-
|
|
556
|
-
if (
|
|
557
|
-
entry = {
|
|
689
|
+
// Header (first line): merge fork metadata and replace parent system prompt.
|
|
690
|
+
if (i === 0 && entry && typeof entry === "object") {
|
|
691
|
+
// Inject fork metadata so children know their lineage.
|
|
692
|
+
if (options && (options.forkedFrom || options.forkedAt || options.parentFlow || options.depth !== undefined)) {
|
|
693
|
+
entry = {
|
|
694
|
+
...entry,
|
|
695
|
+
...(options.forkedFrom !== undefined ? { forkedFrom: options.forkedFrom } : {}),
|
|
696
|
+
...(options.forkedAt !== undefined ? { forkedAt: options.forkedAt } : {}),
|
|
697
|
+
...(options.parentFlow !== undefined ? { parentFlow: options.parentFlow } : {}),
|
|
698
|
+
...(options.depth !== undefined ? { depth: options.depth } : {}),
|
|
699
|
+
};
|
|
558
700
|
changed = true;
|
|
701
|
+
subPasses.add("forkMetadataInjection");
|
|
702
|
+
}
|
|
703
|
+
// Replace the parent orchestrator system prompt with a brief note.
|
|
704
|
+
// Children receive their own directive in the <activation> block.
|
|
705
|
+
if (entry.systemPrompt && typeof entry.systemPrompt === "string") {
|
|
706
|
+
entry = { ...entry, systemPrompt: "[parent orchestrator system prompt stripped — child receives its own directive]" };
|
|
707
|
+
changed = true;
|
|
708
|
+
subPasses.add("stripSystemPrompt");
|
|
709
|
+
}
|
|
710
|
+
// Prevent child from inheriting parent's session identity.
|
|
711
|
+
// Rename id → parentId so lineage is preserved but the child
|
|
712
|
+
// generates its own session identifier.
|
|
713
|
+
if ('id' in entry) {
|
|
714
|
+
entry = { ...entry, parentId: entry.id };
|
|
715
|
+
delete entry.id;
|
|
716
|
+
changed = true;
|
|
717
|
+
subPasses.add('stripSessionId');
|
|
559
718
|
}
|
|
560
719
|
}
|
|
720
|
+
// Drop type: "system" entries — the parent orchestrator system prompt was already
|
|
721
|
+
// stripped from the header above. Standalone system events leak the full prompt.
|
|
722
|
+
// Children receive their own directive in the <activation> block.
|
|
723
|
+
if (entry?.type === "system") {
|
|
724
|
+
subPasses.add("dropSystemEvents");
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
// Drop custom_message entries — hidden orchestrator instructions (e.g.
|
|
728
|
+
// flow continuation hook messages with display:false) that children
|
|
729
|
+
// should never see.
|
|
730
|
+
if (entry?.type === "custom_message") {
|
|
731
|
+
subPasses.add("dropCustomMessages");
|
|
732
|
+
continue;
|
|
733
|
+
}
|
|
734
|
+
// Drop parent-specific configuration events; child receives its own
|
|
735
|
+
// model/tier via the <activation> block and CLI args.
|
|
736
|
+
if (entry?.type === "model_change" || entry?.type === "thinking_level_change") {
|
|
737
|
+
subPasses.add("dropConfigEvents");
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
// Defense-in-depth: drop entries with an explicit unknown type that do not
|
|
741
|
+
// belong in the fork snapshot protocol. Entries without a type field (e.g. bare
|
|
742
|
+
// session headers from getHeader) pass through unchanged.
|
|
743
|
+
if (entry?.type !== undefined &&
|
|
744
|
+
entry?.type !== "session" &&
|
|
745
|
+
entry?.type !== "message") {
|
|
746
|
+
subPasses.add("dropUnknownTypes");
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
// Drop malformed message entries that lack a message payload.
|
|
750
|
+
if (entry?.type === "message" && !entry.message) {
|
|
751
|
+
subPasses.add("dropMalformedMessages");
|
|
752
|
+
continue;
|
|
753
|
+
}
|
|
561
754
|
// Drop sliding system prompt messages entirely.
|
|
562
755
|
if (entry?.type === "message" &&
|
|
563
756
|
entry.message?.role === "system" &&
|
|
564
757
|
contentContainsSteeringHintTag(entry.message?.content)) {
|
|
758
|
+
subPasses.add("dropSlidingSystemPrompts");
|
|
565
759
|
continue;
|
|
566
760
|
}
|
|
567
761
|
if (entry?.type === "message" && entry.message) {
|
|
@@ -570,11 +764,63 @@ export function sanitizeForkSnapshot(snapshot, cache = new Map()) {
|
|
|
570
764
|
if (message.role === "toolResult") {
|
|
571
765
|
message = { ...message, role: "tool" };
|
|
572
766
|
changed = true;
|
|
767
|
+
subPasses.add("normalizeToolResultRole");
|
|
573
768
|
}
|
|
574
|
-
|
|
769
|
+
// Strip reasoning/thinking from assistant messages.
|
|
770
|
+
// (Reasoning typically only appears in assistant messages, but we
|
|
771
|
+
// also check system/tool roles as a safety net for provider-specific
|
|
772
|
+
// formats. stripReasoningFromAssistantMessage is a no-op on non-assistant
|
|
773
|
+
// shapes, so calling it universally is safe.)
|
|
774
|
+
if (message.role === "assistant" || message.role === "system" || message.role === "tool") {
|
|
575
775
|
const stripped = stripReasoningFromAssistantMessage(message);
|
|
576
776
|
message = stripped.message;
|
|
577
|
-
|
|
777
|
+
if (stripped.changed) {
|
|
778
|
+
changed = true;
|
|
779
|
+
subPasses.add("stripReasoning");
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
// Strip inner `message.timestamp` — the outer event-level timestamp (ISO string)
|
|
783
|
+
// is sufficient for ordering. The inner epoch-ms timestamp is redundant.
|
|
784
|
+
if ("timestamp" in message) {
|
|
785
|
+
const { timestamp, ...restMessage } = message;
|
|
786
|
+
message = restMessage;
|
|
787
|
+
changed = true;
|
|
788
|
+
subPasses.add("stripTimestamps");
|
|
789
|
+
}
|
|
790
|
+
// Strip API metadata fields that children don't need (~5-7 KB per assistant message).
|
|
791
|
+
// IMPORTANT: keep `usage` (including `totalTokens`). The child `pi` process replays
|
|
792
|
+
// this JSONL and core/session code reads `message.usage.totalTokens`; stripping
|
|
793
|
+
// `usage` causes: Cannot read properties of undefined (reading 'totalTokens').
|
|
794
|
+
// Strip `cost` from `usage` — it's always zeros in forked context and children never need it.
|
|
795
|
+
if (message.role === "assistant") {
|
|
796
|
+
const { api, provider, model, stopReason, responseId, responseModel, usage, ...rest } = message;
|
|
797
|
+
let stripped = false;
|
|
798
|
+
if (api !== undefined || provider !== undefined || model !== undefined ||
|
|
799
|
+
stopReason !== undefined || responseId !== undefined || responseModel !== undefined) {
|
|
800
|
+
stripped = true;
|
|
801
|
+
}
|
|
802
|
+
// Strip cost sub-object from usage while preserving totalTokens and other fields.
|
|
803
|
+
let cleanedUsage = usage;
|
|
804
|
+
if (usage && typeof usage === "object" && "cost" in usage) {
|
|
805
|
+
const { cost, ...usageWithoutCost } = usage;
|
|
806
|
+
cleanedUsage = usageWithoutCost;
|
|
807
|
+
stripped = true;
|
|
808
|
+
}
|
|
809
|
+
if (stripped) {
|
|
810
|
+
message = { ...rest, ...(cleanedUsage !== undefined ? { usage: cleanedUsage } : {}) };
|
|
811
|
+
changed = true;
|
|
812
|
+
subPasses.add("stripApiMetadata");
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
// Strip `details` from tool/toolResult messages — carries FlowDetails UI metadata
|
|
816
|
+
// (mode, flowStyle, projectAgentsDir, results) that children never need.
|
|
817
|
+
if (message.role === "tool" || message.role === "toolResult") {
|
|
818
|
+
if ("details" in message) {
|
|
819
|
+
const { details, ...restMessage } = message;
|
|
820
|
+
message = restMessage;
|
|
821
|
+
changed = true;
|
|
822
|
+
subPasses.add("stripDetails");
|
|
823
|
+
}
|
|
578
824
|
}
|
|
579
825
|
if ("content" in message) {
|
|
580
826
|
let modifiedContent = message.content;
|
|
@@ -583,6 +829,7 @@ export function sanitizeForkSnapshot(snapshot, cache = new Map()) {
|
|
|
583
829
|
if (!isJsonEqual(afterSliding, modifiedContent)) {
|
|
584
830
|
modifiedContent = afterSliding;
|
|
585
831
|
changed = true;
|
|
832
|
+
subPasses.add("stripSteeringHints");
|
|
586
833
|
}
|
|
587
834
|
// Strip strategic hints from tool results
|
|
588
835
|
if (message.role === "tool" || message.role === "toolResult") {
|
|
@@ -590,6 +837,47 @@ export function sanitizeForkSnapshot(snapshot, cache = new Map()) {
|
|
|
590
837
|
if (!isJsonEqual(afterHints, modifiedContent)) {
|
|
591
838
|
modifiedContent = afterHints;
|
|
592
839
|
changed = true;
|
|
840
|
+
subPasses.add("stripStrategicHints");
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
// Compress parent activation prompts in nested snapshot JSONL
|
|
844
|
+
// (detect user messages containing <context-seal> at depth >= 2).
|
|
845
|
+
if (message.role === "user" && options?.depth !== undefined && options.depth >= 2) {
|
|
846
|
+
let hasParentActivation = false;
|
|
847
|
+
let previewText = "";
|
|
848
|
+
const parentActivationRegex = /<context-seal>[\s\S]*?<\/context-seal>/;
|
|
849
|
+
let fullText = "";
|
|
850
|
+
if (typeof modifiedContent === "string") {
|
|
851
|
+
fullText = modifiedContent;
|
|
852
|
+
}
|
|
853
|
+
else if (Array.isArray(modifiedContent)) {
|
|
854
|
+
fullText = modifiedContent
|
|
855
|
+
.filter((p) => p.type === "text" && typeof p.text === "string")
|
|
856
|
+
.map((p) => p.text)
|
|
857
|
+
.join("");
|
|
858
|
+
}
|
|
859
|
+
if (parentActivationRegex.test(fullText)) {
|
|
860
|
+
hasParentActivation = true;
|
|
861
|
+
// Extract mission content for preview; fall back to content after </context-seal>
|
|
862
|
+
const missionMatch = fullText.match(/<mission>([\s\S]*?)<\/mission>/);
|
|
863
|
+
if (missionMatch) {
|
|
864
|
+
previewText = missionMatch[1].trim().replace(/\s+/g, " ").slice(0, 200).trim();
|
|
865
|
+
}
|
|
866
|
+
else {
|
|
867
|
+
const afterSeal = fullText.split(/<\/context-seal>/).pop() ?? fullText;
|
|
868
|
+
previewText = afterSeal.trim().slice(0, 200).trim();
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
if (hasParentActivation) {
|
|
872
|
+
const compact = `[Parent flow activation stripped] Mission preview: ${previewText}`;
|
|
873
|
+
if (typeof modifiedContent === "string") {
|
|
874
|
+
modifiedContent = compact;
|
|
875
|
+
}
|
|
876
|
+
else {
|
|
877
|
+
modifiedContent = [{ type: "text", text: compact }];
|
|
878
|
+
}
|
|
879
|
+
changed = true;
|
|
880
|
+
subPasses.add("compressParentActivation");
|
|
593
881
|
}
|
|
594
882
|
}
|
|
595
883
|
if (changed) {
|
|
@@ -603,18 +891,38 @@ export function sanitizeForkSnapshot(snapshot, cache = new Map()) {
|
|
|
603
891
|
const outLine = changed ? JSON.stringify(entry) : line;
|
|
604
892
|
sanitizedLines.push(outLine);
|
|
605
893
|
}
|
|
894
|
+
const passesApplied = [];
|
|
606
895
|
let sanitized = `${sanitizedLines.join("\n")}\n`;
|
|
896
|
+
passesApplied.push(...subPasses);
|
|
897
|
+
// Reparent orphaned parentIds after steering-hint messages were dropped.
|
|
898
|
+
sanitized = reparentOrphans(sanitized);
|
|
899
|
+
passesApplied.push("reparentOrphans");
|
|
607
900
|
// Strip batch_read tool calls from assistant messages.
|
|
608
901
|
// Children don't have batch_read in their active tools.
|
|
609
902
|
sanitized = stripBatchReadToolCalls(sanitized);
|
|
610
|
-
|
|
903
|
+
passesApplied.push("stripBatchRead");
|
|
904
|
+
// Compress tool results (flow, batch, web, ask_user).
|
|
611
905
|
sanitized = compressToolResults(sanitized, cache);
|
|
906
|
+
passesApplied.push("compressToolResults");
|
|
907
|
+
// Reparent again after stripBatchRead and compressToolResults may have
|
|
908
|
+
// dropped additional messages, leaving new orphaned parentIds.
|
|
909
|
+
sanitized = reparentOrphans(sanitized);
|
|
910
|
+
passesApplied.push("reparentOrphans");
|
|
612
911
|
// Telemetry: measure total delta across sanitization, stripping, and compression.
|
|
912
|
+
const postBytes = sanitized.length;
|
|
913
|
+
const reduction = preBytes > 0 ? ((1 - postBytes / preBytes) * 100).toFixed(0) : "0";
|
|
613
914
|
if (DEBUG_CONTEXT) {
|
|
614
|
-
|
|
615
|
-
const reduction = preBytes > 0 ? ((1 - postBytes / preBytes) * 100).toFixed(0) : "0";
|
|
616
|
-
console.error(`[context-snapshot] pre: ${preBytes} → post: ${postBytes} bytes (${reduction}% reduction)`);
|
|
915
|
+
logError(`[context-snapshot] pre: ${preBytes} → post: ${postBytes} bytes (${reduction}% reduction)`);
|
|
617
916
|
}
|
|
618
|
-
|
|
917
|
+
// Always emit compression-stats as a trailing metadata entry so the dump contains
|
|
918
|
+
// observability data regardless of DEBUG_CONTEXT setting.
|
|
919
|
+
sanitized = sanitized.trimEnd() + "\n" + JSON.stringify({
|
|
920
|
+
type: "compression-stats",
|
|
921
|
+
preBytes,
|
|
922
|
+
postBytes,
|
|
923
|
+
reductionPercent: Number(reduction),
|
|
924
|
+
passesApplied,
|
|
925
|
+
}) + "\n";
|
|
926
|
+
return { result: sanitized, passesApplied };
|
|
619
927
|
}
|
|
620
928
|
//# sourceMappingURL=snapshot.js.map
|