@caupulican/pi-adaptative 0.81.39 → 0.81.41
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 +77 -0
- package/README.md +2 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts +2 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.d.ts.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js +3 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.js.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/dispatch-grant.ts +4 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts +9 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js +290 -107
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.ts +357 -122
- package/dist/bundled-resources/skills/tool-call-repair/references/repair-catalogue.md +2 -2
- package/dist/cli/args.d.ts +4 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +31 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-directory-layout.d.ts +15 -0
- package/dist/core/agent-directory-layout.d.ts.map +1 -0
- package/dist/core/agent-directory-layout.js +72 -0
- package/dist/core/agent-directory-layout.js.map +1 -0
- package/dist/core/agent-paths.d.ts +25 -2
- package/dist/core/agent-paths.d.ts.map +1 -1
- package/dist/core/agent-paths.js +79 -4
- package/dist/core/agent-paths.js.map +1 -1
- package/dist/core/agent-session-contracts.d.ts +293 -0
- package/dist/core/agent-session-contracts.d.ts.map +1 -0
- package/dist/core/agent-session-contracts.js +26 -0
- package/dist/core/agent-session-contracts.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +52 -8
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +400 -79
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +1 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +74 -518
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +370 -1432
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +3 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/autonomy/approval-gate.d.ts +3 -2
- package/dist/core/autonomy/approval-gate.d.ts.map +1 -1
- package/dist/core/autonomy/approval-gate.js +6 -28
- package/dist/core/autonomy/approval-gate.js.map +1 -1
- package/dist/core/autonomy/bounded-completion.d.ts +1 -1
- package/dist/core/autonomy/bounded-completion.d.ts.map +1 -1
- package/dist/core/autonomy/bounded-completion.js +1 -1
- package/dist/core/autonomy/bounded-completion.js.map +1 -1
- package/dist/core/autonomy/contracts.d.ts +20 -12
- package/dist/core/autonomy/contracts.d.ts.map +1 -1
- package/dist/core/autonomy/contracts.js.map +1 -1
- package/dist/core/autonomy/foreground-envelope.d.ts +8 -2
- package/dist/core/autonomy/foreground-envelope.d.ts.map +1 -1
- package/dist/core/autonomy/foreground-envelope.js +8 -25
- package/dist/core/autonomy/foreground-envelope.js.map +1 -1
- package/dist/core/autonomy/gates.d.ts.map +1 -1
- package/dist/core/autonomy/gates.js +8 -10
- package/dist/core/autonomy/gates.js.map +1 -1
- package/dist/core/autonomy/lane-private-paths.d.ts +2 -0
- package/dist/core/autonomy/lane-private-paths.d.ts.map +1 -0
- package/dist/core/autonomy/lane-private-paths.js +16 -0
- package/dist/core/autonomy/lane-private-paths.js.map +1 -0
- package/dist/core/autonomy/lane-tool-surface.d.ts +10 -0
- package/dist/core/autonomy/lane-tool-surface.d.ts.map +1 -1
- package/dist/core/autonomy/lane-tool-surface.js +48 -9
- package/dist/core/autonomy/lane-tool-surface.js.map +1 -1
- package/dist/core/autonomy/lane-tracker.d.ts +14 -0
- package/dist/core/autonomy/lane-tracker.d.ts.map +1 -1
- package/dist/core/autonomy/lane-tracker.js +38 -0
- package/dist/core/autonomy/lane-tracker.js.map +1 -1
- package/dist/core/autonomy/risk-assessment.d.ts +1 -2
- package/dist/core/autonomy/risk-assessment.d.ts.map +1 -1
- package/dist/core/autonomy/risk-assessment.js +1 -123
- package/dist/core/autonomy/risk-assessment.js.map +1 -1
- package/dist/core/autonomy/session-lane-record.d.ts +4 -4
- package/dist/core/autonomy/session-lane-record.d.ts.map +1 -1
- package/dist/core/autonomy/session-lane-record.js +16 -29
- package/dist/core/autonomy/session-lane-record.js.map +1 -1
- package/dist/core/autonomy/telemetry-events.d.ts +1 -1
- package/dist/core/autonomy/telemetry-events.d.ts.map +1 -1
- package/dist/core/autonomy/telemetry-events.js +1 -1
- package/dist/core/autonomy/telemetry-events.js.map +1 -1
- package/dist/core/autonomy-telemetry.d.ts +7 -7
- package/dist/core/autonomy-telemetry.d.ts.map +1 -1
- package/dist/core/autonomy-telemetry.js +9 -9
- package/dist/core/autonomy-telemetry.js.map +1 -1
- package/dist/core/background-lane-controller.d.ts +56 -236
- package/dist/core/background-lane-controller.d.ts.map +1 -1
- package/dist/core/background-lane-controller.js +141 -1273
- package/dist/core/background-lane-controller.js.map +1 -1
- package/dist/core/bedrock-sso-login.d.ts +16 -0
- package/dist/core/bedrock-sso-login.d.ts.map +1 -0
- package/dist/core/bedrock-sso-login.js +98 -0
- package/dist/core/bedrock-sso-login.js.map +1 -0
- package/dist/core/capability-contract.d.ts +4 -0
- package/dist/core/capability-contract.d.ts.map +1 -0
- package/dist/core/capability-contract.js +28 -0
- package/dist/core/capability-contract.js.map +1 -0
- package/dist/core/compaction-controller.d.ts +90 -0
- package/dist/core/compaction-controller.d.ts.map +1 -0
- package/dist/core/compaction-controller.js +452 -0
- package/dist/core/compaction-controller.js.map +1 -0
- package/dist/core/compaction-support.d.ts +13 -17
- package/dist/core/compaction-support.d.ts.map +1 -1
- package/dist/core/compaction-support.js +3 -3
- package/dist/core/compaction-support.js.map +1 -1
- package/dist/core/context/context-artifacts.d.ts +6 -2
- package/dist/core/context/context-artifacts.d.ts.map +1 -1
- package/dist/core/context/context-artifacts.js +34 -2
- package/dist/core/context/context-artifacts.js.map +1 -1
- package/dist/core/context/context-store-retention.d.ts +8 -2
- package/dist/core/context/context-store-retention.d.ts.map +1 -1
- package/dist/core/context/context-store-retention.js +158 -35
- package/dist/core/context/context-store-retention.js.map +1 -1
- package/dist/core/context/okf-memory.d.ts.map +1 -1
- package/dist/core/context/okf-memory.js +9 -11
- package/dist/core/context/okf-memory.js.map +1 -1
- package/dist/core/context/sqlite-runtime-index.d.ts.map +1 -1
- package/dist/core/context/sqlite-runtime-index.js +6 -8
- package/dist/core/context/sqlite-runtime-index.js.map +1 -1
- package/dist/core/context-gc.d.ts +3 -0
- package/dist/core/context-gc.d.ts.map +1 -1
- package/dist/core/context-gc.js +10 -5
- package/dist/core/context-gc.js.map +1 -1
- package/dist/core/context-pipeline.d.ts +1 -1
- package/dist/core/context-pipeline.d.ts.map +1 -1
- package/dist/core/context-pipeline.js +16 -37
- package/dist/core/context-pipeline.js.map +1 -1
- package/dist/core/cost/cost-summary.d.ts.map +1 -1
- package/dist/core/cost/cost-summary.js +5 -3
- package/dist/core/cost/cost-summary.js.map +1 -1
- package/dist/core/cost/daily-usage.d.ts.map +1 -1
- package/dist/core/cost/daily-usage.js +4 -5
- package/dist/core/cost/daily-usage.js.map +1 -1
- package/dist/core/default-tool-surface.d.ts.map +1 -1
- package/dist/core/default-tool-surface.js +2 -0
- package/dist/core/default-tool-surface.js.map +1 -1
- package/dist/core/delegation/managed-lane-controller.d.ts +34 -0
- package/dist/core/delegation/managed-lane-controller.d.ts.map +1 -0
- package/dist/core/delegation/managed-lane-controller.js +217 -0
- package/dist/core/delegation/managed-lane-controller.js.map +1 -0
- package/dist/core/delegation/session-worker-claim.d.ts +44 -0
- package/dist/core/delegation/session-worker-claim.d.ts.map +1 -0
- package/dist/core/delegation/session-worker-claim.js +98 -0
- package/dist/core/delegation/session-worker-claim.js.map +1 -0
- package/dist/core/delegation/worker-actions.d.ts +7 -5
- package/dist/core/delegation/worker-actions.d.ts.map +1 -1
- package/dist/core/delegation/worker-actions.js +20 -4
- package/dist/core/delegation/worker-actions.js.map +1 -1
- package/dist/core/delegation/{worker-result.d.ts → worker-claim.d.ts} +13 -13
- package/dist/core/delegation/worker-claim.d.ts.map +1 -0
- package/dist/core/delegation/{worker-result.js → worker-claim.js} +61 -51
- package/dist/core/delegation/worker-claim.js.map +1 -0
- package/dist/core/delegation/worker-delegation-controller.d.ts +110 -0
- package/dist/core/delegation/worker-delegation-controller.d.ts.map +1 -0
- package/dist/core/delegation/worker-delegation-controller.js +861 -0
- package/dist/core/delegation/worker-delegation-controller.js.map +1 -0
- package/dist/core/delegation/worker-delegation-request.d.ts +11 -0
- package/dist/core/delegation/worker-delegation-request.d.ts.map +1 -0
- package/dist/core/delegation/worker-delegation-request.js +2 -0
- package/dist/core/delegation/worker-delegation-request.js.map +1 -0
- package/dist/core/delegation/worker-dispatch-scheduler.d.ts +40 -0
- package/dist/core/delegation/worker-dispatch-scheduler.d.ts.map +1 -0
- package/dist/core/delegation/worker-dispatch-scheduler.js +93 -0
- package/dist/core/delegation/worker-dispatch-scheduler.js.map +1 -0
- package/dist/core/delegation/worker-execution-policy.d.ts +62 -0
- package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -0
- package/dist/core/delegation/worker-execution-policy.js +160 -0
- package/dist/core/delegation/worker-execution-policy.js.map +1 -0
- package/dist/core/delegation/worker-lane-projection.d.ts +14 -0
- package/dist/core/delegation/worker-lane-projection.d.ts.map +1 -0
- package/dist/core/delegation/worker-lane-projection.js +100 -0
- package/dist/core/delegation/worker-lane-projection.js.map +1 -0
- package/dist/core/delegation/worker-lifecycle.d.ts +97 -0
- package/dist/core/delegation/worker-lifecycle.d.ts.map +1 -0
- package/dist/core/delegation/worker-lifecycle.js +339 -0
- package/dist/core/delegation/worker-lifecycle.js.map +1 -0
- package/dist/core/delegation/worker-notification-coordinator.d.ts +36 -0
- package/dist/core/delegation/worker-notification-coordinator.d.ts.map +1 -0
- package/dist/core/delegation/worker-notification-coordinator.js +90 -0
- package/dist/core/delegation/worker-notification-coordinator.js.map +1 -0
- package/dist/core/delegation/worker-profile-resolver.d.ts +55 -0
- package/dist/core/delegation/worker-profile-resolver.d.ts.map +1 -0
- package/dist/core/delegation/worker-profile-resolver.js +113 -0
- package/dist/core/delegation/worker-profile-resolver.js.map +1 -0
- package/dist/core/delegation/worker-runner.d.ts +25 -14
- package/dist/core/delegation/worker-runner.d.ts.map +1 -1
- package/dist/core/delegation/worker-runner.js +122 -53
- package/dist/core/delegation/worker-runner.js.map +1 -1
- package/dist/core/delegation/worker-task-label.d.ts +3 -0
- package/dist/core/delegation/worker-task-label.d.ts.map +1 -0
- package/dist/core/delegation/worker-task-label.js +11 -0
- package/dist/core/delegation/worker-task-label.js.map +1 -0
- package/dist/core/doctor.d.ts +8 -0
- package/dist/core/doctor.d.ts.map +1 -1
- package/dist/core/doctor.js +32 -1
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/extension-import-authority.d.ts +6 -0
- package/dist/core/extension-import-authority.d.ts.map +1 -0
- package/dist/core/extension-import-authority.js +10 -0
- package/dist/core/extension-import-authority.js.map +1 -0
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +5 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +52 -18
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +20 -5
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/stale-context.d.ts +2 -0
- package/dist/core/extensions/stale-context.d.ts.map +1 -0
- package/dist/core/extensions/stale-context.js +2 -0
- package/dist/core/extensions/stale-context.js.map +1 -0
- package/dist/core/extensions/storage.d.ts +8 -0
- package/dist/core/extensions/storage.d.ts.map +1 -0
- package/dist/core/extensions/storage.js +28 -0
- package/dist/core/extensions/storage.js.map +1 -0
- package/dist/core/extensions/types.d.ts +78 -21
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/failure-corpus.d.ts +1 -15
- package/dist/core/failure-corpus.d.ts.map +1 -1
- package/dist/core/failure-corpus.js +9 -37
- package/dist/core/failure-corpus.js.map +1 -1
- package/dist/core/foreground-recovery-controller.d.ts +53 -0
- package/dist/core/foreground-recovery-controller.d.ts.map +1 -0
- package/dist/core/foreground-recovery-controller.js +111 -0
- package/dist/core/foreground-recovery-controller.js.map +1 -0
- package/dist/core/gateways/channel-provider.d.ts +3 -0
- package/dist/core/gateways/channel-provider.d.ts.map +1 -1
- package/dist/core/gateways/channel-provider.js +31 -6
- package/dist/core/gateways/channel-provider.js.map +1 -1
- package/dist/core/goal-loop-controller.d.ts +14 -9
- package/dist/core/goal-loop-controller.d.ts.map +1 -1
- package/dist/core/goal-loop-controller.js +47 -75
- package/dist/core/goal-loop-controller.js.map +1 -1
- package/dist/core/goals/compact-goal-context.d.ts +11 -0
- package/dist/core/goals/compact-goal-context.d.ts.map +1 -0
- package/dist/core/goals/compact-goal-context.js +59 -0
- package/dist/core/goals/compact-goal-context.js.map +1 -0
- package/dist/core/goals/goal-acceptance.d.ts +11 -0
- package/dist/core/goals/goal-acceptance.d.ts.map +1 -0
- package/dist/core/goals/goal-acceptance.js +27 -0
- package/dist/core/goals/goal-acceptance.js.map +1 -0
- package/dist/core/goals/goal-auto-continue-controller.d.ts +28 -0
- package/dist/core/goals/goal-auto-continue-controller.d.ts.map +1 -0
- package/dist/core/goals/goal-auto-continue-controller.js +90 -0
- package/dist/core/goals/goal-auto-continue-controller.js.map +1 -0
- package/dist/core/goals/goal-continuation-controller.d.ts +2 -2
- package/dist/core/goals/goal-continuation-controller.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-controller.js +52 -11
- package/dist/core/goals/goal-continuation-controller.js.map +1 -1
- package/dist/core/goals/goal-continuation-defaults.d.ts +4 -29
- package/dist/core/goals/goal-continuation-defaults.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-defaults.js +4 -32
- package/dist/core/goals/goal-continuation-defaults.js.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.d.ts +8 -18
- package/dist/core/goals/goal-continuation-prompt.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-prompt.js +9 -179
- package/dist/core/goals/goal-continuation-prompt.js.map +1 -1
- package/dist/core/goals/goal-lifecycle.d.ts +43 -0
- package/dist/core/goals/goal-lifecycle.d.ts.map +1 -0
- package/dist/core/goals/goal-lifecycle.js +102 -0
- package/dist/core/goals/goal-lifecycle.js.map +1 -0
- package/dist/core/goals/goal-record.d.ts +17 -0
- package/dist/core/goals/goal-record.d.ts.map +1 -0
- package/dist/core/goals/goal-record.js +31 -0
- package/dist/core/goals/goal-record.js.map +1 -0
- package/dist/core/goals/goal-runtime-snapshot.d.ts +11 -9
- package/dist/core/goals/goal-runtime-snapshot.d.ts.map +1 -1
- package/dist/core/goals/goal-runtime-snapshot.js +10 -8
- package/dist/core/goals/goal-runtime-snapshot.js.map +1 -1
- package/dist/core/goals/goal-session-controller.d.ts +42 -0
- package/dist/core/goals/goal-session-controller.d.ts.map +1 -0
- package/dist/core/goals/goal-session-controller.js +128 -0
- package/dist/core/goals/goal-session-controller.js.map +1 -0
- package/dist/core/goals/goal-state.d.ts +46 -25
- package/dist/core/goals/goal-state.d.ts.map +1 -1
- package/dist/core/goals/goal-state.js +91 -24
- package/dist/core/goals/goal-state.js.map +1 -1
- package/dist/core/goals/goal-tool-core.d.ts +9 -10
- package/dist/core/goals/goal-tool-core.d.ts.map +1 -1
- package/dist/core/goals/goal-tool-core.js +60 -75
- package/dist/core/goals/goal-tool-core.js.map +1 -1
- package/dist/core/goals/session-goal-state.d.ts +20 -12
- package/dist/core/goals/session-goal-state.d.ts.map +1 -1
- package/dist/core/goals/session-goal-state.js +133 -33
- package/dist/core/goals/session-goal-state.js.map +1 -1
- package/dist/core/human-input-controller.d.ts +47 -0
- package/dist/core/human-input-controller.d.ts.map +1 -0
- package/dist/core/human-input-controller.js +181 -0
- package/dist/core/human-input-controller.js.map +1 -0
- package/dist/core/human-input.d.ts +100 -0
- package/dist/core/human-input.d.ts.map +1 -0
- package/dist/core/human-input.js +362 -0
- package/dist/core/human-input.js.map +1 -0
- package/dist/core/index.d.ts +9 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +9 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/{telemetry.d.ts → install-telemetry.d.ts} +1 -1
- package/dist/core/install-telemetry.d.ts.map +1 -0
- package/dist/core/{telemetry.js → install-telemetry.js} +1 -1
- package/dist/core/install-telemetry.js.map +1 -0
- package/dist/core/keybindings.d.ts +17 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +24 -6
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/learning/learning-audit.d.ts +2 -4
- package/dist/core/learning/learning-audit.d.ts.map +1 -1
- package/dist/core/learning/learning-audit.js +9 -29
- package/dist/core/learning/learning-audit.js.map +1 -1
- package/dist/core/learning/learning-gate.d.ts.map +1 -1
- package/dist/core/learning/learning-gate.js +1 -6
- package/dist/core/learning/learning-gate.js.map +1 -1
- package/dist/core/learning/session-learning-decision.d.ts +2 -4
- package/dist/core/learning/session-learning-decision.d.ts.map +1 -1
- package/dist/core/learning/session-learning-decision.js +9 -29
- package/dist/core/learning/session-learning-decision.js.map +1 -1
- package/dist/core/local-runtime-controller.d.ts +1 -1
- package/dist/core/local-runtime-controller.d.ts.map +1 -1
- package/dist/core/local-runtime-controller.js.map +1 -1
- package/dist/core/memory-controller.d.ts.map +1 -1
- package/dist/core/memory-controller.js +4 -4
- package/dist/core/memory-controller.js.map +1 -1
- package/dist/core/model-capability.d.ts +0 -19
- package/dist/core/model-capability.d.ts.map +1 -1
- package/dist/core/model-capability.js +1 -19
- package/dist/core/model-capability.js.map +1 -1
- package/dist/core/model-registry.d.ts +6 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +13 -5
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +17 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +38 -25
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-router/intent-classifier.d.ts +1 -4
- package/dist/core/model-router/intent-classifier.d.ts.map +1 -1
- package/dist/core/model-router/intent-classifier.js +1 -156
- package/dist/core/model-router/intent-classifier.js.map +1 -1
- package/dist/core/model-router-controller.d.ts +1 -1
- package/dist/core/model-router-controller.d.ts.map +1 -1
- package/dist/core/model-router-controller.js +2 -2
- package/dist/core/model-router-controller.js.map +1 -1
- package/dist/core/model-selection-controller.d.ts +5 -5
- package/dist/core/model-selection-controller.d.ts.map +1 -1
- package/dist/core/model-selection-controller.js.map +1 -1
- package/dist/core/model-tool-protocol.d.ts +23 -0
- package/dist/core/model-tool-protocol.d.ts.map +1 -0
- package/dist/core/model-tool-protocol.js +43 -0
- package/dist/core/model-tool-protocol.js.map +1 -0
- package/dist/core/models/adaptation-store.d.ts +4 -6
- package/dist/core/models/adaptation-store.d.ts.map +1 -1
- package/dist/core/models/adaptation-store.js +95 -83
- package/dist/core/models/adaptation-store.js.map +1 -1
- package/dist/core/models/fitness-store.d.ts +2 -12
- package/dist/core/models/fitness-store.d.ts.map +1 -1
- package/dist/core/models/fitness-store.js +84 -57
- package/dist/core/models/fitness-store.js.map +1 -1
- package/dist/core/models/host-state-store.d.ts +34 -0
- package/dist/core/models/host-state-store.d.ts.map +1 -0
- package/dist/core/models/host-state-store.js +86 -0
- package/dist/core/models/host-state-store.js.map +1 -0
- package/dist/core/orchestration/agent-resume.d.ts +24 -0
- package/dist/core/orchestration/agent-resume.d.ts.map +1 -0
- package/dist/core/orchestration/agent-resume.js +90 -0
- package/dist/core/orchestration/agent-resume.js.map +1 -0
- package/dist/core/orchestration/capability-gateway.d.ts +61 -0
- package/dist/core/orchestration/capability-gateway.d.ts.map +1 -0
- package/dist/core/orchestration/capability-gateway.js +152 -0
- package/dist/core/orchestration/capability-gateway.js.map +1 -0
- package/dist/core/orchestration/contracts.d.ts +343 -0
- package/dist/core/orchestration/contracts.d.ts.map +1 -0
- package/dist/core/orchestration/contracts.js +135 -0
- package/dist/core/orchestration/contracts.js.map +1 -0
- package/dist/core/orchestration/delegation-ledger.d.ts +56 -0
- package/dist/core/orchestration/delegation-ledger.d.ts.map +1 -0
- package/dist/core/orchestration/delegation-ledger.js +200 -0
- package/dist/core/orchestration/delegation-ledger.js.map +1 -0
- package/dist/core/orchestration/event-store.d.ts +83 -0
- package/dist/core/orchestration/event-store.d.ts.map +1 -0
- package/dist/core/orchestration/event-store.js +560 -0
- package/dist/core/orchestration/event-store.js.map +1 -0
- package/dist/core/orchestration/lane-tool-manifests.d.ts +9 -0
- package/dist/core/orchestration/lane-tool-manifests.d.ts.map +1 -0
- package/dist/core/orchestration/lane-tool-manifests.js +37 -0
- package/dist/core/orchestration/lane-tool-manifests.js.map +1 -0
- package/dist/core/orchestration/model-binding.d.ts +15 -0
- package/dist/core/orchestration/model-binding.d.ts.map +1 -0
- package/dist/core/orchestration/model-binding.js +29 -0
- package/dist/core/orchestration/model-binding.js.map +1 -0
- package/dist/core/orchestration/policy-compiler.d.ts +49 -0
- package/dist/core/orchestration/policy-compiler.d.ts.map +1 -0
- package/dist/core/orchestration/policy-compiler.js +191 -0
- package/dist/core/orchestration/policy-compiler.js.map +1 -0
- package/dist/core/orchestration/policy-gate.d.ts +18 -0
- package/dist/core/orchestration/policy-gate.d.ts.map +1 -0
- package/dist/core/orchestration/policy-gate.js +24 -0
- package/dist/core/orchestration/policy-gate.js.map +1 -0
- package/dist/core/orchestration/profile-registry.d.ts +51 -0
- package/dist/core/orchestration/profile-registry.d.ts.map +1 -0
- package/dist/core/orchestration/profile-registry.js +393 -0
- package/dist/core/orchestration/profile-registry.js.map +1 -0
- package/dist/core/orchestration/profile-store.d.ts +31 -0
- package/dist/core/orchestration/profile-store.d.ts.map +1 -0
- package/dist/core/orchestration/profile-store.js +136 -0
- package/dist/core/orchestration/profile-store.js.map +1 -0
- package/dist/core/orchestration/risk-budget.d.ts +9 -0
- package/dist/core/orchestration/risk-budget.d.ts.map +1 -0
- package/dist/core/orchestration/risk-budget.js +48 -0
- package/dist/core/orchestration/risk-budget.js.map +1 -0
- package/dist/core/orchestration/task-runtime.d.ts +168 -0
- package/dist/core/orchestration/task-runtime.d.ts.map +1 -0
- package/dist/core/orchestration/task-runtime.js +1600 -0
- package/dist/core/orchestration/task-runtime.js.map +1 -0
- package/dist/core/orchestration/work-state-projection.d.ts +32 -0
- package/dist/core/orchestration/work-state-projection.d.ts.map +1 -0
- package/dist/core/orchestration/work-state-projection.js +116 -0
- package/dist/core/orchestration/work-state-projection.js.map +1 -0
- package/dist/core/orchestration/worker-execution-contract.d.ts +21 -0
- package/dist/core/orchestration/worker-execution-contract.d.ts.map +1 -0
- package/dist/core/orchestration/worker-execution-contract.js +179 -0
- package/dist/core/orchestration/worker-execution-contract.js.map +1 -0
- package/dist/core/orchestration/worker-result-adapter.d.ts +21 -0
- package/dist/core/orchestration/worker-result-adapter.d.ts.map +1 -0
- package/dist/core/orchestration/worker-result-adapter.js +109 -0
- package/dist/core/orchestration/worker-result-adapter.js.map +1 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +20 -3
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/process-identity.d.ts +11 -0
- package/dist/core/process-identity.d.ts.map +1 -0
- package/dist/core/process-identity.js +26 -0
- package/dist/core/process-identity.js.map +1 -0
- package/dist/core/process-matrix/codes.d.ts +14 -3
- package/dist/core/process-matrix/codes.d.ts.map +1 -1
- package/dist/core/process-matrix/codes.js.map +1 -1
- package/dist/core/process-matrix/resume-launcher.d.ts +26 -0
- package/dist/core/process-matrix/resume-launcher.d.ts.map +1 -0
- package/dist/core/process-matrix/resume-launcher.js +62 -0
- package/dist/core/process-matrix/resume-launcher.js.map +1 -0
- package/dist/core/process-matrix/runtime.d.ts +37 -22
- package/dist/core/process-matrix/runtime.d.ts.map +1 -1
- package/dist/core/process-matrix/runtime.js +399 -76
- package/dist/core/process-matrix/runtime.js.map +1 -1
- package/dist/core/process-matrix/store.d.ts +5 -2
- package/dist/core/process-matrix/store.d.ts.map +1 -1
- package/dist/core/process-matrix/store.js +123 -14
- package/dist/core/process-matrix/store.js.map +1 -1
- package/dist/core/process-matrix/supervisor.d.ts +10 -7
- package/dist/core/process-matrix/supervisor.d.ts.map +1 -1
- package/dist/core/process-matrix/supervisor.js +45 -14
- package/dist/core/process-matrix/supervisor.js.map +1 -1
- package/dist/core/profile-filter-controller.d.ts +8 -1
- package/dist/core/profile-filter-controller.d.ts.map +1 -1
- package/dist/core/profile-filter-controller.js +23 -5
- package/dist/core/profile-filter-controller.js.map +1 -1
- package/dist/core/profile-registry.d.ts.map +1 -1
- package/dist/core/profile-registry.js +6 -8
- package/dist/core/profile-registry.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +18 -29
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/reflection-controller.d.ts +5 -5
- package/dist/core/reflection-controller.d.ts.map +1 -1
- package/dist/core/reflection-controller.js +5 -2
- package/dist/core/reflection-controller.js.map +1 -1
- package/dist/core/reload-blockers.d.ts.map +1 -1
- package/dist/core/reload-blockers.js +6 -8
- package/dist/core/reload-blockers.js.map +1 -1
- package/dist/core/request-auth.d.ts +7 -0
- package/dist/core/request-auth.d.ts.map +1 -0
- package/dist/core/request-auth.js +8 -0
- package/dist/core/request-auth.js.map +1 -0
- package/dist/core/research/evidence-bundle.d.ts.map +1 -1
- package/dist/core/research/evidence-bundle.js +1 -6
- package/dist/core/research/evidence-bundle.js.map +1 -1
- package/dist/core/research/lane-model-resolver.d.ts +33 -0
- package/dist/core/research/lane-model-resolver.d.ts.map +1 -0
- package/dist/core/research/lane-model-resolver.js +65 -0
- package/dist/core/research/lane-model-resolver.js.map +1 -0
- package/dist/core/research/model-fitness-controller.d.ts +38 -0
- package/dist/core/research/model-fitness-controller.d.ts.map +1 -0
- package/dist/core/research/model-fitness-controller.js +106 -0
- package/dist/core/research/model-fitness-controller.js.map +1 -0
- package/dist/core/research/model-fitness.d.ts +1 -1
- package/dist/core/research/model-fitness.d.ts.map +1 -1
- package/dist/core/research/model-fitness.js +4 -4
- package/dist/core/research/model-fitness.js.map +1 -1
- package/dist/core/research/research-gate.d.ts.map +1 -1
- package/dist/core/research/research-gate.js +7 -7
- package/dist/core/research/research-gate.js.map +1 -1
- package/dist/core/research/research-lane-controller.d.ts +62 -0
- package/dist/core/research/research-lane-controller.d.ts.map +1 -0
- package/dist/core/research/research-lane-controller.js +292 -0
- package/dist/core/research/research-lane-controller.js.map +1 -0
- package/dist/core/research/session-evidence-bundle.d.ts +2 -4
- package/dist/core/research/session-evidence-bundle.d.ts.map +1 -1
- package/dist/core/research/session-evidence-bundle.js +10 -46
- package/dist/core/research/session-evidence-bundle.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +23 -8
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/risk-classifier.d.ts +6 -0
- package/dist/core/risk-classifier.d.ts.map +1 -0
- package/dist/core/risk-classifier.js +233 -0
- package/dist/core/risk-classifier.js.map +1 -0
- package/dist/core/runtime-builder.d.ts +41 -23
- package/dist/core/runtime-builder.d.ts.map +1 -1
- package/dist/core/runtime-builder.js +365 -253
- package/dist/core/runtime-builder.js.map +1 -1
- package/dist/core/sdk.d.ts +6 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +68 -25
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/secrets/credential-exposure-guard.d.ts +9 -0
- package/dist/core/secrets/credential-exposure-guard.d.ts.map +1 -0
- package/dist/core/secrets/credential-exposure-guard.js +241 -0
- package/dist/core/secrets/credential-exposure-guard.js.map +1 -0
- package/dist/core/secrets/secret-dotenv.d.ts +27 -0
- package/dist/core/secrets/secret-dotenv.d.ts.map +1 -0
- package/dist/core/secrets/secret-dotenv.js +183 -0
- package/dist/core/secrets/secret-dotenv.js.map +1 -0
- package/dist/core/secrets/secret-vault-format.d.ts +112 -0
- package/dist/core/secrets/secret-vault-format.d.ts.map +1 -0
- package/dist/core/secrets/secret-vault-format.js +397 -0
- package/dist/core/secrets/secret-vault-format.js.map +1 -0
- package/dist/core/secrets/secret-vault.d.ts +72 -0
- package/dist/core/secrets/secret-vault.d.ts.map +1 -0
- package/dist/core/secrets/secret-vault.js +671 -0
- package/dist/core/secrets/secret-vault.js.map +1 -0
- package/dist/core/session-analytics.d.ts +4 -23
- package/dist/core/session-analytics.d.ts.map +1 -1
- package/dist/core/session-analytics.js +67 -70
- package/dist/core/session-analytics.js.map +1 -1
- package/dist/core/session-image-store.d.ts +33 -0
- package/dist/core/session-image-store.d.ts.map +1 -0
- package/dist/core/session-image-store.js +283 -0
- package/dist/core/session-image-store.js.map +1 -0
- package/dist/core/session-role.d.ts +11 -4
- package/dist/core/session-role.d.ts.map +1 -1
- package/dist/core/session-role.js +24 -5
- package/dist/core/session-role.js.map +1 -1
- package/dist/core/session-snapshot.d.ts +34 -0
- package/dist/core/session-snapshot.d.ts.map +1 -0
- package/dist/core/session-snapshot.js +68 -0
- package/dist/core/session-snapshot.js.map +1 -0
- package/dist/core/session-supervision-runtime.d.ts +31 -0
- package/dist/core/session-supervision-runtime.d.ts.map +1 -0
- package/dist/core/session-supervision-runtime.js +97 -0
- package/dist/core/session-supervision-runtime.js.map +1 -0
- package/dist/core/session-tree-navigator.d.ts +4 -6
- package/dist/core/session-tree-navigator.d.ts.map +1 -1
- package/dist/core/session-tree-navigator.js +4 -1
- package/dist/core/session-tree-navigator.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +81 -29
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tasks/session-task-state.d.ts +2 -4
- package/dist/core/tasks/session-task-state.d.ts.map +1 -1
- package/dist/core/tasks/session-task-state.js +10 -28
- package/dist/core/tasks/session-task-state.js.map +1 -1
- package/dist/core/tasks/task-projection.d.ts +20 -0
- package/dist/core/tasks/task-projection.d.ts.map +1 -0
- package/dist/core/tasks/task-projection.js +47 -0
- package/dist/core/tasks/task-projection.js.map +1 -0
- package/dist/core/tasks/task-state.d.ts +4 -0
- package/dist/core/tasks/task-state.d.ts.map +1 -1
- package/dist/core/tasks/task-state.js +28 -11
- package/dist/core/tasks/task-state.js.map +1 -1
- package/dist/core/tool-capability-policy.d.ts +13 -0
- package/dist/core/tool-capability-policy.d.ts.map +1 -0
- package/dist/core/tool-capability-policy.js +86 -0
- package/dist/core/tool-capability-policy.js.map +1 -0
- package/dist/core/tool-gate-controller.d.ts.map +1 -1
- package/dist/core/tool-gate-controller.js +8 -2
- package/dist/core/tool-gate-controller.js.map +1 -1
- package/dist/core/tool-protocol-controller.d.ts +89 -0
- package/dist/core/tool-protocol-controller.d.ts.map +1 -0
- package/dist/core/tool-protocol-controller.js +512 -0
- package/dist/core/tool-protocol-controller.js.map +1 -0
- package/dist/core/tool-recovery-log-records.d.ts +2 -3
- package/dist/core/tool-recovery-log-records.d.ts.map +1 -1
- package/dist/core/tool-recovery-log-records.js +9 -35
- package/dist/core/tool-recovery-log-records.js.map +1 -1
- package/dist/core/tool-recovery-stats.d.ts +21 -1
- package/dist/core/tool-recovery-stats.d.ts.map +1 -1
- package/dist/core/tool-recovery-stats.js.map +1 -1
- package/dist/core/tool-selection/tool-performance-store.d.ts +3 -7
- package/dist/core/tool-selection/tool-performance-store.d.ts.map +1 -1
- package/dist/core/tool-selection/tool-performance-store.js +97 -138
- package/dist/core/tool-selection/tool-performance-store.js.map +1 -1
- package/dist/core/tools/ask-question.d.ts +124 -0
- package/dist/core/tools/ask-question.d.ts.map +1 -0
- package/dist/core/tools/ask-question.js +693 -0
- package/dist/core/tools/ask-question.js.map +1 -0
- package/dist/core/tools/bash.d.ts +5 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +59 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/delegate-status.d.ts +31 -3
- package/dist/core/tools/delegate-status.d.ts.map +1 -1
- package/dist/core/tools/delegate-status.js +148 -29
- package/dist/core/tools/delegate-status.js.map +1 -1
- package/dist/core/tools/delegate.d.ts +15 -13
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +106 -23
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/extensionify.d.ts.map +1 -1
- package/dist/core/tools/extensionify.js +1 -0
- package/dist/core/tools/extensionify.js.map +1 -1
- package/dist/core/tools/git-filter.d.ts +1 -8
- package/dist/core/tools/git-filter.d.ts.map +1 -1
- package/dist/core/tools/git-filter.js +2 -63
- package/dist/core/tools/git-filter.js.map +1 -1
- package/dist/core/tools/goal.d.ts +10 -8
- package/dist/core/tools/goal.d.ts.map +1 -1
- package/dist/core/tools/goal.js +106 -28
- package/dist/core/tools/goal.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/model-fitness.d.ts.map +1 -1
- package/dist/core/tools/model-fitness.js +2 -2
- package/dist/core/tools/model-fitness.js.map +1 -1
- package/dist/core/tools/orchestration-panel.d.ts +40 -0
- package/dist/core/tools/orchestration-panel.d.ts.map +1 -0
- package/dist/core/tools/orchestration-panel.js +124 -0
- package/dist/core/tools/orchestration-panel.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +11 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +36 -3
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/python.d.ts +2 -0
- package/dist/core/tools/python.d.ts.map +1 -1
- package/dist/core/tools/python.js +3 -1
- package/dist/core/tools/python.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/run-process.d.ts +26 -0
- package/dist/core/tools/run-process.d.ts.map +1 -0
- package/dist/core/tools/run-process.js +138 -0
- package/dist/core/tools/run-process.js.map +1 -0
- package/dist/core/tools/search-command-guard.d.ts +14 -0
- package/dist/core/tools/search-command-guard.d.ts.map +1 -0
- package/dist/core/tools/search-command-guard.js +333 -0
- package/dist/core/tools/search-command-guard.js.map +1 -0
- package/dist/core/tools/secret-store.d.ts +38 -0
- package/dist/core/tools/secret-store.d.ts.map +1 -0
- package/dist/core/tools/secret-store.js +412 -0
- package/dist/core/tools/secret-store.js.map +1 -0
- package/dist/core/tools/shell-command-parser.d.ts +16 -0
- package/dist/core/tools/shell-command-parser.d.ts.map +1 -0
- package/dist/core/tools/shell-command-parser.js +113 -0
- package/dist/core/tools/shell-command-parser.js.map +1 -0
- package/dist/core/tools/task-steps.d.ts +2 -0
- package/dist/core/tools/task-steps.d.ts.map +1 -1
- package/dist/core/tools/task-steps.js +99 -0
- package/dist/core/tools/task-steps.js.map +1 -1
- package/dist/core/tools/tmux-dispatch.d.ts +3 -5
- package/dist/core/tools/tmux-dispatch.d.ts.map +1 -1
- package/dist/core/tools/tmux-dispatch.js +4 -4
- package/dist/core/tools/tmux-dispatch.js.map +1 -1
- package/dist/core/tools/windows-shell-engine.d.ts.map +1 -1
- package/dist/core/tools/windows-shell-engine.js +4 -6
- package/dist/core/tools/windows-shell-engine.js.map +1 -1
- package/dist/core/util/atomic-file.d.ts +6 -2
- package/dist/core/util/atomic-file.d.ts.map +1 -1
- package/dist/core/util/atomic-file.js +4 -4
- package/dist/core/util/atomic-file.js.map +1 -1
- package/dist/core/util/bounded-jsonl.d.ts +10 -0
- package/dist/core/util/bounded-jsonl.d.ts.map +1 -0
- package/dist/core/util/bounded-jsonl.js +75 -0
- package/dist/core/util/bounded-jsonl.js.map +1 -0
- package/dist/core/util/value-guards.d.ts +5 -0
- package/dist/core/util/value-guards.d.ts.map +1 -0
- package/dist/core/util/value-guards.js +12 -0
- package/dist/core/util/value-guards.js.map +1 -0
- package/dist/core/worktree-sync/store.d.ts +3 -3
- package/dist/core/worktree-sync/store.d.ts.map +1 -1
- package/dist/core/worktree-sync/store.js +10 -5
- package/dist/core/worktree-sync/store.js.map +1 -1
- package/dist/index.d.ts +15 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +149 -51
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +4 -6
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +186 -28
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/auth-dialogs-controller.d.ts +4 -0
- package/dist/modes/interactive/auth-dialogs-controller.d.ts.map +1 -1
- package/dist/modes/interactive/auth-dialogs-controller.js +60 -1
- package/dist/modes/interactive/auth-dialogs-controller.js.map +1 -1
- package/dist/modes/interactive/clipboard-input.d.ts +7 -1
- package/dist/modes/interactive/clipboard-input.d.ts.map +1 -1
- package/dist/modes/interactive/clipboard-input.js +44 -6
- package/dist/modes/interactive/clipboard-input.js.map +1 -1
- package/dist/modes/interactive/components/activity-lane.d.ts +55 -0
- package/dist/modes/interactive/components/activity-lane.d.ts.map +1 -0
- package/dist/modes/interactive/components/activity-lane.js +304 -0
- package/dist/modes/interactive/components/activity-lane.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +19 -10
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/expandable-text.d.ts +12 -0
- package/dist/modes/interactive/components/expandable-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/expandable-text.js +17 -0
- package/dist/modes/interactive/components/expandable-text.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +15 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +30 -21
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +6 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +2 -2
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +23 -14
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +6 -6
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +19 -11
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +53 -20
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-group.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-group.js +3 -0
- package/dist/modes/interactive/components/tool-group.js.map +1 -1
- package/dist/modes/interactive/components/usage-action-selector.d.ts +16 -0
- package/dist/modes/interactive/components/usage-action-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/usage-action-selector.js +46 -0
- package/dist/modes/interactive/components/usage-action-selector.js.map +1 -0
- package/dist/modes/interactive/config-backup.d.ts.map +1 -1
- package/dist/modes/interactive/config-backup.js +5 -4
- package/dist/modes/interactive/config-backup.js.map +1 -1
- package/dist/modes/interactive/extension-ui-host.d.ts +14 -0
- package/dist/modes/interactive/extension-ui-host.d.ts.map +1 -1
- package/dist/modes/interactive/extension-ui-host.js +77 -15
- package/dist/modes/interactive/extension-ui-host.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +15 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +27 -19
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/history-reload-math.d.ts +6 -2
- package/dist/modes/interactive/history-reload-math.d.ts.map +1 -1
- package/dist/modes/interactive/history-reload-math.js +10 -5
- package/dist/modes/interactive/history-reload-math.js.map +1 -1
- package/dist/modes/interactive/interactive-event-controller.d.ts +74 -0
- package/dist/modes/interactive/interactive-event-controller.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-event-controller.js +328 -0
- package/dist/modes/interactive/interactive-event-controller.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +22 -24
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +245 -595
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/key-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/key-handlers.js +1 -1
- package/dist/modes/interactive/key-handlers.js.map +1 -1
- package/dist/modes/interactive/loaded-resources-view.d.ts +20 -0
- package/dist/modes/interactive/loaded-resources-view.d.ts.map +1 -0
- package/dist/modes/interactive/loaded-resources-view.js +147 -0
- package/dist/modes/interactive/loaded-resources-view.js.map +1 -0
- package/dist/modes/interactive/profile-menu-controller.d.ts.map +1 -1
- package/dist/modes/interactive/profile-menu-controller.js +7 -7
- package/dist/modes/interactive/profile-menu-controller.js.map +1 -1
- package/dist/modes/interactive/report-commands.d.ts.map +1 -1
- package/dist/modes/interactive/report-commands.js +21 -0
- package/dist/modes/interactive/report-commands.js.map +1 -1
- package/dist/modes/interactive/resource-display.d.ts.map +1 -1
- package/dist/modes/interactive/resource-display.js +8 -2
- package/dist/modes/interactive/resource-display.js.map +1 -1
- package/dist/modes/interactive/resource-shell-commands.d.ts +1 -5
- package/dist/modes/interactive/resource-shell-commands.d.ts.map +1 -1
- package/dist/modes/interactive/resource-shell-commands.js +0 -5
- package/dist/modes/interactive/resource-shell-commands.js.map +1 -1
- package/dist/modes/interactive/session-flow-commands.d.ts +27 -8
- package/dist/modes/interactive/session-flow-commands.d.ts.map +1 -1
- package/dist/modes/interactive/session-flow-commands.js +150 -64
- package/dist/modes/interactive/session-flow-commands.js.map +1 -1
- package/dist/modes/interactive/session-io-commands.d.ts.map +1 -1
- package/dist/modes/interactive/session-io-commands.js +16 -6
- package/dist/modes/interactive/session-io-commands.js.map +1 -1
- package/dist/modes/interactive/session-replacement-errors.d.ts +7 -0
- package/dist/modes/interactive/session-replacement-errors.d.ts.map +1 -0
- package/dist/modes/interactive/session-replacement-errors.js +15 -0
- package/dist/modes/interactive/session-replacement-errors.js.map +1 -0
- package/dist/modes/interactive/startup-checks.d.ts.map +1 -1
- package/dist/modes/interactive/startup-checks.js +1 -1
- package/dist/modes/interactive/startup-checks.js.map +1 -1
- package/dist/modes/interactive/usage-commands.d.ts +34 -0
- package/dist/modes/interactive/usage-commands.d.ts.map +1 -0
- package/dist/modes/interactive/usage-commands.js +225 -0
- package/dist/modes/interactive/usage-commands.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +82 -23
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +15 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +138 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +2 -13
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +1 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +52 -1
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/platform.d.ts +3 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +8 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +5 -3
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +3 -1
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/work-directory.d.ts +11 -0
- package/dist/utils/work-directory.d.ts.map +1 -1
- package/dist/utils/work-directory.js +30 -9
- package/dist/utils/work-directory.js.map +1 -1
- package/docs/UI_POLISH_ORCHESTRATION.md +38 -0
- package/docs/UI_QUALITY_ORCHESTRATION.md +28 -0
- package/docs/docs.json +4 -0
- package/docs/extensions.md +62 -2
- package/docs/harness-architecture.md +156 -0
- package/docs/keybindings.md +11 -1
- package/docs/process-matrix.md +59 -26
- package/docs/providers.md +9 -1
- package/docs/rpc.md +45 -2
- package/docs/sessions.md +15 -0
- package/docs/settings.md +125 -11
- package/docs/task-steps.md +8 -0
- package/docs/telemetry.md +19 -0
- package/docs/tmux-agent-manager.md +10 -3
- package/docs/ui-reference/README.md +9 -0
- package/docs/ui-reference/orchestration-after.txt +14 -0
- package/docs/ui-reference/orchestration-before.txt +13 -0
- package/docs/ui-reference/orchestration-reference.txt +16 -0
- package/docs/usage.md +22 -2
- package/docs/work-directory.md +19 -8
- 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/question.ts +34 -245
- package/examples/extensions/questionnaire.ts +41 -407
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +13 -13
- package/package.json +4 -4
- package/dist/core/delegation/session-worker-result.d.ts +0 -46
- package/dist/core/delegation/session-worker-result.d.ts.map +0 -1
- package/dist/core/delegation/session-worker-result.js +0 -113
- package/dist/core/delegation/session-worker-result.js.map +0 -1
- package/dist/core/delegation/worker-result.d.ts.map +0 -1
- package/dist/core/delegation/worker-result.js.map +0 -1
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/telemetry.js.map +0 -1
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as fs from "node:fs";
|
|
6
6
|
import * as path from "node:path";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { APP_NAME, APP_TITLE, VERSION } from "../../config.js";
|
|
7
|
+
import { Container, Loader, ProcessTerminal, Spacer, setKeybindings, Text, TUI, } from "@caupulican/pi-tui";
|
|
8
|
+
import { APP_NAME, APP_TITLE, getAgentDir, VERSION } from "../../config.js";
|
|
10
9
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
11
10
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
12
11
|
import { DEFAULT_GOAL_CONTINUE_MAX_STALL_TURNS, DEFAULT_GOAL_CONTINUE_MAX_TURNS, DEFAULT_GOAL_CONTINUE_MAX_WALL_CLOCK_MINUTES, MAX_GOAL_CONTINUE_MAX_STALL_TURNS, MAX_GOAL_CONTINUE_MAX_TURNS, MAX_GOAL_CONTINUE_MAX_WALL_CLOCK_MINUTES, } from "../../core/goals/goal-continuation-defaults.js";
|
|
13
12
|
import { configureHttpDispatcher } from "../../core/http-dispatcher.js";
|
|
14
13
|
import { KeybindingsManager } from "../../core/keybindings.js";
|
|
15
14
|
import { formatMissingSessionCwdPrompt } from "../../core/session-cwd.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { SessionImageStore } from "../../core/session-image-store.js";
|
|
16
|
+
import { isRecordObject } from "../../core/util/value-guards.js";
|
|
17
|
+
import { resolvePath } from "../../utils/paths.js";
|
|
18
18
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
19
19
|
import { checkForNewPiVersion } from "../../utils/version-check.js";
|
|
20
20
|
import { AuthDialogsController } from "./auth-dialogs-controller.js";
|
|
@@ -23,57 +23,46 @@ import * as autocompleteProvider from "./autocomplete-provider.js";
|
|
|
23
23
|
import * as autonomyCommands from "./autonomy-commands.js";
|
|
24
24
|
import * as clipboardInput from "./clipboard-input.js";
|
|
25
25
|
import * as compactionQueue from "./compaction-queue.js";
|
|
26
|
+
import { ActivityLaneComponent } from "./components/activity-lane.js";
|
|
26
27
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
27
28
|
import { BashExecutionComponent } from "./components/bash-execution.js";
|
|
28
29
|
import { BranchSummaryMessageComponent } from "./components/branch-summary-message.js";
|
|
29
30
|
import { CompactionSummaryMessageComponent } from "./components/compaction-summary-message.js";
|
|
30
|
-
import { CountdownTimer } from "./components/countdown-timer.js";
|
|
31
31
|
import { CustomEditor } from "./components/custom-editor.js";
|
|
32
32
|
import { CustomMessageComponent } from "./components/custom-message.js";
|
|
33
33
|
import { DynamicBorder } from "./components/dynamic-border.js";
|
|
34
|
+
import { ExpandableText, isExpandable } from "./components/expandable-text.js";
|
|
34
35
|
import { FooterComponent } from "./components/footer.js";
|
|
35
36
|
import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
|
|
36
37
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
37
38
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
38
39
|
import { ToolGroupComponent } from "./components/tool-group.js";
|
|
39
|
-
import { getToolPanelActionKey,
|
|
40
|
+
import { getToolPanelActionKey, shouldReuseToolPanelInPlace, ToolPanelRegistry, } from "./components/tool-panel-registry.js";
|
|
40
41
|
import { UserMessageComponent } from "./components/user-message.js";
|
|
41
42
|
import * as configBackup from "./config-backup.js";
|
|
42
43
|
import { EditorOverlayHost } from "./editor-overlay-host.js";
|
|
43
44
|
import { ExtensionUiHost } from "./extension-ui-host.js";
|
|
44
45
|
import { openEditorForPath, openExternalEditor } from "./external-editor.js";
|
|
45
46
|
import * as historyReloadMath from "./history-reload-math.js";
|
|
47
|
+
import { handleInteractiveEvent } from "./interactive-event-controller.js";
|
|
46
48
|
import * as keyHandlers from "./key-handlers.js";
|
|
49
|
+
import { renderLoadedResources } from "./loaded-resources-view.js";
|
|
47
50
|
import * as localModelCommands from "./local-model-commands.js";
|
|
48
51
|
import { ProfileMenuController } from "./profile-menu-controller.js";
|
|
49
52
|
import * as reportCommands from "./report-commands.js";
|
|
50
|
-
import * as resourceDisplay from "./resource-display.js";
|
|
51
53
|
import * as resourceShellCommands from "./resource-shell-commands.js";
|
|
52
54
|
import * as sessionFlows from "./session-flow-commands.js";
|
|
53
55
|
import * as sessionIoCommands from "./session-io-commands.js";
|
|
56
|
+
import { handleNonFatalSessionReplacementError } from "./session-replacement-errors.js";
|
|
54
57
|
import * as settingsSelectorFlow from "./settings-selector-flow.js";
|
|
55
58
|
import * as signalLifecycle from "./signal-lifecycle.js";
|
|
56
59
|
import * as startupChecks from "./startup-checks.js";
|
|
57
60
|
import { getEditorTheme, getMarkdownTheme, initTheme, onThemeChange, setRegisteredThemes, setTheme, stopThemeWatcher, theme, } from "./theme/theme.js";
|
|
61
|
+
import * as usageCommands from "./usage-commands.js";
|
|
58
62
|
const TUI_HISTORY_RELOAD_CHUNK_SIZE = 20;
|
|
59
63
|
const TUI_LIVE_HISTORY_MAX_COMPONENTS = 260;
|
|
60
64
|
const TUI_LIVE_HISTORY_TRIM_TO_COMPONENTS = 220;
|
|
61
65
|
const STREAMING_UI_UPDATE_INTERVAL_MS = 80;
|
|
62
|
-
function isExpandable(obj) {
|
|
63
|
-
return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
|
|
64
|
-
}
|
|
65
|
-
class ExpandableText extends Text {
|
|
66
|
-
getCollapsedText;
|
|
67
|
-
getExpandedText;
|
|
68
|
-
constructor(getCollapsedText, getExpandedText, expanded = false, paddingX = 0, paddingY = 0) {
|
|
69
|
-
super(expanded ? getExpandedText() : getCollapsedText(), paddingX, paddingY);
|
|
70
|
-
this.getCollapsedText = getCollapsedText;
|
|
71
|
-
this.getExpandedText = getExpandedText;
|
|
72
|
-
}
|
|
73
|
-
setExpanded(expanded) {
|
|
74
|
-
this.setText(expanded ? this.getExpandedText() : this.getCollapsedText());
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
66
|
const ANTHROPIC_SUBSCRIPTION_AUTH_WARNING = "Anthropic subscription auth is active. Third-party harness usage draws from extra usage and is billed per token, not your Claude plan limits. Manage extra usage at https://claude.ai/settings/usage.";
|
|
78
67
|
function isAnthropicSubscriptionAuthKey(apiKey) {
|
|
79
68
|
return typeof apiKey === "string" && apiKey.startsWith("sk-ant-oat");
|
|
@@ -126,6 +115,7 @@ export class InteractiveMode {
|
|
|
126
115
|
pendingUserInputs = [];
|
|
127
116
|
pendingClipboardImages = [];
|
|
128
117
|
clipboardImageCounter = 0;
|
|
118
|
+
clipboardImageStore;
|
|
129
119
|
loadingAnimation = undefined;
|
|
130
120
|
workingMessage = undefined;
|
|
131
121
|
workingVisible = true;
|
|
@@ -170,10 +160,8 @@ export class InteractiveMode {
|
|
|
170
160
|
// Track pending bash components (shown in pending area, moved to chat on submit)
|
|
171
161
|
pendingBashComponents = [];
|
|
172
162
|
// Auto-compaction state
|
|
173
|
-
autoCompactionLoader = undefined;
|
|
174
163
|
autoCompactionEscapeHandler;
|
|
175
164
|
// Auto-retry state
|
|
176
|
-
retryLoader = undefined;
|
|
177
165
|
retryCountdown = undefined;
|
|
178
166
|
retryEscapeHandler;
|
|
179
167
|
// Messages queued while compaction is running
|
|
@@ -183,6 +171,8 @@ export class InteractiveMode {
|
|
|
183
171
|
// Extension widget containers (hold components rendered above/below the editor)
|
|
184
172
|
widgetContainerAbove;
|
|
185
173
|
widgetContainerBelow;
|
|
174
|
+
activityLane;
|
|
175
|
+
hasHumanAudience;
|
|
186
176
|
// Header container that holds the built-in or custom header
|
|
187
177
|
headerContainer;
|
|
188
178
|
// Built-in header (logo + keybinding hints + changelog)
|
|
@@ -204,6 +194,8 @@ export class InteractiveMode {
|
|
|
204
194
|
constructor(runtimeHost, options = {}) {
|
|
205
195
|
this.runtimeHost = runtimeHost;
|
|
206
196
|
this.options = options;
|
|
197
|
+
this.hasHumanAudience = options.hasHumanAudience ?? true;
|
|
198
|
+
this.workingVisible = this.hasHumanAudience;
|
|
207
199
|
this.runtimeHost.setBeforeSessionInvalidate(() => {
|
|
208
200
|
this.extensionUiHost.resetExtensionUI();
|
|
209
201
|
});
|
|
@@ -219,6 +211,9 @@ export class InteractiveMode {
|
|
|
219
211
|
this.statusContainer = new Container();
|
|
220
212
|
this.widgetContainerAbove = new Container();
|
|
221
213
|
this.widgetContainerBelow = new Container();
|
|
214
|
+
this.activityLane = this.hasHumanAudience
|
|
215
|
+
? new ActivityLaneComponent(theme, () => this.ui.requestRender())
|
|
216
|
+
: undefined;
|
|
222
217
|
this.keybindings = KeybindingsManager.create();
|
|
223
218
|
setKeybindings(this.keybindings);
|
|
224
219
|
const editorPaddingX = this.settingsManager.getEditorPaddingX();
|
|
@@ -304,6 +299,7 @@ export class InteractiveMode {
|
|
|
304
299
|
},
|
|
305
300
|
getBuiltInHeader: () => this.builtInHeader,
|
|
306
301
|
getAutocompleteProvider: () => this.autocompleteProvider,
|
|
302
|
+
getClipboardImageStore: () => this.clipboardImageStore,
|
|
307
303
|
getToolsExpanded: () => this.toolOutputExpanded,
|
|
308
304
|
pushAutocompleteProviderWrapper: (factory) => {
|
|
309
305
|
this.autocompleteProviderWrappers.push(factory);
|
|
@@ -339,19 +335,6 @@ export class InteractiveMode {
|
|
|
339
335
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
340
336
|
initTheme(this.settingsManager.getTheme(), true);
|
|
341
337
|
}
|
|
342
|
-
getBuiltInCommandConflictDiagnostics(extensionRunner) {
|
|
343
|
-
const builtinNames = new Set(BUILTIN_SLASH_COMMANDS.map((command) => command.name));
|
|
344
|
-
return extensionRunner
|
|
345
|
-
.getRegisteredCommands()
|
|
346
|
-
.filter((command) => builtinNames.has(command.name))
|
|
347
|
-
.map((command) => ({
|
|
348
|
-
type: "warning",
|
|
349
|
-
message: command.invocationName === command.name
|
|
350
|
-
? `Extension command '/${command.name}' conflicts with built-in interactive command. Skipping in autocomplete.`
|
|
351
|
-
: `Extension command '/${command.name}' conflicts with built-in interactive command. Available as '/${command.invocationName}'.`,
|
|
352
|
-
path: command.sourceInfo.path,
|
|
353
|
-
}));
|
|
354
|
-
}
|
|
355
338
|
// Thin delegate retained so setupAutocompleteProvider's base-provider seam
|
|
356
339
|
// (stubbed via prototype in interactive-mode-status.test.ts) keeps working.
|
|
357
340
|
createBaseAutocompleteProvider() {
|
|
@@ -472,13 +455,19 @@ export class InteractiveMode {
|
|
|
472
455
|
this.headerContainer.addChild(this.builtInHeader);
|
|
473
456
|
}
|
|
474
457
|
this.ui.addChild(this.chatContainer);
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
458
|
+
if (this.hasHumanAudience) {
|
|
459
|
+
this.ui.addChild(this.pendingMessagesContainer);
|
|
460
|
+
this.ui.addChild(this.statusContainer);
|
|
461
|
+
this.extensionUiHost.renderWidgets(); // Initialize with default spacer
|
|
462
|
+
this.ui.addChild(this.widgetContainerAbove);
|
|
463
|
+
if (this.activityLane)
|
|
464
|
+
this.ui.addChild(this.activityLane);
|
|
465
|
+
}
|
|
479
466
|
this.ui.addChild(this.editorContainer);
|
|
480
|
-
|
|
481
|
-
|
|
467
|
+
if (this.hasHumanAudience) {
|
|
468
|
+
this.ui.addChild(this.widgetContainerBelow);
|
|
469
|
+
this.ui.addChild(this.footer);
|
|
470
|
+
}
|
|
482
471
|
this.ui.setFocus(this.editor);
|
|
483
472
|
this.setupKeyHandlers();
|
|
484
473
|
this.setupEditorSubmitHandler();
|
|
@@ -496,6 +485,7 @@ export class InteractiveMode {
|
|
|
496
485
|
onThemeChange(() => {
|
|
497
486
|
this.ui.invalidate();
|
|
498
487
|
this.updateEditorBorderColor();
|
|
488
|
+
this.refreshActivityLane();
|
|
499
489
|
this.ui.requestRender();
|
|
500
490
|
});
|
|
501
491
|
// Set up git branch watcher (uses provider instead of footer)
|
|
@@ -535,10 +525,17 @@ export class InteractiveMode {
|
|
|
535
525
|
}
|
|
536
526
|
});
|
|
537
527
|
// Start package update check asynchronously
|
|
538
|
-
this.checkForPackageUpdates()
|
|
528
|
+
this.checkForPackageUpdates()
|
|
529
|
+
.then((updates) => {
|
|
539
530
|
if (updates.length > 0) {
|
|
540
531
|
this.showPackageUpdateNotification(updates);
|
|
541
532
|
}
|
|
533
|
+
})
|
|
534
|
+
.finally(() => {
|
|
535
|
+
// npm can overwrite the shared Windows console title while checking extension versions.
|
|
536
|
+
if (process.platform === "win32" && this.isInitialized) {
|
|
537
|
+
this.updateTerminalTitle();
|
|
538
|
+
}
|
|
542
539
|
});
|
|
543
540
|
// Check tmux keyboard setup asynchronously
|
|
544
541
|
this.checkTmuxKeyboardSetup().then((warning) => {
|
|
@@ -617,6 +614,50 @@ export class InteractiveMode {
|
|
|
617
614
|
this.footerDataProvider.setAutonomyStatusSnapshot(this.session.getAutonomyStatusSnapshot());
|
|
618
615
|
this.footer.invalidate();
|
|
619
616
|
}
|
|
617
|
+
activityLaneSnapshot() {
|
|
618
|
+
return {
|
|
619
|
+
goalState: this.session.getGoalStateSnapshot(),
|
|
620
|
+
taskState: this.session.getTaskStepsStateSnapshot(),
|
|
621
|
+
laneRecords: this.session.getLaneRecords(),
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
refreshActivityLane(options = {}) {
|
|
625
|
+
if (!this.activityLane)
|
|
626
|
+
return;
|
|
627
|
+
const sessionKey = this.sessionManager.getSessionId();
|
|
628
|
+
if (options.replace) {
|
|
629
|
+
this.activityLane.replaceCanonical(sessionKey, this.activityLaneSnapshot());
|
|
630
|
+
}
|
|
631
|
+
else {
|
|
632
|
+
this.activityLane.updateCanonical(sessionKey, this.activityLaneSnapshot());
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
toolActivityKind(toolName) {
|
|
636
|
+
if (toolName === "task_steps")
|
|
637
|
+
return "task";
|
|
638
|
+
if (toolName === "goal")
|
|
639
|
+
return "goal";
|
|
640
|
+
if (toolName === "delegate" || toolName === "delegate_status")
|
|
641
|
+
return "worker";
|
|
642
|
+
return "tool";
|
|
643
|
+
}
|
|
644
|
+
toolActivityLabel(toolName) {
|
|
645
|
+
const label = this.getRegisteredToolDefinition(toolName)?.label?.trim() || toolName;
|
|
646
|
+
return label.replace(/[_-]+/g, " ").replace(/(^|\s)\S/g, (character) => character.toUpperCase());
|
|
647
|
+
}
|
|
648
|
+
toolActivityTerminalStatus(isError, details) {
|
|
649
|
+
if (isError)
|
|
650
|
+
return "failure";
|
|
651
|
+
if (!isRecordObject(details))
|
|
652
|
+
return "success";
|
|
653
|
+
if (details.applied === false || details.kind === "error")
|
|
654
|
+
return "failure";
|
|
655
|
+
if (details.kind === "review" && details.reviewed === false)
|
|
656
|
+
return "failure";
|
|
657
|
+
if (details.started === false)
|
|
658
|
+
return "neutral";
|
|
659
|
+
return "success";
|
|
660
|
+
}
|
|
620
661
|
checkForPackageUpdates() {
|
|
621
662
|
return startupChecks.checkForPackageUpdates(this.startupChecksHost());
|
|
622
663
|
}
|
|
@@ -639,220 +680,25 @@ export class InteractiveMode {
|
|
|
639
680
|
// =========================================================================
|
|
640
681
|
// Extension System
|
|
641
682
|
// =========================================================================
|
|
642
|
-
// The resource-display formatters below are pure and live in ./resource-display.ts.
|
|
643
|
-
// These thin `this.`-delegates are retained so showLoadedResources' formatter
|
|
644
|
-
// injection seam (exercised via prototype stubs in interactive-mode-status.test.ts)
|
|
645
|
-
// keeps working unchanged.
|
|
646
|
-
formatDisplayPath(p) {
|
|
647
|
-
return resourceDisplay.formatDisplayPath(p);
|
|
648
|
-
}
|
|
649
|
-
formatExtensionDisplayPath(path) {
|
|
650
|
-
return resourceDisplay.formatExtensionDisplayPath(path);
|
|
651
|
-
}
|
|
652
|
-
formatContextPath(p) {
|
|
653
|
-
const cwd = path.resolve(this.sessionManager.getCwd());
|
|
654
|
-
const absolutePath = path.isAbsolute(p) ? path.resolve(p) : path.resolve(cwd, p);
|
|
655
|
-
const relativePath = getCwdRelativePath(absolutePath, cwd);
|
|
656
|
-
if (relativePath !== undefined) {
|
|
657
|
-
return relativePath;
|
|
658
|
-
}
|
|
659
|
-
return this.formatDisplayPath(absolutePath);
|
|
660
|
-
}
|
|
661
683
|
getStartupExpansionState() {
|
|
662
684
|
return this.options.verbose || this.toolOutputExpanded;
|
|
663
685
|
}
|
|
664
|
-
getShortPath(fullPath, sourceInfo) {
|
|
665
|
-
return resourceDisplay.getShortPath(fullPath, sourceInfo);
|
|
666
|
-
}
|
|
667
|
-
getCompactPathLabel(resourcePath, sourceInfo) {
|
|
668
|
-
return resourceDisplay.getCompactPathLabel(resourcePath, sourceInfo);
|
|
669
|
-
}
|
|
670
|
-
getCompactPackageSourceLabel(sourceInfo) {
|
|
671
|
-
return resourceDisplay.getCompactPackageSourceLabel(sourceInfo);
|
|
672
|
-
}
|
|
673
|
-
getCompactExtensionLabel(resourcePath, sourceInfo) {
|
|
674
|
-
return resourceDisplay.getCompactExtensionLabel(resourcePath, sourceInfo);
|
|
675
|
-
}
|
|
676
|
-
getCompactDisplayPathSegments(resourcePath) {
|
|
677
|
-
return resourceDisplay.getCompactDisplayPathSegments(resourcePath);
|
|
678
|
-
}
|
|
679
|
-
getCompactNonPackageExtensionLabel(resourcePath, index, allPaths) {
|
|
680
|
-
return resourceDisplay.getCompactNonPackageExtensionLabel(resourcePath, index, allPaths);
|
|
681
|
-
}
|
|
682
|
-
getCompactExtensionLabels(extensions) {
|
|
683
|
-
return resourceDisplay.getCompactExtensionLabels(extensions);
|
|
684
|
-
}
|
|
685
|
-
getScopeGroup(sourceInfo) {
|
|
686
|
-
return resourceDisplay.getScopeGroup(sourceInfo);
|
|
687
|
-
}
|
|
688
|
-
isPackageSource(sourceInfo) {
|
|
689
|
-
return resourceDisplay.isPackageSource(sourceInfo);
|
|
690
|
-
}
|
|
691
|
-
buildScopeGroups(items) {
|
|
692
|
-
return resourceDisplay.buildScopeGroups(items);
|
|
693
|
-
}
|
|
694
|
-
formatScopeGroups(groups, options) {
|
|
695
|
-
return resourceDisplay.formatScopeGroups(groups, options);
|
|
696
|
-
}
|
|
697
|
-
formatDiagnostics(diagnostics, sourceInfos) {
|
|
698
|
-
return resourceDisplay.formatDiagnostics(diagnostics, sourceInfos);
|
|
699
|
-
}
|
|
700
686
|
showLoadedResources(options) {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
const formatCompactList = (items, options) => {
|
|
708
|
-
const labels = items.map((item) => item.trim()).filter((item) => item.length > 0);
|
|
709
|
-
if (options?.sort !== false) {
|
|
710
|
-
labels.sort((a, b) => a.localeCompare(b));
|
|
711
|
-
}
|
|
712
|
-
return theme.fg("dim", ` ${labels.join(", ")}`);
|
|
713
|
-
};
|
|
714
|
-
const addLoadedSection = (name, collapsedBody, expandedBody = collapsedBody, color = "mdHeading") => {
|
|
715
|
-
const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody}`, () => `${sectionHeader(name, color)}\n${expandedBody}`, this.getStartupExpansionState(), 0, 0);
|
|
716
|
-
this.chatContainer.addChild(section);
|
|
717
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
718
|
-
};
|
|
719
|
-
const skillsResult = this.session.resourceLoader.getSkills();
|
|
720
|
-
const promptsResult = this.session.resourceLoader.getPrompts();
|
|
721
|
-
const themesResult = this.session.resourceLoader.getThemes();
|
|
722
|
-
const extensions = options?.extensions ??
|
|
723
|
-
this.session.resourceLoader.getExtensions().extensions.map((extension) => ({
|
|
724
|
-
path: extension.path,
|
|
725
|
-
sourceInfo: extension.sourceInfo,
|
|
726
|
-
}));
|
|
727
|
-
const sourceInfos = new Map();
|
|
728
|
-
for (const extension of extensions) {
|
|
729
|
-
if (extension.sourceInfo) {
|
|
730
|
-
sourceInfos.set(extension.path, extension.sourceInfo);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
for (const skill of skillsResult.skills) {
|
|
734
|
-
if (skill.sourceInfo) {
|
|
735
|
-
sourceInfos.set(skill.filePath, skill.sourceInfo);
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
for (const prompt of promptsResult.prompts) {
|
|
739
|
-
if (prompt.sourceInfo) {
|
|
740
|
-
sourceInfos.set(prompt.filePath, prompt.sourceInfo);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
for (const loadedTheme of themesResult.themes) {
|
|
744
|
-
if (loadedTheme.sourcePath && loadedTheme.sourceInfo) {
|
|
745
|
-
sourceInfos.set(loadedTheme.sourcePath, loadedTheme.sourceInfo);
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
if (showListing) {
|
|
749
|
-
const contextFiles = this.session.resourceLoader.getAgentsFiles().agentsFiles;
|
|
750
|
-
if (contextFiles.length > 0) {
|
|
751
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
752
|
-
const contextList = contextFiles
|
|
753
|
-
.map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
|
|
754
|
-
.join("\n");
|
|
755
|
-
const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
|
|
756
|
-
addLoadedSection("Context", contextCompactList, contextList);
|
|
757
|
-
}
|
|
758
|
-
const skills = this.session.resourceLoader.getActiveSkills();
|
|
759
|
-
if (skills.length > 0) {
|
|
760
|
-
const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
|
|
761
|
-
const skillList = this.formatScopeGroups(groups, {
|
|
762
|
-
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
763
|
-
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
764
|
-
});
|
|
765
|
-
const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
|
|
766
|
-
addLoadedSection("Skills", skillCompactList, skillList);
|
|
767
|
-
}
|
|
768
|
-
const templates = this.session.promptTemplates;
|
|
769
|
-
if (templates.length > 0) {
|
|
770
|
-
const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
|
|
771
|
-
const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
|
|
772
|
-
const templateList = this.formatScopeGroups(groups, {
|
|
773
|
-
formatPath: (item) => {
|
|
774
|
-
const template = templateByPath.get(item.path);
|
|
775
|
-
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
776
|
-
},
|
|
777
|
-
formatPackagePath: (item) => {
|
|
778
|
-
const template = templateByPath.get(item.path);
|
|
779
|
-
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
780
|
-
},
|
|
781
|
-
});
|
|
782
|
-
const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
|
|
783
|
-
addLoadedSection("Prompts", promptCompactList, templateList);
|
|
784
|
-
}
|
|
785
|
-
if (extensions.length > 0) {
|
|
786
|
-
const groups = this.buildScopeGroups(extensions);
|
|
787
|
-
const extList = this.formatScopeGroups(groups, {
|
|
788
|
-
formatPath: (item) => this.formatExtensionDisplayPath(item.path),
|
|
789
|
-
formatPackagePath: (item) => this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
|
|
790
|
-
});
|
|
791
|
-
const extensionCompactList = formatCompactList(this.getCompactExtensionLabels(extensions));
|
|
792
|
-
addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
|
|
793
|
-
}
|
|
794
|
-
// Show loaded themes (excluding built-in)
|
|
795
|
-
const loadedThemes = themesResult.themes;
|
|
796
|
-
const customThemes = loadedThemes.filter((t) => t.sourcePath);
|
|
797
|
-
if (customThemes.length > 0) {
|
|
798
|
-
const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
|
|
799
|
-
path: loadedTheme.sourcePath,
|
|
800
|
-
sourceInfo: loadedTheme.sourceInfo,
|
|
801
|
-
})));
|
|
802
|
-
const themeList = this.formatScopeGroups(groups, {
|
|
803
|
-
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
804
|
-
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
805
|
-
});
|
|
806
|
-
const themeCompactList = formatCompactList(customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
|
|
807
|
-
addLoadedSection("Themes", themeCompactList, themeList);
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
if (showDiagnostics) {
|
|
811
|
-
const skillDiagnostics = skillsResult.diagnostics;
|
|
812
|
-
if (skillDiagnostics.length > 0) {
|
|
813
|
-
const warningLines = this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
814
|
-
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Skill conflicts]")}\n${warningLines}`, 0, 0));
|
|
815
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
816
|
-
}
|
|
817
|
-
const promptDiagnostics = promptsResult.diagnostics;
|
|
818
|
-
if (promptDiagnostics.length > 0) {
|
|
819
|
-
const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
|
|
820
|
-
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines}`, 0, 0));
|
|
821
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
822
|
-
}
|
|
823
|
-
const extensionDiagnostics = [];
|
|
824
|
-
const extensionErrors = this.session.resourceLoader.getExtensions().errors;
|
|
825
|
-
if (extensionErrors.length > 0) {
|
|
826
|
-
for (const error of extensionErrors) {
|
|
827
|
-
extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
const commandDiagnostics = this.session.extensionRunner.getCommandDiagnostics();
|
|
831
|
-
extensionDiagnostics.push(...commandDiagnostics);
|
|
832
|
-
extensionDiagnostics.push(...this.getBuiltInCommandConflictDiagnostics(this.session.extensionRunner));
|
|
833
|
-
const shortcutDiagnostics = this.session.extensionRunner.getShortcutDiagnostics();
|
|
834
|
-
extensionDiagnostics.push(...shortcutDiagnostics);
|
|
835
|
-
if (extensionDiagnostics.length > 0) {
|
|
836
|
-
const warningLines = this.formatDiagnostics(extensionDiagnostics, sourceInfos);
|
|
837
|
-
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Extension issues]")}\n${warningLines}`, 0, 0));
|
|
838
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
839
|
-
}
|
|
840
|
-
const themeDiagnostics = themesResult.diagnostics;
|
|
841
|
-
if (themeDiagnostics.length > 0) {
|
|
842
|
-
const warningLines = this.formatDiagnostics(themeDiagnostics, sourceInfos);
|
|
843
|
-
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Theme conflicts]")}\n${warningLines}`, 0, 0));
|
|
844
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
845
|
-
}
|
|
846
|
-
}
|
|
687
|
+
renderLoadedResources({
|
|
688
|
+
session: this.session,
|
|
689
|
+
chatContainer: this.chatContainer,
|
|
690
|
+
verbose: this.options.verbose ?? false,
|
|
691
|
+
expanded: this.getStartupExpansionState(),
|
|
692
|
+
}, options);
|
|
847
693
|
}
|
|
848
694
|
/**
|
|
849
695
|
* Initialize the extension system with TUI-based UI context.
|
|
850
696
|
*/
|
|
851
697
|
async bindCurrentSessionExtensions() {
|
|
852
|
-
const uiContext = this.extensionUiHost.createExtensionUIContext();
|
|
698
|
+
const uiContext = this.hasHumanAudience ? this.extensionUiHost.createExtensionUIContext() : undefined;
|
|
853
699
|
await this.session.bindExtensions({
|
|
854
700
|
uiContext,
|
|
855
|
-
mode: "tui",
|
|
701
|
+
mode: this.hasHumanAudience ? "tui" : "print",
|
|
856
702
|
abortHandler: () => {
|
|
857
703
|
this.restoreQueuedMessagesToEditor({ abort: true });
|
|
858
704
|
},
|
|
@@ -873,6 +719,9 @@ export class InteractiveMode {
|
|
|
873
719
|
return result;
|
|
874
720
|
}
|
|
875
721
|
catch (error) {
|
|
722
|
+
const disposition = this.handleNonFatalSessionReplacementError(error);
|
|
723
|
+
if (disposition)
|
|
724
|
+
return { cancelled: disposition === "previous_restored" };
|
|
876
725
|
return this.handleFatalRuntimeError("Failed to create session", error);
|
|
877
726
|
}
|
|
878
727
|
},
|
|
@@ -887,6 +736,9 @@ export class InteractiveMode {
|
|
|
887
736
|
return { cancelled: result.cancelled };
|
|
888
737
|
}
|
|
889
738
|
catch (error) {
|
|
739
|
+
const disposition = this.handleNonFatalSessionReplacementError(error);
|
|
740
|
+
if (disposition)
|
|
741
|
+
return { cancelled: disposition === "previous_restored" };
|
|
890
742
|
return this.handleFatalRuntimeError("Failed to fork session", error);
|
|
891
743
|
}
|
|
892
744
|
},
|
|
@@ -952,6 +804,18 @@ export class InteractiveMode {
|
|
|
952
804
|
async rebindCurrentSession() {
|
|
953
805
|
this.unsubscribe?.();
|
|
954
806
|
this.unsubscribe = undefined;
|
|
807
|
+
this.pendingClipboardImages = [];
|
|
808
|
+
this.clipboardImageCounter = 0;
|
|
809
|
+
const clipboardImageDirectory = this.settingsManager.getClipboardImageDirectory();
|
|
810
|
+
this.clipboardImageStore =
|
|
811
|
+
this.sessionManager.isPersisted() || clipboardImageDirectory
|
|
812
|
+
? new SessionImageStore({
|
|
813
|
+
agentDir: getAgentDir(),
|
|
814
|
+
cwd: this.sessionManager.getCwd(),
|
|
815
|
+
sessionId: this.sessionManager.getSessionId(),
|
|
816
|
+
directory: clipboardImageDirectory,
|
|
817
|
+
})
|
|
818
|
+
: undefined;
|
|
955
819
|
this.applyRuntimeSettings();
|
|
956
820
|
await this.bindCurrentSessionExtensions();
|
|
957
821
|
this.subscribeToAgent();
|
|
@@ -959,6 +823,13 @@ export class InteractiveMode {
|
|
|
959
823
|
await this.updateAvailableProviderCount();
|
|
960
824
|
this.updateEditorBorderColor();
|
|
961
825
|
this.updateTerminalTitle();
|
|
826
|
+
this.refreshActivityLane({ replace: true });
|
|
827
|
+
try {
|
|
828
|
+
await this.session.resumePendingHumanInput();
|
|
829
|
+
}
|
|
830
|
+
catch (error) {
|
|
831
|
+
this.showError(`Failed to resume pending user input: ${error instanceof Error ? error.message : String(error)}`);
|
|
832
|
+
}
|
|
962
833
|
}
|
|
963
834
|
subscribeToExtensionsChanged() {
|
|
964
835
|
this.unsubscribeExtensionsChanged?.();
|
|
@@ -973,6 +844,12 @@ export class InteractiveMode {
|
|
|
973
844
|
this.stop();
|
|
974
845
|
process.exit(1);
|
|
975
846
|
}
|
|
847
|
+
handleNonFatalSessionReplacementError(error) {
|
|
848
|
+
return handleNonFatalSessionReplacementError({
|
|
849
|
+
renderCurrentSessionState: () => this.renderCurrentSessionState(),
|
|
850
|
+
showError: (message) => this.showError(message),
|
|
851
|
+
}, error);
|
|
852
|
+
}
|
|
976
853
|
renderCurrentSessionState() {
|
|
977
854
|
this.pendingMessagesContainer.clear();
|
|
978
855
|
this.compactionQueuedMessages = [];
|
|
@@ -1041,21 +918,21 @@ export class InteractiveMode {
|
|
|
1041
918
|
return;
|
|
1042
919
|
}
|
|
1043
920
|
}
|
|
1044
|
-
attachToolExecutionComponent(toolName, toolCallId, args, repair) {
|
|
921
|
+
attachToolExecutionComponent(toolName, toolCallId, args, repair, deferResultUntilExpanded = false) {
|
|
1045
922
|
const actionKey = getToolPanelActionKey(this.getToolPanelScope(), toolName, args);
|
|
1046
923
|
const toolDefinition = this.getRegisteredToolDefinition(toolName);
|
|
1047
924
|
const reuseInPlace = shouldReuseToolPanelInPlace(toolName, args);
|
|
1048
925
|
const existing = this.toolPanels.getReusable(actionKey, { allowActive: reuseInPlace });
|
|
1049
926
|
if (existing) {
|
|
1050
927
|
if (reuseInPlace && actionKey) {
|
|
1051
|
-
existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair);
|
|
928
|
+
existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair, deferResultUntilExpanded);
|
|
1052
929
|
existing.setExpanded(this.toolOutputExpanded);
|
|
1053
930
|
this.toolPanels.replaceActiveForAction(toolCallId, existing, actionKey);
|
|
1054
931
|
this.ui.requestRender();
|
|
1055
932
|
return existing;
|
|
1056
933
|
}
|
|
1057
934
|
this.detachToolExecutionComponent(existing);
|
|
1058
|
-
existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair);
|
|
935
|
+
existing.resetInvocation(toolName, toolCallId, args, toolDefinition, repair, deferResultUntilExpanded);
|
|
1059
936
|
existing.setExpanded(this.toolOutputExpanded);
|
|
1060
937
|
this.appendToolExecutionComponent(existing, true);
|
|
1061
938
|
this.toolPanels.register(toolCallId, existing, actionKey);
|
|
@@ -1065,6 +942,7 @@ export class InteractiveMode {
|
|
|
1065
942
|
showImages: this.settingsManager.getShowImages(),
|
|
1066
943
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
1067
944
|
repair,
|
|
945
|
+
deferResultUntilExpanded,
|
|
1068
946
|
}, toolDefinition, this.ui, this.sessionManager.getCwd());
|
|
1069
947
|
component.setExpanded(this.toolOutputExpanded);
|
|
1070
948
|
this.appendToolExecutionComponent(component, true);
|
|
@@ -1089,8 +967,15 @@ export class InteractiveMode {
|
|
|
1089
967
|
this.loadingAnimation = undefined;
|
|
1090
968
|
}
|
|
1091
969
|
this.statusContainer.clear();
|
|
970
|
+
this.activityLane?.remove("runtime:routing");
|
|
971
|
+
this.activityLane?.remove("runtime:turn");
|
|
1092
972
|
}
|
|
1093
973
|
setWorkingVisible(visible) {
|
|
974
|
+
if (!this.hasHumanAudience) {
|
|
975
|
+
this.workingVisible = false;
|
|
976
|
+
this.stopWorkingLoader();
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
1094
979
|
this.workingVisible = visible;
|
|
1095
980
|
if (!visible) {
|
|
1096
981
|
this.stopWorkingLoader();
|
|
@@ -1098,15 +983,39 @@ export class InteractiveMode {
|
|
|
1098
983
|
return;
|
|
1099
984
|
}
|
|
1100
985
|
if (this.session.isStreaming && !this.loadingAnimation) {
|
|
1101
|
-
this.
|
|
1102
|
-
|
|
1103
|
-
|
|
986
|
+
if (this.workingIndicatorOptions) {
|
|
987
|
+
this.statusContainer.clear();
|
|
988
|
+
this.loadingAnimation = this.createWorkingLoader();
|
|
989
|
+
this.statusContainer.addChild(this.loadingAnimation);
|
|
990
|
+
}
|
|
991
|
+
else {
|
|
992
|
+
this.activityLane?.start({ id: "runtime:turn", kind: "runtime", label: this.getWorkingLoaderMessage() });
|
|
993
|
+
}
|
|
1104
994
|
}
|
|
1105
995
|
this.ui.requestRender();
|
|
1106
996
|
}
|
|
1107
997
|
setWorkingIndicator(options) {
|
|
1108
998
|
this.workingIndicatorOptions = options;
|
|
1109
|
-
this.
|
|
999
|
+
if (!this.hasHumanAudience) {
|
|
1000
|
+
this.stopWorkingLoader();
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
if (options) {
|
|
1004
|
+
this.activityLane?.remove("runtime:turn");
|
|
1005
|
+
if (this.session.isStreaming && this.workingVisible) {
|
|
1006
|
+
this.stopWorkingLoader();
|
|
1007
|
+
this.loadingAnimation = this.createWorkingLoader();
|
|
1008
|
+
this.statusContainer.addChild(this.loadingAnimation);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
else {
|
|
1012
|
+
this.loadingAnimation?.stop();
|
|
1013
|
+
this.loadingAnimation = undefined;
|
|
1014
|
+
this.statusContainer.clear();
|
|
1015
|
+
if (this.session.isStreaming && this.workingVisible) {
|
|
1016
|
+
this.activityLane?.start({ id: "runtime:turn", kind: "runtime", label: this.getWorkingLoaderMessage() });
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1110
1019
|
this.ui.requestRender();
|
|
1111
1020
|
}
|
|
1112
1021
|
setHiddenThinkingLabel(label) {
|
|
@@ -1129,13 +1038,14 @@ export class InteractiveMode {
|
|
|
1129
1038
|
if (this.loadingAnimation) {
|
|
1130
1039
|
this.loadingAnimation.setMessage(message ?? this.defaultWorkingMessage);
|
|
1131
1040
|
}
|
|
1041
|
+
this.activityLane?.update("runtime:turn", message ?? this.defaultWorkingMessage);
|
|
1132
1042
|
}
|
|
1133
1043
|
/**
|
|
1134
1044
|
* Reset the working indicator and hidden-thinking label to their built-in defaults.
|
|
1135
1045
|
*/
|
|
1136
1046
|
resetWorkingIndicators() {
|
|
1137
1047
|
this.workingMessage = undefined;
|
|
1138
|
-
this.workingVisible =
|
|
1048
|
+
this.workingVisible = this.hasHumanAudience;
|
|
1139
1049
|
this.setWorkingIndicator();
|
|
1140
1050
|
if (this.loadingAnimation) {
|
|
1141
1051
|
this.loadingAnimation.setMessage(`${this.defaultWorkingMessage} (${keyText("app.interrupt")} to interrupt)`);
|
|
@@ -1201,6 +1111,8 @@ export class InteractiveMode {
|
|
|
1201
1111
|
}
|
|
1202
1112
|
handleClipboardImagePaste() {
|
|
1203
1113
|
const self = this;
|
|
1114
|
+
const selectedModel = this.session?.model;
|
|
1115
|
+
const modelCannotSeeImages = selectedModel ? !selectedModel.input.includes("image") : false;
|
|
1204
1116
|
return clipboardInput.handleClipboardImagePaste({
|
|
1205
1117
|
get pendingClipboardImages() {
|
|
1206
1118
|
return self.pendingClipboardImages;
|
|
@@ -1216,6 +1128,12 @@ export class InteractiveMode {
|
|
|
1216
1128
|
},
|
|
1217
1129
|
editor: this.editor,
|
|
1218
1130
|
ui: this.ui,
|
|
1131
|
+
autoResizeImages: this.settingsManager.getImageAutoResize(),
|
|
1132
|
+
blockImages: this.settingsManager.getBlockImages() || modelCannotSeeImages,
|
|
1133
|
+
blockImagesReason: modelCannotSeeImages
|
|
1134
|
+
? "The selected model does not accept image input. Switch to an image-capable model or route this inspection to a vision worker."
|
|
1135
|
+
: undefined,
|
|
1136
|
+
imageStore: this.clipboardImageStore,
|
|
1219
1137
|
showStatus: (message) => this.showStatus(message),
|
|
1220
1138
|
showWarning: (message) => this.showWarning(message),
|
|
1221
1139
|
});
|
|
@@ -1235,6 +1153,7 @@ export class InteractiveMode {
|
|
|
1235
1153
|
set clipboardImageCounter(value) {
|
|
1236
1154
|
self.clipboardImageCounter = value;
|
|
1237
1155
|
},
|
|
1156
|
+
clipboardImageStore: this.clipboardImageStore,
|
|
1238
1157
|
}, text);
|
|
1239
1158
|
}
|
|
1240
1159
|
buildUserInputSubmission(text) {
|
|
@@ -1412,7 +1331,12 @@ export class InteractiveMode {
|
|
|
1412
1331
|
this.editor.setText("");
|
|
1413
1332
|
return;
|
|
1414
1333
|
}
|
|
1415
|
-
if (text === "/usage"
|
|
1334
|
+
if (text === "/usage") {
|
|
1335
|
+
this.handleUsageMenuCommand();
|
|
1336
|
+
this.editor.setText("");
|
|
1337
|
+
return;
|
|
1338
|
+
}
|
|
1339
|
+
if (text === "/cost") {
|
|
1416
1340
|
this.handleUsageCommand();
|
|
1417
1341
|
this.editor.setText("");
|
|
1418
1342
|
return;
|
|
@@ -1567,317 +1491,8 @@ export class InteractiveMode {
|
|
|
1567
1491
|
await this.handleEvent(event);
|
|
1568
1492
|
});
|
|
1569
1493
|
}
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
await this.init();
|
|
1573
|
-
}
|
|
1574
|
-
this.footer.invalidate();
|
|
1575
|
-
switch (event.type) {
|
|
1576
|
-
// Part B: general "the system is processing" feedback for the routing/prep gap before a
|
|
1577
|
-
// turn starts streaming (the judge is a real bounded LLM call, not instant) — independent
|
|
1578
|
-
// of thinking level, since this isn't model-thinking. Reuses the same working loader
|
|
1579
|
-
// agent_start below uses, so the hand-off into real streaming is the same
|
|
1580
|
-
// stop-then-recreate it already does — no distinct spinner, no double-render.
|
|
1581
|
-
case "routing_start":
|
|
1582
|
-
if (!this.session.isStreaming && !this.loadingAnimation && this.workingVisible) {
|
|
1583
|
-
this.loadingAnimation = this.createWorkingLoader();
|
|
1584
|
-
this.statusContainer.addChild(this.loadingAnimation);
|
|
1585
|
-
this.ui.requestRender();
|
|
1586
|
-
}
|
|
1587
|
-
break;
|
|
1588
|
-
case "routing_end":
|
|
1589
|
-
// Unconditional: covers both a clean hand-off into agent_start (which immediately
|
|
1590
|
-
// stops-and-recreates its own loader anyway) and a turn that failed before ever
|
|
1591
|
-
// starting, which must not leave the indicator spinning forever.
|
|
1592
|
-
this.stopWorkingLoader();
|
|
1593
|
-
this.ui.requestRender();
|
|
1594
|
-
break;
|
|
1595
|
-
case "agent_start":
|
|
1596
|
-
this.clearActiveToolCalls();
|
|
1597
|
-
if (this.settingsManager.getShowTerminalProgress()) {
|
|
1598
|
-
this.ui.terminal.setProgress(true);
|
|
1599
|
-
}
|
|
1600
|
-
// Restore main escape handler if retry handler is still active
|
|
1601
|
-
// (retry success event fires later, but we need main handler now)
|
|
1602
|
-
if (this.retryEscapeHandler) {
|
|
1603
|
-
this.defaultEditor.onEscape = this.retryEscapeHandler;
|
|
1604
|
-
this.retryEscapeHandler = undefined;
|
|
1605
|
-
}
|
|
1606
|
-
if (this.retryCountdown) {
|
|
1607
|
-
this.retryCountdown.dispose();
|
|
1608
|
-
this.retryCountdown = undefined;
|
|
1609
|
-
}
|
|
1610
|
-
if (this.retryLoader) {
|
|
1611
|
-
this.retryLoader.stop();
|
|
1612
|
-
this.retryLoader = undefined;
|
|
1613
|
-
}
|
|
1614
|
-
this.stopWorkingLoader();
|
|
1615
|
-
if (this.workingVisible) {
|
|
1616
|
-
this.loadingAnimation = this.createWorkingLoader();
|
|
1617
|
-
this.statusContainer.addChild(this.loadingAnimation);
|
|
1618
|
-
}
|
|
1619
|
-
this.ui.requestRender();
|
|
1620
|
-
break;
|
|
1621
|
-
case "queue_update":
|
|
1622
|
-
this.updatePendingMessagesDisplay();
|
|
1623
|
-
this.ui.requestRender();
|
|
1624
|
-
break;
|
|
1625
|
-
case "session_info_changed":
|
|
1626
|
-
this.updateTerminalTitle();
|
|
1627
|
-
this.footer.invalidate();
|
|
1628
|
-
this.ui.requestRender();
|
|
1629
|
-
break;
|
|
1630
|
-
case "thinking_level_changed":
|
|
1631
|
-
this.footer.invalidate();
|
|
1632
|
-
this.updateEditorBorderColor();
|
|
1633
|
-
break;
|
|
1634
|
-
case "warning":
|
|
1635
|
-
this.showWarning(event.message);
|
|
1636
|
-
break;
|
|
1637
|
-
case "delegate_workers": {
|
|
1638
|
-
const activeParts = [
|
|
1639
|
-
event.running > 0 ? `${event.running} running` : undefined,
|
|
1640
|
-
event.queued > 0 ? `${event.queued} queued` : undefined,
|
|
1641
|
-
].filter((part) => part !== undefined);
|
|
1642
|
-
const latestTerminal = event.terminalSinceFlush.at(-1);
|
|
1643
|
-
const terminalStatus = event.terminalSinceFlush.length === 1 && latestTerminal
|
|
1644
|
-
? `${latestTerminal.laneId} ${latestTerminal.status}`
|
|
1645
|
-
: event.failedSinceFlush > 0
|
|
1646
|
-
? `${event.failedSinceFlush} failed`
|
|
1647
|
-
: event.completedSinceFlush > 0
|
|
1648
|
-
? `${event.completedSinceFlush} completed`
|
|
1649
|
-
: undefined;
|
|
1650
|
-
const status = activeParts.length > 0 ? activeParts.join(", ") : terminalStatus;
|
|
1651
|
-
this.footerDataProvider.setExtensionStatus("delegate", status ? `delegate: ${status}` : undefined);
|
|
1652
|
-
this.footer.invalidate();
|
|
1653
|
-
break;
|
|
1654
|
-
}
|
|
1655
|
-
case "message_start":
|
|
1656
|
-
if (event.message.role === "custom") {
|
|
1657
|
-
this.addMessageToChat(event.message);
|
|
1658
|
-
this.ui.requestRender();
|
|
1659
|
-
}
|
|
1660
|
-
else if (event.message.role === "user") {
|
|
1661
|
-
this.addMessageToChat(event.message);
|
|
1662
|
-
this.updatePendingMessagesDisplay();
|
|
1663
|
-
this.ui.requestRender();
|
|
1664
|
-
}
|
|
1665
|
-
else if (event.message.role === "assistant") {
|
|
1666
|
-
this.clearPendingStreamingUiUpdate();
|
|
1667
|
-
this.lastStreamingUiUpdateAt = 0;
|
|
1668
|
-
this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel);
|
|
1669
|
-
this.streamingMessage = event.message;
|
|
1670
|
-
this.chatContainer.addChild(this.streamingComponent);
|
|
1671
|
-
this.applyStreamingMessageUpdate(this.streamingMessage, { force: true });
|
|
1672
|
-
this.trimLiveTuiHistory();
|
|
1673
|
-
}
|
|
1674
|
-
break;
|
|
1675
|
-
case "message_update":
|
|
1676
|
-
if (this.streamingComponent && event.message.role === "assistant") {
|
|
1677
|
-
this.applyStreamingMessageUpdate(event.message);
|
|
1678
|
-
}
|
|
1679
|
-
break;
|
|
1680
|
-
case "message_end":
|
|
1681
|
-
if (event.message.role === "user")
|
|
1682
|
-
break;
|
|
1683
|
-
if (this.streamingComponent && event.message.role === "assistant") {
|
|
1684
|
-
this.streamingMessage = event.message;
|
|
1685
|
-
let errorMessage;
|
|
1686
|
-
if (this.streamingMessage.stopReason === "aborted") {
|
|
1687
|
-
const retryAttempt = this.session.retryAttempt;
|
|
1688
|
-
errorMessage =
|
|
1689
|
-
retryAttempt > 0
|
|
1690
|
-
? `Aborted after ${retryAttempt} retry attempt${retryAttempt > 1 ? "s" : ""}`
|
|
1691
|
-
: "Operation aborted";
|
|
1692
|
-
this.streamingMessage.errorMessage = errorMessage;
|
|
1693
|
-
}
|
|
1694
|
-
this.applyStreamingMessageUpdate(this.streamingMessage, { force: true });
|
|
1695
|
-
if (this.streamingMessage.stopReason === "aborted" || this.streamingMessage.stopReason === "error") {
|
|
1696
|
-
if (!errorMessage) {
|
|
1697
|
-
errorMessage = this.streamingMessage.errorMessage || "Error";
|
|
1698
|
-
}
|
|
1699
|
-
for (const [, component] of this.toolPanels.activeEntries()) {
|
|
1700
|
-
component.updateResult({
|
|
1701
|
-
content: [{ type: "text", text: errorMessage }],
|
|
1702
|
-
isError: true,
|
|
1703
|
-
});
|
|
1704
|
-
}
|
|
1705
|
-
this.clearActiveToolCalls();
|
|
1706
|
-
}
|
|
1707
|
-
else {
|
|
1708
|
-
// Args are now complete - trigger diff computation for edit tools
|
|
1709
|
-
for (const [, component] of this.toolPanels.activeEntries()) {
|
|
1710
|
-
component.setArgsComplete();
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
this.streamingComponent = undefined;
|
|
1714
|
-
this.streamingMessage = undefined;
|
|
1715
|
-
this.footer.invalidate();
|
|
1716
|
-
}
|
|
1717
|
-
this.ui.requestRender();
|
|
1718
|
-
break;
|
|
1719
|
-
case "tool_execution_start": {
|
|
1720
|
-
let component = this.toolPanels.getActive(event.toolCallId);
|
|
1721
|
-
if (!component)
|
|
1722
|
-
component = this.attachToolExecutionComponent(event.toolName, event.toolCallId, event.args, event.repair);
|
|
1723
|
-
else
|
|
1724
|
-
component.updateArgs(event.args, event.repair);
|
|
1725
|
-
component.markExecutionStarted(event.repair);
|
|
1726
|
-
this.ui.requestRender();
|
|
1727
|
-
break;
|
|
1728
|
-
}
|
|
1729
|
-
case "tool_execution_update": {
|
|
1730
|
-
const component = this.toolPanels.getActive(event.toolCallId);
|
|
1731
|
-
if (component) {
|
|
1732
|
-
component.updateArgs(event.args, event.repair);
|
|
1733
|
-
component.updateResult({ ...event.partialResult, isError: false }, true);
|
|
1734
|
-
this.ui.requestRender();
|
|
1735
|
-
}
|
|
1736
|
-
break;
|
|
1737
|
-
}
|
|
1738
|
-
case "tool_execution_end": {
|
|
1739
|
-
const component = this.toolPanels.getActive(event.toolCallId);
|
|
1740
|
-
if (component) {
|
|
1741
|
-
component.updateResult({ ...event.result, isError: event.isError });
|
|
1742
|
-
this.toolPanels.registerAliases(component, getToolPanelResultActionKeys(this.getToolPanelScope(), event.toolName, event.result));
|
|
1743
|
-
this.toolPanels.finish(event.toolCallId);
|
|
1744
|
-
this.ui.requestRender();
|
|
1745
|
-
}
|
|
1746
|
-
break;
|
|
1747
|
-
}
|
|
1748
|
-
case "agent_end":
|
|
1749
|
-
// Native in-process reflection fully replaces the subprocess learning paths
|
|
1750
|
-
// (continuous-learning AND autonomy-review) when enabled; otherwise fall back to legacy.
|
|
1751
|
-
if (this.isNativeReflectionEnabled()) {
|
|
1752
|
-
this.maybeRunNativeReflection(event.messages);
|
|
1753
|
-
}
|
|
1754
|
-
else if (!this.maybeStartAutoLearn()) {
|
|
1755
|
-
this.maybeStartAutonomyReview(event.messages);
|
|
1756
|
-
}
|
|
1757
|
-
if (this.settingsManager.getShowTerminalProgress()) {
|
|
1758
|
-
this.ui.terminal.setProgress(false);
|
|
1759
|
-
}
|
|
1760
|
-
if (this.loadingAnimation) {
|
|
1761
|
-
this.loadingAnimation.stop();
|
|
1762
|
-
this.loadingAnimation = undefined;
|
|
1763
|
-
this.statusContainer.clear();
|
|
1764
|
-
}
|
|
1765
|
-
if (this.streamingComponent) {
|
|
1766
|
-
this.chatContainer.removeChild(this.streamingComponent);
|
|
1767
|
-
this.streamingComponent = undefined;
|
|
1768
|
-
this.streamingMessage = undefined;
|
|
1769
|
-
}
|
|
1770
|
-
this.clearActiveToolCalls();
|
|
1771
|
-
await this.checkShutdownRequested();
|
|
1772
|
-
this.ui.requestRender();
|
|
1773
|
-
break;
|
|
1774
|
-
case "compaction_start": {
|
|
1775
|
-
if (this.settingsManager.getShowTerminalProgress()) {
|
|
1776
|
-
this.ui.terminal.setProgress(true);
|
|
1777
|
-
}
|
|
1778
|
-
// Keep editor active; submissions are queued during compaction.
|
|
1779
|
-
this.autoCompactionEscapeHandler = this.defaultEditor.onEscape;
|
|
1780
|
-
this.defaultEditor.onEscape = () => {
|
|
1781
|
-
this.session.abortCompaction();
|
|
1782
|
-
};
|
|
1783
|
-
this.statusContainer.clear();
|
|
1784
|
-
const cancelHint = `(${keyText("app.interrupt")} to cancel)`;
|
|
1785
|
-
const label = event.reason === "manual"
|
|
1786
|
-
? `Compacting context... ${cancelHint}`
|
|
1787
|
-
: `${event.reason === "overflow" ? "Context overflow detected, " : ""}Auto-compacting... ${cancelHint}`;
|
|
1788
|
-
this.autoCompactionLoader = new Loader(this.ui, (spinner) => theme.fg("accent", spinner), (text) => theme.fg("muted", text), label);
|
|
1789
|
-
this.statusContainer.addChild(this.autoCompactionLoader);
|
|
1790
|
-
this.ui.requestRender();
|
|
1791
|
-
break;
|
|
1792
|
-
}
|
|
1793
|
-
case "compaction_end": {
|
|
1794
|
-
if (this.settingsManager.getShowTerminalProgress()) {
|
|
1795
|
-
this.ui.terminal.setProgress(false);
|
|
1796
|
-
}
|
|
1797
|
-
if (this.autoCompactionEscapeHandler) {
|
|
1798
|
-
this.defaultEditor.onEscape = this.autoCompactionEscapeHandler;
|
|
1799
|
-
this.autoCompactionEscapeHandler = undefined;
|
|
1800
|
-
}
|
|
1801
|
-
if (this.autoCompactionLoader) {
|
|
1802
|
-
this.autoCompactionLoader.stop();
|
|
1803
|
-
this.autoCompactionLoader = undefined;
|
|
1804
|
-
this.statusContainer.clear();
|
|
1805
|
-
}
|
|
1806
|
-
if (event.aborted) {
|
|
1807
|
-
if (event.reason === "manual") {
|
|
1808
|
-
this.showError("Compaction cancelled");
|
|
1809
|
-
}
|
|
1810
|
-
else {
|
|
1811
|
-
this.showStatus("Auto-compaction cancelled");
|
|
1812
|
-
}
|
|
1813
|
-
}
|
|
1814
|
-
else if (event.result) {
|
|
1815
|
-
await this.rebuildChatFromMessages();
|
|
1816
|
-
this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
|
|
1817
|
-
this.footer.invalidate();
|
|
1818
|
-
}
|
|
1819
|
-
else if (event.errorMessage) {
|
|
1820
|
-
if (event.reason === "manual") {
|
|
1821
|
-
this.showError(event.errorMessage);
|
|
1822
|
-
}
|
|
1823
|
-
else {
|
|
1824
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
1825
|
-
this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
else if (event.skipReason) {
|
|
1829
|
-
// Benign auto-compaction no-op: still tell the user WHY nothing changed —
|
|
1830
|
-
// an invisible skip is indistinguishable from broken compaction.
|
|
1831
|
-
this.showStatus(`Auto-compaction skipped: ${event.skipReason}`);
|
|
1832
|
-
}
|
|
1833
|
-
void this.flushCompactionQueue({ willRetry: event.willRetry });
|
|
1834
|
-
this.ui.requestRender();
|
|
1835
|
-
break;
|
|
1836
|
-
}
|
|
1837
|
-
case "auto_retry_start": {
|
|
1838
|
-
// Set up escape to abort retry
|
|
1839
|
-
this.retryEscapeHandler = this.defaultEditor.onEscape;
|
|
1840
|
-
this.defaultEditor.onEscape = () => {
|
|
1841
|
-
this.session.abortRetry();
|
|
1842
|
-
};
|
|
1843
|
-
// Show retry indicator
|
|
1844
|
-
this.statusContainer.clear();
|
|
1845
|
-
this.retryCountdown?.dispose();
|
|
1846
|
-
const retryMessage = (seconds) => `Retrying (${event.attempt}/${event.maxAttempts}) in ${seconds}s... (${keyText("app.interrupt")} to cancel)`;
|
|
1847
|
-
this.retryLoader = new Loader(this.ui, (spinner) => theme.fg("warning", spinner), (text) => theme.fg("muted", text), retryMessage(Math.ceil(event.delayMs / 1000)));
|
|
1848
|
-
this.retryCountdown = new CountdownTimer(event.delayMs, this.ui, (seconds) => {
|
|
1849
|
-
this.retryLoader?.setMessage(retryMessage(seconds));
|
|
1850
|
-
}, () => {
|
|
1851
|
-
this.retryCountdown = undefined;
|
|
1852
|
-
});
|
|
1853
|
-
this.statusContainer.addChild(this.retryLoader);
|
|
1854
|
-
this.ui.requestRender();
|
|
1855
|
-
break;
|
|
1856
|
-
}
|
|
1857
|
-
case "auto_retry_end": {
|
|
1858
|
-
// Restore escape handler
|
|
1859
|
-
if (this.retryEscapeHandler) {
|
|
1860
|
-
this.defaultEditor.onEscape = this.retryEscapeHandler;
|
|
1861
|
-
this.retryEscapeHandler = undefined;
|
|
1862
|
-
}
|
|
1863
|
-
if (this.retryCountdown) {
|
|
1864
|
-
this.retryCountdown.dispose();
|
|
1865
|
-
this.retryCountdown = undefined;
|
|
1866
|
-
}
|
|
1867
|
-
// Stop loader
|
|
1868
|
-
if (this.retryLoader) {
|
|
1869
|
-
this.retryLoader.stop();
|
|
1870
|
-
this.retryLoader = undefined;
|
|
1871
|
-
this.statusContainer.clear();
|
|
1872
|
-
}
|
|
1873
|
-
// Show error only on final failure (success shows normal response)
|
|
1874
|
-
if (!event.success) {
|
|
1875
|
-
this.showError(`Retry failed after ${event.attempt} attempts: ${event.finalError || "Unknown error"}`);
|
|
1876
|
-
}
|
|
1877
|
-
this.ui.requestRender();
|
|
1878
|
-
break;
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1494
|
+
handleEvent(event) {
|
|
1495
|
+
return handleInteractiveEvent(this, event);
|
|
1881
1496
|
}
|
|
1882
1497
|
/** Extract text content from a user message */
|
|
1883
1498
|
// Thin `this.`-delegate to the pure formatter in ./history-reload-math.ts; kept so
|
|
@@ -2070,6 +1685,8 @@ export class InteractiveMode {
|
|
|
2070
1685
|
* we update the previous status line instead of appending new ones to avoid log spam.
|
|
2071
1686
|
*/
|
|
2072
1687
|
showStatus(message) {
|
|
1688
|
+
if (!this.hasHumanAudience)
|
|
1689
|
+
return;
|
|
2073
1690
|
this.appendStatusToChat(message);
|
|
2074
1691
|
}
|
|
2075
1692
|
addMessageToChat(message, options) {
|
|
@@ -2152,7 +1769,9 @@ export class InteractiveMode {
|
|
|
2152
1769
|
// Thin `this.`-delegate to the pure reload-window math in ./history-reload-math.ts;
|
|
2153
1770
|
// kept so renderSessionContext and the prototype-based history tests resolve it via `this`.
|
|
2154
1771
|
messagesForTuiHistoryReload(messages) {
|
|
2155
|
-
return historyReloadMath.messagesForTuiHistoryReload(messages
|
|
1772
|
+
return historyReloadMath.messagesForTuiHistoryReload(messages, {
|
|
1773
|
+
includeToolResultContent: this.toolOutputExpanded,
|
|
1774
|
+
});
|
|
2156
1775
|
}
|
|
2157
1776
|
/**
|
|
2158
1777
|
* Render session context to chat. Used for initial load and rebuild after compaction.
|
|
@@ -2203,7 +1822,7 @@ export class InteractiveMode {
|
|
|
2203
1822
|
// Render tool call components
|
|
2204
1823
|
for (const content of message.content) {
|
|
2205
1824
|
if (content.type === "toolCall") {
|
|
2206
|
-
const component = this.attachToolExecutionComponent(content.name, content.id, content.arguments);
|
|
1825
|
+
const component = this.attachToolExecutionComponent(content.name, content.id, content.arguments, undefined, true);
|
|
2207
1826
|
if (message.stopReason === "aborted" || message.stopReason === "error") {
|
|
2208
1827
|
let errorMessage;
|
|
2209
1828
|
if (message.stopReason === "aborted") {
|
|
@@ -2580,20 +2199,28 @@ export class InteractiveMode {
|
|
|
2580
2199
|
}
|
|
2581
2200
|
updatePendingMessagesDisplay() {
|
|
2582
2201
|
this.pendingMessagesContainer.clear();
|
|
2202
|
+
for (const component of this.pendingBashComponents)
|
|
2203
|
+
this.pendingMessagesContainer.addChild(component);
|
|
2583
2204
|
const { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
this.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));
|
|
2589
|
-
}
|
|
2590
|
-
for (const message of followUpMessages) {
|
|
2591
|
-
const text = theme.fg("dim", `Follow-up: ${message}`);
|
|
2592
|
-
this.pendingMessagesContainer.addChild(new TruncatedText(text, 1, 0));
|
|
2593
|
-
}
|
|
2205
|
+
const steeringCount = steeringMessages.length;
|
|
2206
|
+
const followUpCount = followUpMessages.length;
|
|
2207
|
+
const total = steeringCount + followUpCount;
|
|
2208
|
+
if (total > 0) {
|
|
2594
2209
|
const dequeueHint = this.getAppKeyDisplay("app.message.dequeue");
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2210
|
+
const details = [
|
|
2211
|
+
steeringCount > 0 ? `${steeringCount} steering` : undefined,
|
|
2212
|
+
followUpCount > 0 ? `${followUpCount} follow-up` : undefined,
|
|
2213
|
+
]
|
|
2214
|
+
.filter((value) => value !== undefined)
|
|
2215
|
+
.join(" · ");
|
|
2216
|
+
this.activityLane?.wait({
|
|
2217
|
+
id: "queue:messages",
|
|
2218
|
+
kind: "queue",
|
|
2219
|
+
label: `Queued ${total} · ${details} · ${dequeueHint} edit`,
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
else {
|
|
2223
|
+
this.activityLane?.remove("queue:messages");
|
|
2597
2224
|
}
|
|
2598
2225
|
}
|
|
2599
2226
|
restoreQueuedMessagesToEditor(options) {
|
|
@@ -2690,6 +2317,7 @@ export class InteractiveMode {
|
|
|
2690
2317
|
showSelector: (create) => this.showSelector(create),
|
|
2691
2318
|
showStatus: (message) => this.showStatus(message),
|
|
2692
2319
|
showError: (message) => this.showError(message),
|
|
2320
|
+
refreshAutonomyFooterStatus: () => this.refreshAutonomyFooterStatus(),
|
|
2693
2321
|
renderCurrentSessionState: () => this.renderCurrentSessionState(),
|
|
2694
2322
|
renderInitialMessages: (options) => this.renderInitialMessages(options),
|
|
2695
2323
|
flushCompactionQueue: (options) => this.flushCompactionQueue(options),
|
|
@@ -3210,7 +2838,7 @@ export class InteractiveMode {
|
|
|
3210
2838
|
}, text);
|
|
3211
2839
|
}
|
|
3212
2840
|
parseGoalContinueCommand(text) {
|
|
3213
|
-
const usage = "Usage: /goal-continue [maxTurns
|
|
2841
|
+
const usage = "Usage: /goal-continue [maxTurns 0=unbounded] [maxStallTurns 0-100] [maxMinutes 0-1440]";
|
|
3214
2842
|
const parts = text.trim().split(/\s+/).slice(1);
|
|
3215
2843
|
if (parts.length > 3) {
|
|
3216
2844
|
return { ok: false, error: usage };
|
|
@@ -3225,7 +2853,7 @@ export class InteractiveMode {
|
|
|
3225
2853
|
return undefined;
|
|
3226
2854
|
return parsed;
|
|
3227
2855
|
};
|
|
3228
|
-
const maxTurns = parseBoundedInteger(parts[0], DEFAULT_GOAL_CONTINUE_MAX_TURNS,
|
|
2856
|
+
const maxTurns = parseBoundedInteger(parts[0], DEFAULT_GOAL_CONTINUE_MAX_TURNS, 0, MAX_GOAL_CONTINUE_MAX_TURNS);
|
|
3229
2857
|
const maxStallTurns = parseBoundedInteger(parts[1], DEFAULT_GOAL_CONTINUE_MAX_STALL_TURNS, 0, MAX_GOAL_CONTINUE_MAX_STALL_TURNS);
|
|
3230
2858
|
const maxWallClockMinutes = parseBoundedInteger(parts[2], DEFAULT_GOAL_CONTINUE_MAX_WALL_CLOCK_MINUTES, 0, MAX_GOAL_CONTINUE_MAX_WALL_CLOCK_MINUTES);
|
|
3231
2859
|
if (maxTurns === undefined || maxStallTurns === undefined || maxWallClockMinutes === undefined) {
|
|
@@ -3234,28 +2862,45 @@ export class InteractiveMode {
|
|
|
3234
2862
|
return { ok: true, maxTurns, maxStallTurns, maxWallClockMinutes };
|
|
3235
2863
|
}
|
|
3236
2864
|
async handleGoalCommand(text) {
|
|
2865
|
+
let statusMessage;
|
|
3237
2866
|
await sessionFlows.handleGoalCommand({
|
|
3238
2867
|
session: this.session,
|
|
3239
|
-
|
|
2868
|
+
promptForGoalEdit: (currentObjective) => this.extensionUiHost.showExtensionEditor("Edit goal objective", currentObjective),
|
|
2869
|
+
getMaxStallTurns: () => this.settingsManager?.getAutonomySettings().maxStallTurns ?? 20,
|
|
2870
|
+
showStatus: (message) => {
|
|
2871
|
+
statusMessage = message;
|
|
2872
|
+
},
|
|
3240
2873
|
showError: (message) => this.showError(message),
|
|
3241
2874
|
refreshAutonomyFooterStatus: () => this.refreshAutonomyFooterStatus(),
|
|
3242
2875
|
}, text);
|
|
2876
|
+
this.refreshActivityLane?.();
|
|
2877
|
+
if (statusMessage)
|
|
2878
|
+
this.activityLane?.announce(statusMessage, "neutral");
|
|
3243
2879
|
}
|
|
3244
2880
|
handleTaskCommand(text) {
|
|
2881
|
+
let statusMessage;
|
|
3245
2882
|
sessionFlows.handleTaskCommand({
|
|
3246
2883
|
session: this.session,
|
|
3247
|
-
showStatus: (message) =>
|
|
2884
|
+
showStatus: (message) => {
|
|
2885
|
+
statusMessage = message;
|
|
2886
|
+
},
|
|
3248
2887
|
showError: (message) => this.showError(message),
|
|
3249
2888
|
}, text);
|
|
2889
|
+
this.refreshActivityLane?.();
|
|
2890
|
+
const state = this.session.getTaskStepsStateSnapshot();
|
|
2891
|
+
if ((!state || state.steps.length === 0 || statusMessage?.startsWith("/task ")) && statusMessage) {
|
|
2892
|
+
this.activityLane?.announce(statusMessage, "neutral");
|
|
2893
|
+
}
|
|
3250
2894
|
}
|
|
3251
2895
|
async handleGoalContinueCommand(text) {
|
|
3252
2896
|
await sessionFlows.handleGoalContinueCommand({
|
|
3253
2897
|
session: this.session,
|
|
3254
2898
|
parseGoalContinueCommand: (t) => this.parseGoalContinueCommand(t),
|
|
3255
|
-
showStatus: (message) => this.
|
|
2899
|
+
showStatus: (message) => this.activityLane?.announce(message),
|
|
3256
2900
|
showError: (message) => this.showError(message),
|
|
3257
2901
|
refreshAutonomyFooterStatus: () => this.refreshAutonomyFooterStatus(),
|
|
3258
2902
|
}, text);
|
|
2903
|
+
this.refreshActivityLane?.();
|
|
3259
2904
|
}
|
|
3260
2905
|
handleSessionCommand() {
|
|
3261
2906
|
sessionFlows.handleSessionCommand({
|
|
@@ -3273,6 +2918,15 @@ export class InteractiveMode {
|
|
|
3273
2918
|
getCurrentAutoLearnSettings: () => this.getCurrentAutoLearnSettings(),
|
|
3274
2919
|
});
|
|
3275
2920
|
}
|
|
2921
|
+
handleUsageMenuCommand() {
|
|
2922
|
+
usageCommands.handleUsageMenuCommand({
|
|
2923
|
+
session: this.session,
|
|
2924
|
+
showSelector: (create) => this.showSelector(create),
|
|
2925
|
+
showStatus: (message) => this.showStatus(message),
|
|
2926
|
+
showError: (message) => this.showError(message),
|
|
2927
|
+
showUsageReport: () => this.handleUsageCommand(),
|
|
2928
|
+
});
|
|
2929
|
+
}
|
|
3276
2930
|
handleChangelogCommand() {
|
|
3277
2931
|
reportCommands.handleChangelogCommand({
|
|
3278
2932
|
chatContainer: this.chatContainer,
|
|
@@ -3324,6 +2978,8 @@ export class InteractiveMode {
|
|
|
3324
2978
|
this.ui.requestRender();
|
|
3325
2979
|
}
|
|
3326
2980
|
catch (error) {
|
|
2981
|
+
if (this.handleNonFatalSessionReplacementError(error))
|
|
2982
|
+
return;
|
|
3327
2983
|
await this.handleFatalRuntimeError("Failed to create session", error);
|
|
3328
2984
|
}
|
|
3329
2985
|
}
|
|
@@ -3422,17 +3078,9 @@ export class InteractiveMode {
|
|
|
3422
3078
|
}, command, excludeFromContext);
|
|
3423
3079
|
}
|
|
3424
3080
|
handleCompactCommand(customInstructions) {
|
|
3425
|
-
const self = this;
|
|
3426
3081
|
return resourceShellCommands.handleCompactCommand({
|
|
3427
3082
|
sessionManager: this.sessionManager,
|
|
3428
3083
|
showWarning: (message) => this.showWarning(message),
|
|
3429
|
-
get loadingAnimation() {
|
|
3430
|
-
return self.loadingAnimation;
|
|
3431
|
-
},
|
|
3432
|
-
set loadingAnimation(value) {
|
|
3433
|
-
self.loadingAnimation = value;
|
|
3434
|
-
},
|
|
3435
|
-
statusContainer: this.statusContainer,
|
|
3436
3084
|
session: this.session,
|
|
3437
3085
|
}, customInstructions);
|
|
3438
3086
|
}
|
|
@@ -3446,8 +3094,10 @@ export class InteractiveMode {
|
|
|
3446
3094
|
this.loadingAnimation = undefined;
|
|
3447
3095
|
}
|
|
3448
3096
|
this.authDialogs.cancelActiveDialog();
|
|
3097
|
+
this.extensionUiHost.clearHostWidgets();
|
|
3449
3098
|
this.extensionUiHost.resetExtensionUI();
|
|
3450
3099
|
this.overlayHost.unmount();
|
|
3100
|
+
this.activityLane?.dispose();
|
|
3451
3101
|
this.footer.dispose();
|
|
3452
3102
|
this.footerDataProvider.dispose();
|
|
3453
3103
|
if (this.unsubscribe) {
|