@caupulican/pi-adaptative 0.86.14 → 0.90.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/CHANGELOG.md +49 -0
- package/README.md +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js +14 -15
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.ts +14 -16
- package/dist/bundled-resources/skills/worker-profile-writer/SKILL.md +4 -4
- package/dist/core/agent-session.d.ts +23 -33
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +76 -109
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/autonomy/contracts.d.ts +1 -1
- package/dist/core/autonomy/contracts.js.map +1 -1
- package/dist/core/autonomy/gates.d.ts.map +1 -1
- package/dist/core/autonomy/gates.js +16 -0
- package/dist/core/autonomy/gates.js.map +1 -1
- package/dist/core/autonomy/subagent-prompt.d.ts +2 -1
- package/dist/core/autonomy/subagent-prompt.d.ts.map +1 -1
- package/dist/core/autonomy/subagent-prompt.js +2 -18
- package/dist/core/autonomy/subagent-prompt.js.map +1 -1
- package/dist/core/background-tool-task-controller.js +5 -5
- package/dist/core/background-tool-task-controller.js.map +1 -1
- package/dist/core/compaction-controller.d.ts +22 -2
- package/dist/core/compaction-controller.d.ts.map +1 -1
- package/dist/core/compaction-controller.js +75 -39
- package/dist/core/compaction-controller.js.map +1 -1
- package/dist/core/context/brain-curator.d.ts +2 -3
- package/dist/core/context/brain-curator.d.ts.map +1 -1
- package/dist/core/context/brain-curator.js +3 -20
- package/dist/core/context/brain-curator.js.map +1 -1
- package/dist/core/context/context-composition.d.ts +2 -1
- package/dist/core/context/context-composition.d.ts.map +1 -1
- package/dist/core/context/context-composition.js +6 -1
- package/dist/core/context/context-composition.js.map +1 -1
- package/dist/core/context/memory-prompt-block.js +1 -1
- package/dist/core/context/memory-prompt-block.js.map +1 -1
- package/dist/core/context/tool-output-packer.js +1 -1
- package/dist/core/context/tool-output-packer.js.map +1 -1
- package/dist/core/context-gc.js +10 -10
- package/dist/core/context-gc.js.map +1 -1
- package/dist/core/context-pipeline.d.ts +4 -4
- package/dist/core/context-pipeline.js +4 -4
- package/dist/core/context-pipeline.js.map +1 -1
- package/dist/core/default-tool-surface.d.ts.map +1 -1
- package/dist/core/default-tool-surface.js +1 -2
- package/dist/core/default-tool-surface.js.map +1 -1
- package/dist/core/delegation/session-worker-claim.d.ts +2 -2
- package/dist/core/delegation/session-worker-claim.js +2 -2
- package/dist/core/delegation/session-worker-claim.js.map +1 -1
- package/dist/core/delegation/worker-agent-control-coordinator.js +1 -1
- package/dist/core/delegation/worker-agent-control-coordinator.js.map +1 -1
- package/dist/core/delegation/worker-resource-materializer.js +3 -3
- package/dist/core/delegation/worker-resource-materializer.js.map +1 -1
- package/dist/core/delegation/worker-runner.d.ts +2 -13
- package/dist/core/delegation/worker-runner.d.ts.map +1 -1
- package/dist/core/delegation/worker-runner.js +5 -67
- package/dist/core/delegation/worker-runner.js.map +1 -1
- package/dist/core/extensions/builtin.js +4 -4
- package/dist/core/extensions/builtin.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +6 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +21 -9
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +12 -3
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/foreground-terminal-handoff-controller.js +2 -2
- package/dist/core/foreground-terminal-handoff-controller.js.map +1 -1
- package/dist/core/goals/compact-goal-context.d.ts.map +1 -1
- package/dist/core/goals/compact-goal-context.js +13 -9
- package/dist/core/goals/compact-goal-context.js.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.js +1 -1
- package/dist/core/goals/goal-continuation-prompt.js.map +1 -1
- package/dist/core/human-input-controller.js +1 -1
- package/dist/core/human-input-controller.js.map +1 -1
- package/dist/core/improvement-loop.js +13 -13
- package/dist/core/improvement-loop.js.map +1 -1
- package/dist/core/learning/reflection-engine.d.ts +2 -1
- package/dist/core/learning/reflection-engine.d.ts.map +1 -1
- package/dist/core/learning/reflection-engine.js +4 -24
- package/dist/core/learning/reflection-engine.js.map +1 -1
- package/dist/core/model-capability.d.ts.map +1 -1
- package/dist/core/model-capability.js +1 -1
- package/dist/core/model-capability.js.map +1 -1
- package/dist/core/model-router/route-judge.d.ts +2 -1
- package/dist/core/model-router/route-judge.d.ts.map +1 -1
- package/dist/core/model-router/route-judge.js +4 -12
- package/dist/core/model-router/route-judge.js.map +1 -1
- package/dist/core/models/perf-profile.d.ts +1 -1
- package/dist/core/models/perf-profile.d.ts.map +1 -1
- package/dist/core/models/perf-profile.js +2 -8
- package/dist/core/models/perf-profile.js.map +1 -1
- package/dist/core/orchestration/lane-tool-manifests.d.ts +1 -1
- package/dist/core/orchestration/lane-tool-manifests.d.ts.map +1 -1
- package/dist/core/orchestration/lane-tool-manifests.js +1 -6
- package/dist/core/orchestration/lane-tool-manifests.js.map +1 -1
- package/dist/core/process-matrix/resume-launcher.js +3 -3
- package/dist/core/process-matrix/resume-launcher.js.map +1 -1
- package/dist/core/process-matrix/runtime.d.ts +2 -0
- package/dist/core/process-matrix/runtime.d.ts.map +1 -1
- package/dist/core/process-matrix/runtime.js +23 -19
- package/dist/core/process-matrix/runtime.js.map +1 -1
- package/dist/core/provider-prompt-contracts.d.ts +34 -0
- package/dist/core/provider-prompt-contracts.d.ts.map +1 -0
- package/dist/core/provider-prompt-contracts.js +133 -0
- package/dist/core/provider-prompt-contracts.js.map +1 -0
- package/dist/core/provider-request-context-controller.d.ts +40 -0
- package/dist/core/provider-request-context-controller.d.ts.map +1 -0
- package/dist/core/provider-request-context-controller.js +68 -0
- package/dist/core/provider-request-context-controller.js.map +1 -0
- package/dist/core/provider-request-runtime-controller.d.ts +22 -0
- package/dist/core/provider-request-runtime-controller.d.ts.map +1 -0
- package/dist/core/provider-request-runtime-controller.js +87 -0
- package/dist/core/provider-request-runtime-controller.js.map +1 -0
- package/dist/core/provider-tool-text.d.ts +7 -0
- package/dist/core/provider-tool-text.d.ts.map +1 -0
- package/dist/core/provider-tool-text.js +42 -0
- package/dist/core/provider-tool-text.js.map +1 -0
- package/dist/core/research/model-fitness.d.ts +2 -5
- package/dist/core/research/model-fitness.d.ts.map +1 -1
- package/dist/core/research/model-fitness.js +2 -20
- package/dist/core/research/model-fitness.js.map +1 -1
- package/dist/core/research/research-runner.d.ts +2 -1
- package/dist/core/research/research-runner.d.ts.map +1 -1
- package/dist/core/research/research-runner.js +6 -21
- package/dist/core/research/research-runner.js.map +1 -1
- package/dist/core/risk-classifier.d.ts.map +1 -1
- package/dist/core/risk-classifier.js +9 -1
- package/dist/core/risk-classifier.js.map +1 -1
- package/dist/core/runtime-builder.d.ts +3 -0
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +20 -25
- package/dist/core/runtime-builder.js.map +1 -1
- package/dist/core/scout-controller.d.ts +2 -1
- package/dist/core/scout-controller.d.ts.map +1 -1
- package/dist/core/scout-controller.js +2 -16
- package/dist/core/scout-controller.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/secrets/credential-exposure-guard.js +6 -6
- package/dist/core/secrets/credential-exposure-guard.js.map +1 -1
- package/dist/core/secrets/credential-manager.d.ts +11 -1
- package/dist/core/secrets/credential-manager.d.ts.map +1 -1
- package/dist/core/secrets/credential-manager.js +28 -7
- package/dist/core/secrets/credential-manager.js.map +1 -1
- package/dist/core/secrets/credential-migration-source.d.ts +20 -0
- package/dist/core/secrets/credential-migration-source.d.ts.map +1 -0
- package/dist/core/secrets/credential-migration-source.js +113 -0
- package/dist/core/secrets/credential-migration-source.js.map +1 -0
- package/dist/core/secrets/credential-session-connection.d.ts +9 -0
- package/dist/core/secrets/credential-session-connection.d.ts.map +1 -0
- package/dist/core/secrets/credential-session-connection.js +39 -0
- package/dist/core/secrets/credential-session-connection.js.map +1 -0
- package/dist/core/security/untrusted-boundary.d.ts +2 -2
- package/dist/core/security/untrusted-boundary.d.ts.map +1 -1
- package/dist/core/security/untrusted-boundary.js +3 -10
- package/dist/core/security/untrusted-boundary.js.map +1 -1
- package/dist/core/session-role.d.ts.map +1 -1
- package/dist/core/session-role.js +1 -2
- package/dist/core/session-role.js.map +1 -1
- package/dist/core/skill-vault.d.ts +98 -0
- package/dist/core/skill-vault.d.ts.map +1 -0
- package/dist/core/skill-vault.js +270 -0
- package/dist/core/skill-vault.js.map +1 -0
- package/dist/core/skills.d.ts +10 -9
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +42 -50
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +1 -1
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.js +20 -60
- package/dist/core/system-prompt-builder.js.map +1 -1
- package/dist/core/system-prompt.d.ts +4 -4
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +87 -121
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tasks/task-state.d.ts.map +1 -1
- package/dist/core/tasks/task-state.js +6 -7
- package/dist/core/tasks/task-state.js.map +1 -1
- package/dist/core/tool-capability-policy.d.ts.map +1 -1
- package/dist/core/tool-capability-policy.js +2 -1
- package/dist/core/tool-capability-policy.js.map +1 -1
- package/dist/core/tool-protocol-controller.d.ts.map +1 -1
- package/dist/core/tool-protocol-controller.js +4 -7
- package/dist/core/tool-protocol-controller.js.map +1 -1
- package/dist/core/tool-selection/promotion.d.ts.map +1 -1
- package/dist/core/tool-selection/promotion.js +2 -6
- package/dist/core/tool-selection/promotion.js.map +1 -1
- package/dist/core/toolkit/reflex-interpreter.d.ts +2 -1
- package/dist/core/toolkit/reflex-interpreter.d.ts.map +1 -1
- package/dist/core/toolkit/reflex-interpreter.js +2 -14
- package/dist/core/toolkit/reflex-interpreter.js.map +1 -1
- package/dist/core/tools/ask-question.js +6 -6
- package/dist/core/tools/ask-question.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +8 -7
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/delegate-status.d.ts +17 -13
- package/dist/core/tools/delegate-status.d.ts.map +1 -1
- package/dist/core/tools/delegate-status.js +111 -226
- package/dist/core/tools/delegate-status.js.map +1 -1
- package/dist/core/tools/delegate.d.ts +29 -2
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +149 -48
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/edit.d.ts +4 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +34 -3
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/extensionify-runtime.js +4 -4
- package/dist/core/tools/extensionify-runtime.js.map +1 -1
- package/dist/core/tools/file-failure-recovery.d.ts +17 -0
- package/dist/core/tools/file-failure-recovery.d.ts.map +1 -0
- package/dist/core/tools/file-failure-recovery.js +43 -0
- package/dist/core/tools/file-failure-recovery.js.map +1 -0
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +2 -4
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/goal.js +3 -3
- package/dist/core/tools/goal.js.map +1 -1
- package/dist/core/tools/grep.js +2 -2
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +2 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +2 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +3 -0
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +14 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/model-fitness.js +4 -4
- package/dist/core/tools/model-fitness.js.map +1 -1
- package/dist/core/tools/profile-writer.d.ts +30 -16
- package/dist/core/tools/profile-writer.d.ts.map +1 -1
- package/dist/core/tools/profile-writer.js +98 -59
- package/dist/core/tools/profile-writer.js.map +1 -1
- package/dist/core/tools/python.js +6 -6
- package/dist/core/tools/python.js.map +1 -1
- package/dist/core/tools/read.d.ts +3 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +17 -0
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/run-process.js +4 -4
- package/dist/core/tools/run-process.js.map +1 -1
- package/dist/core/tools/run-toolkit-script.js +4 -4
- package/dist/core/tools/run-toolkit-script.js.map +1 -1
- package/dist/core/tools/secret-store.d.ts +32 -3
- package/dist/core/tools/secret-store.d.ts.map +1 -1
- package/dist/core/tools/secret-store.js +141 -34
- package/dist/core/tools/secret-store.js.map +1 -1
- package/dist/core/tools/skill.d.ts +29 -0
- package/dist/core/tools/skill.d.ts.map +1 -0
- package/dist/core/tools/skill.js +79 -0
- package/dist/core/tools/skill.js.map +1 -0
- package/dist/core/tools/task-steps.js +4 -4
- package/dist/core/tools/task-steps.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +4 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/worktree-sync.js +6 -6
- package/dist/core/tools/worktree-sync.js.map +1 -1
- package/dist/core/tools/write.d.ts +4 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +39 -3
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/interactive-event-controller.js +1 -1
- package/dist/modes/interactive/interactive-event-controller.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/report-commands.js +1 -1
- package/dist/modes/interactive/report-commands.js.map +1 -1
- package/dist/modes/interactive/secret-menu-controller.d.ts.map +1 -1
- package/dist/modes/interactive/secret-menu-controller.js +2 -18
- package/dist/modes/interactive/secret-menu-controller.js.map +1 -1
- package/dist/modes/interactive/session-flow-commands.js +1 -1
- package/dist/modes/interactive/session-flow-commands.js.map +1 -1
- package/docs/compaction.md +45 -25
- package/docs/extensions.md +23 -7
- package/docs/settings.md +3 -3
- package/docs/skills.md +14 -10
- package/docs/task-steps.md +2 -2
- package/docs/tmux-agent-manager.md +1 -1
- package/docs/tool-repair.md +18 -1
- package/docs/usage.md +4 -2
- package/docs/worker-profiles.md +3 -3
- package/docs/worktree-sync.md +2 -2
- package/examples/extensions/custom-compaction.ts +5 -17
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/summarize.ts +3 -5
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/04-skills.ts +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
- package/dist/core/util/json-size.d.ts +0 -3
- package/dist/core/util/json-size.d.ts.map +0 -1
- package/dist/core/util/json-size.js +0 -95
- package/dist/core/util/json-size.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../../src/core/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAA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AAS,EAAE,OAAO,CAAC,SAAS,EAAE,EAC5D,KAAK,EACL,SAAS,CAAC,KAAK,EACf,OAAO,CAAC,GAAG,CACX,CACD,CAAC;YACF,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO;YAC5C,MAAM,MAAM,GAAG,iBAAiB,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;YACjF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACb,MAAM,SAAS,GAAI,OAAO,CAAC,aAAuC,IAAI,IAAI,SAAS,EAAE,CAAC;gBACtF,SAAS,CAAC,KAAK,EAAE,CAAC;gBAClB,OAAO,SAAS,CAAC;YAClB,CAAC;YACD,MAAM,IAAI,GAAI,OAAO,CAAC,aAAkC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/E,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,OAA0B;IACtE,OAAO,kBAAkB,CAAC,yBAAyB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { mkdir as fsMkdir, writeFile as fsWriteFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport type { AgentTool } from \"@caupulican/pi-agent-core\";\nimport { Container, Text } from \"@caupulican/pi-tui\";\nimport { type Static, Type } from \"typebox\";\nimport { keyHint } from \"../../modes/interactive/components/keybinding-hints.ts\";\nimport { getLanguageFromPath, highlightCode, type Theme } from \"../../modes/interactive/theme/theme.ts\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.ts\";\nimport {\n\ttype FileContentReference,\n\tFileMutationIntentController,\n\tFileMutationPreflightError,\n} from \"./file-mutation-intent.ts\";\nimport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nimport { resolveToCwd } from \"./path-utils.ts\";\nimport { normalizeDisplayText, renderToolPath, replaceTabs, str } from \"./render-utils.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\n\nconst writePathSchema = Type.String({ minLength: 1 });\nconst writeSchema = Type.Union([\n\tType.Object(\n\t\t{\n\t\t\tpath: writePathSchema,\n\t\t\tcontent: Type.String(),\n\t\t},\n\t\t{ additionalProperties: false },\n\t),\n\tType.Object(\n\t\t{\n\t\t\tpath: writePathSchema,\n\t\t\tcontentRef: Type.String({ minLength: 1 }),\n\t\t},\n\t\t{ additionalProperties: false },\n\t),\n\tType.Object(\n\t\t{\n\t\t\tpath: writePathSchema,\n\t\t\tpayloadRef: Type.String({ minLength: 1 }),\n\t\t},\n\t\t{ additionalProperties: false },\n\t),\n]);\n\nexport type WriteToolInput = Static<typeof writeSchema>;\n\n/**\n * Pluggable operations for the write tool.\n * Override these to delegate file writing to remote systems (for example SSH).\n */\nexport interface WriteOperations {\n\t/** Atomically create a new file and fail if any entry already occupies the path. */\n\tcreateFile: (absolutePath: string, content: string) => Promise<void>;\n\t/** Create directory recursively */\n\tmkdir: (dir: string) => Promise<void>;\n}\n\nconst defaultWriteOperations: WriteOperations = {\n\tcreateFile: (path, content) => fsWriteFile(path, content, { encoding: \"utf-8\", flag: \"wx\" }),\n\tmkdir: (dir) => fsMkdir(dir, { recursive: true }).then(() => {}),\n};\n\nexport interface WriteToolOptions {\n\t/** Custom operations for file writing. Default: local filesystem */\n\toperations?: WriteOperations;\n\t/** Session-owned harness preflight and exact-content-reference authority. */\n\tintentController?: FileMutationIntentController;\n}\n\nexport interface WriteToolDetails {\n\tphase: \"written\";\n\tcontentRef?: string;\n\tbyteCount?: number;\n}\n\ntype WriteHighlightCache = {\n\targsRef: unknown;\n\trawPath: string | null;\n\tcountCompleteLines: boolean;\n\texpanded: boolean;\n\trenderedLines: string[];\n\ttotalLines?: number;\n\tcappedByCharacters: boolean;\n\tcappedByLines: boolean;\n};\n\nclass WriteCallRenderComponent extends Text {\n\tcache?: WriteHighlightCache;\n\n\tconstructor() {\n\t\tsuper(\"\", 0, 0);\n\t}\n}\n\nconst WRITE_COLLAPSED_PREVIEW_LINES = 10;\nconst WRITE_COLLAPSED_PREVIEW_CHARS = 8_192;\n\nfunction countWriteDisplayLines(fileContent: string): number {\n\tlet lastContentIndex = fileContent.length - 1;\n\twhile (lastContentIndex >= 0) {\n\t\tconst code = fileContent.charCodeAt(lastContentIndex);\n\t\tif (code !== 10 && code !== 13) break;\n\t\tlastContentIndex--;\n\t}\n\tif (lastContentIndex < 0) return 0;\n\n\tlet lines = 1;\n\tfor (let i = 0; i <= lastContentIndex; i++) {\n\t\tif (fileContent.charCodeAt(i) === 10) lines++;\n\t}\n\treturn lines;\n}\n\nfunction trimTrailingEmptyLines(lines: string[]): string[] {\n\tlet end = lines.length;\n\twhile (end > 0 && lines[end - 1] === \"\") {\n\t\tend--;\n\t}\n\treturn lines.slice(0, end);\n}\n\nfunction buildCollapsedWriteSource(fileContent: string): {\n\tsource: string;\n\tcappedByCharacters: boolean;\n\tcappedByLines: boolean;\n} {\n\tconst rawPrefix = fileContent.slice(0, WRITE_COLLAPSED_PREVIEW_CHARS);\n\tconst normalizedPrefix = replaceTabs(normalizeDisplayText(rawPrefix));\n\tlet end = normalizedPrefix.length;\n\tlet newlineCount = 0;\n\tfor (let i = 0; i < normalizedPrefix.length; i++) {\n\t\tif (normalizedPrefix.charCodeAt(i) !== 10) continue;\n\t\tnewlineCount++;\n\t\tif (newlineCount === WRITE_COLLAPSED_PREVIEW_LINES) {\n\t\t\tend = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tconst cappedByLines = end < normalizedPrefix.length;\n\treturn {\n\t\tsource: normalizedPrefix.slice(0, end),\n\t\tcappedByCharacters: !cappedByLines && rawPrefix.length < fileContent.length,\n\t\tcappedByLines,\n\t};\n}\n\nfunction buildWriteHighlightCache(\n\targsRef: unknown,\n\trawPath: string | null,\n\tfileContent: string,\n\tcountCompleteLines: boolean,\n\texpanded: boolean,\n): WriteHighlightCache {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (expanded) {\n\t\tconst source = replaceTabs(normalizeDisplayText(fileContent));\n\t\tconst renderedLines = trimTrailingEmptyLines(lang ? highlightCode(source, lang) : source.split(\"\\n\"));\n\t\treturn {\n\t\t\targsRef,\n\t\t\trawPath,\n\t\t\tcountCompleteLines,\n\t\t\texpanded,\n\t\t\trenderedLines,\n\t\t\ttotalLines: renderedLines.length,\n\t\t\tcappedByCharacters: false,\n\t\t\tcappedByLines: false,\n\t\t};\n\t}\n\n\tconst preview = buildCollapsedWriteSource(fileContent);\n\tconst renderedLines = trimTrailingEmptyLines(\n\t\tlang ? highlightCode(preview.source, lang) : preview.source.split(\"\\n\"),\n\t);\n\treturn {\n\t\targsRef,\n\t\trawPath,\n\t\tcountCompleteLines,\n\t\texpanded,\n\t\trenderedLines,\n\t\ttotalLines: countCompleteLines ? countWriteDisplayLines(fileContent) : undefined,\n\t\tcappedByCharacters: preview.cappedByCharacters,\n\t\tcappedByLines: preview.cappedByLines,\n\t};\n}\n\nfunction getWriteHighlightCache(\n\tcache: WriteHighlightCache | undefined,\n\targsRef: unknown,\n\trawPath: string | null,\n\tfileContent: string,\n\tcountCompleteLines: boolean,\n\texpanded: boolean,\n): WriteHighlightCache {\n\tif (\n\t\tcache &&\n\t\tcache.argsRef === argsRef &&\n\t\tcache.rawPath === rawPath &&\n\t\tcache.countCompleteLines === countCompleteLines &&\n\t\tcache.expanded === expanded\n\t) {\n\t\treturn cache;\n\t}\n\treturn buildWriteHighlightCache(argsRef, rawPath, fileContent, countCompleteLines, expanded);\n}\n\nfunction formatWriteCall(\n\targs: { path?: string; file_path?: string; content?: string; contentRef?: string; payloadRef?: string } | undefined,\n\toptions: ToolRenderResultOptions,\n\ttheme: Theme,\n\tcache: WriteHighlightCache | undefined,\n\tcwd: string,\n): string {\n\tconst rawPath = str(args?.file_path ?? args?.path);\n\tconst fileContent = str(args?.content);\n\tconst hasContent = typeof args?.content === \"string\";\n\tconst pathDisplay = renderToolPath(rawPath, theme, cwd);\n\tlet text = `${theme.fg(\"toolTitle\", theme.bold(\"write\"))} ${pathDisplay}`;\n\n\tif (!hasContent && typeof args?.contentRef !== \"string\" && typeof args?.payloadRef !== \"string\") {\n\t\ttext += `\\n\\n${theme.fg(\"error\", \"[invalid content arg - expected string]\")}`;\n\t} else if (hasContent && fileContent) {\n\t\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\t\tconst displayLines = cache?.renderedLines ?? [];\n\t\ttext += `\\n\\n${displayLines.map((line) => (lang ? line : theme.fg(\"toolOutput\", replaceTabs(line)))).join(\"\\n\")}`;\n\t\tif (!options.expanded && cache && (cache.cappedByCharacters || cache.cappedByLines)) {\n\t\t\tconst total = cache.totalLines;\n\t\t\tif (cache.cappedByCharacters) {\n\t\t\t\tconst totalSuffix = total === undefined ? \"\" : `; ${total} total line${total === 1 ? \"\" : \"s\"}`;\n\t\t\t\ttext += `${theme.fg(\"muted\", `\\n... (preview capped at ${WRITE_COLLAPSED_PREVIEW_CHARS} characters${totalSuffix},`)} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t\t\t} else if (total === undefined) {\n\t\t\t\ttext += `${theme.fg(\"muted\", \"\\n... (preview capped,\")} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t\t\t} else {\n\t\t\t\tconst remaining = Math.max(0, total - displayLines.length);\n\t\t\t\tif (remaining > 0) {\n\t\t\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines, ${total} total,`)} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (args?.contentRef) {\n\t\ttext += `\\n\\n${theme.fg(\"muted\", `reuse ${args.contentRef}`)}`;\n\t} else if (args?.payloadRef) {\n\t\ttext += `\\n\\n${theme.fg(\"muted\", `retarget ${args.payloadRef}`)}`;\n\t}\n\n\treturn text;\n}\n\nasync function writeCollisionWithRetainedPayload(\n\terror: FileMutationPreflightError,\n\tinput: WriteToolInput,\n\tintentController: FileMutationIntentController,\n\tsignal?: AbortSignal,\n): Promise<Error> {\n\tconst retargetError = (reference: string): Error =>\n\t\tnew Error(\n\t\t\t`PI_FILE_MUTATION_RETARGET write_collision: ${reference}. Choose only a corrected path; the exact valid write payload is retained.`,\n\t\t);\n\tif (\"contentRef\" in input) {\n\t\tawait intentController.assertContentReference(input.contentRef, signal);\n\t\treturn retargetError(`contentRef ${input.contentRef}`);\n\t}\n\tif (\"payloadRef\" in input) {\n\t\tawait intentController.assertMutationPayload(input.payloadRef, \"write\", signal);\n\t\treturn retargetError(`payloadRef ${input.payloadRef}`);\n\t}\n\n\ttry {\n\t\tconst retained = await intentController.retainMutationPayload(\"write\", input.content);\n\t\tif (retained) {\n\t\t\treturn retargetError(`payloadRef ${retained.payloadRef}`);\n\t\t}\n\t} catch {\n\t\t// The collision remains authoritative when the bounded retry cache is unavailable.\n\t}\n\treturn new Error(`${error.message} The payload could not be retained within the secure retry-cache bound.`);\n}\n\nfunction formatWriteResult(\n\tresult: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; isError?: boolean },\n\ttheme: Theme,\n): string | undefined {\n\tif (!result.isError) {\n\t\treturn undefined;\n\t}\n\tconst output = result.content\n\t\t.filter((c) => c.type === \"text\")\n\t\t.map((c) => c.text || \"\")\n\t\t.join(\"\\n\");\n\tif (!output) {\n\t\treturn undefined;\n\t}\n\treturn `\\n${theme.fg(\"error\", output)}`;\n}\n\nexport function createWriteToolDefinition(\n\tcwd: string,\n\toptions?: WriteToolOptions,\n): ToolDefinition<typeof writeSchema, WriteToolDetails> {\n\tconst ops = options?.operations ?? defaultWriteOperations;\n\tif (options?.operations && !options.intentController) {\n\t\tthrow new Error(\"Custom write operations require a matching file mutation intent controller.\");\n\t}\n\tconst intentController = options?.intentController ?? new FileMutationIntentController();\n\treturn {\n\t\tname: \"write\",\n\t\tlabel: \"write\",\n\t\tdescription:\n\t\t\t\"Create a new file without overwriting. Send path and exactly one of content or contentRef. After a path-only collision, use the returned payloadRef with only a corrected path. The harness owns preflight, bounded payload retention, and atomic rechecks.\",\n\t\tpromptSnippet: \"Preflight new paths; never overwrite\",\n\t\tpromptGuidelines: [\n\t\t\t\"Call write once with path and exactly one of content or contentRef; preparation and collision checks are harness-owned.\",\n\t\t\t\"If a collision result returns payloadRef, choose a new path and reuse that reference instead of regenerating content.\",\n\t\t\t\"Write is create-only; edit existing files. Reuse contentRef for exact copies.\",\n\t\t],\n\t\tparameters: writeSchema,\n\t\tasync execute(_toolCallId, input: WriteToolInput, signal?: AbortSignal, _onUpdate?, _ctx?) {\n\t\t\tconst { path } = input;\n\t\t\tconst absolutePath = resolveToCwd(path, cwd);\n\t\t\tconst content = \"content\" in input && typeof input.content === \"string\" ? input.content : undefined;\n\t\t\tconst contentRef =\n\t\t\t\t\"contentRef\" in input && typeof input.contentRef === \"string\" ? input.contentRef : undefined;\n\t\t\tconst payloadRef =\n\t\t\t\t\"payloadRef\" in input && typeof input.payloadRef === \"string\" ? input.payloadRef : undefined;\n\t\t\tif ([content, contentRef, payloadRef].filter((value) => value !== undefined).length !== 1) {\n\t\t\t\tthrow new Error(\"Write requires exactly one of content, contentRef, or payloadRef.\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst lease = await intentController.prepare(\"write\", absolutePath, signal, path);\n\t\t\t\treturn await withFileMutationQueue(absolutePath, async () => {\n\t\t\t\t\t// Do not reject from an abort event listener here: that would release the\n\t\t\t\t\t// mutation queue while an in-flight filesystem operation may still finish.\n\t\t\t\t\t// Checking signal.aborted after each await observes the same aborts while\n\t\t\t\t\t// keeping the queue locked until the current operation has settled.\n\t\t\t\t\tconst throwIfAborted = (): void => {\n\t\t\t\t\t\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n\t\t\t\t\t};\n\n\t\t\t\t\tthrowIfAborted();\n\t\t\t\t\tawait intentController.assertCurrent(lease, signal);\n\t\t\t\t\tawait ops.mkdir(dirname(absolutePath));\n\t\t\t\t\tthrowIfAborted();\n\n\t\t\t\t\tlet contentReference: FileContentReference;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (content !== undefined) {\n\t\t\t\t\t\t\tawait ops.createFile(absolutePath, content);\n\t\t\t\t\t\t\tcontentReference = intentController.rememberContent(absolutePath, content);\n\t\t\t\t\t\t} else if (contentRef !== undefined) {\n\t\t\t\t\t\t\tcontentReference = await intentController.copyReferencedContent(contentRef, absolutePath, signal);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (payloadRef === undefined) throw new Error(\"Write requires a payload reference.\");\n\t\t\t\t\t\t\tcontentReference = await intentController.copyMutationPayload(payloadRef, absolutePath, signal);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"EEXIST\") {\n\t\t\t\t\t\t\tthrow new FileMutationPreflightError(\n\t\t\t\t\t\t\t\t\"write_collision\",\n\t\t\t\t\t\t\t\t`Write collision: ${path} already exists; no content was overwritten.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t\tthrowIfAborted();\n\n\t\t\t\t\tconst byteCount = contentReference.byteLength;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: \"text\" as const,\n\t\t\t\t\t\t\t\ttext: `Successfully wrote ${byteCount} bytes to ${path}; this write is complete, so do not call write again for this path. To copy these exact bytes to a different new path, call write once for that path with contentRef ${contentReference.contentRef}.`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\tphase: \"written\" as const,\n\t\t\t\t\t\t\tcontentRef: contentReference.contentRef,\n\t\t\t\t\t\t\tbyteCount,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof FileMutationPreflightError && error.reason === \"write_collision\") {\n\t\t\t\t\tthrow await writeCollisionWithRetainedPayload(error, input, intentController, signal);\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst renderArgs = args as\n\t\t\t\t| { path?: string; file_path?: string; content?: string; contentRef?: string; payloadRef?: string }\n\t\t\t\t| undefined;\n\t\t\tconst rawPath = str(renderArgs?.file_path ?? renderArgs?.path);\n\t\t\tconst fileContent = str(renderArgs?.content);\n\t\t\tconst component =\n\t\t\t\t(context.lastComponent as WriteCallRenderComponent | undefined) ?? new WriteCallRenderComponent();\n\t\t\tif (fileContent !== null) {\n\t\t\t\tcomponent.cache = getWriteHighlightCache(\n\t\t\t\t\tcomponent.cache,\n\t\t\t\t\targs,\n\t\t\t\t\trawPath,\n\t\t\t\t\tfileContent,\n\t\t\t\t\tcontext.argsComplete && !context.toolGroupSummary,\n\t\t\t\t\tcontext.expanded,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcomponent.cache = undefined;\n\t\t\t}\n\t\t\tcomponent.setText(\n\t\t\t\tformatWriteCall(\n\t\t\t\t\trenderArgs,\n\t\t\t\t\t{ expanded: context.expanded, isPartial: context.isPartial },\n\t\t\t\t\ttheme,\n\t\t\t\t\tcomponent.cache,\n\t\t\t\t\tcontext.cwd,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn component;\n\t\t},\n\t\trenderResult(result, _options, theme, context) {\n\t\t\tconst output = formatWriteResult({ ...result, isError: context.isError }, theme);\n\t\t\tif (!output) {\n\t\t\t\tconst component = (context.lastComponent as Container | undefined) ?? new Container();\n\t\t\t\tcomponent.clear();\n\t\t\t\treturn component;\n\t\t\t}\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(output);\n\t\t\treturn text;\n\t\t},\n\t};\n}\n\nexport function createWriteTool(cwd: string, options?: WriteToolOptions): AgentTool<typeof writeSchema> {\n\treturn wrapToolDefinition(createWriteToolDefinition(cwd, options));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../../src/core/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAkB,uCAAuC,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAc,MAAM,wCAAwC,CAAC;AAExG,OAAO,EACN,gCAAgC,EAEhC,iBAAiB,EACjB,kCAAkC,EAClC,mCAAmC,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEN,4BAA4B,EAC5B,0BAA0B,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AACtD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,C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AAyB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { mkdir as fsMkdir, writeFile as fsWriteFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport { type AgentTool, createAgentToolFailureRecoveryAuthority } from \"@caupulican/pi-agent-core\";\nimport { Container, Text } from \"@caupulican/pi-tui\";\nimport { type Static, Type } from \"typebox\";\nimport { keyHint } from \"../../modes/interactive/components/keybinding-hints.ts\";\nimport { getLanguageFromPath, highlightCode, type Theme } from \"../../modes/interactive/theme/theme.ts\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.ts\";\nimport {\n\tFILE_EXISTS_RECOVERY_TARGET_KIND,\n\ttype FileFailureRecoveryAuthority,\n\tfileRecoveryScope,\n\tselectFileFailureRecoveryAuthority,\n\tWRITE_RETARGET_RECOVERY_TARGET_KIND,\n} from \"./file-failure-recovery.ts\";\nimport {\n\ttype FileContentReference,\n\tFileMutationIntentController,\n\tFileMutationPreflightError,\n} from \"./file-mutation-intent.ts\";\nimport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nimport { resolveToCwd } from \"./path-utils.ts\";\nimport { normalizeDisplayText, renderToolPath, replaceTabs, str } from \"./render-utils.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\n\nconst writePathSchema = Type.String({ minLength: 1 });\nconst writeSchema = Type.Union([\n\tType.Object(\n\t\t{\n\t\t\tpath: writePathSchema,\n\t\t\tcontent: Type.String(),\n\t\t},\n\t\t{ additionalProperties: false },\n\t),\n\tType.Object(\n\t\t{\n\t\t\tpath: writePathSchema,\n\t\t\tcontentRef: Type.String({ minLength: 1 }),\n\t\t},\n\t\t{ additionalProperties: false },\n\t),\n\tType.Object(\n\t\t{\n\t\t\tpath: writePathSchema,\n\t\t\tpayloadRef: Type.String({ minLength: 1 }),\n\t\t},\n\t\t{ additionalProperties: false },\n\t),\n]);\n\nexport type WriteToolInput = Static<typeof writeSchema>;\n\n/**\n * Pluggable operations for the write tool.\n * Override these to delegate file writing to remote systems (for example SSH).\n */\nexport interface WriteOperations {\n\t/** Atomically create a new file and fail if any entry already occupies the path. */\n\tcreateFile: (absolutePath: string, content: string) => Promise<void>;\n\t/** Create directory recursively */\n\tmkdir: (dir: string) => Promise<void>;\n}\n\nconst defaultWriteOperations: WriteOperations = {\n\tcreateFile: (path, content) => fsWriteFile(path, content, { encoding: \"utf-8\", flag: \"wx\" }),\n\tmkdir: (dir) => fsMkdir(dir, { recursive: true }).then(() => {}),\n};\n\nexport interface WriteToolOptions {\n\t/** Custom operations for file writing. Default: local filesystem */\n\toperations?: WriteOperations;\n\t/** Shared backend identity for exact cross-tool recovery with custom operations. */\n\tfailureRecoveryAuthority?: FileFailureRecoveryAuthority;\n\t/** Session-owned harness preflight and exact-content-reference authority. */\n\tintentController?: FileMutationIntentController;\n}\n\nexport interface WriteToolDetails {\n\tphase: \"written\";\n\tcontentRef?: string;\n\tbyteCount?: number;\n}\n\ntype WriteHighlightCache = {\n\targsRef: unknown;\n\trawPath: string | null;\n\tcountCompleteLines: boolean;\n\texpanded: boolean;\n\trenderedLines: string[];\n\ttotalLines?: number;\n\tcappedByCharacters: boolean;\n\tcappedByLines: boolean;\n};\n\nclass WriteCallRenderComponent extends Text {\n\tcache?: WriteHighlightCache;\n\n\tconstructor() {\n\t\tsuper(\"\", 0, 0);\n\t}\n}\n\nconst WRITE_COLLAPSED_PREVIEW_LINES = 10;\nconst WRITE_COLLAPSED_PREVIEW_CHARS = 8_192;\n\nfunction countWriteDisplayLines(fileContent: string): number {\n\tlet lastContentIndex = fileContent.length - 1;\n\twhile (lastContentIndex >= 0) {\n\t\tconst code = fileContent.charCodeAt(lastContentIndex);\n\t\tif (code !== 10 && code !== 13) break;\n\t\tlastContentIndex--;\n\t}\n\tif (lastContentIndex < 0) return 0;\n\n\tlet lines = 1;\n\tfor (let i = 0; i <= lastContentIndex; i++) {\n\t\tif (fileContent.charCodeAt(i) === 10) lines++;\n\t}\n\treturn lines;\n}\n\nfunction trimTrailingEmptyLines(lines: string[]): string[] {\n\tlet end = lines.length;\n\twhile (end > 0 && lines[end - 1] === \"\") {\n\t\tend--;\n\t}\n\treturn lines.slice(0, end);\n}\n\nfunction buildCollapsedWriteSource(fileContent: string): {\n\tsource: string;\n\tcappedByCharacters: boolean;\n\tcappedByLines: boolean;\n} {\n\tconst rawPrefix = fileContent.slice(0, WRITE_COLLAPSED_PREVIEW_CHARS);\n\tconst normalizedPrefix = replaceTabs(normalizeDisplayText(rawPrefix));\n\tlet end = normalizedPrefix.length;\n\tlet newlineCount = 0;\n\tfor (let i = 0; i < normalizedPrefix.length; i++) {\n\t\tif (normalizedPrefix.charCodeAt(i) !== 10) continue;\n\t\tnewlineCount++;\n\t\tif (newlineCount === WRITE_COLLAPSED_PREVIEW_LINES) {\n\t\t\tend = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tconst cappedByLines = end < normalizedPrefix.length;\n\treturn {\n\t\tsource: normalizedPrefix.slice(0, end),\n\t\tcappedByCharacters: !cappedByLines && rawPrefix.length < fileContent.length,\n\t\tcappedByLines,\n\t};\n}\n\nfunction buildWriteHighlightCache(\n\targsRef: unknown,\n\trawPath: string | null,\n\tfileContent: string,\n\tcountCompleteLines: boolean,\n\texpanded: boolean,\n): WriteHighlightCache {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (expanded) {\n\t\tconst source = replaceTabs(normalizeDisplayText(fileContent));\n\t\tconst renderedLines = trimTrailingEmptyLines(lang ? highlightCode(source, lang) : source.split(\"\\n\"));\n\t\treturn {\n\t\t\targsRef,\n\t\t\trawPath,\n\t\t\tcountCompleteLines,\n\t\t\texpanded,\n\t\t\trenderedLines,\n\t\t\ttotalLines: renderedLines.length,\n\t\t\tcappedByCharacters: false,\n\t\t\tcappedByLines: false,\n\t\t};\n\t}\n\n\tconst preview = buildCollapsedWriteSource(fileContent);\n\tconst renderedLines = trimTrailingEmptyLines(\n\t\tlang ? highlightCode(preview.source, lang) : preview.source.split(\"\\n\"),\n\t);\n\treturn {\n\t\targsRef,\n\t\trawPath,\n\t\tcountCompleteLines,\n\t\texpanded,\n\t\trenderedLines,\n\t\ttotalLines: countCompleteLines ? countWriteDisplayLines(fileContent) : undefined,\n\t\tcappedByCharacters: preview.cappedByCharacters,\n\t\tcappedByLines: preview.cappedByLines,\n\t};\n}\n\nfunction getWriteHighlightCache(\n\tcache: WriteHighlightCache | undefined,\n\targsRef: unknown,\n\trawPath: string | null,\n\tfileContent: string,\n\tcountCompleteLines: boolean,\n\texpanded: boolean,\n): WriteHighlightCache {\n\tif (\n\t\tcache &&\n\t\tcache.argsRef === argsRef &&\n\t\tcache.rawPath === rawPath &&\n\t\tcache.countCompleteLines === countCompleteLines &&\n\t\tcache.expanded === expanded\n\t) {\n\t\treturn cache;\n\t}\n\treturn buildWriteHighlightCache(argsRef, rawPath, fileContent, countCompleteLines, expanded);\n}\n\nfunction formatWriteCall(\n\targs: { path?: string; file_path?: string; content?: string; contentRef?: string; payloadRef?: string } | undefined,\n\toptions: ToolRenderResultOptions,\n\ttheme: Theme,\n\tcache: WriteHighlightCache | undefined,\n\tcwd: string,\n): string {\n\tconst rawPath = str(args?.file_path ?? args?.path);\n\tconst fileContent = str(args?.content);\n\tconst hasContent = typeof args?.content === \"string\";\n\tconst pathDisplay = renderToolPath(rawPath, theme, cwd);\n\tlet text = `${theme.fg(\"toolTitle\", theme.bold(\"write\"))} ${pathDisplay}`;\n\n\tif (!hasContent && typeof args?.contentRef !== \"string\" && typeof args?.payloadRef !== \"string\") {\n\t\ttext += `\\n\\n${theme.fg(\"error\", \"[invalid content arg - expected string]\")}`;\n\t} else if (hasContent && fileContent) {\n\t\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\t\tconst displayLines = cache?.renderedLines ?? [];\n\t\ttext += `\\n\\n${displayLines.map((line) => (lang ? line : theme.fg(\"toolOutput\", replaceTabs(line)))).join(\"\\n\")}`;\n\t\tif (!options.expanded && cache && (cache.cappedByCharacters || cache.cappedByLines)) {\n\t\t\tconst total = cache.totalLines;\n\t\t\tif (cache.cappedByCharacters) {\n\t\t\t\tconst totalSuffix = total === undefined ? \"\" : `; ${total} total line${total === 1 ? \"\" : \"s\"}`;\n\t\t\t\ttext += `${theme.fg(\"muted\", `\\n... (preview capped at ${WRITE_COLLAPSED_PREVIEW_CHARS} characters${totalSuffix},`)} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t\t\t} else if (total === undefined) {\n\t\t\t\ttext += `${theme.fg(\"muted\", \"\\n... (preview capped,\")} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t\t\t} else {\n\t\t\t\tconst remaining = Math.max(0, total - displayLines.length);\n\t\t\t\tif (remaining > 0) {\n\t\t\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines, ${total} total,`)} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (args?.contentRef) {\n\t\ttext += `\\n\\n${theme.fg(\"muted\", `reuse ${args.contentRef}`)}`;\n\t} else if (args?.payloadRef) {\n\t\ttext += `\\n\\n${theme.fg(\"muted\", `retarget ${args.payloadRef}`)}`;\n\t}\n\n\treturn text;\n}\n\nasync function writeCollisionWithRetainedPayload(\n\terror: FileMutationPreflightError,\n\tinput: WriteToolInput,\n\tintentController: FileMutationIntentController,\n\tsignal?: AbortSignal,\n): Promise<Error> {\n\tconst retargetError = (reference: string): Error =>\n\t\tnew Error(\n\t\t\t`PI_FILE_MUTATION_RETARGET write_collision: ${reference}. Choose only a corrected path; the exact valid write payload is retained.`,\n\t\t);\n\tif (\"contentRef\" in input) {\n\t\tawait intentController.assertContentReference(input.contentRef, signal);\n\t\treturn retargetError(`contentRef ${input.contentRef}`);\n\t}\n\tif (\"payloadRef\" in input) {\n\t\tawait intentController.assertMutationPayload(input.payloadRef, \"write\", signal);\n\t\treturn retargetError(`payloadRef ${input.payloadRef}`);\n\t}\n\n\ttry {\n\t\tconst retained = await intentController.retainMutationPayload(\"write\", input.content);\n\t\tif (retained) {\n\t\t\treturn retargetError(`payloadRef ${retained.payloadRef}`);\n\t\t}\n\t} catch {\n\t\t// The collision remains authoritative when the bounded retry cache is unavailable.\n\t}\n\treturn new Error(`${error.message} The payload could not be retained within the secure retry-cache bound.`);\n}\n\nfunction formatWriteResult(\n\tresult: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; isError?: boolean },\n\ttheme: Theme,\n): string | undefined {\n\tif (!result.isError) {\n\t\treturn undefined;\n\t}\n\tconst output = result.content\n\t\t.filter((c) => c.type === \"text\")\n\t\t.map((c) => c.text || \"\")\n\t\t.join(\"\\n\");\n\tif (!output) {\n\t\treturn undefined;\n\t}\n\treturn `\\n${theme.fg(\"error\", output)}`;\n}\n\nexport function createWriteToolDefinition(\n\tcwd: string,\n\toptions?: WriteToolOptions,\n): ToolDefinition<typeof writeSchema, WriteToolDetails> {\n\tconst ops = options?.operations ?? defaultWriteOperations;\n\tconst failureRecoveryAuthority = selectFileFailureRecoveryAuthority(\n\t\toptions?.operations !== undefined,\n\t\toptions?.failureRecoveryAuthority,\n\t);\n\tif (options?.operations && !options.intentController) {\n\t\tthrow new Error(\"Custom write operations require a matching file mutation intent controller.\");\n\t}\n\tconst intentController = options?.intentController ?? new FileMutationIntentController();\n\tconst retargetRecoveryAuthority = createAgentToolFailureRecoveryAuthority();\n\treturn {\n\t\tname: \"write\",\n\t\tlabel: \"write\",\n\t\tdescription:\n\t\t\t\"Create a new file without overwriting. Send path and exactly one of content or contentRef. After a path-only collision, use the returned payloadRef with only a corrected path. The harness owns preflight, bounded payload retention, and atomic rechecks.\",\n\t\tpromptSnippet: \"Preflight new paths; never overwrite\",\n\t\tpromptGuidelines: [\n\t\t\t\"Call once: path plus exactly one of content/contentRef; harness owns preparation/collision checks.\",\n\t\t\t\"Collision with payloadRef: choose new path, reuse reference; never regenerate content.\",\n\t\t\t\"write is create-only; edit existing files. Reuse contentRef for exact copies.\",\n\t\t],\n\t\tparameters: writeSchema,\n\t\tfailureRecovery: {\n\t\t\tgetFailureTargets: (params, failure) =>\n\t\t\t\tfailure.failureCode === \"mutation_retarget_required\"\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tauthority: retargetRecoveryAuthority,\n\t\t\t\t\t\t\t\tkind: WRITE_RETARGET_RECOVERY_TARGET_KIND,\n\t\t\t\t\t\t\t\tscope: resolveToCwd(params.path, cwd),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t: [],\n\t\t\tactions: [\n\t\t\t\t{\n\t\t\t\t\tkind: \"correct\",\n\t\t\t\t\tauthority: retargetRecoveryAuthority,\n\t\t\t\t\ttargetKind: WRITE_RETARGET_RECOVERY_TARGET_KIND,\n\t\t\t\t\tinstruction:\n\t\t\t\t\t\t\"Use write with the retained payloadRef and a corrected new path; write cannot overwrite an existing entry.\",\n\t\t\t\t},\n\t\t\t\t...(failureRecoveryAuthority\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkind: \"repair\" as const,\n\t\t\t\t\t\t\t\tauthority: failureRecoveryAuthority.contractAuthority,\n\t\t\t\t\t\t\t\ttargetKind: FILE_EXISTS_RECOVERY_TARGET_KIND,\n\t\t\t\t\t\t\t\tinstruction:\n\t\t\t\t\t\t\t\t\t\"If the goal requires this exact missing file and its content is known, create it with write.\",\n\t\t\t\t\t\t\t\tgetEvidence: (params: WriteToolInput, result: { details: WriteToolDetails }) =>\n\t\t\t\t\t\t\t\t\tresult.details.phase === \"written\"\n\t\t\t\t\t\t\t\t\t\t? [fileRecoveryScope(failureRecoveryAuthority, params.path, cwd)]\n\t\t\t\t\t\t\t\t\t\t: [],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t: []),\n\t\t\t],\n\t\t},\n\t\tasync execute(_toolCallId, input: WriteToolInput, signal?: AbortSignal, _onUpdate?, _ctx?) {\n\t\t\tconst { path } = input;\n\t\t\tconst absolutePath = resolveToCwd(path, cwd);\n\t\t\tconst content = \"content\" in input && typeof input.content === \"string\" ? input.content : undefined;\n\t\t\tconst contentRef =\n\t\t\t\t\"contentRef\" in input && typeof input.contentRef === \"string\" ? input.contentRef : undefined;\n\t\t\tconst payloadRef =\n\t\t\t\t\"payloadRef\" in input && typeof input.payloadRef === \"string\" ? input.payloadRef : undefined;\n\t\t\tif ([content, contentRef, payloadRef].filter((value) => value !== undefined).length !== 1) {\n\t\t\t\tthrow new Error(\"Write requires exactly one of content, contentRef, or payloadRef.\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst lease = await intentController.prepare(\"write\", absolutePath, signal, path);\n\t\t\t\treturn await withFileMutationQueue(absolutePath, async () => {\n\t\t\t\t\t// Do not reject from an abort event listener here: that would release the\n\t\t\t\t\t// mutation queue while an in-flight filesystem operation may still finish.\n\t\t\t\t\t// Checking signal.aborted after each await observes the same aborts while\n\t\t\t\t\t// keeping the queue locked until the current operation has settled.\n\t\t\t\t\tconst throwIfAborted = (): void => {\n\t\t\t\t\t\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n\t\t\t\t\t};\n\n\t\t\t\t\tthrowIfAborted();\n\t\t\t\t\tawait intentController.assertCurrent(lease, signal);\n\t\t\t\t\tawait ops.mkdir(dirname(absolutePath));\n\t\t\t\t\tthrowIfAborted();\n\n\t\t\t\t\tlet contentReference: FileContentReference;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (content !== undefined) {\n\t\t\t\t\t\t\tawait ops.createFile(absolutePath, content);\n\t\t\t\t\t\t\tcontentReference = intentController.rememberContent(absolutePath, content);\n\t\t\t\t\t\t} else if (contentRef !== undefined) {\n\t\t\t\t\t\t\tcontentReference = await intentController.copyReferencedContent(contentRef, absolutePath, signal);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (payloadRef === undefined) throw new Error(\"Write requires a payload reference.\");\n\t\t\t\t\t\t\tcontentReference = await intentController.copyMutationPayload(payloadRef, absolutePath, signal);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"EEXIST\") {\n\t\t\t\t\t\t\tthrow new FileMutationPreflightError(\n\t\t\t\t\t\t\t\t\"write_collision\",\n\t\t\t\t\t\t\t\t`Write collision: ${path} already exists; no content was overwritten.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t\tthrowIfAborted();\n\n\t\t\t\t\tconst byteCount = contentReference.byteLength;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: \"text\" as const,\n\t\t\t\t\t\t\t\ttext: `Successfully wrote ${byteCount} bytes to ${path}; this write is complete, so do not call write again for this path. To copy these exact bytes to a different new path, call write once for that path with contentRef ${contentReference.contentRef}.`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\tphase: \"written\" as const,\n\t\t\t\t\t\t\tcontentRef: contentReference.contentRef,\n\t\t\t\t\t\t\tbyteCount,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof FileMutationPreflightError && error.reason === \"write_collision\") {\n\t\t\t\t\tthrow await writeCollisionWithRetainedPayload(error, input, intentController, signal);\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst renderArgs = args as\n\t\t\t\t| { path?: string; file_path?: string; content?: string; contentRef?: string; payloadRef?: string }\n\t\t\t\t| undefined;\n\t\t\tconst rawPath = str(renderArgs?.file_path ?? renderArgs?.path);\n\t\t\tconst fileContent = str(renderArgs?.content);\n\t\t\tconst component =\n\t\t\t\t(context.lastComponent as WriteCallRenderComponent | undefined) ?? new WriteCallRenderComponent();\n\t\t\tif (fileContent !== null) {\n\t\t\t\tcomponent.cache = getWriteHighlightCache(\n\t\t\t\t\tcomponent.cache,\n\t\t\t\t\targs,\n\t\t\t\t\trawPath,\n\t\t\t\t\tfileContent,\n\t\t\t\t\tcontext.argsComplete && !context.toolGroupSummary,\n\t\t\t\t\tcontext.expanded,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcomponent.cache = undefined;\n\t\t\t}\n\t\t\tcomponent.setText(\n\t\t\t\tformatWriteCall(\n\t\t\t\t\trenderArgs,\n\t\t\t\t\t{ expanded: context.expanded, isPartial: context.isPartial },\n\t\t\t\t\ttheme,\n\t\t\t\t\tcomponent.cache,\n\t\t\t\t\tcontext.cwd,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn component;\n\t\t},\n\t\trenderResult(result, _options, theme, context) {\n\t\t\tconst output = formatWriteResult({ ...result, isError: context.isError }, theme);\n\t\t\tif (!output) {\n\t\t\t\tconst component = (context.lastComponent as Container | undefined) ?? new Container();\n\t\t\t\tcomponent.clear();\n\t\t\t\treturn component;\n\t\t\t}\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(output);\n\t\t\treturn text;\n\t\t},\n\t};\n}\n\nexport function createWriteTool(cwd: string, options?: WriteToolOptions): AgentTool<typeof writeSchema> {\n\treturn wrapToolDefinition(createWriteToolDefinition(cwd, options));\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { getAgentDir, VERSION } from "./config.ts";
|
|
|
5
5
|
export { AgentSession, type AgentSessionConfig, type AgentSessionEvent, type AgentSessionEventListener, type ModelCycleResult, type ParsedSkillBlock, type PromptOptions, parseSkillBlock, type SessionStats, } from "./core/agent-session.ts";
|
|
6
6
|
export { type ApiKeyCredential, type AuthCredential, type AuthStatus, AuthStorage, type AuthStorageBackend, FileAuthStorageBackend, InMemoryAuthStorageBackend, type OAuthCredential, } from "./core/auth-storage.ts";
|
|
7
7
|
export { createEventBus, type EventBus, type EventBusController } from "./core/event-bus.ts";
|
|
8
|
-
export type { AgentEndEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BuildSystemPromptOptions, CompactOptions, ContextEvent, ContextUsage, CustomToolCallEvent, EditToolCallEvent, ExecOptions, ExecResult, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionStorage, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetOptions, ExtensionWorkRunOptions, FindToolCallEvent, GrepToolCallEvent, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MessageEndEvent, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ProviderConfig, ProviderModelConfig, ReadToolCallEvent, RegisteredCommand, RegisteredTool, ResolvedCommand, SessionBeforeCompactEvent, SessionBeforeForkEvent, SessionBeforeSwitchEvent, SessionBeforeTreeEvent, SessionCompactEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolInfo, ToolRenderResultOptions, ToolResultEvent, TurnEndEvent, TurnStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
8
|
+
export type { AgentEndEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BuildSystemPromptOptions, CompactOptions, ContextEvent, ContextEventResult, ContextUsage, CustomToolCallEvent, EditToolCallEvent, ExecOptions, ExecResult, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionStorage, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetOptions, ExtensionWorkRunOptions, FindToolCallEvent, GrepToolCallEvent, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MessageEndEvent, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ProviderConfig, ProviderModelConfig, ReadToolCallEvent, RegisteredCommand, RegisteredTool, ResolvedCommand, SessionBeforeCompactEvent, SessionBeforeForkEvent, SessionBeforeSwitchEvent, SessionBeforeTreeEvent, SessionCompactEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolInfo, ToolRenderResultOptions, ToolResultEvent, TurnEndEvent, TurnStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
9
9
|
export { defineTool, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.ts";
|
|
10
10
|
export { createExtensionRuntime, discoverAndLoadExtensions } from "./core/extensions/loader.ts";
|
|
11
11
|
export type { ReadonlyFooterDataProvider } from "./core/footer-data-provider.ts";
|
|
@@ -29,12 +29,15 @@ export { mergeResourceProfileMap, mergeResourceProfileSettings, parseResourcePro
|
|
|
29
29
|
export { AgentSessionRuntime, type AgentSessionRuntimeDiagnostic, type AgentSessionRuntimeResource, type AgentSessionServices, type AgentSessionSwitchOptions, type CreateAgentSessionFromServicesOptions, type CreateAgentSessionOptions, type CreateAgentSessionResult, type CreateAgentSessionRuntimeFactory, type CreateAgentSessionRuntimeResult, type CreateAgentSessionServicesOptions, createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashTool, createCodingTools, createEditTool, createFindTool, createGrepTool, createLsTool, createReadOnlyTools, createReadTool, createWriteTool, type PromptTemplate, SessionReplacementCallbackError, SessionReplacementRuntimeError, } from "./core/sdk.ts";
|
|
30
30
|
export { BitwardenCredentialStorage, BitwardenCredentialStorageError, type BitwardenCredentialStorageErrorCode, type BitwardenCredentialStorageOptions, } from "./core/secrets/bitwarden-credential-storage.ts";
|
|
31
31
|
export { type CredentialActivationResult, type CredentialConnectionStatus, CredentialManager, CredentialManagerError, type CredentialManagerErrorCode, type CredentialManagerOptions, type CredentialMutationResult, type CredentialProfileRecord, type CredentialProfileStorage, type CredentialProfileSummary, type CredentialProjectIdentity, type CredentialProjectResolver, CredentialStorageError, type CredentialStorageErrorCode, type CredentialVariable, type StoredCredentialProfileSummary, } from "./core/secrets/credential-manager.ts";
|
|
32
|
+
export { type CredentialMigrationSource, CredentialMigrationSourceError, type CredentialMigrationSourceErrorCode, type CredentialMigrationSourceResolver, resolveCredentialMigrationSources, } from "./core/secrets/credential-migration-source.ts";
|
|
32
33
|
export { createPortableGitProjectKey, resolveCredentialProject } from "./core/secrets/credential-project.ts";
|
|
33
34
|
export { type CompactionSettings, type DirectoryResourceProfileInfo, getDirectoryResourceProfileInfo, type ImageSettings, matchesResourceProfilePattern, type PackageSource, type ResourceProfileFilterSettings, type ResourceProfileKind, type ResourceProfileSettings, type RetrySettings, SettingsManager, type SettingsManagerCreateOptions, } from "./core/settings-manager.ts";
|
|
34
|
-
export {
|
|
35
|
+
export { ACTIVE_SKILL_CONTEXT_CUSTOM_TYPE, DEFAULT_SKILL_IDLE_TIMEOUT_MS, MAX_ACTIVE_SKILL_BODY_BYTES, MIN_ACTIVE_SKILL_BODY_BYTES, resolveActiveSkillBodyByteLimit, type SkillLoadResult, type SkillSearchResult, SkillVaultController, type SkillVaultControllerOptions, type SkillVaultStatus, } from "./core/skill-vault.ts";
|
|
36
|
+
export { type LoadSkillsFromDirOptions, type LoadSkillsResult, loadSkills, loadSkillsFromDir, MAX_SKILL_FRONTMATTER_BYTES, readSkillFrontmatterFile, type Skill, type SkillFrontmatter, } from "./core/skills.ts";
|
|
35
37
|
export { createSyntheticSourceInfo } from "./core/source-info.ts";
|
|
36
38
|
export { type AskQuestion, type AskQuestionAnswer, AskQuestionDialog, type AskQuestionStopReason, type AskQuestionToolDetails, type AskQuestionToolInput, type AskQuestionToolOptions, createAskQuestionToolDefinition, } from "./core/tools/ask-question.ts";
|
|
37
|
-
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createSecretStoreToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FileContentReference, FileMutationIntentController, type FileMutationIntentControllerOptions, type FileMutationIntentOperations, type FileMutationKind, type FileMutationLease, type FileMutationPayloadReference, FileMutationPreflightError, type FileMutationPreflightFailureReason, type FilePathIdentity, type FilePathInspection, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type SecretStoreStatus, type SecretStoreToolDetails, type SecretStoreToolInput, type SecretStoreToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolDetails, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
|
|
39
|
+
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFileFailureRecoveryAuthority, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createSecretStoreToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FileContentReference, type FileFailureRecoveryAuthority, FileMutationIntentController, type FileMutationIntentControllerOptions, type FileMutationIntentOperations, type FileMutationKind, type FileMutationLease, type FileMutationPayloadReference, FileMutationPreflightError, type FileMutationPreflightFailureReason, type FilePathIdentity, type FilePathInspection, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type SecretStoreStatus, type SecretStoreToolDetails, type SecretStoreToolInput, type SecretStoreToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolDetails, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
|
|
40
|
+
export { createSkillVaultToolDefinition, type SkillToolDetails, type SkillToolInput, } from "./core/tools/skill.ts";
|
|
38
41
|
export { jaccard, runSkillAudit, type SkillAuditReport, type SkillSummary, tokenize, } from "./core/tools/skill-audit.ts";
|
|
39
42
|
export { hasProjectTrustInputs, type ProjectTrustDecision, ProjectTrustStore } from "./core/trust-manager.ts";
|
|
40
43
|
export { type MainOptions, main } from "./main.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,uBAAuB,EACvB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,YAAY,EACZ,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,cAAc,EACd,KAAK,mBAAmB,EACxB,qBAAqB,EACrB,aAAa,EACb,KAAK,wBAAwB,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,eAAe,EACf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A4B,GACjC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,uBAAuB,EACvB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,YAAY,EACZ,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,cAAc,EACd,KAAK,mBAAmB,EACxB,qBAAqB,EACrB,aAAa,EACb,KAAK,wBAAwB,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,eAAe,EACf,KAAK,YAAY,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACN,KAAK,gBA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AAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACN,KAAK,qBAAqB,EAC1B,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,YAAY,GACjB,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -34,14 +34,17 @@ createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, c
|
|
|
34
34
|
createCodingTools, createEditTool, createFindTool, createGrepTool, createLsTool, createReadOnlyTools, createReadTool, createWriteTool, SessionReplacementCallbackError, SessionReplacementRuntimeError, } from "./core/sdk.js";
|
|
35
35
|
export { BitwardenCredentialStorage, BitwardenCredentialStorageError, } from "./core/secrets/bitwarden-credential-storage.js";
|
|
36
36
|
export { CredentialManager, CredentialManagerError, CredentialStorageError, } from "./core/secrets/credential-manager.js";
|
|
37
|
+
export { CredentialMigrationSourceError, resolveCredentialMigrationSources, } from "./core/secrets/credential-migration-source.js";
|
|
37
38
|
export { createPortableGitProjectKey, resolveCredentialProject } from "./core/secrets/credential-project.js";
|
|
38
39
|
export { getDirectoryResourceProfileInfo, matchesResourceProfilePattern, SettingsManager, } from "./core/settings-manager.js";
|
|
40
|
+
export { ACTIVE_SKILL_CONTEXT_CUSTOM_TYPE, DEFAULT_SKILL_IDLE_TIMEOUT_MS, MAX_ACTIVE_SKILL_BODY_BYTES, MIN_ACTIVE_SKILL_BODY_BYTES, resolveActiveSkillBodyByteLimit, SkillVaultController, } from "./core/skill-vault.js";
|
|
39
41
|
// Skills
|
|
40
|
-
export {
|
|
42
|
+
export { loadSkills, loadSkillsFromDir, MAX_SKILL_FRONTMATTER_BYTES, readSkillFrontmatterFile, } from "./core/skills.js";
|
|
41
43
|
export { createSyntheticSourceInfo } from "./core/source-info.js";
|
|
42
44
|
export { AskQuestionDialog, createAskQuestionToolDefinition, } from "./core/tools/ask-question.js";
|
|
43
45
|
// Tools
|
|
44
|
-
export { createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createSecretStoreToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, FileMutationIntentController, FileMutationPreflightError, formatSize, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
|
|
46
|
+
export { createBashToolDefinition, createEditToolDefinition, createFileFailureRecoveryAuthority, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createSecretStoreToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, FileMutationIntentController, FileMutationPreflightError, formatSize, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
|
|
47
|
+
export { createSkillVaultToolDefinition, } from "./core/tools/skill.js";
|
|
45
48
|
// Skill-audit primitives — exported so extensions (e.g. continuous-learning) can reuse the native
|
|
46
49
|
// Jaccard overlap audit via `import { runSkillAudit } from "@caupulican/pi-adaptative"` instead of
|
|
47
50
|
// carrying a duplicate copy.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,aAAa;AACb,OAAO,EAIN,mBAAmB,EAInB,uBAAuB,EAIvB,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EAGd,YAAY,EACZ,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EAExB,qBAAqB,EAErB,mBAAmB,EACnB,oBAAoB,EAOpB,cAAc,EAEd,qBAAqB,EACrB,aAAa,GAEb,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C;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AAC5C,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAEN,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAGf,MAAM,2BAA2B,CAAC","sourcesContent":["// Core session management\n\nexport { convertToLlm } from \"@caupulican/pi-agent-core\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryEntry,\n\ttype BranchSummaryResult,\n\tbuildSessionContext,\n\ttype CollectEntriesResult,\n\ttype CompactionEntry,\n\ttype CompactionResult,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileEntry,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\tprepareBranchEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\tserializeConversation,\n\tshouldCompact,\n\ttype ThinkingLevelChangeEntry,\n} from \"@caupulican/pi-agent-core/node\";\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport { getAgentDir, VERSION } from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionStorage,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tExtensionWorkRunOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageEndEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tdefineTool,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\nexport { createExtensionRuntime, discoverAndLoadExtensions } from \"./core/extensions/loader.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport {\n\tappendRunRecord,\n\ttype ConfidenceMode,\n\ttype ConfidenceResult,\n\tcleanupImprovementSandbox,\n\tcompareMetric,\n\tcomputeMadConfidence,\n\tcreateImprovementDecisionTool,\n\tcreateImprovementLoopTool,\n\tcreateImprovementSandbox,\n\tdecideImprovement,\n\texportImprovementSandboxPatch,\n\ttype GitStatusEntry,\n\ttype ImprovementDecision,\n\ttype ImprovementDecisionInput,\n\ttype ImprovementDecisionReason,\n\ttype ImprovementDecisionResult,\n\ttype ImprovementLoopConfig,\n\ttype ImprovementLoopExec,\n\ttype ImprovementLoopInitInput,\n\ttype ImprovementLoopPaths,\n\ttype ImprovementLoopRecordInput,\n\ttype ImprovementLoopState,\n\ttype ImprovementLoopStatusInput,\n\ttype ImprovementLoopToolAction,\n\ttype ImprovementLoopToolDetails,\n\ttype ImprovementMeasurementCommandResult,\n\ttype ImprovementMeasurementResult,\n\ttype ImprovementRunRecord,\n\ttype ImprovementSandboxCleanupInput,\n\ttype ImprovementSandboxCreateInput,\n\ttype ImprovementSandboxExportInput,\n\ttype ImprovementSandboxRecord,\n\timprovementLoopPaths,\n\tinitImprovementLoop,\n\ttype LowConfidenceAction,\n\ttype MetricComparison,\n\ttype MetricDirection,\n\tmedian,\n\tmedianAbsoluteDeviation,\n\tmetricMapFromOutput,\n\ttype OwnedDiscardPlan,\n\ttype OwnedDiscardPlanInput,\n\tparseGitPorcelainStatus,\n\tparseMetricLines,\n\tplanOwnedDiscard,\n\treadImprovementLoopState,\n\treadRunRecords,\n\trecordImprovementRun,\n\trunImprovementMeasurement,\n\tselectPrimaryMetric,\n\tserializeRunRecord,\n} from \"./core/improvement-loop.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport * from \"./core/orchestration/capability-gateway.ts\";\nexport * from \"./core/orchestration/contracts.ts\";\nexport * from \"./core/orchestration/event-store.ts\";\nexport * from \"./core/orchestration/model-binding.ts\";\nexport * from \"./core/orchestration/policy-compiler.ts\";\nexport * from \"./core/orchestration/profile-registry.ts\";\nexport * from \"./core/orchestration/profile-store.ts\";\nexport * from \"./core/orchestration/task-runtime.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport { PI_ORCHESTRATION_AGENT_ID_ENV } from \"./core/process-identity.ts\";\nexport {\n\tACTIVE_TURN_TTL_MS,\n\tAUTO_RELOAD_COORDINATOR_TTL_MS,\n\tdescribeReloadSession,\n\tgetPendingReloadBlockers,\n\tgetReloadCoordinationDir,\n\tisReloadSessionProcessAlive,\n\ttype PendingReloadBlockers,\n\ttype ReloadBlockerOptions,\n\ttype ReloadSessionRecord,\n} from \"./core/reload-blockers.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\nexport {\n\tmergeResourceProfileMap,\n\tmergeResourceProfileSettings,\n\tparseResourceProfileBlocks,\n\tparseResourceProfileInput,\n\tparseResourceProfileJson,\n\tstripResourceProfileBlocks,\n} from \"./core/resource-profile-blocks.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionRuntimeResource,\n\ttype AgentSessionServices,\n\ttype AgentSessionSwitchOptions,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n\tSessionReplacementCallbackError,\n\tSessionReplacementRuntimeError,\n} from \"./core/sdk.ts\";\nexport {\n\tBitwardenCredentialStorage,\n\tBitwardenCredentialStorageError,\n\ttype BitwardenCredentialStorageErrorCode,\n\ttype BitwardenCredentialStorageOptions,\n} from \"./core/secrets/bitwarden-credential-storage.ts\";\nexport {\n\ttype CredentialActivationResult,\n\ttype CredentialConnectionStatus,\n\tCredentialManager,\n\tCredentialManagerError,\n\ttype CredentialManagerErrorCode,\n\ttype CredentialManagerOptions,\n\ttype CredentialMutationResult,\n\ttype CredentialProfileRecord,\n\ttype CredentialProfileStorage,\n\ttype CredentialProfileSummary,\n\ttype CredentialProjectIdentity,\n\ttype CredentialProjectResolver,\n\tCredentialStorageError,\n\ttype CredentialStorageErrorCode,\n\ttype CredentialVariable,\n\ttype StoredCredentialProfileSummary,\n} from \"./core/secrets/credential-manager.ts\";\nexport { createPortableGitProjectKey, resolveCredentialProject } from \"./core/secrets/credential-project.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype DirectoryResourceProfileInfo,\n\tgetDirectoryResourceProfileInfo,\n\ttype ImageSettings,\n\tmatchesResourceProfilePattern,\n\ttype PackageSource,\n\ttype ResourceProfileFilterSettings,\n\ttype ResourceProfileKind,\n\ttype ResourceProfileSettings,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport {\n\ttype AskQuestion,\n\ttype AskQuestionAnswer,\n\tAskQuestionDialog,\n\ttype AskQuestionStopReason,\n\ttype AskQuestionToolDetails,\n\ttype AskQuestionToolInput,\n\ttype AskQuestionToolOptions,\n\tcreateAskQuestionToolDefinition,\n} from \"./core/tools/ask-question.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateSecretStoreToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FileContentReference,\n\tFileMutationIntentController,\n\ttype FileMutationIntentControllerOptions,\n\ttype FileMutationIntentOperations,\n\ttype FileMutationKind,\n\ttype FileMutationLease,\n\ttype FileMutationPayloadReference,\n\tFileMutationPreflightError,\n\ttype FileMutationPreflightFailureReason,\n\ttype FilePathIdentity,\n\ttype FilePathInspection,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype SecretStoreStatus,\n\ttype SecretStoreToolDetails,\n\ttype SecretStoreToolInput,\n\ttype SecretStoreToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolDetails,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\n// Skill-audit primitives — exported so extensions (e.g. continuous-learning) can reuse the native\n// Jaccard overlap audit via `import { runSkillAudit } from \"@caupulican/pi-adaptative\"` instead of\n// carrying a duplicate copy.\nexport {\n\tjaccard,\n\trunSkillAudit,\n\ttype SkillAuditReport,\n\ttype SkillSummary,\n\ttokenize,\n} from \"./core/tools/skill-audit.ts\";\nexport { hasProjectTrustInputs, type ProjectTrustDecision, ProjectTrustStore } from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\trenderTitleBadge,\n\trenderToolTitle,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tTitleBadgeComponent,\n\ttype TitleBadgeOptions,\n\ttype TitleBadgeSegment,\n\ttype TitleBadgeStatus,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tToolTitleComponent,\n\ttype ToolTitleOptions,\n\ttype ToolTitleSegment,\n\ttype ToolTitleStatus,\n\tTreeSelectorComponent,\n\ttitleBadge,\n\ttoolTitle,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\nexport {\n\ttype AcquireWorkRunOptions,\n\tacquireWorkRun,\n\tassertPortablePathSegment,\n\tboundedWorkRetention,\n\tcreateWorkRunId,\n\tgetProcessWorkRun,\n\tgetWorkRoot,\n\tgetWorkRunDir,\n\tgetWorkTenantDir,\n\tPI_WORK_ROOT_ENV,\n\tpruneWorkTenant,\n\ttype WorkRetentionOptions,\n\ttype WorkRunLease,\n} from \"./utils/work-directory.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,aAAa;AACb,OAAO,EAIN,mBAAmB,EAInB,uBAAuB,EAIvB,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EAGd,YAAY,EACZ,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,EACZ,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,OAAO,EACP,OAAO,EACP,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EAEtB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EAGxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EAInB,sBAAsB,EAEtB,kBAAkB,EAIlB,qBAAqB,EACrB,UAAU,EACV,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,GAE5B,MAAM,yCAAyC,CAAC;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AAC5C,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAEN,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAGf,MAAM,2BAA2B,CAAC","sourcesContent":["// Core session management\n\nexport { convertToLlm } from \"@caupulican/pi-agent-core\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryEntry,\n\ttype BranchSummaryResult,\n\tbuildSessionContext,\n\ttype CollectEntriesResult,\n\ttype CompactionEntry,\n\ttype CompactionResult,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileEntry,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\tprepareBranchEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\tserializeConversation,\n\tshouldCompact,\n\ttype ThinkingLevelChangeEntry,\n} from \"@caupulican/pi-agent-core/node\";\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport { getAgentDir, VERSION } from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextEventResult,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionStorage,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tExtensionWorkRunOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageEndEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tdefineTool,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\nexport { createExtensionRuntime, discoverAndLoadExtensions } from \"./core/extensions/loader.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport {\n\tappendRunRecord,\n\ttype ConfidenceMode,\n\ttype ConfidenceResult,\n\tcleanupImprovementSandbox,\n\tcompareMetric,\n\tcomputeMadConfidence,\n\tcreateImprovementDecisionTool,\n\tcreateImprovementLoopTool,\n\tcreateImprovementSandbox,\n\tdecideImprovement,\n\texportImprovementSandboxPatch,\n\ttype GitStatusEntry,\n\ttype ImprovementDecision,\n\ttype ImprovementDecisionInput,\n\ttype ImprovementDecisionReason,\n\ttype ImprovementDecisionResult,\n\ttype ImprovementLoopConfig,\n\ttype ImprovementLoopExec,\n\ttype ImprovementLoopInitInput,\n\ttype ImprovementLoopPaths,\n\ttype ImprovementLoopRecordInput,\n\ttype ImprovementLoopState,\n\ttype ImprovementLoopStatusInput,\n\ttype ImprovementLoopToolAction,\n\ttype ImprovementLoopToolDetails,\n\ttype ImprovementMeasurementCommandResult,\n\ttype ImprovementMeasurementResult,\n\ttype ImprovementRunRecord,\n\ttype ImprovementSandboxCleanupInput,\n\ttype ImprovementSandboxCreateInput,\n\ttype ImprovementSandboxExportInput,\n\ttype ImprovementSandboxRecord,\n\timprovementLoopPaths,\n\tinitImprovementLoop,\n\ttype LowConfidenceAction,\n\ttype MetricComparison,\n\ttype MetricDirection,\n\tmedian,\n\tmedianAbsoluteDeviation,\n\tmetricMapFromOutput,\n\ttype OwnedDiscardPlan,\n\ttype OwnedDiscardPlanInput,\n\tparseGitPorcelainStatus,\n\tparseMetricLines,\n\tplanOwnedDiscard,\n\treadImprovementLoopState,\n\treadRunRecords,\n\trecordImprovementRun,\n\trunImprovementMeasurement,\n\tselectPrimaryMetric,\n\tserializeRunRecord,\n} from \"./core/improvement-loop.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport * from \"./core/orchestration/capability-gateway.ts\";\nexport * from \"./core/orchestration/contracts.ts\";\nexport * from \"./core/orchestration/event-store.ts\";\nexport * from \"./core/orchestration/model-binding.ts\";\nexport * from \"./core/orchestration/policy-compiler.ts\";\nexport * from \"./core/orchestration/profile-registry.ts\";\nexport * from \"./core/orchestration/profile-store.ts\";\nexport * from \"./core/orchestration/task-runtime.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport { PI_ORCHESTRATION_AGENT_ID_ENV } from \"./core/process-identity.ts\";\nexport {\n\tACTIVE_TURN_TTL_MS,\n\tAUTO_RELOAD_COORDINATOR_TTL_MS,\n\tdescribeReloadSession,\n\tgetPendingReloadBlockers,\n\tgetReloadCoordinationDir,\n\tisReloadSessionProcessAlive,\n\ttype PendingReloadBlockers,\n\ttype ReloadBlockerOptions,\n\ttype ReloadSessionRecord,\n} from \"./core/reload-blockers.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\nexport {\n\tmergeResourceProfileMap,\n\tmergeResourceProfileSettings,\n\tparseResourceProfileBlocks,\n\tparseResourceProfileInput,\n\tparseResourceProfileJson,\n\tstripResourceProfileBlocks,\n} from \"./core/resource-profile-blocks.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionRuntimeResource,\n\ttype AgentSessionServices,\n\ttype AgentSessionSwitchOptions,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n\tSessionReplacementCallbackError,\n\tSessionReplacementRuntimeError,\n} from \"./core/sdk.ts\";\nexport {\n\tBitwardenCredentialStorage,\n\tBitwardenCredentialStorageError,\n\ttype BitwardenCredentialStorageErrorCode,\n\ttype BitwardenCredentialStorageOptions,\n} from \"./core/secrets/bitwarden-credential-storage.ts\";\nexport {\n\ttype CredentialActivationResult,\n\ttype CredentialConnectionStatus,\n\tCredentialManager,\n\tCredentialManagerError,\n\ttype CredentialManagerErrorCode,\n\ttype CredentialManagerOptions,\n\ttype CredentialMutationResult,\n\ttype CredentialProfileRecord,\n\ttype CredentialProfileStorage,\n\ttype CredentialProfileSummary,\n\ttype CredentialProjectIdentity,\n\ttype CredentialProjectResolver,\n\tCredentialStorageError,\n\ttype CredentialStorageErrorCode,\n\ttype CredentialVariable,\n\ttype StoredCredentialProfileSummary,\n} from \"./core/secrets/credential-manager.ts\";\nexport {\n\ttype CredentialMigrationSource,\n\tCredentialMigrationSourceError,\n\ttype CredentialMigrationSourceErrorCode,\n\ttype CredentialMigrationSourceResolver,\n\tresolveCredentialMigrationSources,\n} from \"./core/secrets/credential-migration-source.ts\";\nexport { createPortableGitProjectKey, resolveCredentialProject } from \"./core/secrets/credential-project.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype DirectoryResourceProfileInfo,\n\tgetDirectoryResourceProfileInfo,\n\ttype ImageSettings,\n\tmatchesResourceProfilePattern,\n\ttype PackageSource,\n\ttype ResourceProfileFilterSettings,\n\ttype ResourceProfileKind,\n\ttype ResourceProfileSettings,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\nexport {\n\tACTIVE_SKILL_CONTEXT_CUSTOM_TYPE,\n\tDEFAULT_SKILL_IDLE_TIMEOUT_MS,\n\tMAX_ACTIVE_SKILL_BODY_BYTES,\n\tMIN_ACTIVE_SKILL_BODY_BYTES,\n\tresolveActiveSkillBodyByteLimit,\n\ttype SkillLoadResult,\n\ttype SkillSearchResult,\n\tSkillVaultController,\n\ttype SkillVaultControllerOptions,\n\ttype SkillVaultStatus,\n} from \"./core/skill-vault.ts\";\n// Skills\nexport {\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\tMAX_SKILL_FRONTMATTER_BYTES,\n\treadSkillFrontmatterFile,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport {\n\ttype AskQuestion,\n\ttype AskQuestionAnswer,\n\tAskQuestionDialog,\n\ttype AskQuestionStopReason,\n\ttype AskQuestionToolDetails,\n\ttype AskQuestionToolInput,\n\ttype AskQuestionToolOptions,\n\tcreateAskQuestionToolDefinition,\n} from \"./core/tools/ask-question.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFileFailureRecoveryAuthority,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateSecretStoreToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FileContentReference,\n\ttype FileFailureRecoveryAuthority,\n\tFileMutationIntentController,\n\ttype FileMutationIntentControllerOptions,\n\ttype FileMutationIntentOperations,\n\ttype FileMutationKind,\n\ttype FileMutationLease,\n\ttype FileMutationPayloadReference,\n\tFileMutationPreflightError,\n\ttype FileMutationPreflightFailureReason,\n\ttype FilePathIdentity,\n\ttype FilePathInspection,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype SecretStoreStatus,\n\ttype SecretStoreToolDetails,\n\ttype SecretStoreToolInput,\n\ttype SecretStoreToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolDetails,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\tcreateSkillVaultToolDefinition,\n\ttype SkillToolDetails,\n\ttype SkillToolInput,\n} from \"./core/tools/skill.ts\";\n// Skill-audit primitives — exported so extensions (e.g. continuous-learning) can reuse the native\n// Jaccard overlap audit via `import { runSkillAudit } from \"@caupulican/pi-adaptative\"` instead of\n// carrying a duplicate copy.\nexport {\n\tjaccard,\n\trunSkillAudit,\n\ttype SkillAuditReport,\n\ttype SkillSummary,\n\ttokenize,\n} from \"./core/tools/skill-audit.ts\";\nexport { hasProjectTrustInputs, type ProjectTrustDecision, ProjectTrustStore } from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\trenderTitleBadge,\n\trenderToolTitle,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tTitleBadgeComponent,\n\ttype TitleBadgeOptions,\n\ttype TitleBadgeSegment,\n\ttype TitleBadgeStatus,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tToolTitleComponent,\n\ttype ToolTitleOptions,\n\ttype ToolTitleSegment,\n\ttype ToolTitleStatus,\n\tTreeSelectorComponent,\n\ttitleBadge,\n\ttoolTitle,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\nexport {\n\ttype AcquireWorkRunOptions,\n\tacquireWorkRun,\n\tassertPortablePathSegment,\n\tboundedWorkRetention,\n\tcreateWorkRunId,\n\tgetProcessWorkRun,\n\tgetWorkRoot,\n\tgetWorkRunDir,\n\tgetWorkTenantDir,\n\tPI_WORK_ROOT_ENV,\n\tpruneWorkTenant,\n\ttype WorkRetentionOptions,\n\ttype WorkRunLease,\n} from \"./utils/work-directory.ts\";\n"]}
|
|
@@ -201,7 +201,7 @@ export async function handleInteractiveEvent(host, event) {
|
|
|
201
201
|
host.toolPanels.finish(event.toolCallId);
|
|
202
202
|
host.ui.requestRender();
|
|
203
203
|
}
|
|
204
|
-
if (["task_steps", "goal", "delegate"
|
|
204
|
+
if (["task_steps", "goal", "delegate"].includes(event.toolName)) {
|
|
205
205
|
host.refreshActivityLane();
|
|
206
206
|
}
|
|
207
207
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-event-controller.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-event-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;A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P,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,EAC9E,GAAG,EAAE;gBACJ,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;YACjC,CAAC,CACD,CAAC;YACF,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM;QACP,CAAC;QAED,KAAK,gBAAgB;YACpB,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE;gBACjF,EAAE,EAAE,eAAe;gBACnB,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc;aACvD,CAAC,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACpB,IAAI,CAAC,SAAS,CAAC,sBAAsB,KAAK,CAAC,OAAO,cAAc,KAAK,CAAC,UAAU,IAAI,eAAe,EAAE,CAAC,CAAC;YACxG,CAAC;YACD,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM;IACR,CAAC;AACF,CAAC","sourcesContent":["import type { AgentMessage, ToolCallRepairInfo } from \"@caupulican/pi-agent-core\";\nimport { createCompactionSummaryMessage } from \"@caupulican/pi-agent-core/messages\";\nimport type { AssistantMessage } from \"@caupulican/pi-ai\";\nimport {\n\ttype Container,\n\ttype Loader,\n\ttype LoaderIndicatorOptions,\n\ttype MarkdownTheme,\n\tSpacer,\n\tText,\n\ttype TUI,\n} from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { AgentSessionEvent } from \"../../core/agent-session-contracts.ts\";\nimport type { FooterDataProvider } from \"../../core/footer-data-provider.ts\";\nimport type { SettingsManager } from \"../../core/settings-manager.ts\";\nimport {\n\ttype ActivityLaneComponent,\n\ttype ActivityLaneKind,\n\tBACKGROUND_TOOL_ACTIVITY_ID_PREFIX,\n\tbackgroundToolActivityId,\n} from \"./components/activity-lane.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport { CountdownTimer } from \"./components/countdown-timer.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { keyText } from \"./components/keybinding-hints.ts\";\nimport type { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport {\n\tgetToolPanelResultActionKeys,\n\ttype ToolPanelRegistry,\n\ttype ToolPanelTenantScope,\n} from \"./components/tool-panel-registry.ts\";\nimport { theme } from \"./theme/theme.ts\";\n\n/** Structural host consumed by the event owner. InteractiveMode deliberately remains a thin facade. */\nexport interface InteractiveEventHost {\n\tisInitialized: boolean;\n\tsession: AgentSession;\n\tsettingsManager: SettingsManager;\n\tfooter: FooterComponent;\n\tfooterDataProvider: FooterDataProvider;\n\tui: TUI;\n\tdefaultEditor: CustomEditor;\n\tstatusContainer: Container;\n\tchatContainer: Container;\n\tactivityLane: ActivityLaneComponent | undefined;\n\tloadingAnimation: Loader | undefined;\n\tworkingVisible: boolean;\n\tworkingIndicatorOptions: LoaderIndicatorOptions | undefined;\n\tretryEscapeHandler: (() => void) | undefined;\n\tretryCountdown: CountdownTimer | undefined;\n\tautoCompactionEscapeHandler: (() => void) | undefined;\n\tstreamingComponent: AssistantMessageComponent | undefined;\n\tstreamingMessage: AssistantMessage | undefined;\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\tlastStreamingUiUpdateAt: number;\n\ttoolPanels: ToolPanelRegistry;\n\tinit(): Promise<void>;\n\tcreateWorkingLoader(): Loader;\n\tstopWorkingLoader(): void;\n\tclearActiveToolCalls(): void;\n\tgetWorkingLoaderMessage(): string;\n\tupdatePendingMessagesDisplay(): void;\n\tupdateTerminalTitle(): void;\n\trefreshActivityLane(): void;\n\tupdateEditorBorderColor(): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\taddMessageToChat(message: AgentMessage): void;\n\tclearPendingStreamingUiUpdate(): void;\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\tapplyStreamingMessageUpdate(message: AssistantMessage, options?: { force?: boolean }): void;\n\ttrimLiveTuiHistory(): void;\n\tattachToolExecutionComponent(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: unknown,\n\t\trepair?: ToolCallRepairInfo,\n\t): ToolExecutionComponent;\n\ttoolActivityKind(toolName: string): ActivityLaneKind;\n\ttoolActivityLabel(toolName: string): string;\n\ttoolActivityTerminalStatus(isError: boolean, details: unknown): \"success\" | \"failure\" | \"neutral\";\n\tgetToolPanelScope(): ToolPanelTenantScope;\n\tisNativeReflectionEnabled(): boolean;\n\tmaybeRunNativeReflection(messages: AgentMessage[]): void;\n\tmaybeStartAutoLearn(): boolean;\n\tmaybeStartAutonomyReview(messages: AgentMessage[]): boolean;\n\tcheckShutdownRequested(): Promise<void>;\n\trebuildChatFromMessages(): Promise<void>;\n\tflushCompactionQueue(options?: { willRetry?: boolean }): Promise<void>;\n}\n\nfunction clearRetryControls(host: InteractiveEventHost): void {\n\tif (host.retryEscapeHandler) {\n\t\thost.defaultEditor.onEscape = host.retryEscapeHandler;\n\t\thost.retryEscapeHandler = undefined;\n\t}\n\tif (host.retryCountdown) {\n\t\thost.retryCountdown.dispose();\n\t\thost.retryCountdown = undefined;\n\t}\n}\n\n/** Single owner for AgentSessionEvent -> terminal UI state transitions. */\nexport async function handleInteractiveEvent(host: InteractiveEventHost, event: AgentSessionEvent): Promise<void> {\n\tif (!host.isInitialized) await host.init();\n\thost.footer.invalidate();\n\n\tswitch (event.type) {\n\t\tcase \"routing_start\":\n\t\t\tif (!host.session.isStreaming && !host.loadingAnimation && host.workingVisible) {\n\t\t\t\tif (host.workingIndicatorOptions) {\n\t\t\t\t\thost.loadingAnimation = host.createWorkingLoader();\n\t\t\t\t\thost.statusContainer.addChild(host.loadingAnimation);\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane?.start({ id: \"runtime:routing\", kind: \"runtime\", label: \"Routing\" });\n\t\t\t\t}\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"routing_end\":\n\t\t\thost.stopWorkingLoader();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"agent_start\":\n\t\t\thost.clearActiveToolCalls();\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(true);\n\t\t\tclearRetryControls(host);\n\t\t\thost.activityLane?.remove(\"runtime:retry\");\n\t\t\thost.stopWorkingLoader();\n\t\t\tif (host.workingVisible) {\n\t\t\t\tif (host.workingIndicatorOptions) {\n\t\t\t\t\thost.loadingAnimation = host.createWorkingLoader();\n\t\t\t\t\thost.statusContainer.addChild(host.loadingAnimation);\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane?.start({\n\t\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\t\tlabel: host.getWorkingLoaderMessage(),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"queue_update\":\n\t\t\thost.updatePendingMessagesDisplay();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"session_info_changed\":\n\t\t\thost.updateTerminalTitle();\n\t\t\thost.refreshActivityLane();\n\t\t\thost.footer.invalidate();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"thinking_level_changed\":\n\t\t\thost.footer.invalidate();\n\t\t\thost.updateEditorBorderColor();\n\t\t\tbreak;\n\n\t\tcase \"warning\":\n\t\t\thost.showWarning(event.message);\n\t\t\tbreak;\n\n\t\tcase \"delegate_workers\":\n\t\t\thost.footerDataProvider.setExtensionStatus(\"delegate\", undefined);\n\t\t\thost.refreshActivityLane();\n\t\t\thost.footer.invalidate();\n\t\t\tbreak;\n\n\t\tcase \"background_tools\":\n\t\t\thost.activityLane?.removeByPrefix(BACKGROUND_TOOL_ACTIVITY_ID_PREFIX);\n\t\t\tfor (const task of event.tasks) {\n\t\t\t\thost.activityLane?.start({\n\t\t\t\t\tid: backgroundToolActivityId(task.taskId),\n\t\t\t\t\tkind: \"tool\",\n\t\t\t\t\tlabel: task.description.trim() || `${task.toolName} · ${task.taskId}`,\n\t\t\t\t\ttag: task.toolName,\n\t\t\t\t});\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"message_start\":\n\t\t\tif (event.message.role === \"custom\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"user\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.updatePendingMessagesDisplay();\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"assistant\") {\n\t\t\t\thost.clearPendingStreamingUiUpdate();\n\t\t\t\thost.lastStreamingUiUpdateAt = 0;\n\t\t\t\thost.streamingComponent = new AssistantMessageComponent(\n\t\t\t\t\tundefined,\n\t\t\t\t\thost.hideThinkingBlock,\n\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\thost.hiddenThinkingLabel,\n\t\t\t\t);\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\thost.chatContainer.addChild(host.streamingComponent);\n\t\t\t\thost.applyStreamingMessageUpdate(host.streamingMessage, { force: true });\n\t\t\t\thost.trimLiveTuiHistory();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_update\":\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.applyStreamingMessageUpdate(event.message);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_end\":\n\t\t\tif (event.message.role === \"user\") break;\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\tlet errorMessage: string | undefined;\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\") {\n\t\t\t\t\tconst retryAttempt = host.session.retryAttempt;\n\t\t\t\t\terrorMessage =\n\t\t\t\t\t\tretryAttempt > 0\n\t\t\t\t\t\t\t? `Aborted after ${retryAttempt} retry attempt${retryAttempt > 1 ? \"s\" : \"\"}`\n\t\t\t\t\t\t\t: \"Operation aborted\";\n\t\t\t\t\thost.streamingMessage.errorMessage = errorMessage;\n\t\t\t\t}\n\t\t\t\thost.applyStreamingMessageUpdate(host.streamingMessage, { force: true });\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\" || host.streamingMessage.stopReason === \"error\") {\n\t\t\t\t\terrorMessage ??= host.streamingMessage.errorMessage || \"Error\";\n\t\t\t\t\tfor (const [, component] of host.toolPanels.activeEntries()) {\n\t\t\t\t\t\tcomponent.updateResult({ content: [{ type: \"text\", text: errorMessage }], isError: true });\n\t\t\t\t\t}\n\t\t\t\t\thost.clearActiveToolCalls();\n\t\t\t\t} else {\n\t\t\t\t\tfor (const [, component] of host.toolPanels.activeEntries()) component.setArgsComplete();\n\t\t\t\t}\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t\thost.footer.invalidate();\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"tool_execution_start\": {\n\t\t\thost.activityLane?.start({\n\t\t\t\tid: `tool:${event.toolCallId}`,\n\t\t\t\tkind: host.toolActivityKind(event.toolName),\n\t\t\t\tlabel: host.toolActivityLabel(event.toolName),\n\t\t\t\ttag: event.toolName,\n\t\t\t});\n\t\t\tlet component = host.toolPanels.getActive(event.toolCallId);\n\t\t\tif (!component) {\n\t\t\t\tcomponent = host.attachToolExecutionComponent(event.toolName, event.toolCallId, event.args, event.repair);\n\t\t\t} else {\n\t\t\t\tcomponent.updateArgs(event.args, event.repair);\n\t\t\t}\n\t\t\tcomponent.markExecutionStarted(event.repair);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_update\": {\n\t\t\tconst component = host.toolPanels.getActive(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateArgs(event.args, event.repair);\n\t\t\t\tcomponent.updateResult({ ...event.partialResult, isError: false }, true);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_end\": {\n\t\t\tconst toolActivityId = `tool:${event.toolCallId}`;\n\t\t\tif (host.activityLane) {\n\t\t\t\tconst toolKind = host.toolActivityKind(event.toolName);\n\t\t\t\tconst terminalStatus = host.toolActivityTerminalStatus(event.isError, event.result.details);\n\t\t\t\tif (toolKind === \"tool\" || terminalStatus !== \"success\") {\n\t\t\t\t\thost.activityLane.finish(toolActivityId, terminalStatus, {\n\t\t\t\t\t\tid: toolActivityId,\n\t\t\t\t\t\tkind: toolKind,\n\t\t\t\t\t\tlabel: host.toolActivityLabel(event.toolName),\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane.remove(toolActivityId);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst component = host.toolPanels.getActive(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult({ ...event.result, isError: event.isError });\n\t\t\t\thost.toolPanels.registerAliases(\n\t\t\t\t\tcomponent,\n\t\t\t\t\tgetToolPanelResultActionKeys(host.getToolPanelScope(), event.toolName, event.result),\n\t\t\t\t);\n\t\t\t\thost.toolPanels.finish(event.toolCallId);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tif ([\"task_steps\", \"goal\", \"delegate\", \"delegate_status\"].includes(event.toolName)) {\n\t\t\t\thost.refreshActivityLane();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"agent_end\": {\n\t\t\tif (host.isNativeReflectionEnabled()) host.maybeRunNativeReflection(event.messages);\n\t\t\telse if (!host.maybeStartAutoLearn()) host.maybeStartAutonomyReview(event.messages);\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(false);\n\t\t\tif (event.willRetry) {\n\t\t\t\thost.activityLane?.remove(\"runtime:turn\");\n\t\t\t} else {\n\t\t\t\tconst finalAssistant = event.messages.findLast(\n\t\t\t\t\t(message): message is AssistantMessage => message.role === \"assistant\",\n\t\t\t\t);\n\t\t\t\tconst failed = finalAssistant?.stopReason === \"error\" || finalAssistant?.stopReason === \"aborted\";\n\t\t\t\thost.activityLane?.finish(\"runtime:turn\", failed ? \"failure\" : \"success\", {\n\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: failed ? \"Turn failed\" : \"Done\",\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (host.loadingAnimation) {\n\t\t\t\thost.loadingAnimation.stop();\n\t\t\t\thost.loadingAnimation = undefined;\n\t\t\t\thost.statusContainer.clear();\n\t\t\t}\n\t\t\tif (host.streamingComponent) {\n\t\t\t\thost.chatContainer.removeChild(host.streamingComponent);\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t}\n\t\t\thost.clearActiveToolCalls();\n\t\t\thost.activityLane?.removeByPrefix(\"tool:\");\n\t\t\tawait host.checkShutdownRequested();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_start\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(true);\n\t\t\thost.autoCompactionEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => host.session.abortCompaction();\n\t\t\thost.stopWorkingLoader();\n\t\t\tconst cancelHint = `(${keyText(\"app.interrupt\")} to cancel)`;\n\t\t\tconst label =\n\t\t\t\tevent.reason === \"manual\"\n\t\t\t\t\t? `Compacting context ${cancelHint}`\n\t\t\t\t\t: `${event.reason === \"overflow\" ? \"Context overflow · \" : \"\"}Auto-compacting ${cancelHint}`;\n\t\t\thost.activityLane?.start({ id: \"runtime:compaction\", kind: \"runtime\", label });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_end\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(false);\n\t\t\tif (host.autoCompactionEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.autoCompactionEscapeHandler;\n\t\t\t\thost.autoCompactionEscapeHandler = undefined;\n\t\t\t}\n\t\t\tif (event.aborted) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"neutral\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Compaction cancelled\",\n\t\t\t\t});\n\t\t\t\tif (event.reason === \"manual\") host.showError(\"Compaction cancelled\");\n\t\t\t} else if (event.result) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"success\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Context compacted\",\n\t\t\t\t});\n\t\t\t\tawait host.rebuildChatFromMessages();\n\t\t\t\thost.addMessageToChat(\n\t\t\t\t\tcreateCompactionSummaryMessage(\n\t\t\t\t\t\tevent.result.summary,\n\t\t\t\t\t\tevent.result.tokensBefore,\n\t\t\t\t\t\tnew Date().toISOString(),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\thost.footer.invalidate();\n\t\t\t} else if (event.errorMessage) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"failure\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Compaction failed\",\n\t\t\t\t});\n\t\t\t\tif (event.reason === \"manual\") host.showError(event.errorMessage);\n\t\t\t\telse {\n\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\thost.chatContainer.addChild(new Text(theme.fg(\"error\", event.errorMessage), 1, 0));\n\t\t\t\t}\n\t\t\t} else if (event.skipReason) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"neutral\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: `Compaction skipped · ${event.skipReason}`,\n\t\t\t\t});\n\t\t\t}\n\t\t\tvoid host.flushCompactionQueue({ willRetry: event.willRetry });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_start\": {\n\t\t\thost.retryEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => host.session.abortRetry();\n\t\t\thost.retryCountdown?.dispose();\n\t\t\tconst retryMessage = (seconds: number) =>\n\t\t\t\t`Retry ${event.attempt}/${event.maxAttempts} in ${seconds}s · ${keyText(\"app.interrupt\")} cancel`;\n\t\t\thost.activityLane?.wait({\n\t\t\t\tid: \"runtime:retry\",\n\t\t\t\tkind: \"runtime\",\n\t\t\t\tlabel: retryMessage(Math.ceil(event.delayMs / 1000)),\n\t\t\t});\n\t\t\thost.retryCountdown = new CountdownTimer(\n\t\t\t\tevent.delayMs,\n\t\t\t\thost.ui,\n\t\t\t\t(seconds) => host.activityLane?.update(\"runtime:retry\", retryMessage(seconds)),\n\t\t\t\t() => {\n\t\t\t\t\thost.retryCountdown = undefined;\n\t\t\t\t},\n\t\t\t);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_end\":\n\t\t\tclearRetryControls(host);\n\t\t\thost.activityLane?.finish(\"runtime:retry\", event.success ? \"success\" : \"failure\", {\n\t\t\t\tid: \"runtime:retry\",\n\t\t\t\tkind: \"runtime\",\n\t\t\t\tlabel: event.success ? \"Retry resumed\" : \"Retry failed\",\n\t\t\t});\n\t\t\tif (!event.success) {\n\t\t\t\thost.showError(`Retry failed after ${event.attempt} attempts: ${event.finalError || \"Unknown error\"}`);\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-event-controller.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-event-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAEpF,OAAO,EAKN,MAAM,EACN,IAAI,GAEJ,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAGN,kCAAkC,EAClC,wBAAwB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EACN,4BAA4B,GAG5B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AA6DzC,SAAS,kBAAkB,CAAC,IAA0B;IACrD,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACtD,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACrC,CAAC;IACD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;IACjC,CAAC;AACF,CAAC;AAED,2EAA2E;AAC3E,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,IAA0B,EAAE,KAAwB;IAChG,IAAI,CAAC,IAAI,CAAC,aAAa;QAAE,MAAM,IAAI,CAAC,I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\nimport { createCompactionSummaryMessage } from \"@caupulican/pi-agent-core/messages\";\nimport type { AssistantMessage } from \"@caupulican/pi-ai\";\nimport {\n\ttype Container,\n\ttype Loader,\n\ttype LoaderIndicatorOptions,\n\ttype MarkdownTheme,\n\tSpacer,\n\tText,\n\ttype TUI,\n} from \"@caupulican/pi-tui\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { AgentSessionEvent } from \"../../core/agent-session-contracts.ts\";\nimport type { FooterDataProvider } from \"../../core/footer-data-provider.ts\";\nimport type { SettingsManager } from \"../../core/settings-manager.ts\";\nimport {\n\ttype ActivityLaneComponent,\n\ttype ActivityLaneKind,\n\tBACKGROUND_TOOL_ACTIVITY_ID_PREFIX,\n\tbackgroundToolActivityId,\n} from \"./components/activity-lane.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport { CountdownTimer } from \"./components/countdown-timer.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport type { FooterComponent } from \"./components/footer.ts\";\nimport { keyText } from \"./components/keybinding-hints.ts\";\nimport type { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport {\n\tgetToolPanelResultActionKeys,\n\ttype ToolPanelRegistry,\n\ttype ToolPanelTenantScope,\n} from \"./components/tool-panel-registry.ts\";\nimport { theme } from \"./theme/theme.ts\";\n\n/** Structural host consumed by the event owner. InteractiveMode deliberately remains a thin facade. */\nexport interface InteractiveEventHost {\n\tisInitialized: boolean;\n\tsession: AgentSession;\n\tsettingsManager: SettingsManager;\n\tfooter: FooterComponent;\n\tfooterDataProvider: FooterDataProvider;\n\tui: TUI;\n\tdefaultEditor: CustomEditor;\n\tstatusContainer: Container;\n\tchatContainer: Container;\n\tactivityLane: ActivityLaneComponent | undefined;\n\tloadingAnimation: Loader | undefined;\n\tworkingVisible: boolean;\n\tworkingIndicatorOptions: LoaderIndicatorOptions | undefined;\n\tretryEscapeHandler: (() => void) | undefined;\n\tretryCountdown: CountdownTimer | undefined;\n\tautoCompactionEscapeHandler: (() => void) | undefined;\n\tstreamingComponent: AssistantMessageComponent | undefined;\n\tstreamingMessage: AssistantMessage | undefined;\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\tlastStreamingUiUpdateAt: number;\n\ttoolPanels: ToolPanelRegistry;\n\tinit(): Promise<void>;\n\tcreateWorkingLoader(): Loader;\n\tstopWorkingLoader(): void;\n\tclearActiveToolCalls(): void;\n\tgetWorkingLoaderMessage(): string;\n\tupdatePendingMessagesDisplay(): void;\n\tupdateTerminalTitle(): void;\n\trefreshActivityLane(): void;\n\tupdateEditorBorderColor(): void;\n\tshowWarning(message: string): void;\n\tshowError(message: string): void;\n\taddMessageToChat(message: AgentMessage): void;\n\tclearPendingStreamingUiUpdate(): void;\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\tapplyStreamingMessageUpdate(message: AssistantMessage, options?: { force?: boolean }): void;\n\ttrimLiveTuiHistory(): void;\n\tattachToolExecutionComponent(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: unknown,\n\t\trepair?: ToolCallRepairInfo,\n\t): ToolExecutionComponent;\n\ttoolActivityKind(toolName: string): ActivityLaneKind;\n\ttoolActivityLabel(toolName: string): string;\n\ttoolActivityTerminalStatus(isError: boolean, details: unknown): \"success\" | \"failure\" | \"neutral\";\n\tgetToolPanelScope(): ToolPanelTenantScope;\n\tisNativeReflectionEnabled(): boolean;\n\tmaybeRunNativeReflection(messages: AgentMessage[]): void;\n\tmaybeStartAutoLearn(): boolean;\n\tmaybeStartAutonomyReview(messages: AgentMessage[]): boolean;\n\tcheckShutdownRequested(): Promise<void>;\n\trebuildChatFromMessages(): Promise<void>;\n\tflushCompactionQueue(options?: { willRetry?: boolean }): Promise<void>;\n}\n\nfunction clearRetryControls(host: InteractiveEventHost): void {\n\tif (host.retryEscapeHandler) {\n\t\thost.defaultEditor.onEscape = host.retryEscapeHandler;\n\t\thost.retryEscapeHandler = undefined;\n\t}\n\tif (host.retryCountdown) {\n\t\thost.retryCountdown.dispose();\n\t\thost.retryCountdown = undefined;\n\t}\n}\n\n/** Single owner for AgentSessionEvent -> terminal UI state transitions. */\nexport async function handleInteractiveEvent(host: InteractiveEventHost, event: AgentSessionEvent): Promise<void> {\n\tif (!host.isInitialized) await host.init();\n\thost.footer.invalidate();\n\n\tswitch (event.type) {\n\t\tcase \"routing_start\":\n\t\t\tif (!host.session.isStreaming && !host.loadingAnimation && host.workingVisible) {\n\t\t\t\tif (host.workingIndicatorOptions) {\n\t\t\t\t\thost.loadingAnimation = host.createWorkingLoader();\n\t\t\t\t\thost.statusContainer.addChild(host.loadingAnimation);\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane?.start({ id: \"runtime:routing\", kind: \"runtime\", label: \"Routing\" });\n\t\t\t\t}\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"routing_end\":\n\t\t\thost.stopWorkingLoader();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"agent_start\":\n\t\t\thost.clearActiveToolCalls();\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(true);\n\t\t\tclearRetryControls(host);\n\t\t\thost.activityLane?.remove(\"runtime:retry\");\n\t\t\thost.stopWorkingLoader();\n\t\t\tif (host.workingVisible) {\n\t\t\t\tif (host.workingIndicatorOptions) {\n\t\t\t\t\thost.loadingAnimation = host.createWorkingLoader();\n\t\t\t\t\thost.statusContainer.addChild(host.loadingAnimation);\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane?.start({\n\t\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\t\tlabel: host.getWorkingLoaderMessage(),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"queue_update\":\n\t\t\thost.updatePendingMessagesDisplay();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"session_info_changed\":\n\t\t\thost.updateTerminalTitle();\n\t\t\thost.refreshActivityLane();\n\t\t\thost.footer.invalidate();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"thinking_level_changed\":\n\t\t\thost.footer.invalidate();\n\t\t\thost.updateEditorBorderColor();\n\t\t\tbreak;\n\n\t\tcase \"warning\":\n\t\t\thost.showWarning(event.message);\n\t\t\tbreak;\n\n\t\tcase \"delegate_workers\":\n\t\t\thost.footerDataProvider.setExtensionStatus(\"delegate\", undefined);\n\t\t\thost.refreshActivityLane();\n\t\t\thost.footer.invalidate();\n\t\t\tbreak;\n\n\t\tcase \"background_tools\":\n\t\t\thost.activityLane?.removeByPrefix(BACKGROUND_TOOL_ACTIVITY_ID_PREFIX);\n\t\t\tfor (const task of event.tasks) {\n\t\t\t\thost.activityLane?.start({\n\t\t\t\t\tid: backgroundToolActivityId(task.taskId),\n\t\t\t\t\tkind: \"tool\",\n\t\t\t\t\tlabel: task.description.trim() || `${task.toolName} · ${task.taskId}`,\n\t\t\t\t\ttag: task.toolName,\n\t\t\t\t});\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"message_start\":\n\t\t\tif (event.message.role === \"custom\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"user\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.updatePendingMessagesDisplay();\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"assistant\") {\n\t\t\t\thost.clearPendingStreamingUiUpdate();\n\t\t\t\thost.lastStreamingUiUpdateAt = 0;\n\t\t\t\thost.streamingComponent = new AssistantMessageComponent(\n\t\t\t\t\tundefined,\n\t\t\t\t\thost.hideThinkingBlock,\n\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\thost.hiddenThinkingLabel,\n\t\t\t\t);\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\thost.chatContainer.addChild(host.streamingComponent);\n\t\t\t\thost.applyStreamingMessageUpdate(host.streamingMessage, { force: true });\n\t\t\t\thost.trimLiveTuiHistory();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_update\":\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.applyStreamingMessageUpdate(event.message);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_end\":\n\t\t\tif (event.message.role === \"user\") break;\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\tlet errorMessage: string | undefined;\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\") {\n\t\t\t\t\tconst retryAttempt = host.session.retryAttempt;\n\t\t\t\t\terrorMessage =\n\t\t\t\t\t\tretryAttempt > 0\n\t\t\t\t\t\t\t? `Aborted after ${retryAttempt} retry attempt${retryAttempt > 1 ? \"s\" : \"\"}`\n\t\t\t\t\t\t\t: \"Operation aborted\";\n\t\t\t\t\thost.streamingMessage.errorMessage = errorMessage;\n\t\t\t\t}\n\t\t\t\thost.applyStreamingMessageUpdate(host.streamingMessage, { force: true });\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\" || host.streamingMessage.stopReason === \"error\") {\n\t\t\t\t\terrorMessage ??= host.streamingMessage.errorMessage || \"Error\";\n\t\t\t\t\tfor (const [, component] of host.toolPanels.activeEntries()) {\n\t\t\t\t\t\tcomponent.updateResult({ content: [{ type: \"text\", text: errorMessage }], isError: true });\n\t\t\t\t\t}\n\t\t\t\t\thost.clearActiveToolCalls();\n\t\t\t\t} else {\n\t\t\t\t\tfor (const [, component] of host.toolPanels.activeEntries()) component.setArgsComplete();\n\t\t\t\t}\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t\thost.footer.invalidate();\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"tool_execution_start\": {\n\t\t\thost.activityLane?.start({\n\t\t\t\tid: `tool:${event.toolCallId}`,\n\t\t\t\tkind: host.toolActivityKind(event.toolName),\n\t\t\t\tlabel: host.toolActivityLabel(event.toolName),\n\t\t\t\ttag: event.toolName,\n\t\t\t});\n\t\t\tlet component = host.toolPanels.getActive(event.toolCallId);\n\t\t\tif (!component) {\n\t\t\t\tcomponent = host.attachToolExecutionComponent(event.toolName, event.toolCallId, event.args, event.repair);\n\t\t\t} else {\n\t\t\t\tcomponent.updateArgs(event.args, event.repair);\n\t\t\t}\n\t\t\tcomponent.markExecutionStarted(event.repair);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_update\": {\n\t\t\tconst component = host.toolPanels.getActive(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateArgs(event.args, event.repair);\n\t\t\t\tcomponent.updateResult({ ...event.partialResult, isError: false }, true);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_end\": {\n\t\t\tconst toolActivityId = `tool:${event.toolCallId}`;\n\t\t\tif (host.activityLane) {\n\t\t\t\tconst toolKind = host.toolActivityKind(event.toolName);\n\t\t\t\tconst terminalStatus = host.toolActivityTerminalStatus(event.isError, event.result.details);\n\t\t\t\tif (toolKind === \"tool\" || terminalStatus !== \"success\") {\n\t\t\t\t\thost.activityLane.finish(toolActivityId, terminalStatus, {\n\t\t\t\t\t\tid: toolActivityId,\n\t\t\t\t\t\tkind: toolKind,\n\t\t\t\t\t\tlabel: host.toolActivityLabel(event.toolName),\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\thost.activityLane.remove(toolActivityId);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst component = host.toolPanels.getActive(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult({ ...event.result, isError: event.isError });\n\t\t\t\thost.toolPanels.registerAliases(\n\t\t\t\t\tcomponent,\n\t\t\t\t\tgetToolPanelResultActionKeys(host.getToolPanelScope(), event.toolName, event.result),\n\t\t\t\t);\n\t\t\t\thost.toolPanels.finish(event.toolCallId);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tif ([\"task_steps\", \"goal\", \"delegate\"].includes(event.toolName)) {\n\t\t\t\thost.refreshActivityLane();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"agent_end\": {\n\t\t\tif (host.isNativeReflectionEnabled()) host.maybeRunNativeReflection(event.messages);\n\t\t\telse if (!host.maybeStartAutoLearn()) host.maybeStartAutonomyReview(event.messages);\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(false);\n\t\t\tif (event.willRetry) {\n\t\t\t\thost.activityLane?.remove(\"runtime:turn\");\n\t\t\t} else {\n\t\t\t\tconst finalAssistant = event.messages.findLast(\n\t\t\t\t\t(message): message is AssistantMessage => message.role === \"assistant\",\n\t\t\t\t);\n\t\t\t\tconst failed = finalAssistant?.stopReason === \"error\" || finalAssistant?.stopReason === \"aborted\";\n\t\t\t\thost.activityLane?.finish(\"runtime:turn\", failed ? \"failure\" : \"success\", {\n\t\t\t\t\tid: \"runtime:turn\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: failed ? \"Turn failed\" : \"Done\",\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (host.loadingAnimation) {\n\t\t\t\thost.loadingAnimation.stop();\n\t\t\t\thost.loadingAnimation = undefined;\n\t\t\t\thost.statusContainer.clear();\n\t\t\t}\n\t\t\tif (host.streamingComponent) {\n\t\t\t\thost.chatContainer.removeChild(host.streamingComponent);\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t}\n\t\t\thost.clearActiveToolCalls();\n\t\t\thost.activityLane?.removeByPrefix(\"tool:\");\n\t\t\tawait host.checkShutdownRequested();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_start\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(true);\n\t\t\thost.autoCompactionEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => host.session.abortCompaction();\n\t\t\thost.stopWorkingLoader();\n\t\t\tconst cancelHint = `(${keyText(\"app.interrupt\")} to cancel)`;\n\t\t\tconst label =\n\t\t\t\tevent.reason === \"manual\"\n\t\t\t\t\t? `Compacting context ${cancelHint}`\n\t\t\t\t\t: `${event.reason === \"overflow\" ? \"Context overflow · \" : \"\"}Auto-compacting ${cancelHint}`;\n\t\t\thost.activityLane?.start({ id: \"runtime:compaction\", kind: \"runtime\", label });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_end\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) host.ui.terminal.setProgress(false);\n\t\t\tif (host.autoCompactionEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.autoCompactionEscapeHandler;\n\t\t\t\thost.autoCompactionEscapeHandler = undefined;\n\t\t\t}\n\t\t\tif (event.aborted) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"neutral\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Compaction cancelled\",\n\t\t\t\t});\n\t\t\t\tif (event.reason === \"manual\") host.showError(\"Compaction cancelled\");\n\t\t\t} else if (event.result) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"success\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Context compacted\",\n\t\t\t\t});\n\t\t\t\tawait host.rebuildChatFromMessages();\n\t\t\t\thost.addMessageToChat(\n\t\t\t\t\tcreateCompactionSummaryMessage(\n\t\t\t\t\t\tevent.result.summary,\n\t\t\t\t\t\tevent.result.tokensBefore,\n\t\t\t\t\t\tnew Date().toISOString(),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\thost.footer.invalidate();\n\t\t\t} else if (event.errorMessage) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"failure\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: \"Compaction failed\",\n\t\t\t\t});\n\t\t\t\tif (event.reason === \"manual\") host.showError(event.errorMessage);\n\t\t\t\telse {\n\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\thost.chatContainer.addChild(new Text(theme.fg(\"error\", event.errorMessage), 1, 0));\n\t\t\t\t}\n\t\t\t} else if (event.skipReason) {\n\t\t\t\thost.activityLane?.finish(\"runtime:compaction\", \"neutral\", {\n\t\t\t\t\tid: \"runtime:compaction\",\n\t\t\t\t\tkind: \"runtime\",\n\t\t\t\t\tlabel: `Compaction skipped · ${event.skipReason}`,\n\t\t\t\t});\n\t\t\t}\n\t\t\tvoid host.flushCompactionQueue({ willRetry: event.willRetry });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_start\": {\n\t\t\thost.retryEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => host.session.abortRetry();\n\t\t\thost.retryCountdown?.dispose();\n\t\t\tconst retryMessage = (seconds: number) =>\n\t\t\t\t`Retry ${event.attempt}/${event.maxAttempts} in ${seconds}s · ${keyText(\"app.interrupt\")} cancel`;\n\t\t\thost.activityLane?.wait({\n\t\t\t\tid: \"runtime:retry\",\n\t\t\t\tkind: \"runtime\",\n\t\t\t\tlabel: retryMessage(Math.ceil(event.delayMs / 1000)),\n\t\t\t});\n\t\t\thost.retryCountdown = new CountdownTimer(\n\t\t\t\tevent.delayMs,\n\t\t\t\thost.ui,\n\t\t\t\t(seconds) => host.activityLane?.update(\"runtime:retry\", retryMessage(seconds)),\n\t\t\t\t() => {\n\t\t\t\t\thost.retryCountdown = undefined;\n\t\t\t\t},\n\t\t\t);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_end\":\n\t\t\tclearRetryControls(host);\n\t\t\thost.activityLane?.finish(\"runtime:retry\", event.success ? \"success\" : \"failure\", {\n\t\t\t\tid: \"runtime:retry\",\n\t\t\t\tkind: \"runtime\",\n\t\t\t\tlabel: event.success ? \"Retry resumed\" : \"Retry failed\",\n\t\t\t});\n\t\t\tif (!event.success) {\n\t\t\t\thost.showError(`Retry failed after ${event.attempt} attempts: ${event.finalError || \"Unknown error\"}`);\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t}\n}\n"]}
|