@pentoshi/clai 4.11.7 → 4.11.8
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/dist/agent/compaction/summary-execution.d.ts +32 -0
- package/dist/agent/compaction/summary-execution.js +407 -0
- package/dist/agent/compaction/summary-execution.js.map +1 -0
- package/dist/agent/compaction-attempt.d.ts +5 -1
- package/dist/agent/compaction-attempt.js +22 -12
- package/dist/agent/compaction-attempt.js.map +1 -1
- package/dist/agent/compaction-executor.d.ts +5 -53
- package/dist/agent/compaction-executor.js +4 -447
- package/dist/agent/compaction-executor.js.map +1 -1
- package/dist/agent/compaction-summary.d.ts +0 -25
- package/dist/agent/compaction-summary.js +0 -20
- package/dist/agent/compaction-summary.js.map +1 -1
- package/dist/agent/confirm-port.d.ts +0 -6
- package/dist/agent/confirm-port.js +0 -11
- package/dist/agent/confirm-port.js.map +1 -1
- package/dist/agent/context/compact-with-summary.d.ts +34 -0
- package/dist/agent/context/compact-with-summary.js +381 -0
- package/dist/agent/context/compact-with-summary.js.map +1 -0
- package/dist/agent/context-breakdown.d.ts +0 -12
- package/dist/agent/context-breakdown.js +0 -16
- package/dist/agent/context-breakdown.js.map +1 -1
- package/dist/agent/context-manager.d.ts +4 -90
- package/dist/agent/context-manager.js +4 -458
- package/dist/agent/context-manager.js.map +1 -1
- package/dist/agent/continue-orient.d.ts +0 -19
- package/dist/agent/continue-orient.js +0 -24
- package/dist/agent/continue-orient.js.map +1 -1
- package/dist/agent/durable-blocks.d.ts +5 -0
- package/dist/agent/durable-blocks.js +16 -0
- package/dist/agent/durable-blocks.js.map +1 -0
- package/dist/agent/durable-envelope.d.ts +0 -2
- package/dist/agent/durable-envelope.js +0 -16
- package/dist/agent/durable-envelope.js.map +1 -1
- package/dist/agent/events.d.ts +6 -17
- package/dist/agent/evidence/task-classification.d.ts +25 -0
- package/dist/agent/evidence/task-classification.js +124 -0
- package/dist/agent/evidence/task-classification.js.map +1 -0
- package/dist/agent/evidence/task-selection.d.ts +29 -0
- package/dist/agent/evidence/task-selection.js +148 -0
- package/dist/agent/evidence/task-selection.js.map +1 -0
- package/dist/agent/evidence/tool-budgets.d.ts +12 -0
- package/dist/agent/evidence/tool-budgets.js +82 -0
- package/dist/agent/evidence/tool-budgets.js.map +1 -0
- package/dist/agent/evidence-governor.d.ts +0 -3
- package/dist/agent/evidence-governor.js.map +1 -1
- package/dist/agent/injected-blocks.d.ts +1 -0
- package/dist/agent/injected-blocks.js +14 -4
- package/dist/agent/injected-blocks.js.map +1 -1
- package/dist/agent/message-slim.js +0 -2
- package/dist/agent/message-slim.js.map +1 -1
- package/dist/agent/outcomes.d.ts +0 -1
- package/dist/agent/outcomes.js +0 -11
- package/dist/agent/outcomes.js.map +1 -1
- package/dist/agent/parser/arg-formatting.d.ts +3 -0
- package/dist/agent/parser/arg-formatting.js +99 -0
- package/dist/agent/parser/arg-formatting.js.map +1 -0
- package/dist/agent/parser/bare-recognition.d.ts +6 -0
- package/dist/agent/parser/bare-recognition.js +106 -0
- package/dist/agent/parser/bare-recognition.js.map +1 -0
- package/dist/agent/parser/parse-entry.d.ts +9 -0
- package/dist/agent/parser/parse-entry.js +198 -0
- package/dist/agent/parser/parse-entry.js.map +1 -0
- package/dist/agent/parser/repetition.d.ts +1 -0
- package/dist/agent/parser/repetition.js +72 -0
- package/dist/agent/parser/repetition.js.map +1 -0
- package/dist/agent/parser/salvage.d.ts +8 -0
- package/dist/agent/parser/salvage.js +100 -0
- package/dist/agent/parser/salvage.js.map +1 -0
- package/dist/agent/parser/vendor-protocols.d.ts +21 -0
- package/dist/agent/parser/vendor-protocols.js +265 -0
- package/dist/agent/parser/vendor-protocols.js.map +1 -0
- package/dist/agent/parser/xml-protocol.d.ts +7 -0
- package/dist/agent/parser/xml-protocol.js +455 -0
- package/dist/agent/parser/xml-protocol.js.map +1 -0
- package/dist/agent/plan/actions/plan-clear.d.ts +4 -0
- package/dist/agent/plan/actions/plan-clear.js +46 -0
- package/dist/agent/plan/actions/plan-clear.js.map +1 -0
- package/dist/agent/plan/actions/plan-create.d.ts +4 -0
- package/dist/agent/plan/actions/plan-create.js +371 -0
- package/dist/agent/plan/actions/plan-create.js.map +1 -0
- package/dist/agent/plan/actions/task-add.d.ts +5 -0
- package/dist/agent/plan/actions/task-add.js +131 -0
- package/dist/agent/plan/actions/task-add.js.map +1 -0
- package/dist/agent/plan/actions/task-move.d.ts +5 -0
- package/dist/agent/plan/actions/task-move.js +72 -0
- package/dist/agent/plan/actions/task-move.js.map +1 -0
- package/dist/agent/plan/context-message.d.ts +2 -0
- package/dist/agent/plan/context-message.js +91 -0
- package/dist/agent/plan/context-message.js.map +1 -0
- package/dist/agent/plan/handle-plan-tool.d.ts +24 -0
- package/dist/agent/plan/handle-plan-tool.js +310 -0
- package/dist/agent/plan/handle-plan-tool.js.map +1 -0
- package/dist/agent/plan/normalization.d.ts +19 -0
- package/dist/agent/plan/normalization.js +175 -0
- package/dist/agent/plan/normalization.js.map +1 -0
- package/dist/agent/plan-implement-compact.d.ts +0 -20
- package/dist/agent/plan-implement-compact.js +0 -21
- package/dist/agent/plan-implement-compact.js.map +1 -1
- package/dist/agent/plan-mode-reminders.d.ts +0 -24
- package/dist/agent/plan-mode-reminders.js +0 -21
- package/dist/agent/plan-mode-reminders.js.map +1 -1
- package/dist/agent/plan-tool.d.ts +5 -60
- package/dist/agent/plan-tool.js +7 -1235
- package/dist/agent/plan-tool.js.map +1 -1
- package/dist/agent/progress-pause-policy.d.ts +0 -1
- package/dist/agent/progress-pause-policy.js +1 -5
- package/dist/agent/progress-pause-policy.js.map +1 -1
- package/dist/agent/progress.d.ts +0 -5
- package/dist/agent/progress.js +0 -14
- package/dist/agent/progress.js.map +1 -1
- package/dist/agent/project-root.d.ts +0 -21
- package/dist/agent/project-root.js +0 -36
- package/dist/agent/project-root.js.map +1 -1
- package/dist/agent/prompt-composer.d.ts +0 -1
- package/dist/agent/prompt-composer.js +0 -2
- package/dist/agent/prompt-composer.js.map +1 -1
- package/dist/agent/reliability-policy.d.ts +0 -38
- package/dist/agent/reliability-policy.js +0 -39
- package/dist/agent/reliability-policy.js.map +1 -1
- package/dist/agent/request-accounting.d.ts +0 -30
- package/dist/agent/request-accounting.js +1 -25
- package/dist/agent/request-accounting.js.map +1 -1
- package/dist/agent/request-budget.d.ts +0 -2
- package/dist/agent/request-budget.js +0 -13
- package/dist/agent/request-budget.js.map +1 -1
- package/dist/agent/responder-context.js +14 -3
- package/dist/agent/responder-context.js.map +1 -1
- package/dist/agent/responder-parent.d.ts +0 -10
- package/dist/agent/responder-parent.js +0 -12
- package/dist/agent/responder-parent.js.map +1 -1
- package/dist/agent/runner.d.ts +0 -30
- package/dist/agent/runner.js +403 -5087
- package/dist/agent/runner.js.map +1 -1
- package/dist/agent/scope-context.d.ts +0 -1
- package/dist/agent/scope-context.js +0 -1
- package/dist/agent/scope-context.js.map +1 -1
- package/dist/agent/scratch-write.d.ts +0 -1
- package/dist/agent/scratch-write.js +0 -1
- package/dist/agent/scratch-write.js.map +1 -1
- package/dist/agent/session-policy.d.ts +0 -28
- package/dist/agent/session-policy.js +0 -34
- package/dist/agent/session-policy.js.map +1 -1
- package/dist/agent/session-state.d.ts +0 -38
- package/dist/agent/session-state.js +4 -41
- package/dist/agent/session-state.js.map +1 -1
- package/dist/agent/step-budget.d.ts +0 -4
- package/dist/agent/step-budget.js +0 -4
- package/dist/agent/step-budget.js.map +1 -1
- package/dist/agent/stop-summary.d.ts +0 -5
- package/dist/agent/stop-summary.js +0 -8
- package/dist/agent/stop-summary.js.map +1 -1
- package/dist/agent/stream-recovery.d.ts +1 -54
- package/dist/agent/stream-recovery.js +4 -53
- package/dist/agent/stream-recovery.js.map +1 -1
- package/dist/agent/task-evidence.d.ts +10 -159
- package/dist/agent/task-evidence.js +10 -477
- package/dist/agent/task-evidence.js.map +1 -1
- package/dist/agent/task-plan.d.ts +0 -8
- package/dist/agent/task-plan.js +0 -6
- package/dist/agent/task-plan.js.map +1 -1
- package/dist/agent/task-sync.d.ts +0 -25
- package/dist/agent/task-sync.js +0 -31
- package/dist/agent/task-sync.js.map +1 -1
- package/dist/agent/tool-call-parser.d.ts +10 -205
- package/dist/agent/tool-call-parser.js +11 -1715
- package/dist/agent/tool-call-parser.js.map +1 -1
- package/dist/agent/tool-history.d.ts +1 -57
- package/dist/agent/tool-history.js +1 -68
- package/dist/agent/tool-history.js.map +1 -1
- package/dist/agent/tool-output-formatting.d.ts +0 -18
- package/dist/agent/tool-output-formatting.js +0 -28
- package/dist/agent/tool-output-formatting.js.map +1 -1
- package/dist/agent/turn/automatic-compaction-execution.d.ts +14 -0
- package/dist/agent/turn/automatic-compaction-execution.js +19 -0
- package/dist/agent/turn/automatic-compaction-execution.js.map +1 -0
- package/dist/agent/turn/compaction-admission.d.ts +25 -0
- package/dist/agent/turn/compaction-admission.js +40 -0
- package/dist/agent/turn/compaction-admission.js.map +1 -0
- package/dist/agent/turn/compaction-candidate.d.ts +10 -0
- package/dist/agent/turn/compaction-candidate.js +12 -0
- package/dist/agent/turn/compaction-candidate.js.map +1 -0
- package/dist/agent/turn/compaction-coordinator.d.ts +42 -0
- package/dist/agent/turn/compaction-coordinator.js +169 -0
- package/dist/agent/turn/compaction-coordinator.js.map +1 -0
- package/dist/agent/turn/compaction-durable-envelope.d.ts +24 -0
- package/dist/agent/turn/compaction-durable-envelope.js +54 -0
- package/dist/agent/turn/compaction-durable-envelope.js.map +1 -0
- package/dist/agent/turn/compaction-final-fit.d.ts +10 -0
- package/dist/agent/turn/compaction-final-fit.js +14 -0
- package/dist/agent/turn/compaction-final-fit.js.map +1 -0
- package/dist/agent/turn/compaction-messages.d.ts +6 -0
- package/dist/agent/turn/compaction-messages.js +15 -0
- package/dist/agent/turn/compaction-messages.js.map +1 -0
- package/dist/agent/turn/compaction-replay-selection.d.ts +10 -0
- package/dist/agent/turn/compaction-replay-selection.js +27 -0
- package/dist/agent/turn/compaction-replay-selection.js.map +1 -0
- package/dist/agent/turn/compaction-request-estimator.d.ts +7 -0
- package/dist/agent/turn/compaction-request-estimator.js +13 -0
- package/dist/agent/turn/compaction-request-estimator.js.map +1 -0
- package/dist/agent/turn/compaction-summarizer.d.ts +21 -0
- package/dist/agent/turn/compaction-summarizer.js +41 -0
- package/dist/agent/turn/compaction-summarizer.js.map +1 -0
- package/dist/agent/turn/continuation-overlap.d.ts +1 -0
- package/dist/agent/turn/continuation-overlap.js +35 -0
- package/dist/agent/turn/continuation-overlap.js.map +1 -0
- package/dist/agent/turn/contracts.d.ts +25 -0
- package/dist/agent/turn/contracts.js +2 -0
- package/dist/agent/turn/contracts.js.map +1 -0
- package/dist/agent/turn/event-emitter.d.ts +21 -0
- package/dist/agent/turn/event-emitter.js +116 -0
- package/dist/agent/turn/event-emitter.js.map +1 -0
- package/dist/agent/turn/evidence-flags.d.ts +16 -0
- package/dist/agent/turn/evidence-flags.js +44 -0
- package/dist/agent/turn/evidence-flags.js.map +1 -0
- package/dist/agent/turn/finalizer.d.ts +28 -0
- package/dist/agent/turn/finalizer.js +44 -0
- package/dist/agent/turn/finalizer.js.map +1 -0
- package/dist/agent/turn/history-writer.d.ts +17 -0
- package/dist/agent/turn/history-writer.js +72 -0
- package/dist/agent/turn/history-writer.js.map +1 -0
- package/dist/agent/turn/inserted-text.d.ts +1 -0
- package/dist/agent/turn/inserted-text.js +2 -0
- package/dist/agent/turn/inserted-text.js.map +1 -0
- package/dist/agent/turn/loop/answer-assessment.d.ts +22 -0
- package/dist/agent/turn/loop/answer-assessment.js +30 -0
- package/dist/agent/turn/loop/answer-assessment.js.map +1 -0
- package/dist/agent/turn/loop/answer-path.d.ts +20 -0
- package/dist/agent/turn/loop/answer-path.js +92 -0
- package/dist/agent/turn/loop/answer-path.js.map +1 -0
- package/dist/agent/turn/loop/call-binding.d.ts +17 -0
- package/dist/agent/turn/loop/call-binding.js +42 -0
- package/dist/agent/turn/loop/call-binding.js.map +1 -0
- package/dist/agent/turn/loop/canonicalize-turn-call.d.ts +5 -0
- package/dist/agent/turn/loop/canonicalize-turn-call.js +12 -0
- package/dist/agent/turn/loop/canonicalize-turn-call.js.map +1 -0
- package/dist/agent/turn/loop/completion-interpretation.d.ts +34 -0
- package/dist/agent/turn/loop/completion-interpretation.js +71 -0
- package/dist/agent/turn/loop/completion-interpretation.js.map +1 -0
- package/dist/agent/turn/loop/deps.d.ts +98 -0
- package/dist/agent/turn/loop/deps.js +2 -0
- package/dist/agent/turn/loop/deps.js.map +1 -0
- package/dist/agent/turn/loop/empty-response.d.ts +22 -0
- package/dist/agent/turn/loop/empty-response.js +51 -0
- package/dist/agent/turn/loop/empty-response.js.map +1 -0
- package/dist/agent/turn/loop/final-outcome.d.ts +15 -0
- package/dist/agent/turn/loop/final-outcome.js +49 -0
- package/dist/agent/turn/loop/final-outcome.js.map +1 -0
- package/dist/agent/turn/loop/group-execution.d.ts +14 -0
- package/dist/agent/turn/loop/group-execution.js +44 -0
- package/dist/agent/turn/loop/group-execution.js.map +1 -0
- package/dist/agent/turn/loop/model-only-rounds.d.ts +31 -0
- package/dist/agent/turn/loop/model-only-rounds.js +49 -0
- package/dist/agent/turn/loop/model-only-rounds.js.map +1 -0
- package/dist/agent/turn/loop/native-tool-calls.d.ts +12 -0
- package/dist/agent/turn/loop/native-tool-calls.js +57 -0
- package/dist/agent/turn/loop/native-tool-calls.js.map +1 -0
- package/dist/agent/turn/loop/native-write-salvage.d.ts +18 -0
- package/dist/agent/turn/loop/native-write-salvage.js +92 -0
- package/dist/agent/turn/loop/native-write-salvage.js.map +1 -0
- package/dist/agent/turn/loop/output-budget.d.ts +40 -0
- package/dist/agent/turn/loop/output-budget.js +76 -0
- package/dist/agent/turn/loop/output-budget.js.map +1 -0
- package/dist/agent/turn/loop/plan-call-deferral.d.ts +12 -0
- package/dist/agent/turn/loop/plan-call-deferral.js +32 -0
- package/dist/agent/turn/loop/plan-call-deferral.js.map +1 -0
- package/dist/agent/turn/loop/request-assembly.d.ts +32 -0
- package/dist/agent/turn/loop/request-assembly.js +97 -0
- package/dist/agent/turn/loop/request-assembly.js.map +1 -0
- package/dist/agent/turn/loop/round-closeout.d.ts +56 -0
- package/dist/agent/turn/loop/round-closeout.js +77 -0
- package/dist/agent/turn/loop/round-closeout.js.map +1 -0
- package/dist/agent/turn/loop/round-recorder.d.ts +38 -0
- package/dist/agent/turn/loop/round-recorder.js +71 -0
- package/dist/agent/turn/loop/round-recorder.js.map +1 -0
- package/dist/agent/turn/loop/round-request.d.ts +19 -0
- package/dist/agent/turn/loop/round-request.js +169 -0
- package/dist/agent/turn/loop/round-request.js.map +1 -0
- package/dist/agent/turn/loop/round-state.d.ts +11 -0
- package/dist/agent/turn/loop/round-state.js +11 -0
- package/dist/agent/turn/loop/round-state.js.map +1 -0
- package/dist/agent/turn/loop/run-rounds.d.ts +5 -0
- package/dist/agent/turn/loop/run-rounds.js +664 -0
- package/dist/agent/turn/loop/run-rounds.js.map +1 -0
- package/dist/agent/turn/loop/sequence-suppression.d.ts +54 -0
- package/dist/agent/turn/loop/sequence-suppression.js +112 -0
- package/dist/agent/turn/loop/sequence-suppression.js.map +1 -0
- package/dist/agent/turn/loop/state.d.ts +38 -0
- package/dist/agent/turn/loop/state.js +29 -0
- package/dist/agent/turn/loop/state.js.map +1 -0
- package/dist/agent/turn/loop/stream-failure.d.ts +55 -0
- package/dist/agent/turn/loop/stream-failure.js +149 -0
- package/dist/agent/turn/loop/stream-failure.js.map +1 -0
- package/dist/agent/turn/loop/stream-request.d.ts +16 -0
- package/dist/agent/turn/loop/stream-request.js +21 -0
- package/dist/agent/turn/loop/stream-request.js.map +1 -0
- package/dist/agent/turn/loop/stream-session.d.ts +41 -0
- package/dist/agent/turn/loop/stream-session.js +136 -0
- package/dist/agent/turn/loop/stream-session.js.map +1 -0
- package/dist/agent/turn/loop/tool-call-recovery.d.ts +25 -0
- package/dist/agent/turn/loop/tool-call-recovery.js +162 -0
- package/dist/agent/turn/loop/tool-call-recovery.js.map +1 -0
- package/dist/agent/turn/loop/unrun-calls.d.ts +12 -0
- package/dist/agent/turn/loop/unrun-calls.js +27 -0
- package/dist/agent/turn/loop/unrun-calls.js.map +1 -0
- package/dist/agent/turn/loop/wire-occurrences.d.ts +31 -0
- package/dist/agent/turn/loop/wire-occurrences.js +45 -0
- package/dist/agent/turn/loop/wire-occurrences.js.map +1 -0
- package/dist/agent/turn/mcp-agent-tools.d.ts +17 -0
- package/dist/agent/turn/mcp-agent-tools.js +69 -0
- package/dist/agent/turn/mcp-agent-tools.js.map +1 -0
- package/dist/agent/turn/message-assembly.d.ts +14 -0
- package/dist/agent/turn/message-assembly.js +22 -0
- package/dist/agent/turn/message-assembly.js.map +1 -0
- package/dist/agent/turn/outcome-accounting.d.ts +27 -0
- package/dist/agent/turn/outcome-accounting.js +91 -0
- package/dist/agent/turn/outcome-accounting.js.map +1 -0
- package/dist/agent/turn/plan-mode-gate.d.ts +16 -0
- package/dist/agent/turn/plan-mode-gate.js +36 -0
- package/dist/agent/turn/plan-mode-gate.js.map +1 -0
- package/dist/agent/turn/plan-persistence.d.ts +28 -0
- package/dist/agent/turn/plan-persistence.js +56 -0
- package/dist/agent/turn/plan-persistence.js.map +1 -0
- package/dist/agent/turn/prompt-sections.d.ts +9 -0
- package/dist/agent/turn/prompt-sections.js +67 -0
- package/dist/agent/turn/prompt-sections.js.map +1 -0
- package/dist/agent/turn/responder-claims.d.ts +16 -0
- package/dist/agent/turn/responder-claims.js +37 -0
- package/dist/agent/turn/responder-claims.js.map +1 -0
- package/dist/agent/turn/responder-dependency.d.ts +3 -0
- package/dist/agent/turn/responder-dependency.js +36 -0
- package/dist/agent/turn/responder-dependency.js.map +1 -0
- package/dist/agent/turn/responder-inbox.d.ts +28 -0
- package/dist/agent/turn/responder-inbox.js +57 -0
- package/dist/agent/turn/responder-inbox.js.map +1 -0
- package/dist/agent/turn/responder-job-linkage.d.ts +30 -0
- package/dist/agent/turn/responder-job-linkage.js +124 -0
- package/dist/agent/turn/responder-job-linkage.js.map +1 -0
- package/dist/agent/turn/responder-read-tool.d.ts +26 -0
- package/dist/agent/turn/responder-read-tool.js +83 -0
- package/dist/agent/turn/responder-read-tool.js.map +1 -0
- package/dist/agent/turn/scaffold-outcome.d.ts +7 -0
- package/dist/agent/turn/scaffold-outcome.js +93 -0
- package/dist/agent/turn/scaffold-outcome.js.map +1 -0
- package/dist/agent/turn/scaffold-preflight.d.ts +8 -0
- package/dist/agent/turn/scaffold-preflight.js +31 -0
- package/dist/agent/turn/scaffold-preflight.js.map +1 -0
- package/dist/agent/turn/session-state-projection.d.ts +18 -0
- package/dist/agent/turn/session-state-projection.js +46 -0
- package/dist/agent/turn/session-state-projection.js.map +1 -0
- package/dist/agent/turn/setup/compaction-services.d.ts +55 -0
- package/dist/agent/turn/setup/compaction-services.js +69 -0
- package/dist/agent/turn/setup/compaction-services.js.map +1 -0
- package/dist/agent/turn/setup/evidence-rehydration.d.ts +3 -0
- package/dist/agent/turn/setup/evidence-rehydration.js +22 -0
- package/dist/agent/turn/setup/evidence-rehydration.js.map +1 -0
- package/dist/agent/turn/setup/mcp-agent-ports.d.ts +29 -0
- package/dist/agent/turn/setup/mcp-agent-ports.js +26 -0
- package/dist/agent/turn/setup/mcp-agent-ports.js.map +1 -0
- package/dist/agent/turn/setup/prompt-classification.d.ts +10 -0
- package/dist/agent/turn/setup/prompt-classification.js +18 -0
- package/dist/agent/turn/setup/prompt-classification.js.map +1 -0
- package/dist/agent/turn/setup/responder-wake.d.ts +16 -0
- package/dist/agent/turn/setup/responder-wake.js +18 -0
- package/dist/agent/turn/setup/responder-wake.js.map +1 -0
- package/dist/agent/turn/setup/session-state.d.ts +20 -0
- package/dist/agent/turn/setup/session-state.js +23 -0
- package/dist/agent/turn/setup/session-state.js.map +1 -0
- package/dist/agent/turn/setup/task-gate-setup.d.ts +19 -0
- package/dist/agent/turn/setup/task-gate-setup.js +21 -0
- package/dist/agent/turn/setup/task-gate-setup.js.map +1 -0
- package/dist/agent/turn/setup/turn-budget.d.ts +19 -0
- package/dist/agent/turn/setup/turn-budget.js +34 -0
- package/dist/agent/turn/setup/turn-budget.js.map +1 -0
- package/dist/agent/turn/setup/turn-messages.d.ts +25 -0
- package/dist/agent/turn/setup/turn-messages.js +38 -0
- package/dist/agent/turn/setup/turn-messages.js.map +1 -0
- package/dist/agent/turn/setup/turn-state-machine.d.ts +13 -0
- package/dist/agent/turn/setup/turn-state-machine.js +52 -0
- package/dist/agent/turn/setup/turn-state-machine.js.map +1 -0
- package/dist/agent/turn/system-sections.d.ts +36 -0
- package/dist/agent/turn/system-sections.js +157 -0
- package/dist/agent/turn/system-sections.js.map +1 -0
- package/dist/agent/turn/task-autostart.d.ts +12 -0
- package/dist/agent/turn/task-autostart.js +35 -0
- package/dist/agent/turn/task-autostart.js.map +1 -0
- package/dist/agent/turn/task-batch-guard.d.ts +18 -0
- package/dist/agent/turn/task-batch-guard.js +83 -0
- package/dist/agent/turn/task-batch-guard.js.map +1 -0
- package/dist/agent/turn/task-credit.d.ts +15 -0
- package/dist/agent/turn/task-credit.js +49 -0
- package/dist/agent/turn/task-credit.js.map +1 -0
- package/dist/agent/turn/task-gate.d.ts +13 -0
- package/dist/agent/turn/task-gate.js +34 -0
- package/dist/agent/turn/task-gate.js.map +1 -0
- package/dist/agent/turn/task-update-gate.d.ts +13 -0
- package/dist/agent/turn/task-update-gate.js +40 -0
- package/dist/agent/turn/task-update-gate.js.map +1 -0
- package/dist/agent/turn/task-work-signals.d.ts +3 -0
- package/dist/agent/turn/task-work-signals.js +44 -0
- package/dist/agent/turn/task-work-signals.js.map +1 -0
- package/dist/agent/turn/tool-call-preparation.d.ts +20 -0
- package/dist/agent/turn/tool-call-preparation.js +67 -0
- package/dist/agent/turn/tool-call-preparation.js.map +1 -0
- package/dist/agent/turn/tool-evidence-signals.d.ts +22 -0
- package/dist/agent/turn/tool-evidence-signals.js +101 -0
- package/dist/agent/turn/tool-evidence-signals.js.map +1 -0
- package/dist/agent/turn/tool-execution/authorization.d.ts +32 -0
- package/dist/agent/turn/tool-execution/authorization.js +100 -0
- package/dist/agent/turn/tool-execution/authorization.js.map +1 -0
- package/dist/agent/turn/tool-execution/deps.d.ts +74 -0
- package/dist/agent/turn/tool-execution/deps.js +2 -0
- package/dist/agent/turn/tool-execution/deps.js.map +1 -0
- package/dist/agent/turn/tool-execution/dispatch.d.ts +27 -0
- package/dist/agent/turn/tool-execution/dispatch.js +76 -0
- package/dist/agent/turn/tool-execution/dispatch.js.map +1 -0
- package/dist/agent/turn/tool-execution/engagement-checkpoint.d.ts +7 -0
- package/dist/agent/turn/tool-execution/engagement-checkpoint.js +32 -0
- package/dist/agent/turn/tool-execution/engagement-checkpoint.js.map +1 -0
- package/dist/agent/turn/tool-execution/engagement-gate.d.ts +16 -0
- package/dist/agent/turn/tool-execution/engagement-gate.js +55 -0
- package/dist/agent/turn/tool-execution/engagement-gate.js.map +1 -0
- package/dist/agent/turn/tool-execution/gates.d.ts +21 -0
- package/dist/agent/turn/tool-execution/gates.js +45 -0
- package/dist/agent/turn/tool-execution/gates.js.map +1 -0
- package/dist/agent/turn/tool-execution/guards.d.ts +42 -0
- package/dist/agent/turn/tool-execution/guards.js +62 -0
- package/dist/agent/turn/tool-execution/guards.js.map +1 -0
- package/dist/agent/turn/tool-execution/meta-tools.d.ts +50 -0
- package/dist/agent/turn/tool-execution/meta-tools.js +114 -0
- package/dist/agent/turn/tool-execution/meta-tools.js.map +1 -0
- package/dist/agent/turn/tool-execution/plan-tool-ledger.d.ts +10 -0
- package/dist/agent/turn/tool-execution/plan-tool-ledger.js +50 -0
- package/dist/agent/turn/tool-execution/plan-tool-ledger.js.map +1 -0
- package/dist/agent/turn/tool-execution/result-framing.d.ts +36 -0
- package/dist/agent/turn/tool-execution/result-framing.js +54 -0
- package/dist/agent/turn/tool-execution/result-framing.js.map +1 -0
- package/dist/agent/turn/tool-execution/run-setup.d.ts +29 -0
- package/dist/agent/turn/tool-execution/run-setup.js +64 -0
- package/dist/agent/turn/tool-execution/run-setup.js.map +1 -0
- package/dist/agent/turn/tool-execution/single-tool.d.ts +4 -0
- package/dist/agent/turn/tool-execution/single-tool.js +613 -0
- package/dist/agent/turn/tool-execution/single-tool.js.map +1 -0
- package/dist/agent/turn/tool-execution/state.d.ts +19 -0
- package/dist/agent/turn/tool-execution/state.js +13 -0
- package/dist/agent/turn/tool-execution/state.js.map +1 -0
- package/dist/agent/turn/tool-execution/supervision.d.ts +20 -0
- package/dist/agent/turn/tool-execution/supervision.js +44 -0
- package/dist/agent/turn/tool-execution/supervision.js.map +1 -0
- package/dist/agent/turn/tool-result-recorder.d.ts +26 -0
- package/dist/agent/turn/tool-result-recorder.js +54 -0
- package/dist/agent/turn/tool-result-recorder.js.map +1 -0
- package/dist/agent/turn/tool-routing.d.ts +23 -0
- package/dist/agent/turn/tool-routing.js +58 -0
- package/dist/agent/turn/tool-routing.js.map +1 -0
- package/dist/agent/turn/tool-watchdog.d.ts +22 -0
- package/dist/agent/turn/tool-watchdog.js +135 -0
- package/dist/agent/turn/tool-watchdog.js.map +1 -0
- package/dist/agent/turn/turn-counters.d.ts +9 -0
- package/dist/agent/turn/turn-counters.js +13 -0
- package/dist/agent/turn/turn-counters.js.map +1 -0
- package/dist/agent/turn/workspace-setup.d.ts +29 -0
- package/dist/agent/turn/workspace-setup.js +74 -0
- package/dist/agent/turn/workspace-setup.js.map +1 -0
- package/dist/agent/workspace-orient.d.ts +0 -45
- package/dist/agent/workspace-orient.js +3 -69
- package/dist/agent/workspace-orient.js.map +1 -1
- package/dist/app/adapters/agent-event-adapter.d.ts +0 -1
- package/dist/app/adapters/agent-event-adapter.js +1 -4
- package/dist/app/adapters/agent-event-adapter.js.map +1 -1
- package/dist/app/adapters/current-interactive-sessions-adapter.d.ts +0 -1
- package/dist/app/adapters/current-interactive-sessions-adapter.js +0 -1
- package/dist/app/adapters/current-interactive-sessions-adapter.js.map +1 -1
- package/dist/app/adapters/current-jobs-adapter.d.ts +0 -1
- package/dist/app/adapters/current-jobs-adapter.js +0 -1
- package/dist/app/adapters/current-jobs-adapter.js.map +1 -1
- package/dist/app/adapters/current-store-adapter.d.ts +0 -1
- package/dist/app/adapters/current-store-adapter.js +0 -1
- package/dist/app/adapters/current-store-adapter.js.map +1 -1
- package/dist/app/adapters/quiet-meta-tools.d.ts +0 -11
- package/dist/app/adapters/quiet-meta-tools.js +0 -11
- package/dist/app/adapters/quiet-meta-tools.js.map +1 -1
- package/dist/app/commands/catalog.d.ts +0 -8
- package/dist/app/commands/catalog.js +10 -32
- package/dist/app/commands/catalog.js.map +1 -1
- package/dist/app/commands/command.d.ts +0 -4
- package/dist/app/commands/command.js.map +1 -1
- package/dist/app/commands/registry.d.ts +0 -3
- package/dist/app/commands/registry.js +1 -7
- package/dist/app/commands/registry.js.map +1 -1
- package/dist/app/confirm-prompt-text.d.ts +0 -6
- package/dist/app/confirm-prompt-text.js +0 -6
- package/dist/app/confirm-prompt-text.js.map +1 -1
- package/dist/app/controllers/cancel-all-result.d.ts +0 -5
- package/dist/app/controllers/cancel-all-result.js +0 -5
- package/dist/app/controllers/cancel-all-result.js.map +1 -1
- package/dist/app/controllers/plan-controller.d.ts +0 -6
- package/dist/app/controllers/plan-controller.js +0 -11
- package/dist/app/controllers/plan-controller.js.map +1 -1
- package/dist/app/controllers/session-compact-helper.d.ts +0 -9
- package/dist/app/controllers/session-compact-helper.js +0 -14
- package/dist/app/controllers/session-compact-helper.js.map +1 -1
- package/dist/app/controllers/session-context-usage.d.ts +0 -11
- package/dist/app/controllers/session-context-usage.js +22 -30
- package/dist/app/controllers/session-context-usage.js.map +1 -1
- package/dist/app/controllers/session-controller.d.ts +1 -38
- package/dist/app/controllers/session-controller.js +8 -47
- package/dist/app/controllers/session-controller.js.map +1 -1
- package/dist/app/controllers/session-naming.d.ts +0 -4
- package/dist/app/controllers/session-naming.js +0 -4
- package/dist/app/controllers/session-naming.js.map +1 -1
- package/dist/app/controllers/session-persistence.d.ts +0 -6
- package/dist/app/controllers/session-persistence.js +0 -10
- package/dist/app/controllers/session-persistence.js.map +1 -1
- package/dist/app/controllers/session-responder.js +0 -4
- package/dist/app/controllers/session-responder.js.map +1 -1
- package/dist/app/controllers/session-turn-request.d.ts +0 -1
- package/dist/app/controllers/session-turn-request.js +0 -1
- package/dist/app/controllers/session-turn-request.js.map +1 -1
- package/dist/app/controllers/session-usage-ledger.d.ts +6 -1
- package/dist/app/controllers/session-usage-ledger.js +43 -3
- package/dist/app/controllers/session-usage-ledger.js.map +1 -1
- package/dist/app/controllers/turn-controller.js +2 -6
- package/dist/app/controllers/turn-controller.js.map +1 -1
- package/dist/app/events/app-event.d.ts +1 -11
- package/dist/app/events/app-event.js +0 -1
- package/dist/app/events/app-event.js.map +1 -1
- package/dist/app/events/event-buffer.d.ts +0 -6
- package/dist/app/events/event-buffer.js +0 -6
- package/dist/app/events/event-buffer.js.map +1 -1
- package/dist/app/events/sequencer.d.ts +0 -2
- package/dist/app/events/sequencer.js +0 -1
- package/dist/app/events/sequencer.js.map +1 -1
- package/dist/app/ports/agent-port.d.ts +0 -19
- package/dist/app/ports/interactive-sessions-port.d.ts +0 -13
- package/dist/app/ports/interactive-sessions-port.js +0 -7
- package/dist/app/ports/interactive-sessions-port.js.map +1 -1
- package/dist/app/ports/persistence-port.d.ts +0 -14
- package/dist/app/ports/updates-port.d.ts +0 -5
- package/dist/classic/app/ClassicApp.js +0 -2
- package/dist/classic/app/ClassicApp.js.map +1 -1
- package/dist/classic/app/action-handlers.js +0 -4
- package/dist/classic/app/action-handlers.js.map +1 -1
- package/dist/classic/app/git-branch.js +0 -1
- package/dist/classic/app/git-branch.js.map +1 -1
- package/dist/classic/app/use-feed.d.ts +0 -7
- package/dist/classic/app/use-feed.js +0 -5
- package/dist/classic/app/use-feed.js.map +1 -1
- package/dist/classic/app/wiring-interactions.js +0 -2
- package/dist/classic/app/wiring-interactions.js.map +1 -1
- package/dist/classic/blocks/assistant-lines.d.ts +0 -1
- package/dist/classic/blocks/assistant-lines.js +0 -1
- package/dist/classic/blocks/assistant-lines.js.map +1 -1
- package/dist/classic/blocks/batch-lines.d.ts +0 -1
- package/dist/classic/blocks/batch-lines.js +0 -1
- package/dist/classic/blocks/batch-lines.js.map +1 -1
- package/dist/classic/blocks/block-context.d.ts +0 -7
- package/dist/classic/blocks/block-context.js +0 -1
- package/dist/classic/blocks/block-context.js.map +1 -1
- package/dist/classic/blocks/compacted-lines.d.ts +0 -1
- package/dist/classic/blocks/compacted-lines.js +0 -1
- package/dist/classic/blocks/compacted-lines.js.map +1 -1
- package/dist/classic/blocks/diff-lines.d.ts +0 -3
- package/dist/classic/blocks/diff-lines.js +0 -4
- package/dist/classic/blocks/diff-lines.js.map +1 -1
- package/dist/classic/blocks/intro-lines.d.ts +0 -5
- package/dist/classic/blocks/intro-lines.js +0 -5
- package/dist/classic/blocks/intro-lines.js.map +1 -1
- package/dist/classic/blocks/notice-lines.d.ts +0 -4
- package/dist/classic/blocks/notice-lines.js +0 -6
- package/dist/classic/blocks/notice-lines.js.map +1 -1
- package/dist/classic/blocks/thinking-lines.d.ts +0 -1
- package/dist/classic/blocks/thinking-lines.js +0 -1
- package/dist/classic/blocks/thinking-lines.js.map +1 -1
- package/dist/classic/blocks/tool-lines.d.ts +0 -7
- package/dist/classic/blocks/tool-lines.js +0 -10
- package/dist/classic/blocks/tool-lines.js.map +1 -1
- package/dist/classic/blocks/user-lines.d.ts +0 -1
- package/dist/classic/blocks/user-lines.js +0 -1
- package/dist/classic/blocks/user-lines.js.map +1 -1
- package/dist/classic/bootstrap/osc52-renderer.js +0 -1
- package/dist/classic/bootstrap/osc52-renderer.js.map +1 -1
- package/dist/classic/chrome/Chrome.d.ts +0 -1
- package/dist/classic/chrome/Chrome.js.map +1 -1
- package/dist/classic/chrome/Composer.d.ts +0 -5
- package/dist/classic/chrome/Composer.js +0 -5
- package/dist/classic/chrome/Composer.js.map +1 -1
- package/dist/classic/chrome/composer-controller.js +0 -4
- package/dist/classic/chrome/composer-controller.js.map +1 -1
- package/dist/classic/chrome/composer-frame.d.ts +0 -3
- package/dist/classic/chrome/composer-frame.js +0 -3
- package/dist/classic/chrome/composer-frame.js.map +1 -1
- package/dist/classic/chrome/directory-row.d.ts +0 -7
- package/dist/classic/chrome/directory-row.js +0 -7
- package/dist/classic/chrome/directory-row.js.map +1 -1
- package/dist/classic/chrome/row-budget.d.ts +0 -2
- package/dist/classic/chrome/row-budget.js +0 -8
- package/dist/classic/chrome/row-budget.js.map +1 -1
- package/dist/classic/chrome/status-rows.d.ts +0 -12
- package/dist/classic/chrome/status-rows.js +0 -16
- package/dist/classic/chrome/status-rows.js.map +1 -1
- package/dist/classic/chrome/toast-rows.d.ts +0 -4
- package/dist/classic/chrome/toast-rows.js +0 -9
- package/dist/classic/chrome/toast-rows.js.map +1 -1
- package/dist/classic/feed/Feed.d.ts +0 -5
- package/dist/classic/feed/Feed.js +0 -4
- package/dist/classic/feed/Feed.js.map +1 -1
- package/dist/classic/feed/FeedStatic.d.ts +0 -8
- package/dist/classic/feed/FeedStatic.js +0 -8
- package/dist/classic/feed/FeedStatic.js.map +1 -1
- package/dist/classic/feed/ScrollbarGutter.js +0 -1
- package/dist/classic/feed/ScrollbarGutter.js.map +1 -1
- package/dist/classic/feed/block-height.d.ts +0 -7
- package/dist/classic/feed/block-height.js +0 -7
- package/dist/classic/feed/block-height.js.map +1 -1
- package/dist/classic/feed/commit-ledger.d.ts +0 -12
- package/dist/classic/feed/commit-ledger.js +0 -10
- package/dist/classic/feed/commit-ledger.js.map +1 -1
- package/dist/classic/feed/feed-blocks.d.ts +0 -8
- package/dist/classic/feed/feed-blocks.js +0 -6
- package/dist/classic/feed/feed-blocks.js.map +1 -1
- package/dist/classic/feed/live-tail-policy.d.ts +0 -13
- package/dist/classic/feed/live-tail-policy.js +0 -11
- package/dist/classic/feed/live-tail-policy.js.map +1 -1
- package/dist/classic/feed/scrollbar-rows.d.ts +0 -1
- package/dist/classic/feed/scrollbar-rows.js +0 -1
- package/dist/classic/feed/scrollbar-rows.js.map +1 -1
- package/dist/classic/feed/transcript-window.d.ts +0 -10
- package/dist/classic/feed/transcript-window.js +0 -6
- package/dist/classic/feed/transcript-window.js.map +1 -1
- package/dist/classic/input/input-router.js +0 -2
- package/dist/classic/input/input-router.js.map +1 -1
- package/dist/classic/panels/completion-rows.js +2 -1
- package/dist/classic/panels/completion-rows.js.map +1 -1
- package/dist/classic/panels/keys-panel.d.ts +0 -1
- package/dist/classic/panels/keys-panel.js +0 -1
- package/dist/classic/panels/keys-panel.js.map +1 -1
- package/dist/classic/panels/pager-panel.d.ts +0 -5
- package/dist/classic/panels/pager-panel.js +0 -11
- package/dist/classic/panels/pager-panel.js.map +1 -1
- package/dist/classic/panels/panel-controller.d.ts +0 -2
- package/dist/classic/panels/panel-controller.js +0 -2
- package/dist/classic/panels/panel-controller.js.map +1 -1
- package/dist/classic/panels/panel-frame.js +0 -2
- package/dist/classic/panels/panel-frame.js.map +1 -1
- package/dist/classic/panels/panel-wheel.d.ts +0 -5
- package/dist/classic/panels/panel-wheel.js +0 -5
- package/dist/classic/panels/panel-wheel.js.map +1 -1
- package/dist/classic/panels/secret-panel.d.ts +0 -1
- package/dist/classic/panels/secret-panel.js +0 -1
- package/dist/classic/panels/secret-panel.js.map +1 -1
- package/dist/classic/panels/text-editor-panel.d.ts +0 -1
- package/dist/classic/panels/text-editor-panel.js +0 -1
- package/dist/classic/panels/text-editor-panel.js.map +1 -1
- package/dist/classic/render/ansi-text.d.ts +0 -19
- package/dist/classic/render/ansi-text.js +0 -19
- package/dist/classic/render/ansi-text.js.map +1 -1
- package/dist/classic/render/glyphs.d.ts +0 -4
- package/dist/classic/render/glyphs.js +0 -4
- package/dist/classic/render/glyphs.js.map +1 -1
- package/dist/classic/render/ink-theme.d.ts +0 -10
- package/dist/classic/render/ink-theme.js +0 -6
- package/dist/classic/render/ink-theme.js.map +1 -1
- package/dist/classic/render/measure.d.ts +0 -12
- package/dist/classic/render/measure.js +0 -12
- package/dist/classic/render/measure.js.map +1 -1
- package/dist/classic/render/shell-width.d.ts +0 -8
- package/dist/classic/render/shell-width.js +0 -8
- package/dist/classic/render/shell-width.js.map +1 -1
- package/dist/classic/render/wrap.d.ts +0 -11
- package/dist/classic/render/wrap.js +0 -8
- package/dist/classic/render/wrap.js.map +1 -1
- package/dist/commands/doctor.js +0 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/providers.d.ts +0 -1
- package/dist/commands/providers.js +0 -22
- package/dist/commands/providers.js.map +1 -1
- package/dist/commands/search-providers.d.ts +0 -1
- package/dist/commands/search-providers.js +0 -4
- package/dist/commands/search-providers.js.map +1 -1
- package/dist/commands/update/installers.d.ts +61 -0
- package/dist/commands/update/installers.js +505 -0
- package/dist/commands/update/installers.js.map +1 -0
- package/dist/commands/update-install.d.ts +4 -65
- package/dist/commands/update-install.js +6 -506
- package/dist/commands/update-install.js.map +1 -1
- package/dist/commands/update.d.ts +0 -6
- package/dist/commands/update.js +1 -11
- package/dist/commands/update.js.map +1 -1
- package/dist/index.js +3 -10
- package/dist/index.js.map +1 -1
- package/dist/interactive-session/artifact-writer.d.ts +0 -1
- package/dist/interactive-session/artifact-writer.js +0 -1
- package/dist/interactive-session/artifact-writer.js.map +1 -1
- package/dist/interactive-session/cleanup.d.ts +0 -10
- package/dist/interactive-session/cleanup.js +0 -13
- package/dist/interactive-session/cleanup.js.map +1 -1
- package/dist/interactive-session/config.d.ts +0 -16
- package/dist/interactive-session/config.js +0 -13
- package/dist/interactive-session/config.js.map +1 -1
- package/dist/interactive-session/manager.d.ts +0 -27
- package/dist/interactive-session/manager.js +0 -42
- package/dist/interactive-session/manager.js.map +1 -1
- package/dist/interactive-session/output-store.d.ts +0 -6
- package/dist/interactive-session/output-store.js +0 -5
- package/dist/interactive-session/output-store.js.map +1 -1
- package/dist/interactive-session/output-view.d.ts +0 -4
- package/dist/interactive-session/output-view.js +0 -12
- package/dist/interactive-session/output-view.js.map +1 -1
- package/dist/interactive-session/recovery-journal.d.ts +0 -7
- package/dist/interactive-session/recovery-journal.js +0 -7
- package/dist/interactive-session/recovery-journal.js.map +1 -1
- package/dist/interactive-session/registry.d.ts +0 -25
- package/dist/interactive-session/registry.js +0 -27
- package/dist/interactive-session/registry.js.map +1 -1
- package/dist/interactive-session/runtime.d.ts +0 -30
- package/dist/interactive-session/runtime.js +0 -23
- package/dist/interactive-session/runtime.js.map +1 -1
- package/dist/interactive-session/session-runtime.d.ts +0 -9
- package/dist/interactive-session/session-runtime.js +0 -10
- package/dist/interactive-session/session-runtime.js.map +1 -1
- package/dist/interactive-session/streaming-redactor.d.ts +0 -14
- package/dist/interactive-session/streaming-redactor.js +0 -18
- package/dist/interactive-session/streaming-redactor.js.map +1 -1
- package/dist/interactive-session/telemetry.d.ts +0 -8
- package/dist/interactive-session/telemetry.js +0 -7
- package/dist/interactive-session/telemetry.js.map +1 -1
- package/dist/interactive-session/transport-factory.d.ts +0 -5
- package/dist/interactive-session/transport-factory.js +0 -5
- package/dist/interactive-session/transport-factory.js.map +1 -1
- package/dist/interactive-session/transport-pipe.d.ts +0 -7
- package/dist/interactive-session/transport-pipe.js +0 -14
- package/dist/interactive-session/transport-pipe.js.map +1 -1
- package/dist/interactive-session/transport.d.ts +0 -26
- package/dist/interactive-session/transport.js +0 -20
- package/dist/interactive-session/transport.js.map +1 -1
- package/dist/interactive-session/types.d.ts +0 -19
- package/dist/interactive-session/types.js +0 -22
- package/dist/interactive-session/types.js.map +1 -1
- package/dist/llm/adapters/anthropic-stream-events.d.ts +38 -0
- package/dist/llm/adapters/anthropic-stream-events.js +144 -0
- package/dist/llm/adapters/anthropic-stream-events.js.map +1 -0
- package/dist/llm/adapters/anthropic-tools.d.ts +5 -55
- package/dist/llm/adapters/anthropic-tools.js +6 -208
- package/dist/llm/adapters/anthropic-tools.js.map +1 -1
- package/dist/llm/adapters/anthropic-wire-blocks.d.ts +9 -0
- package/dist/llm/adapters/anthropic-wire-blocks.js +59 -0
- package/dist/llm/adapters/anthropic-wire-blocks.js.map +1 -0
- package/dist/llm/adapters/gemini-tools.d.ts +0 -6
- package/dist/llm/adapters/gemini-tools.js +0 -24
- package/dist/llm/adapters/gemini-tools.js.map +1 -1
- package/dist/llm/adapters/ollama-tools.js +0 -5
- package/dist/llm/adapters/ollama-tools.js.map +1 -1
- package/dist/llm/adapters/openai-tools.d.ts +0 -4
- package/dist/llm/adapters/openai-tools.js +2 -11
- package/dist/llm/adapters/openai-tools.js.map +1 -1
- package/dist/llm/agentrouter.d.ts +0 -9
- package/dist/llm/agentrouter.js +10 -60
- package/dist/llm/agentrouter.js.map +1 -1
- package/dist/llm/anthropic.d.ts +0 -7
- package/dist/llm/anthropic.js +2 -30
- package/dist/llm/anthropic.js.map +1 -1
- package/dist/llm/artifacts/legacy-blocks.d.ts +3 -0
- package/dist/llm/artifacts/legacy-blocks.js +109 -0
- package/dist/llm/artifacts/legacy-blocks.js.map +1 -0
- package/dist/llm/artifacts/replay-selection.d.ts +9 -0
- package/dist/llm/artifacts/replay-selection.js +48 -0
- package/dist/llm/artifacts/replay-selection.js.map +1 -0
- package/dist/llm/aws-mantle.js +2 -4
- package/dist/llm/aws-mantle.js.map +1 -1
- package/dist/llm/bynara.js +2 -0
- package/dist/llm/bynara.js.map +1 -1
- package/dist/llm/cache-affinity.d.ts +1 -0
- package/dist/llm/cache-affinity.js +6 -0
- package/dist/llm/cache-affinity.js.map +1 -1
- package/dist/llm/capabilities.d.ts +7 -36
- package/dist/llm/capabilities.js +11 -502
- package/dist/llm/capabilities.js.map +1 -1
- package/dist/llm/capability/state.d.ts +25 -0
- package/dist/llm/capability/state.js +125 -0
- package/dist/llm/capability/state.js.map +1 -0
- package/dist/llm/capability/tool-dialect.d.ts +3 -0
- package/dist/llm/capability/tool-dialect.js +78 -0
- package/dist/llm/capability/tool-dialect.js.map +1 -0
- package/dist/llm/capability/vision-patterns.d.ts +4 -0
- package/dist/llm/capability/vision-patterns.js +188 -0
- package/dist/llm/capability/vision-patterns.js.map +1 -0
- package/dist/llm/capability/vision-registry.d.ts +20 -0
- package/dist/llm/capability/vision-registry.js +112 -0
- package/dist/llm/capability/vision-registry.js.map +1 -0
- package/dist/llm/context-snapshot.d.ts +0 -18
- package/dist/llm/context-snapshot.js +1 -8
- package/dist/llm/context-snapshot.js.map +1 -1
- package/dist/llm/context-windows.d.ts +0 -6
- package/dist/llm/context-windows.js +0 -30
- package/dist/llm/context-windows.js.map +1 -1
- package/dist/llm/custom-provider-profile.d.ts +4 -23
- package/dist/llm/custom-provider-profile.js +4 -515
- package/dist/llm/custom-provider-profile.js.map +1 -1
- package/dist/llm/custom-providers.d.ts +0 -23
- package/dist/llm/custom-providers.js +2 -27
- package/dist/llm/custom-providers.js.map +1 -1
- package/dist/llm/effort-fallback.d.ts +0 -38
- package/dist/llm/effort-fallback.js +0 -38
- package/dist/llm/effort-fallback.js.map +1 -1
- package/dist/llm/fireworks.js +2 -0
- package/dist/llm/fireworks.js.map +1 -1
- package/dist/llm/free.js +7 -2
- package/dist/llm/free.js.map +1 -1
- package/dist/llm/gemini.d.ts +0 -1
- package/dist/llm/gemini.js +2 -19
- package/dist/llm/gemini.js.map +1 -1
- package/dist/llm/hetzner.js +2 -0
- package/dist/llm/hetzner.js.map +1 -1
- package/dist/llm/http.d.ts +24 -251
- package/dist/llm/http.js +19 -2021
- package/dist/llm/http.js.map +1 -1
- package/dist/llm/key-rotation.d.ts +0 -32
- package/dist/llm/key-rotation.js +6 -37
- package/dist/llm/key-rotation.js.map +1 -1
- package/dist/llm/lightning.d.ts +0 -8
- package/dist/llm/lightning.js +3 -18
- package/dist/llm/lightning.js.map +1 -1
- package/dist/llm/merge-gateway.d.ts +0 -9
- package/dist/llm/merge-gateway.js +2 -44
- package/dist/llm/merge-gateway.js.map +1 -1
- package/dist/llm/modal.js +3 -15
- package/dist/llm/modal.js.map +1 -1
- package/dist/llm/model-families.d.ts +0 -5
- package/dist/llm/model-families.js +0 -5
- package/dist/llm/model-families.js.map +1 -1
- package/dist/llm/model-layers/model-patterns.d.ts +7 -0
- package/dist/llm/model-layers/model-patterns.js +30 -0
- package/dist/llm/model-layers/model-patterns.js.map +1 -0
- package/dist/llm/model-layers/model-rules.d.ts +8 -0
- package/dist/llm/model-layers/model-rules.js +221 -0
- package/dist/llm/model-layers/model-rules.js.map +1 -0
- package/dist/llm/model-layers/nvidia-layer.d.ts +2 -0
- package/dist/llm/model-layers/nvidia-layer.js +135 -0
- package/dist/llm/model-layers/nvidia-layer.js.map +1 -0
- package/dist/llm/nvidia.js +3 -11
- package/dist/llm/nvidia.js.map +1 -1
- package/dist/llm/ollama.js +2 -11
- package/dist/llm/ollama.js.map +1 -1
- package/dist/llm/openai.js +2 -0
- package/dist/llm/openai.js.map +1 -1
- package/dist/llm/openrouter.js +3 -1
- package/dist/llm/openrouter.js.map +1 -1
- package/dist/llm/operation-ledger.d.ts +0 -6
- package/dist/llm/operation-ledger.js +0 -6
- package/dist/llm/operation-ledger.js.map +1 -1
- package/dist/llm/operation-usage.d.ts +2 -0
- package/dist/llm/operation-usage.js +27 -0
- package/dist/llm/operation-usage.js.map +1 -1
- package/dist/llm/orcarouter.d.ts +0 -4
- package/dist/llm/orcarouter.js +3 -26
- package/dist/llm/orcarouter.js.map +1 -1
- package/dist/llm/profile/control-rejections.d.ts +14 -0
- package/dist/llm/profile/control-rejections.js +75 -0
- package/dist/llm/profile/control-rejections.js.map +1 -0
- package/dist/llm/profile/custom-layer.d.ts +3 -0
- package/dist/llm/profile/custom-layer.js +83 -0
- package/dist/llm/profile/custom-layer.js.map +1 -0
- package/dist/llm/profile/layer-merge.d.ts +3 -0
- package/dist/llm/profile/layer-merge.js +185 -0
- package/dist/llm/profile/layer-merge.js.map +1 -0
- package/dist/llm/profile/spec-validation.d.ts +5 -0
- package/dist/llm/profile/spec-validation.js +289 -0
- package/dist/llm/profile/spec-validation.js.map +1 -0
- package/dist/llm/profile/spec-vocabulary.d.ts +21 -0
- package/dist/llm/profile/spec-vocabulary.js +142 -0
- package/dist/llm/profile/spec-vocabulary.js.map +1 -0
- package/dist/llm/provider-identity.d.ts +5 -0
- package/dist/llm/provider-identity.js +130 -0
- package/dist/llm/provider-identity.js.map +1 -0
- package/dist/llm/provider-info-text.d.ts +1 -0
- package/dist/llm/provider-info-text.js +587 -0
- package/dist/llm/provider-info-text.js.map +1 -0
- package/dist/llm/provider-model-layers.d.ts +2 -0
- package/dist/llm/provider-model-layers.js +6 -380
- package/dist/llm/provider-model-layers.js.map +1 -1
- package/dist/llm/provider-profile-layers.js +0 -2
- package/dist/llm/provider-profile-layers.js.map +1 -1
- package/dist/llm/provider-profile.d.ts +10 -12
- package/dist/llm/provider-profile.js +6 -265
- package/dist/llm/provider-profile.js.map +1 -1
- package/dist/llm/provider.d.ts +4 -16
- package/dist/llm/provider.js +6 -760
- package/dist/llm/provider.js.map +1 -1
- package/dist/llm/qwen-cloud.js +2 -4
- package/dist/llm/qwen-cloud.js.map +1 -1
- package/dist/llm/reasoning-artifacts.d.ts +5 -50
- package/dist/llm/reasoning-artifacts.js +11 -198
- package/dist/llm/reasoning-artifacts.js.map +1 -1
- package/dist/llm/reasoning-capability.js +0 -16
- package/dist/llm/reasoning-capability.js.map +1 -1
- package/dist/llm/request-fingerprint.d.ts +0 -4
- package/dist/llm/request-fingerprint.js +0 -4
- package/dist/llm/request-fingerprint.js.map +1 -1
- package/dist/llm/request-plan.d.ts +0 -14
- package/dist/llm/request-plan.js +0 -23
- package/dist/llm/request-plan.js.map +1 -1
- package/dist/llm/responses/item-events.d.ts +3 -0
- package/dist/llm/responses/item-events.js +93 -0
- package/dist/llm/responses/item-events.js.map +1 -0
- package/dist/llm/responses-complete.d.ts +1 -1
- package/dist/llm/responses-complete.js +2 -1
- package/dist/llm/responses-complete.js.map +1 -1
- package/dist/llm/responses-config.js.map +1 -1
- package/dist/llm/responses-http.d.ts +1 -0
- package/dist/llm/responses-http.js +3 -1
- package/dist/llm/responses-http.js.map +1 -1
- package/dist/llm/responses-parse.d.ts +3 -0
- package/dist/llm/responses-parse.js +19 -6
- package/dist/llm/responses-parse.js.map +1 -1
- package/dist/llm/responses-request.d.ts +2 -1
- package/dist/llm/responses-request.js +7 -2
- package/dist/llm/responses-request.js.map +1 -1
- package/dist/llm/responses-shape.d.ts +5 -0
- package/dist/llm/responses-shape.js +16 -0
- package/dist/llm/responses-shape.js.map +1 -0
- package/dist/llm/responses-stream-accumulator.d.ts +1 -1
- package/dist/llm/responses-stream-accumulator.js +8 -9
- package/dist/llm/responses-stream-accumulator.js.map +1 -1
- package/dist/llm/responses-stream-events.d.ts +2 -0
- package/dist/llm/responses-stream-events.js +34 -102
- package/dist/llm/responses-stream-events.js.map +1 -1
- package/dist/llm/responses-stream-watchdog.js.map +1 -1
- package/dist/llm/responses-stream.js +9 -4
- package/dist/llm/responses-stream.js.map +1 -1
- package/dist/llm/router.d.ts +7 -44
- package/dist/llm/router.js +24 -1145
- package/dist/llm/router.js.map +1 -1
- package/dist/llm/routing/attempt-complete.d.ts +3 -0
- package/dist/llm/routing/attempt-complete.js +120 -0
- package/dist/llm/routing/attempt-complete.js.map +1 -0
- package/dist/llm/routing/attempt-request.d.ts +21 -0
- package/dist/llm/routing/attempt-request.js +99 -0
- package/dist/llm/routing/attempt-request.js.map +1 -0
- package/dist/llm/routing/attempt-stream.d.ts +3 -0
- package/dist/llm/routing/attempt-stream.js +256 -0
- package/dist/llm/routing/attempt-stream.js.map +1 -0
- package/dist/llm/routing/error-classification.d.ts +15 -0
- package/dist/llm/routing/error-classification.js +151 -0
- package/dist/llm/routing/error-classification.js.map +1 -0
- package/dist/llm/routing/failure-report.d.ts +22 -0
- package/dist/llm/routing/failure-report.js +128 -0
- package/dist/llm/routing/failure-report.js.map +1 -0
- package/dist/llm/routing/key-rotation.d.ts +21 -0
- package/dist/llm/routing/key-rotation.js +207 -0
- package/dist/llm/routing/key-rotation.js.map +1 -0
- package/dist/llm/routing/provider-selection.d.ts +8 -0
- package/dist/llm/routing/provider-selection.js +119 -0
- package/dist/llm/routing/provider-selection.js.map +1 -0
- package/dist/llm/sampling.d.ts +0 -15
- package/dist/llm/sampling.js +0 -9
- package/dist/llm/sampling.js.map +1 -1
- package/dist/llm/session-affinity.d.ts +2 -0
- package/dist/llm/session-affinity.js +9 -0
- package/dist/llm/session-affinity.js.map +1 -0
- package/dist/llm/stream-progress.d.ts +0 -1
- package/dist/llm/stream-progress.js +0 -15
- package/dist/llm/stream-progress.js.map +1 -1
- package/dist/llm/system-messages.d.ts +0 -22
- package/dist/llm/system-messages.js +6 -22
- package/dist/llm/system-messages.js.map +1 -1
- package/dist/llm/token-estimate-calibration.d.ts +0 -6
- package/dist/llm/token-estimate-calibration.js +0 -26
- package/dist/llm/token-estimate-calibration.js.map +1 -1
- package/dist/llm/token-usage.d.ts +8 -69
- package/dist/llm/token-usage.js +10 -257
- package/dist/llm/token-usage.js.map +1 -1
- package/dist/llm/tokenrouter.d.ts +0 -12
- package/dist/llm/tokenrouter.js +3 -14
- package/dist/llm/tokenrouter.js.map +1 -1
- package/dist/llm/tool-protocol.d.ts +3 -22
- package/dist/llm/tool-protocol.js +20 -155
- package/dist/llm/tool-protocol.js.map +1 -1
- package/dist/llm/tool-wire/argument-repair.d.ts +4 -0
- package/dist/llm/tool-wire/argument-repair.js +174 -0
- package/dist/llm/tool-wire/argument-repair.js.map +1 -0
- package/dist/llm/transport-events.d.ts +12 -0
- package/dist/llm/transport-events.js +29 -0
- package/dist/llm/transport-events.js.map +1 -0
- package/dist/llm/usage/provider-parsers.d.ts +11 -0
- package/dist/llm/usage/provider-parsers.js +220 -0
- package/dist/llm/usage/provider-parsers.js.map +1 -0
- package/dist/llm/wire/abort-race.d.ts +1 -0
- package/dist/llm/wire/abort-race.js +34 -0
- package/dist/llm/wire/abort-race.js.map +1 -0
- package/dist/llm/wire/capability-errors.d.ts +11 -0
- package/dist/llm/wire/capability-errors.js +92 -0
- package/dist/llm/wire/capability-errors.js.map +1 -0
- package/dist/llm/wire/chat-body.d.ts +40 -0
- package/dist/llm/wire/chat-body.js +172 -0
- package/dist/llm/wire/chat-body.js.map +1 -0
- package/dist/llm/wire/model-catalog.d.ts +4 -0
- package/dist/llm/wire/model-catalog.js +34 -0
- package/dist/llm/wire/model-catalog.js.map +1 -0
- package/dist/llm/wire/openai-complete.d.ts +27 -0
- package/dist/llm/wire/openai-complete.js +138 -0
- package/dist/llm/wire/openai-complete.js.map +1 -0
- package/dist/llm/wire/openai-stream.d.ts +36 -0
- package/dist/llm/wire/openai-stream.js +665 -0
- package/dist/llm/wire/openai-stream.js.map +1 -0
- package/dist/llm/wire/reasoning-artifacts.d.ts +45 -0
- package/dist/llm/wire/reasoning-artifacts.js +140 -0
- package/dist/llm/wire/reasoning-artifacts.js.map +1 -0
- package/dist/llm/wire/reasoning-payload.d.ts +9 -0
- package/dist/llm/wire/reasoning-payload.js +212 -0
- package/dist/llm/wire/reasoning-payload.js.map +1 -0
- package/dist/llm/wire/response-errors.d.ts +5 -0
- package/dist/llm/wire/response-errors.js +182 -0
- package/dist/llm/wire/response-errors.js.map +1 -0
- package/dist/llm/wire/responses-first.d.ts +30 -0
- package/dist/llm/wire/responses-first.js +335 -0
- package/dist/llm/wire/responses-first.js.map +1 -0
- package/dist/llm/wire/stream-framing.d.ts +38 -0
- package/dist/llm/wire/stream-framing.js +217 -0
- package/dist/llm/wire/stream-framing.js.map +1 -0
- package/dist/mcp/runtime.d.ts +0 -15
- package/dist/mcp/runtime.js +0 -8
- package/dist/mcp/runtime.js.map +1 -1
- package/dist/modes/ask.d.ts +0 -3
- package/dist/modes/ask.js +0 -22
- package/dist/modes/ask.js.map +1 -1
- package/dist/noninteractive/blocks/tool-blocks.d.ts +35 -0
- package/dist/noninteractive/blocks/tool-blocks.js +206 -0
- package/dist/noninteractive/blocks/tool-blocks.js.map +1 -0
- package/dist/noninteractive/readline-prompts.d.ts +0 -21
- package/dist/noninteractive/readline-prompts.js +0 -31
- package/dist/noninteractive/readline-prompts.js.map +1 -1
- package/dist/noninteractive/stdio-confirm-port.d.ts +0 -9
- package/dist/noninteractive/stdio-confirm-port.js +0 -9
- package/dist/noninteractive/stdio-confirm-port.js.map +1 -1
- package/dist/noninteractive/stream-blocks.d.ts +3 -49
- package/dist/noninteractive/stream-blocks.js +14 -234
- package/dist/noninteractive/stream-blocks.js.map +1 -1
- package/dist/noninteractive/stream-renderer.d.ts +0 -10
- package/dist/noninteractive/stream-renderer.js +0 -10
- package/dist/noninteractive/stream-renderer.js.map +1 -1
- package/dist/noninteractive/stream-spinner.d.ts +0 -8
- package/dist/noninteractive/stream-spinner.js +0 -8
- package/dist/noninteractive/stream-spinner.js.map +1 -1
- package/dist/os/bun-runtime.d.ts +0 -15
- package/dist/os/bun-runtime.js +0 -33
- package/dist/os/bun-runtime.js.map +1 -1
- package/dist/os/command.d.ts +0 -6
- package/dist/os/command.js +0 -13
- package/dist/os/command.js.map +1 -1
- package/dist/os/cwd.d.ts +0 -5
- package/dist/os/cwd.js +0 -6
- package/dist/os/cwd.js.map +1 -1
- package/dist/os/permissions.d.ts +0 -11
- package/dist/os/permissions.js +0 -13
- package/dist/os/permissions.js.map +1 -1
- package/dist/os/process-identity.d.ts +0 -22
- package/dist/os/process-identity.js +0 -23
- package/dist/os/process-identity.js.map +1 -1
- package/dist/os/process-tree.d.ts +0 -7
- package/dist/os/process-tree.js +0 -8
- package/dist/os/process-tree.js.map +1 -1
- package/dist/prompts/index.d.ts +0 -36
- package/dist/prompts/index.js +0 -46
- package/dist/prompts/index.js.map +1 -1
- package/dist/safety/classifier.d.ts +5 -26
- package/dist/safety/classifier.js +5 -573
- package/dist/safety/classifier.js.map +1 -1
- package/dist/safety/engagement-policy.d.ts +0 -13
- package/dist/safety/engagement-policy.js +0 -32
- package/dist/safety/engagement-policy.js.map +1 -1
- package/dist/safety/patterns.d.ts +0 -108
- package/dist/safety/patterns.js +0 -159
- package/dist/safety/patterns.js.map +1 -1
- package/dist/safety/shell-classification.d.ts +19 -0
- package/dist/safety/shell-classification.js +215 -0
- package/dist/safety/shell-classification.js.map +1 -0
- package/dist/safety/tool-classification.d.ts +4 -0
- package/dist/safety/tool-classification.js +260 -0
- package/dist/safety/tool-classification.js.map +1 -0
- package/dist/store/config/endpoints.d.ts +85 -0
- package/dist/store/config/endpoints.js +298 -0
- package/dist/store/config/endpoints.js.map +1 -0
- package/dist/store/config/settings.d.ts +11 -0
- package/dist/store/config/settings.js +52 -0
- package/dist/store/config/settings.js.map +1 -0
- package/dist/store/config.d.ts +6 -169
- package/dist/store/config.js +4 -411
- package/dist/store/config.js.map +1 -1
- package/dist/store/engagement.d.ts +0 -1
- package/dist/store/engagement.js +0 -3
- package/dist/store/engagement.js.map +1 -1
- package/dist/store/history/jsonl-backend.d.ts +7 -0
- package/dist/store/history/jsonl-backend.js +151 -0
- package/dist/store/history/jsonl-backend.js.map +1 -0
- package/dist/store/history/jsonl-lock.d.ts +2 -0
- package/dist/store/history/jsonl-lock.js +100 -0
- package/dist/store/history/jsonl-lock.js.map +1 -0
- package/dist/store/history/lifecycle.d.ts +14 -0
- package/dist/store/history/lifecycle.js +316 -0
- package/dist/store/history/lifecycle.js.map +1 -0
- package/dist/store/history/recovery.d.ts +62 -0
- package/dist/store/history/recovery.js +253 -0
- package/dist/store/history/recovery.js.map +1 -0
- package/dist/store/history/session-queries.d.ts +9 -0
- package/dist/store/history/session-queries.js +142 -0
- package/dist/store/history/session-queries.js.map +1 -0
- package/dist/store/history/sqlite-backend.d.ts +25 -0
- package/dist/store/history/sqlite-backend.js +209 -0
- package/dist/store/history/sqlite-backend.js.map +1 -0
- package/dist/store/history-index.d.ts +0 -5
- package/dist/store/history-index.js +0 -10
- package/dist/store/history-index.js.map +1 -1
- package/dist/store/history.d.ts +12 -97
- package/dist/store/history.js +12 -1214
- package/dist/store/history.js.map +1 -1
- package/dist/store/keys/search-providers.d.ts +33 -0
- package/dist/store/keys/search-providers.js +211 -0
- package/dist/store/keys/search-providers.js.map +1 -0
- package/dist/store/keys/secret-store.d.ts +40 -0
- package/dist/store/keys/secret-store.js +249 -0
- package/dist/store/keys/secret-store.js.map +1 -0
- package/dist/store/keys.d.ts +8 -95
- package/dist/store/keys.js +7 -537
- package/dist/store/keys.js.map +1 -1
- package/dist/store/logs.d.ts +0 -1
- package/dist/store/logs.js +1 -7
- package/dist/store/logs.js.map +1 -1
- package/dist/store/paths.d.ts +0 -12
- package/dist/store/paths.js +0 -12
- package/dist/store/paths.js.map +1 -1
- package/dist/store/plan/jsonl-backend.d.ts +7 -0
- package/dist/store/plan/jsonl-backend.js +115 -0
- package/dist/store/plan/jsonl-backend.js.map +1 -0
- package/dist/store/plan/mutation.d.ts +25 -0
- package/dist/store/plan/mutation.js +270 -0
- package/dist/store/plan/mutation.js.map +1 -0
- package/dist/store/plan/sqlite-backend.d.ts +66 -0
- package/dist/store/plan/sqlite-backend.js +66 -0
- package/dist/store/plan/sqlite-backend.js.map +1 -0
- package/dist/store/plan/task-normalization.d.ts +8 -0
- package/dist/store/plan/task-normalization.js +165 -0
- package/dist/store/plan/task-normalization.js.map +1 -0
- package/dist/store/plan.d.ts +9 -176
- package/dist/store/plan.js +11 -742
- package/dist/store/plan.js.map +1 -1
- package/dist/store/project.js +0 -5
- package/dist/store/project.js.map +1 -1
- package/dist/store/responder-settlement.d.ts +0 -1
- package/dist/store/responder-settlement.js +0 -3
- package/dist/store/responder-settlement.js.map +1 -1
- package/dist/store/scope.d.ts +0 -16
- package/dist/store/scope.js +0 -22
- package/dist/store/scope.js.map +1 -1
- package/dist/store/session-workspace.d.ts +0 -51
- package/dist/store/session-workspace.js +0 -57
- package/dist/store/session-workspace.js.map +1 -1
- package/dist/store/task-transitions.d.ts +0 -7
- package/dist/store/task-transitions.js +0 -6
- package/dist/store/task-transitions.js.map +1 -1
- package/dist/tools/batch/batch-parsing.d.ts +11 -0
- package/dist/tools/batch/batch-parsing.js +78 -0
- package/dist/tools/batch/batch-parsing.js.map +1 -0
- package/dist/tools/batch/limits.d.ts +6 -0
- package/dist/tools/batch/limits.js +17 -0
- package/dist/tools/batch/limits.js.map +1 -0
- package/dist/tools/batch/run-batch.d.ts +3 -0
- package/dist/tools/batch/run-batch.js +402 -0
- package/dist/tools/batch/run-batch.js.map +1 -0
- package/dist/tools/batch-fail-policy.d.ts +0 -29
- package/dist/tools/batch-fail-policy.js +0 -31
- package/dist/tools/batch-fail-policy.js.map +1 -1
- package/dist/tools/call-normalization.d.ts +2 -0
- package/dist/tools/call-normalization.js +165 -0
- package/dist/tools/call-normalization.js.map +1 -0
- package/dist/tools/capabilities.d.ts +0 -1
- package/dist/tools/capabilities.js +0 -28
- package/dist/tools/capabilities.js.map +1 -1
- package/dist/tools/command-intent.d.ts +0 -19
- package/dist/tools/command-intent.js +0 -65
- package/dist/tools/command-intent.js.map +1 -1
- package/dist/tools/definitions/aggregate.d.ts +2 -0
- package/dist/tools/definitions/aggregate.js +263 -0
- package/dist/tools/definitions/aggregate.js.map +1 -0
- package/dist/tools/definitions/context-1.d.ts +2 -0
- package/dist/tools/definitions/context-1.js +8 -0
- package/dist/tools/definitions/context-1.js.map +1 -0
- package/dist/tools/definitions/context-2.d.ts +2 -0
- package/dist/tools/definitions/context-2.js +90 -0
- package/dist/tools/definitions/context-2.js.map +1 -0
- package/dist/tools/definitions/define.d.ts +7 -0
- package/dist/tools/definitions/define.js +53 -0
- package/dist/tools/definitions/define.js.map +1 -0
- package/dist/tools/definitions/files.d.ts +2 -0
- package/dist/tools/definitions/files.js +193 -0
- package/dist/tools/definitions/files.js.map +1 -0
- package/dist/tools/definitions/network-1.d.ts +2 -0
- package/dist/tools/definitions/network-1.js +72 -0
- package/dist/tools/definitions/network-1.js.map +1 -0
- package/dist/tools/definitions/network-2.d.ts +2 -0
- package/dist/tools/definitions/network-2.js +22 -0
- package/dist/tools/definitions/network-2.js.map +1 -0
- package/dist/tools/definitions/orchestration.d.ts +2 -0
- package/dist/tools/definitions/orchestration.js +122 -0
- package/dist/tools/definitions/orchestration.js.map +1 -0
- package/dist/tools/definitions/pentest.d.ts +2 -0
- package/dist/tools/definitions/pentest.js +91 -0
- package/dist/tools/definitions/pentest.js.map +1 -0
- package/dist/tools/definitions/selection.d.ts +9 -0
- package/dist/tools/definitions/selection.js +84 -0
- package/dist/tools/definitions/selection.js.map +1 -0
- package/dist/tools/definitions/shell.d.ts +2 -0
- package/dist/tools/definitions/shell.js +83 -0
- package/dist/tools/definitions/shell.js.map +1 -0
- package/dist/tools/definitions/terminal.d.ts +2 -0
- package/dist/tools/definitions/terminal.js +91 -0
- package/dist/tools/definitions/terminal.js.map +1 -0
- package/dist/tools/definitions/web-1.d.ts +2 -0
- package/dist/tools/definitions/web-1.js +68 -0
- package/dist/tools/definitions/web-1.js.map +1 -0
- package/dist/tools/definitions/web-2.d.ts +2 -0
- package/dist/tools/definitions/web-2.js +59 -0
- package/dist/tools/definitions/web-2.js.map +1 -0
- package/dist/tools/definitions.d.ts +3 -16
- package/dist/tools/definitions.js +8 -1238
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/diff/line-ops.d.ts +34 -0
- package/dist/tools/diff/line-ops.js +218 -0
- package/dist/tools/diff/line-ops.js.map +1 -0
- package/dist/tools/dns-native.d.ts +0 -5
- package/dist/tools/dns-native.js +0 -16
- package/dist/tools/dns-native.js.map +1 -1
- package/dist/tools/external-tools.d.ts +0 -8
- package/dist/tools/external-tools.js.map +1 -1
- package/dist/tools/file-diff.d.ts +3 -78
- package/dist/tools/file-diff.js +2 -271
- package/dist/tools/file-diff.js.map +1 -1
- package/dist/tools/fs/internals-2.d.ts +1 -0
- package/dist/tools/fs/internals-2.js +6 -0
- package/dist/tools/fs/internals-2.js.map +1 -0
- package/dist/tools/fs/internals.d.ts +4 -0
- package/dist/tools/fs/internals.js +23 -0
- package/dist/tools/fs/internals.js.map +1 -0
- package/dist/tools/fs/mutations.d.ts +17 -0
- package/dist/tools/fs/mutations.js +396 -0
- package/dist/tools/fs/mutations.js.map +1 -0
- package/dist/tools/fs/read-window.d.ts +14 -0
- package/dist/tools/fs/read-window.js +288 -0
- package/dist/tools/fs/read-window.js.map +1 -0
- package/dist/tools/fs/read.d.ts +7 -0
- package/dist/tools/fs/read.js +164 -0
- package/dist/tools/fs/read.js.map +1 -0
- package/dist/tools/fs/search.d.ts +13 -0
- package/dist/tools/fs/search.js +125 -0
- package/dist/tools/fs/search.js.map +1 -0
- package/dist/tools/fs.d.ts +4 -79
- package/dist/tools/fs.js +26 -1115
- package/dist/tools/fs.js.map +1 -1
- package/dist/tools/handlers/args.d.ts +8 -0
- package/dist/tools/handlers/args.js +50 -0
- package/dist/tools/handlers/args.js.map +1 -0
- package/dist/tools/handlers/context-1.d.ts +2 -0
- package/dist/tools/handlers/context-1.js +7 -0
- package/dist/tools/handlers/context-1.js.map +1 -0
- package/dist/tools/handlers/context-2.d.ts +2 -0
- package/dist/tools/handlers/context-2.js +14 -0
- package/dist/tools/handlers/context-2.js.map +1 -0
- package/dist/tools/handlers/files-1.d.ts +2 -0
- package/dist/tools/handlers/files-1.js +51 -0
- package/dist/tools/handlers/files-1.js.map +1 -0
- package/dist/tools/handlers/files-2.d.ts +2 -0
- package/dist/tools/handlers/files-2.js +31 -0
- package/dist/tools/handlers/files-2.js.map +1 -0
- package/dist/tools/handlers/network-1.d.ts +2 -0
- package/dist/tools/handlers/network-1.js +52 -0
- package/dist/tools/handlers/network-1.js.map +1 -0
- package/dist/tools/handlers/network-2.d.ts +2 -0
- package/dist/tools/handlers/network-2.js +32 -0
- package/dist/tools/handlers/network-2.js.map +1 -0
- package/dist/tools/handlers/network-3.d.ts +2 -0
- package/dist/tools/handlers/network-3.js +17 -0
- package/dist/tools/handlers/network-3.js.map +1 -0
- package/dist/tools/handlers/nmap-preparation.d.ts +13 -0
- package/dist/tools/handlers/nmap-preparation.js +66 -0
- package/dist/tools/handlers/nmap-preparation.js.map +1 -0
- package/dist/tools/handlers/orchestration-1.d.ts +2 -0
- package/dist/tools/handlers/orchestration-1.js +7 -0
- package/dist/tools/handlers/orchestration-1.js.map +1 -0
- package/dist/tools/handlers/orchestration-2.d.ts +2 -0
- package/dist/tools/handlers/orchestration-2.js +16 -0
- package/dist/tools/handlers/orchestration-2.js.map +1 -0
- package/dist/tools/handlers/pentest.d.ts +2 -0
- package/dist/tools/handlers/pentest.js +208 -0
- package/dist/tools/handlers/pentest.js.map +1 -0
- package/dist/tools/handlers/responder-job-options.d.ts +3 -0
- package/dist/tools/handlers/responder-job-options.js +16 -0
- package/dist/tools/handlers/responder-job-options.js.map +1 -0
- package/dist/tools/handlers/shell-1.d.ts +2 -0
- package/dist/tools/handlers/shell-1.js +94 -0
- package/dist/tools/handlers/shell-1.js.map +1 -0
- package/dist/tools/handlers/shell-2.d.ts +2 -0
- package/dist/tools/handlers/shell-2.js +49 -0
- package/dist/tools/handlers/shell-2.js.map +1 -0
- package/dist/tools/handlers/shell-3.d.ts +2 -0
- package/dist/tools/handlers/shell-3.js +47 -0
- package/dist/tools/handlers/shell-3.js.map +1 -0
- package/dist/tools/handlers/web.d.ts +2 -0
- package/dist/tools/handlers/web.js +168 -0
- package/dist/tools/handlers/web.js.map +1 -0
- package/dist/tools/http/agents.d.ts +10 -0
- package/dist/tools/http/agents.js +63 -0
- package/dist/tools/http/agents.js.map +1 -0
- package/dist/tools/http/evidence-format.d.ts +37 -0
- package/dist/tools/http/evidence-format.js +181 -0
- package/dist/tools/http/evidence-format.js.map +1 -0
- package/dist/tools/http/fetch.d.ts +31 -0
- package/dist/tools/http/fetch.js +480 -0
- package/dist/tools/http/fetch.js.map +1 -0
- package/dist/tools/http/retry-policy.d.ts +14 -0
- package/dist/tools/http/retry-policy.js +144 -0
- package/dist/tools/http/retry-policy.js.map +1 -0
- package/dist/tools/http.d.ts +1 -45
- package/dist/tools/http.js +1 -920
- package/dist/tools/http.js.map +1 -1
- package/dist/tools/image.d.ts +0 -15
- package/dist/tools/image.js +0 -21
- package/dist/tools/image.js.map +1 -1
- package/dist/tools/interactive-session-tools.d.ts +0 -7
- package/dist/tools/interactive-session-tools.js +0 -13
- package/dist/tools/interactive-session-tools.js.map +1 -1
- package/dist/tools/jobs/helpers.d.ts +6 -0
- package/dist/tools/jobs/helpers.js +63 -0
- package/dist/tools/jobs/helpers.js.map +1 -0
- package/dist/tools/jobs/limits.d.ts +20 -0
- package/dist/tools/jobs/limits.js +21 -0
- package/dist/tools/jobs/limits.js.map +1 -0
- package/dist/tools/jobs/polling-policy.d.ts +11 -0
- package/dist/tools/jobs/polling-policy.js +33 -0
- package/dist/tools/jobs/polling-policy.js.map +1 -0
- package/dist/tools/jobs/process-identity.d.ts +5 -0
- package/dist/tools/jobs/process-identity.js +80 -0
- package/dist/tools/jobs/process-identity.js.map +1 -0
- package/dist/tools/jobs/redacted-writer.d.ts +25 -0
- package/dist/tools/jobs/redacted-writer.js +134 -0
- package/dist/tools/jobs/redacted-writer.js.map +1 -0
- package/dist/tools/jobs/types.d.ts +152 -0
- package/dist/tools/jobs/types.js +2 -0
- package/dist/tools/jobs/types.js.map +1 -0
- package/dist/tools/jobs.d.ts +8 -210
- package/dist/tools/jobs.js +13 -453
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/net-ping-sweep.d.ts +0 -8
- package/dist/tools/net-ping-sweep.js +0 -22
- package/dist/tools/net-ping-sweep.js.map +1 -1
- package/dist/tools/network-context.d.ts +0 -4
- package/dist/tools/network-context.js +0 -8
- package/dist/tools/network-context.js.map +1 -1
- package/dist/tools/nmap-runner.d.ts +0 -21
- package/dist/tools/nmap-runner.js +0 -43
- package/dist/tools/nmap-runner.js.map +1 -1
- package/dist/tools/output-selection.d.ts +0 -1
- package/dist/tools/output-selection.js +0 -3
- package/dist/tools/output-selection.js.map +1 -1
- package/dist/tools/package-binary.js +0 -7
- package/dist/tools/package-binary.js.map +1 -1
- package/dist/tools/pdf/read.d.ts +6 -0
- package/dist/tools/pdf/read.js +529 -0
- package/dist/tools/pdf/read.js.map +1 -0
- package/dist/tools/pdf.d.ts +2 -6
- package/dist/tools/pdf.js +1 -528
- package/dist/tools/pdf.js.map +1 -1
- package/dist/tools/pentest-workflows.js +0 -12
- package/dist/tools/pentest-workflows.js.map +1 -1
- package/dist/tools/policies/output-policy.d.ts +0 -17
- package/dist/tools/policies/output-policy.js +0 -18
- package/dist/tools/policies/output-policy.js.map +1 -1
- package/dist/tools/reducers/ffuf.d.ts +0 -5
- package/dist/tools/reducers/ffuf.js +0 -8
- package/dist/tools/reducers/ffuf.js.map +1 -1
- package/dist/tools/reducers/gobuster.js +0 -1
- package/dist/tools/reducers/gobuster.js.map +1 -1
- package/dist/tools/reducers/httpx.js +0 -1
- package/dist/tools/reducers/httpx.js.map +1 -1
- package/dist/tools/reducers/nmap.d.ts +0 -5
- package/dist/tools/reducers/nmap.js +0 -5
- package/dist/tools/reducers/nmap.js.map +1 -1
- package/dist/tools/reducers/nuclei.js +0 -1
- package/dist/tools/reducers/nuclei.js.map +1 -1
- package/dist/tools/reducers/subdomains.d.ts +0 -4
- package/dist/tools/reducers/subdomains.js +0 -4
- package/dist/tools/reducers/subdomains.js.map +1 -1
- package/dist/tools/reducers/types.d.ts +0 -5
- package/dist/tools/registry.d.ts +4 -20
- package/dist/tools/registry.js +36 -1634
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/shell/artifact-name.d.ts +1 -0
- package/dist/tools/shell/artifact-name.js +6 -0
- package/dist/tools/shell/artifact-name.js.map +1 -0
- package/dist/tools/shell/capture.d.ts +31 -0
- package/dist/tools/shell/capture.js +135 -0
- package/dist/tools/shell/capture.js.map +1 -0
- package/dist/tools/shell/exec-attempt.d.ts +10 -0
- package/dist/tools/shell/exec-attempt.js +288 -0
- package/dist/tools/shell/exec-attempt.js.map +1 -0
- package/dist/tools/shell/internals-2.d.ts +16 -0
- package/dist/tools/shell/internals-2.js +48 -0
- package/dist/tools/shell/internals-2.js.map +1 -0
- package/dist/tools/shell/internals.d.ts +10 -0
- package/dist/tools/shell/internals.js +51 -0
- package/dist/tools/shell/internals.js.map +1 -0
- package/dist/tools/shell/spawn-argv.d.ts +17 -0
- package/dist/tools/shell/spawn-argv.js +248 -0
- package/dist/tools/shell/spawn-argv.js.map +1 -0
- package/dist/tools/shell-quoting.d.ts +1 -0
- package/dist/tools/shell-quoting.js +7 -0
- package/dist/tools/shell-quoting.js.map +1 -0
- package/dist/tools/shell.d.ts +4 -82
- package/dist/tools/shell.js +7 -845
- package/dist/tools/shell.js.map +1 -1
- package/dist/tools/sudo-session.d.ts +0 -41
- package/dist/tools/sudo-session.js +0 -44
- package/dist/tools/sudo-session.js.map +1 -1
- package/dist/tools/tool-types.d.ts +0 -7
- package/dist/tools/validate.d.ts +0 -35
- package/dist/tools/validate.js +2 -67
- package/dist/tools/validate.js.map +1 -1
- package/dist/tools/web/audit.d.ts +0 -74
- package/dist/tools/web/audit.js +0 -39
- package/dist/tools/web/audit.js.map +1 -1
- package/dist/tools/web/budget.d.ts +0 -35
- package/dist/tools/web/budget.js +0 -75
- package/dist/tools/web/budget.js.map +1 -1
- package/dist/tools/web/capture.d.ts +0 -106
- package/dist/tools/web/capture.js +0 -148
- package/dist/tools/web/capture.js.map +1 -1
- package/dist/tools/web/decode.d.ts +0 -8
- package/dist/tools/web/decode.js +0 -9
- package/dist/tools/web/decode.js.map +1 -1
- package/dist/tools/web/fetch-core.d.ts +2 -32
- package/dist/tools/web/fetch-core.js +4 -1058
- package/dist/tools/web/fetch-core.js.map +1 -1
- package/dist/tools/web/fetch.d.ts +0 -29
- package/dist/tools/web/fetch.js +0 -46
- package/dist/tools/web/fetch.js.map +1 -1
- package/dist/tools/web/issue-hop.d.ts +57 -0
- package/dist/tools/web/issue-hop.js +396 -0
- package/dist/tools/web/issue-hop.js.map +1 -0
- package/dist/tools/web/providers/brave.d.ts +0 -40
- package/dist/tools/web/providers/brave.js +1 -100
- package/dist/tools/web/providers/brave.js.map +1 -1
- package/dist/tools/web/providers/duckduckgo.d.ts +0 -41
- package/dist/tools/web/providers/duckduckgo.js +0 -104
- package/dist/tools/web/providers/duckduckgo.js.map +1 -1
- package/dist/tools/web/providers/exa.d.ts +0 -43
- package/dist/tools/web/providers/exa.js +1 -102
- package/dist/tools/web/providers/exa.js.map +1 -1
- package/dist/tools/web/providers/provider.d.ts +0 -69
- package/dist/tools/web/providers/provider.js +0 -28
- package/dist/tools/web/providers/provider.js.map +1 -1
- package/dist/tools/web/providers/tavily.d.ts +0 -46
- package/dist/tools/web/providers/tavily.js +1 -111
- package/dist/tools/web/providers/tavily.js.map +1 -1
- package/dist/tools/web/readable.d.ts +0 -62
- package/dist/tools/web/readable.js +1 -132
- package/dist/tools/web/readable.js.map +1 -1
- package/dist/tools/web/redact.d.ts +0 -26
- package/dist/tools/web/redact.js +0 -2
- package/dist/tools/web/redact.js.map +1 -1
- package/dist/tools/web/request-loop.d.ts +38 -0
- package/dist/tools/web/request-loop.js +172 -0
- package/dist/tools/web/request-loop.js.map +1 -0
- package/dist/tools/web/response-body.d.ts +41 -0
- package/dist/tools/web/response-body.js +174 -0
- package/dist/tools/web/response-body.js.map +1 -0
- package/dist/tools/web/search-attempts.d.ts +20 -0
- package/dist/tools/web/search-attempts.js +303 -0
- package/dist/tools/web/search-attempts.js.map +1 -0
- package/dist/tools/web/search.d.ts +0 -33
- package/dist/tools/web/search.js +3 -396
- package/dist/tools/web/search.js.map +1 -1
- package/dist/tools/web/ssrf-guard.d.ts +0 -42
- package/dist/tools/web/ssrf-guard.js +0 -57
- package/dist/tools/web/ssrf-guard.js.map +1 -1
- package/dist/tools/web/types.d.ts +0 -197
- package/dist/tools/web/types.js +0 -41
- package/dist/tools/web/types.js.map +1 -1
- package/dist/tools/web/validate-args.d.ts +11 -0
- package/dist/tools/web/validate-args.js +107 -0
- package/dist/tools/web/validate-args.js.map +1 -0
- package/dist/tools/whois-native.d.ts +0 -4
- package/dist/tools/whois-native.js +0 -6
- package/dist/tools/whois-native.js.map +1 -1
- package/dist/tools/wordlists.js +0 -32
- package/dist/tools/wordlists.js.map +1 -1
- package/dist/tui-v2/app/App.d.ts +0 -10
- package/dist/tui-v2/app/App.js +67 -112
- package/dist/tui-v2/app/App.js.map +1 -1
- package/dist/tui-v2/bootstrap/pager-export.d.ts +0 -8
- package/dist/tui-v2/bootstrap/pager-export.js +0 -11
- package/dist/tui-v2/bootstrap/pager-export.js.map +1 -1
- package/dist/tui-v2/bootstrap/patch-opentui-text.d.ts +0 -5
- package/dist/tui-v2/bootstrap/patch-opentui-text.js +0 -5
- package/dist/tui-v2/bootstrap/patch-opentui-text.js.map +1 -1
- package/dist/tui-v2/bootstrap/resize-repaint.d.ts +16 -20
- package/dist/tui-v2/bootstrap/resize-repaint.js +31 -16
- package/dist/tui-v2/bootstrap/resize-repaint.js.map +1 -1
- package/dist/tui-v2/bootstrap/start-tui-v2.d.ts +0 -7
- package/dist/tui-v2/bootstrap/start-tui-v2.js +10 -27
- package/dist/tui-v2/bootstrap/start-tui-v2.js.map +1 -1
- package/dist/tui-v2/components/completion/completion-menu.d.ts +0 -4
- package/dist/tui-v2/components/completion/completion-menu.js +2 -6
- package/dist/tui-v2/components/completion/completion-menu.js.map +1 -1
- package/dist/tui-v2/components/composer/composer-input-box.d.ts +0 -4
- package/dist/tui-v2/components/composer/composer-input-box.js +1 -10
- package/dist/tui-v2/components/composer/composer-input-box.js.map +1 -1
- package/dist/tui-v2/components/composer/paste-chip.d.ts +0 -7
- package/dist/tui-v2/components/composer/paste-chip.js +0 -7
- package/dist/tui-v2/components/composer/paste-chip.js.map +1 -1
- package/dist/tui-v2/components/jobs/jobs-panel.d.ts +0 -12
- package/dist/tui-v2/components/jobs/jobs-panel.js +0 -34
- package/dist/tui-v2/components/jobs/jobs-panel.js.map +1 -1
- package/dist/tui-v2/components/modal/confirm-modal.d.ts +0 -8
- package/dist/tui-v2/components/modal/confirm-modal.js +0 -4
- package/dist/tui-v2/components/modal/confirm-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/keys-modal.d.ts +0 -11
- package/dist/tui-v2/components/modal/keys-modal.js +0 -24
- package/dist/tui-v2/components/modal/keys-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/prompt-actions-modal.d.ts +0 -6
- package/dist/tui-v2/components/modal/prompt-actions-modal.js +4 -13
- package/dist/tui-v2/components/modal/prompt-actions-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/scope-modal.d.ts +0 -5
- package/dist/tui-v2/components/modal/scope-modal.js +0 -12
- package/dist/tui-v2/components/modal/scope-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/secret-modal.d.ts +0 -8
- package/dist/tui-v2/components/modal/secret-modal.js +0 -17
- package/dist/tui-v2/components/modal/secret-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/text-editor-modal.d.ts +0 -6
- package/dist/tui-v2/components/modal/text-editor-modal.js +0 -6
- package/dist/tui-v2/components/modal/text-editor-modal.js.map +1 -1
- package/dist/tui-v2/components/overlay/overlay-host.d.ts +0 -14
- package/dist/tui-v2/components/overlay/overlay-host.js +0 -2
- package/dist/tui-v2/components/overlay/overlay-host.js.map +1 -1
- package/dist/tui-v2/components/pager/pager-line.d.ts +0 -5
- package/dist/tui-v2/components/pager/pager-line.js +0 -10
- package/dist/tui-v2/components/pager/pager-line.js.map +1 -1
- package/dist/tui-v2/components/pager/pager.d.ts +0 -14
- package/dist/tui-v2/components/pager/pager.js +3 -58
- package/dist/tui-v2/components/pager/pager.js.map +1 -1
- package/dist/tui-v2/components/picker/picker.d.ts +0 -6
- package/dist/tui-v2/components/picker/picker.js +3 -12
- package/dist/tui-v2/components/picker/picker.js.map +1 -1
- package/dist/tui-v2/components/plan/plan-pane-anim.d.ts +0 -25
- package/dist/tui-v2/components/plan/plan-pane-anim.js +0 -23
- package/dist/tui-v2/components/plan/plan-pane-anim.js.map +1 -1
- package/dist/tui-v2/components/plan/plan-view.d.ts +0 -7
- package/dist/tui-v2/components/plan/plan-view.js +0 -20
- package/dist/tui-v2/components/plan/plan-view.js.map +1 -1
- package/dist/tui-v2/components/plan/use-pane-presence.d.ts +0 -9
- package/dist/tui-v2/components/plan/use-pane-presence.js +0 -9
- package/dist/tui-v2/components/plan/use-pane-presence.js.map +1 -1
- package/dist/tui-v2/components/queue/queue-panel.d.ts +0 -12
- package/dist/tui-v2/components/queue/queue-panel.js +2 -4
- package/dist/tui-v2/components/queue/queue-panel.js.map +1 -1
- package/dist/tui-v2/components/status/status-line.d.ts +0 -17
- package/dist/tui-v2/components/status/status-line.js +0 -10
- package/dist/tui-v2/components/status/status-line.js.map +1 -1
- package/dist/tui-v2/components/toast/toast-anim.d.ts +0 -20
- package/dist/tui-v2/components/toast/toast-anim.js +0 -15
- package/dist/tui-v2/components/toast/toast-anim.js.map +1 -1
- package/dist/tui-v2/components/toast/toast-host.d.ts +0 -12
- package/dist/tui-v2/components/toast/toast-host.js +1 -29
- package/dist/tui-v2/components/toast/toast-host.js.map +1 -1
- package/dist/tui-v2/components/transcript/assistant-message.d.ts +0 -11
- package/dist/tui-v2/components/transcript/assistant-message.js +3 -24
- package/dist/tui-v2/components/transcript/assistant-message.js.map +1 -1
- package/dist/tui-v2/components/transcript/compacted-row.d.ts +0 -6
- package/dist/tui-v2/components/transcript/compacted-row.js +2 -6
- package/dist/tui-v2/components/transcript/compacted-row.js.map +1 -1
- package/dist/tui-v2/components/transcript/file-diff-card.d.ts +0 -9
- package/dist/tui-v2/components/transcript/file-diff-card.js +0 -16
- package/dist/tui-v2/components/transcript/file-diff-card.js.map +1 -1
- package/dist/tui-v2/components/transcript/intro-card.d.ts +0 -9
- package/dist/tui-v2/components/transcript/intro-card.js +2 -13
- package/dist/tui-v2/components/transcript/intro-card.js.map +1 -1
- package/dist/tui-v2/components/transcript/linkable-text.d.ts +0 -16
- package/dist/tui-v2/components/transcript/linkable-text.js +0 -11
- package/dist/tui-v2/components/transcript/linkable-text.js.map +1 -1
- package/dist/tui-v2/components/transcript/notice-row.d.ts +0 -7
- package/dist/tui-v2/components/transcript/notice-row.js +2 -18
- package/dist/tui-v2/components/transcript/notice-row.js.map +1 -1
- package/dist/tui-v2/components/transcript/search-bar.d.ts +0 -10
- package/dist/tui-v2/components/transcript/search-bar.js +0 -3
- package/dist/tui-v2/components/transcript/search-bar.js.map +1 -1
- package/dist/tui-v2/components/transcript/selectable-line.d.ts +0 -16
- package/dist/tui-v2/components/transcript/selectable-line.js +0 -9
- package/dist/tui-v2/components/transcript/selectable-line.js.map +1 -1
- package/dist/tui-v2/components/transcript/thinking-block.d.ts +0 -18
- package/dist/tui-v2/components/transcript/thinking-block.js +2 -40
- package/dist/tui-v2/components/transcript/thinking-block.js.map +1 -1
- package/dist/tui-v2/components/transcript/tool-card.d.ts +0 -19
- package/dist/tui-v2/components/transcript/tool-card.js +2 -42
- package/dist/tui-v2/components/transcript/tool-card.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-row.d.ts +0 -14
- package/dist/tui-v2/components/transcript/transcript-row.js +0 -13
- package/dist/tui-v2/components/transcript/transcript-row.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-scroll-port.d.ts +0 -32
- package/dist/tui-v2/components/transcript/transcript-scroll-port.js +0 -22
- package/dist/tui-v2/components/transcript/transcript-scroll-port.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-view.d.ts +0 -9
- package/dist/tui-v2/components/transcript/transcript-view.js +4 -67
- package/dist/tui-v2/components/transcript/transcript-view.js.map +1 -1
- package/dist/tui-v2/components/transcript/use-click-without-drag.d.ts +0 -7
- package/dist/tui-v2/components/transcript/use-click-without-drag.js +1 -11
- package/dist/tui-v2/components/transcript/use-click-without-drag.js.map +1 -1
- package/dist/tui-v2/components/transcript/use-native-selection-copy.d.ts +0 -7
- package/dist/tui-v2/components/transcript/use-native-selection-copy.js +0 -9
- package/dist/tui-v2/components/transcript/use-native-selection-copy.js.map +1 -1
- package/dist/tui-v2/components/transcript/use-transcript-selection.d.ts +0 -1
- package/dist/tui-v2/components/transcript/use-transcript-selection.js +0 -14
- package/dist/tui-v2/components/transcript/use-transcript-selection.js.map +1 -1
- package/dist/tui-v2/components/transcript/user-message.d.ts +0 -2
- package/dist/tui-v2/components/transcript/user-message.js +2 -7
- package/dist/tui-v2/components/transcript/user-message.js.map +1 -1
- package/dist/tui-v2/composer/composer-editor.d.ts +0 -20
- package/dist/tui-v2/composer/composer-editor.js +0 -61
- package/dist/tui-v2/composer/composer-editor.js.map +1 -1
- package/dist/tui-v2/composer/composer-wheel.d.ts +0 -17
- package/dist/tui-v2/composer/composer-wheel.js +0 -17
- package/dist/tui-v2/composer/composer-wheel.js.map +1 -1
- package/dist/tui-v2/composer/disable-native-textarea-scroll.d.ts +0 -12
- package/dist/tui-v2/composer/disable-native-textarea-scroll.js +0 -13
- package/dist/tui-v2/composer/disable-native-textarea-scroll.js.map +1 -1
- package/dist/tui-v2/composer/textarea-keybindings.d.ts +0 -19
- package/dist/tui-v2/composer/textarea-keybindings.js +0 -34
- package/dist/tui-v2/composer/textarea-keybindings.js.map +1 -1
- package/dist/tui-v2/composer/use-draft-actions.d.ts +0 -10
- package/dist/tui-v2/composer/use-draft-actions.js +0 -5
- package/dist/tui-v2/composer/use-draft-actions.js.map +1 -1
- package/dist/tui-v2/hooks/terminal-dimensions.d.ts +6 -0
- package/dist/tui-v2/hooks/terminal-dimensions.js +14 -0
- package/dist/tui-v2/hooks/terminal-dimensions.js.map +1 -0
- package/dist/tui-v2/input/chord-from-opentui-key.d.ts +0 -17
- package/dist/tui-v2/input/chord-from-opentui-key.js +0 -17
- package/dist/tui-v2/input/chord-from-opentui-key.js.map +1 -1
- package/dist/tui-v2/rendering/ansi-to-styled.d.ts +0 -12
- package/dist/tui-v2/rendering/ansi-to-styled.js +0 -10
- package/dist/tui-v2/rendering/ansi-to-styled.js.map +1 -1
- package/dist/tui-v2/rendering/pager-markdown.d.ts +0 -18
- package/dist/tui-v2/rendering/pager-markdown.js +0 -14
- package/dist/tui-v2/rendering/pager-markdown.js.map +1 -1
- package/dist/types.d.ts +2 -135
- package/dist/types.js +0 -3
- package/dist/types.js.map +1 -1
- package/dist/ui/mentions/expand.d.ts +26 -0
- package/dist/ui/mentions/expand.js +308 -0
- package/dist/ui/mentions/expand.js.map +1 -0
- package/dist/ui/mentions/file-suggestions.d.ts +7 -0
- package/dist/ui/mentions/file-suggestions.js +106 -0
- package/dist/ui/mentions/file-suggestions.js.map +1 -0
- package/dist/ui/mentions.d.ts +6 -70
- package/dist/ui/mentions.js +8 -482
- package/dist/ui/mentions.js.map +1 -1
- package/dist/ui/plan-pane.d.ts +0 -15
- package/dist/ui/plan-pane.js +1 -16
- package/dist/ui/plan-pane.js.map +1 -1
- package/dist/ui/thinking.d.ts +0 -8
- package/dist/ui/thinking.js +0 -13
- package/dist/ui/thinking.js.map +1 -1
- package/dist/ui-core/actions/action-id.d.ts +0 -8
- package/dist/ui-core/actions/action-id.js +0 -25
- package/dist/ui-core/actions/action-id.js.map +1 -1
- package/dist/ui-core/actions/action-router.d.ts +0 -10
- package/dist/ui-core/actions/action-router.js +0 -16
- package/dist/ui-core/actions/action-router.js.map +1 -1
- package/dist/ui-core/actions/cancel-timing.d.ts +0 -3
- package/dist/ui-core/actions/cancel-timing.js +0 -3
- package/dist/ui-core/actions/cancel-timing.js.map +1 -1
- package/dist/ui-core/actions/format-shortcuts.d.ts +0 -9
- package/dist/ui-core/actions/format-shortcuts.js +0 -9
- package/dist/ui-core/actions/format-shortcuts.js.map +1 -1
- package/dist/ui-core/actions/keymap.d.ts +0 -9
- package/dist/ui-core/actions/keymap.js +0 -39
- package/dist/ui-core/actions/keymap.js.map +1 -1
- package/dist/ui-core/actions/mode-cycle.d.ts +0 -2
- package/dist/ui-core/actions/mode-cycle.js +0 -4
- package/dist/ui-core/actions/mode-cycle.js.map +1 -1
- package/dist/ui-core/bootstrap/can-use-tui.d.ts +0 -6
- package/dist/ui-core/bootstrap/can-use-tui.js +0 -9
- package/dist/ui-core/bootstrap/can-use-tui.js.map +1 -1
- package/dist/ui-core/bootstrap/capabilities.d.ts +0 -8
- package/dist/ui-core/bootstrap/capabilities.js +1 -8
- package/dist/ui-core/bootstrap/capabilities.js.map +1 -1
- package/dist/ui-core/bootstrap/composition-root.d.ts +0 -17
- package/dist/ui-core/bootstrap/composition-root.js +30 -19
- package/dist/ui-core/bootstrap/composition-root.js.map +1 -1
- package/dist/ui-core/bootstrap/console-guard.d.ts +0 -15
- package/dist/ui-core/bootstrap/console-guard.js +32 -0
- package/dist/ui-core/bootstrap/console-guard.js.map +1 -1
- package/dist/ui-core/bootstrap/console-suppress.js +2 -7
- package/dist/ui-core/bootstrap/console-suppress.js.map +1 -1
- package/dist/ui-core/bootstrap/exit-epilogue.d.ts +0 -6
- package/dist/ui-core/bootstrap/exit-epilogue.js +0 -5
- package/dist/ui-core/bootstrap/exit-epilogue.js.map +1 -1
- package/dist/ui-core/bootstrap/lifecycle.d.ts +0 -42
- package/dist/ui-core/bootstrap/lifecycle.js +0 -31
- package/dist/ui-core/bootstrap/lifecycle.js.map +1 -1
- package/dist/ui-core/bootstrap/overlay-ports.d.ts +0 -11
- package/dist/ui-core/bootstrap/overlay-ports.js +0 -13
- package/dist/ui-core/bootstrap/overlay-ports.js.map +1 -1
- package/dist/ui-core/bootstrap/theme-mode-cache.js +0 -5
- package/dist/ui-core/bootstrap/theme-mode-cache.js.map +1 -1
- package/dist/ui-core/commands/command-handlers.d.ts +0 -6
- package/dist/ui-core/commands/command-handlers.js +0 -6
- package/dist/ui-core/commands/command-handlers.js.map +1 -1
- package/dist/ui-core/commands/config-commands.d.ts +0 -3
- package/dist/ui-core/commands/config-commands.js +0 -7
- package/dist/ui-core/commands/config-commands.js.map +1 -1
- package/dist/ui-core/commands/key-commands.d.ts +2 -0
- package/dist/ui-core/commands/key-commands.js +79 -213
- package/dist/ui-core/commands/key-commands.js.map +1 -1
- package/dist/ui-core/commands/keys/editors.d.ts +15 -0
- package/dist/ui-core/commands/keys/editors.js +127 -0
- package/dist/ui-core/commands/keys/editors.js.map +1 -0
- package/dist/ui-core/commands/mcp-commands.js +0 -6
- package/dist/ui-core/commands/mcp-commands.js.map +1 -1
- package/dist/ui-core/commands/picker-commands.d.ts +3 -14
- package/dist/ui-core/commands/picker-commands.js +6 -694
- package/dist/ui-core/commands/picker-commands.js.map +1 -1
- package/dist/ui-core/commands/pickers/custom-provider.d.ts +3 -0
- package/dist/ui-core/commands/pickers/custom-provider.js +170 -0
- package/dist/ui-core/commands/pickers/custom-provider.js.map +1 -0
- package/dist/ui-core/commands/pickers/history.d.ts +3 -0
- package/dist/ui-core/commands/pickers/history.js +185 -0
- package/dist/ui-core/commands/pickers/history.js.map +1 -0
- package/dist/ui-core/commands/pickers/output-pager.d.ts +5 -0
- package/dist/ui-core/commands/pickers/output-pager.js +90 -0
- package/dist/ui-core/commands/pickers/output-pager.js.map +1 -0
- package/dist/ui-core/commands/pickers/search-reasoning.d.ts +4 -0
- package/dist/ui-core/commands/pickers/search-reasoning.js +184 -0
- package/dist/ui-core/commands/pickers/search-reasoning.js.map +1 -0
- package/dist/ui-core/commands/session-commands.d.ts +0 -4
- package/dist/ui-core/commands/session-commands.js +23 -17
- package/dist/ui-core/commands/session-commands.js.map +1 -1
- package/dist/ui-core/commands/startup-update.d.ts +0 -6
- package/dist/ui-core/commands/startup-update.js +0 -6
- package/dist/ui-core/commands/startup-update.js.map +1 -1
- package/dist/ui-core/composer/arrow-intent.d.ts +0 -10
- package/dist/ui-core/composer/arrow-intent.js +0 -14
- package/dist/ui-core/composer/arrow-intent.js.map +1 -1
- package/dist/ui-core/composer/completion.d.ts +0 -9
- package/dist/ui-core/composer/completion.js +1 -13
- package/dist/ui-core/composer/completion.js.map +1 -1
- package/dist/ui-core/composer/composer-action-port.d.ts +0 -10
- package/dist/ui-core/composer/composer-action-port.js +0 -10
- package/dist/ui-core/composer/composer-action-port.js.map +1 -1
- package/dist/ui-core/composer/composer-height.d.ts +0 -12
- package/dist/ui-core/composer/composer-height.js +0 -12
- package/dist/ui-core/composer/composer-height.js.map +1 -1
- package/dist/ui-core/composer/composer-wheel.d.ts +0 -17
- package/dist/ui-core/composer/composer-wheel.js +0 -17
- package/dist/ui-core/composer/composer-wheel.js.map +1 -1
- package/dist/ui-core/composer/draft-actions.d.ts +0 -14
- package/dist/ui-core/composer/draft-actions.js +0 -13
- package/dist/ui-core/composer/draft-actions.js.map +1 -1
- package/dist/ui-core/composer/history-nav.d.ts +0 -9
- package/dist/ui-core/composer/history-nav.js +0 -9
- package/dist/ui-core/composer/history-nav.js.map +1 -1
- package/dist/ui-core/composer/input-history.d.ts +0 -1
- package/dist/ui-core/composer/input-history.js +0 -1
- package/dist/ui-core/composer/input-history.js.map +1 -1
- package/dist/ui-core/composer/newline-hint.d.ts +0 -7
- package/dist/ui-core/composer/newline-hint.js +0 -9
- package/dist/ui-core/composer/newline-hint.js.map +1 -1
- package/dist/ui-core/composer/paste-placeholder.d.ts +0 -23
- package/dist/ui-core/composer/paste-placeholder.js +0 -21
- package/dist/ui-core/composer/paste-placeholder.js.map +1 -1
- package/dist/ui-core/composer/prompt-history.d.ts +0 -11
- package/dist/ui-core/composer/prompt-history.js +0 -11
- package/dist/ui-core/composer/prompt-history.js.map +1 -1
- package/dist/ui-core/composer/secret-buffer.d.ts +0 -8
- package/dist/ui-core/composer/secret-buffer.js +0 -8
- package/dist/ui-core/composer/secret-buffer.js.map +1 -1
- package/dist/ui-core/composer/textarea-keybindings.d.ts +0 -15
- package/dist/ui-core/composer/textarea-keybindings.js +0 -30
- package/dist/ui-core/composer/textarea-keybindings.js.map +1 -1
- package/dist/ui-core/controllers/focus-controller.d.ts +0 -11
- package/dist/ui-core/controllers/focus-controller.js +0 -11
- package/dist/ui-core/controllers/focus-controller.js.map +1 -1
- package/dist/ui-core/controllers/interruptible-controller.d.ts +0 -6
- package/dist/ui-core/controllers/interruptible-controller.js +0 -6
- package/dist/ui-core/controllers/interruptible-controller.js.map +1 -1
- package/dist/ui-core/controllers/overlay-controller.d.ts +1 -81
- package/dist/ui-core/controllers/overlay-controller.js +1 -48
- package/dist/ui-core/controllers/overlay-controller.js.map +1 -1
- package/dist/ui-core/controllers/selection-controller.d.ts +0 -9
- package/dist/ui-core/controllers/selection-controller.js +0 -7
- package/dist/ui-core/controllers/selection-controller.js.map +1 -1
- package/dist/ui-core/controllers/toast-controller.d.ts +0 -24
- package/dist/ui-core/controllers/toast-controller.js +0 -15
- package/dist/ui-core/controllers/toast-controller.js.map +1 -1
- package/dist/ui-core/layout/compute-layout.d.ts +0 -19
- package/dist/ui-core/layout/compute-layout.js +0 -32
- package/dist/ui-core/layout/compute-layout.js.map +1 -1
- package/dist/ui-core/motion/ease.d.ts +0 -6
- package/dist/ui-core/motion/ease.js +0 -6
- package/dist/ui-core/motion/ease.js.map +1 -1
- package/dist/ui-core/notify.d.ts +0 -8
- package/dist/ui-core/notify.js +0 -8
- package/dist/ui-core/notify.js.map +1 -1
- package/dist/ui-core/plan/plan-lifecycle.d.ts +0 -27
- package/dist/ui-core/plan/plan-lifecycle.js +0 -45
- package/dist/ui-core/plan/plan-lifecycle.js.map +1 -1
- package/dist/ui-core/ports/clipboard-osc52.d.ts +0 -8
- package/dist/ui-core/ports/clipboard-osc52.js +0 -7
- package/dist/ui-core/ports/clipboard-osc52.js.map +1 -1
- package/dist/ui-core/ports/pager-export-port.js +0 -2
- package/dist/ui-core/ports/pager-export-port.js.map +1 -1
- package/dist/ui-core/ports/renderer-port.d.ts +0 -6
- package/dist/ui-core/react/providers.d.ts +0 -7
- package/dist/ui-core/react/providers.js +0 -7
- package/dist/ui-core/react/providers.js.map +1 -1
- package/dist/ui-core/react/use-has-draft.d.ts +0 -5
- package/dist/ui-core/react/use-has-draft.js +0 -5
- package/dist/ui-core/react/use-has-draft.js.map +1 -1
- package/dist/ui-core/react/use-overlay.d.ts +0 -1
- package/dist/ui-core/react/use-overlay.js +0 -1
- package/dist/ui-core/react/use-overlay.js.map +1 -1
- package/dist/ui-core/react/use-plan.d.ts +0 -1
- package/dist/ui-core/react/use-plan.js +0 -1
- package/dist/ui-core/react/use-plan.js.map +1 -1
- package/dist/ui-core/react/use-toast.d.ts +0 -1
- package/dist/ui-core/react/use-toast.js +0 -3
- package/dist/ui-core/react/use-toast.js.map +1 -1
- package/dist/ui-core/react/use-transcript-store.d.ts +0 -7
- package/dist/ui-core/react/use-transcript-store.js +0 -7
- package/dist/ui-core/react/use-transcript-store.js.map +1 -1
- package/dist/ui-core/rendering/artifact-pager-source.d.ts +0 -7
- package/dist/ui-core/rendering/artifact-pager-source.js +0 -3
- package/dist/ui-core/rendering/artifact-pager-source.js.map +1 -1
- package/dist/ui-core/rendering/batch-sections.d.ts +0 -38
- package/dist/ui-core/rendering/batch-sections.js +1 -47
- package/dist/ui-core/rendering/batch-sections.js.map +1 -1
- package/dist/ui-core/rendering/code-block.d.ts +0 -25
- package/dist/ui-core/rendering/code-block.js +0 -47
- package/dist/ui-core/rendering/code-block.js.map +1 -1
- package/dist/ui-core/rendering/context-limit.js +0 -2
- package/dist/ui-core/rendering/context-limit.js.map +1 -1
- package/dist/ui-core/rendering/duration.js +0 -3
- package/dist/ui-core/rendering/duration.js.map +1 -1
- package/dist/ui-core/rendering/exit-summary/table.d.ts +23 -0
- package/dist/ui-core/rendering/exit-summary/table.js +194 -0
- package/dist/ui-core/rendering/exit-summary/table.js.map +1 -0
- package/dist/ui-core/rendering/exit-summary.js +1 -210
- package/dist/ui-core/rendering/exit-summary.js.map +1 -1
- package/dist/ui-core/rendering/file-diff-view.d.ts +0 -27
- package/dist/ui-core/rendering/file-diff-view.js +0 -29
- package/dist/ui-core/rendering/file-diff-view.js.map +1 -1
- package/dist/ui-core/rendering/format-help.d.ts +0 -13
- package/dist/ui-core/rendering/format-help.js +0 -18
- package/dist/ui-core/rendering/format-help.js.map +1 -1
- package/dist/ui-core/rendering/format-keys.js +0 -2
- package/dist/ui-core/rendering/format-keys.js.map +1 -1
- package/dist/ui-core/rendering/format-usage.js +18 -5
- package/dist/ui-core/rendering/format-usage.js.map +1 -1
- package/dist/ui-core/rendering/incremental-strip.js +0 -13
- package/dist/ui-core/rendering/incremental-strip.js.map +1 -1
- package/dist/ui-core/rendering/intro-header.js +0 -1
- package/dist/ui-core/rendering/intro-header.js.map +1 -1
- package/dist/ui-core/rendering/job-tail-source.d.ts +0 -9
- package/dist/ui-core/rendering/job-tail-source.js +0 -9
- package/dist/ui-core/rendering/job-tail-source.js.map +1 -1
- package/dist/ui-core/rendering/link-detector.d.ts +0 -8
- package/dist/ui-core/rendering/link-detector.js +0 -10
- package/dist/ui-core/rendering/link-detector.js.map +1 -1
- package/dist/ui-core/rendering/markdown/tables.d.ts +8 -0
- package/dist/ui-core/rendering/markdown/tables.js +276 -0
- package/dist/ui-core/rendering/markdown/tables.js.map +1 -0
- package/dist/ui-core/rendering/markdown.d.ts +4 -9
- package/dist/ui-core/rendering/markdown.js +224 -593
- package/dist/ui-core/rendering/markdown.js.map +1 -1
- package/dist/ui-core/rendering/open-tool-output.d.ts +0 -30
- package/dist/ui-core/rendering/open-tool-output.js +0 -39
- package/dist/ui-core/rendering/open-tool-output.js.map +1 -1
- package/dist/ui-core/rendering/pager-chrome.d.ts +0 -20
- package/dist/ui-core/rendering/pager-chrome.js +0 -24
- package/dist/ui-core/rendering/pager-chrome.js.map +1 -1
- package/dist/ui-core/rendering/pager-source.d.ts +0 -17
- package/dist/ui-core/rendering/pager-source.js +0 -27
- package/dist/ui-core/rendering/pager-source.js.map +1 -1
- package/dist/ui-core/rendering/pager-text.d.ts +0 -21
- package/dist/ui-core/rendering/pager-text.js +0 -31
- package/dist/ui-core/rendering/pager-text.js.map +1 -1
- package/dist/ui-core/rendering/pager-view-policy.d.ts +0 -24
- package/dist/ui-core/rendering/pager-view-policy.js +0 -31
- package/dist/ui-core/rendering/pager-view-policy.js.map +1 -1
- package/dist/ui-core/rendering/picker-filter.d.ts +0 -11
- package/dist/ui-core/rendering/picker-filter.js +0 -11
- package/dist/ui-core/rendering/picker-filter.js.map +1 -1
- package/dist/ui-core/rendering/plan-view.d.ts +0 -39
- package/dist/ui-core/rendering/plan-view.js +0 -37
- package/dist/ui-core/rendering/plan-view.js.map +1 -1
- package/dist/ui-core/rendering/prompt-preview.d.ts +0 -5
- package/dist/ui-core/rendering/prompt-preview.js +0 -5
- package/dist/ui-core/rendering/prompt-preview.js.map +1 -1
- package/dist/ui-core/rendering/sanitize-display.d.ts +0 -10
- package/dist/ui-core/rendering/sanitize-display.js +0 -14
- package/dist/ui-core/rendering/sanitize-display.js.map +1 -1
- package/dist/ui-core/rendering/status-segments.js +3 -3
- package/dist/ui-core/rendering/status-segments.js.map +1 -1
- package/dist/ui-core/rendering/streaming-markdown.js +0 -11
- package/dist/ui-core/rendering/streaming-markdown.js.map +1 -1
- package/dist/ui-core/rendering/syntax/clike.d.ts +22 -0
- package/dist/ui-core/rendering/syntax/clike.js +168 -0
- package/dist/ui-core/rendering/syntax/clike.js.map +1 -0
- package/dist/ui-core/rendering/syntax/keywords.d.ts +24 -0
- package/dist/ui-core/rendering/syntax/keywords.js +169 -0
- package/dist/ui-core/rendering/syntax/keywords.js.map +1 -0
- package/dist/ui-core/rendering/syntax/language-highlighters.d.ts +18 -0
- package/dist/ui-core/rendering/syntax/language-highlighters.js +538 -0
- package/dist/ui-core/rendering/syntax/language-highlighters.js.map +1 -0
- package/dist/ui-core/rendering/syntax/language-table.d.ts +3 -0
- package/dist/ui-core/rendering/syntax/language-table.js +244 -0
- package/dist/ui-core/rendering/syntax/language-table.js.map +1 -0
- package/dist/ui-core/rendering/syntax-highlight.d.ts +6 -28
- package/dist/ui-core/rendering/syntax-highlight.js +5 -1177
- package/dist/ui-core/rendering/syntax-highlight.js.map +1 -1
- package/dist/ui-core/rendering/text-format.d.ts +0 -3
- package/dist/ui-core/rendering/text-format.js +0 -3
- package/dist/ui-core/rendering/text-format.js.map +1 -1
- package/dist/ui-core/rendering/text-width.d.ts +0 -26
- package/dist/ui-core/rendering/text-width.js +0 -26
- package/dist/ui-core/rendering/text-width.js.map +1 -1
- package/dist/ui-core/rendering/theme.d.ts +0 -65
- package/dist/ui-core/rendering/theme.js +0 -24
- package/dist/ui-core/rendering/theme.js.map +1 -1
- package/dist/ui-core/rendering/thinking-tail.js +0 -3
- package/dist/ui-core/rendering/thinking-tail.js.map +1 -1
- package/dist/ui-core/rendering/tool-presenter.d.ts +0 -41
- package/dist/ui-core/rendering/tool-presenter.js +1 -67
- package/dist/ui-core/rendering/tool-presenter.js.map +1 -1
- package/dist/ui-core/rendering/transcript-semantic.d.ts +0 -8
- package/dist/ui-core/rendering/transcript-semantic.js +0 -13
- package/dist/ui-core/rendering/transcript-semantic.js.map +1 -1
- package/dist/ui-core/rendering/user-message-wrap.d.ts +0 -16
- package/dist/ui-core/rendering/user-message-wrap.js +0 -16
- package/dist/ui-core/rendering/user-message-wrap.js.map +1 -1
- package/dist/ui-core/rendering/wordmark.d.ts +0 -8
- package/dist/ui-core/rendering/wordmark.js +0 -21
- package/dist/ui-core/rendering/wordmark.js.map +1 -1
- package/dist/ui-core/state/hydrate/classic-transcript.d.ts +8 -0
- package/dist/ui-core/state/hydrate/classic-transcript.js +168 -0
- package/dist/ui-core/state/hydrate/classic-transcript.js.map +1 -0
- package/dist/ui-core/state/hydrate/from-messages.d.ts +6 -0
- package/dist/ui-core/state/hydrate/from-messages.js +237 -0
- package/dist/ui-core/state/hydrate/from-messages.js.map +1 -0
- package/dist/ui-core/state/pager-search.d.ts +0 -9
- package/dist/ui-core/state/pager-search.js +1 -8
- package/dist/ui-core/state/pager-search.js.map +1 -1
- package/dist/ui-core/state/semantic-document.d.ts +0 -8
- package/dist/ui-core/state/semantic-document.js +0 -8
- package/dist/ui-core/state/semantic-document.js.map +1 -1
- package/dist/ui-core/state/thinking-copy.d.ts +0 -8
- package/dist/ui-core/state/thinking-copy.js +0 -8
- package/dist/ui-core/state/thinking-copy.js.map +1 -1
- package/dist/ui-core/state/transcript/apply-app-event.d.ts +8 -0
- package/dist/ui-core/state/transcript/apply-app-event.js +406 -0
- package/dist/ui-core/state/transcript/apply-app-event.js.map +1 -0
- package/dist/ui-core/state/transcript/message-lifecycle.d.ts +7 -0
- package/dist/ui-core/state/transcript/message-lifecycle.js +285 -0
- package/dist/ui-core/state/transcript/message-lifecycle.js.map +1 -0
- package/dist/ui-core/state/transcript-compaction.d.ts +0 -19
- package/dist/ui-core/state/transcript-compaction.js +0 -21
- package/dist/ui-core/state/transcript-compaction.js.map +1 -1
- package/dist/ui-core/state/transcript-hydrate.d.ts +6 -52
- package/dist/ui-core/state/transcript-hydrate.js +5 -470
- package/dist/ui-core/state/transcript-hydrate.js.map +1 -1
- package/dist/ui-core/state/transcript-reducer.d.ts +1 -15
- package/dist/ui-core/state/transcript-reducer.js +1 -708
- package/dist/ui-core/state/transcript-reducer.js.map +1 -1
- package/dist/ui-core/state/transcript-search.d.ts +0 -8
- package/dist/ui-core/state/transcript-search.js +0 -8
- package/dist/ui-core/state/transcript-search.js.map +1 -1
- package/dist/ui-core/state/transcript-store.d.ts +0 -26
- package/dist/ui-core/state/transcript-store.js +0 -28
- package/dist/ui-core/state/transcript-store.js.map +1 -1
- package/dist/ui-core/state/transcript-types.d.ts +0 -33
- package/dist/ui-core/state/transcript-types.js +0 -17
- package/dist/ui-core/state/transcript-types.js.map +1 -1
- package/dist/ui-core/state/transcript-window.d.ts +0 -8
- package/dist/ui-core/state/transcript-window.js +0 -8
- package/dist/ui-core/state/transcript-window.js.map +1 -1
- package/dist/version.generated.d.ts +2 -2
- package/dist/version.generated.js +2 -2
- package/package.json +19 -2
- package/dist/agent/finalize-gate.d.ts +0 -54
- package/dist/agent/finalize-gate.js +0 -97
- package/dist/agent/finalize-gate.js.map +0 -1
- package/dist/agent/must-continue.d.ts +0 -36
- package/dist/agent/must-continue.js +0 -172
- package/dist/agent/must-continue.js.map +0 -1
package/dist/agent/plan-tool.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { isLumpedSingleTask } from "./tool-call-parser.js";
|
|
6
|
-
import { buildDependencyReminder, dependencyToast } from "./task-sync.js";
|
|
7
|
-
import { getActiveProjectRoot } from "./project-root.js";
|
|
8
|
-
import { classifyTaskTitle } from "./task-evidence.js";
|
|
9
|
-
import { detectPackageManager } from "./workspace-orient.js";
|
|
10
|
-
/** Titles match for plan merge (exact or mutual long substring). */
|
|
11
|
-
export function titlesMatchForPlan(a, b) {
|
|
12
|
-
const t1 = a.trim().toLowerCase();
|
|
13
|
-
const t2 = b.trim().toLowerCase();
|
|
14
|
-
return (t1 === t2 ||
|
|
15
|
-
(t1.length > 8 && t2.length > 8 && (t1.includes(t2) || t2.includes(t1))));
|
|
16
|
-
}
|
|
17
|
-
/** Final coding-plan task: start server / probe localhost / leave running. */
|
|
1
|
+
import { normalizePlanTaskEntries } from "./plan/handle-plan-tool.js";
|
|
2
|
+
export { planContextMessage } from "./plan/context-message.js";
|
|
3
|
+
export { handlePlanTool, looksLikeRunOnlyGoal, normalizeCodingPlanTasks, renderPlanForTerminal, resolvePlanTaskId, slugifyTaskId, titlesMatchForPlan } from "./plan/handle-plan-tool.js";
|
|
4
|
+
export { normalizePlanTaskEntries };
|
|
18
5
|
export function looksLikeRunServerTask(title) {
|
|
19
6
|
const t = title.trim().toLowerCase();
|
|
20
7
|
if (/\b(dev\s*server|npm\s+run\s+dev|pnpm\s+(run\s+)?dev|yarn\s+dev|bun\s+run\s+dev|shell\.start|localhost|leave\s+(it\s+)?running|verify\s+in\s+browser|open\s+in\s+browser|probe\s+(localhost|http)|http:\/\/localhost)\b/.test(t)) {
|
|
@@ -25,7 +12,6 @@ export function looksLikeRunServerTask(title) {
|
|
|
25
12
|
if (/\b(server|dev|vite|next|preview)\b.+\b(start|run|verify|tail|probe)\b/.test(t)) {
|
|
26
13
|
return true;
|
|
27
14
|
}
|
|
28
|
-
// "run and verify" / "start app" style finals
|
|
29
15
|
if (/\b(run|start)\b.+\b(app|verify)\b/.test(t) && /\b(server|dev|browser|localhost|url|port|job)\b/.test(t)) {
|
|
30
16
|
return true;
|
|
31
17
|
}
|
|
@@ -35,13 +21,11 @@ export function looksLikeLocalAppScaffold(kind, goal, detail, tasks) {
|
|
|
35
21
|
if (kind === "pentest")
|
|
36
22
|
return false;
|
|
37
23
|
const blob = `${kind} ${goal} ${detail} ${tasks.join(" ")}`.toLowerCase();
|
|
38
|
-
// Pure libraries / CLIs with no server surface
|
|
39
24
|
if (/\b(library|cli\b|command[- ]line|npm package|rust crate|go module)\b/.test(blob) &&
|
|
40
25
|
!/\b(react|vite|next|vue|svelte|web\s*app|frontend|dev\s*server|localhost|todo\s*app|dashboard|spa)\b/.test(blob)) {
|
|
41
26
|
return false;
|
|
42
27
|
}
|
|
43
28
|
if (kind === "coding") {
|
|
44
|
-
// coding + no library-only signal → require run/verify when app-like
|
|
45
29
|
return /\b(app|react|vite|next|vue|svelte|nuxt|angular|frontend|web|ui|todo|blog|dashboard|spa|server|localhost|scaffold)\b/.test(blob);
|
|
46
30
|
}
|
|
47
31
|
return /\b(react|vite|next\.?js?|vue|svelte|nuxt|angular|web\s*app|frontend|spa|todo\s*app|blog\s*app|dashboard)\b/.test(blob);
|
|
@@ -59,10 +43,6 @@ function looksLikeInstallTask(title) {
|
|
|
59
43
|
function looksLikeScaffoldishTask(title) {
|
|
60
44
|
return /\b(scaffold|create|init|vite|next|bootstrap|cargo\s+new)\b/i.test(title);
|
|
61
45
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Ensure coding app plans have an explicit install step after scaffold.
|
|
64
|
-
* Avoids "implement blocked from npm install" + install attributed to wrong task.
|
|
65
|
-
*/
|
|
66
46
|
export function ensureCodingPlanInstallTask(kind, goal, detail, tasks) {
|
|
67
47
|
if (!looksLikeLocalAppScaffold(kind, goal, detail, tasks))
|
|
68
48
|
return tasks;
|
|
@@ -95,9 +75,6 @@ function looksLikeFeatureAppPlan(goal, detail, tasks) {
|
|
|
95
75
|
return (/\b(todo|to-?do|blog|dashboard|chat|kanban|notes?|crm|shop|auth|login|crud|portfolio)\b/.test(blob) &&
|
|
96
76
|
/\b(app|application|project|site|ui|feature)\b/.test(blob));
|
|
97
77
|
}
|
|
98
|
-
/**
|
|
99
|
-
* Ensure feature-app plans include an implement-feature task (not scaffold-only).
|
|
100
|
-
*/
|
|
101
78
|
export function ensureCodingPlanFeatureTask(kind, goal, detail, tasks) {
|
|
102
79
|
if (!looksLikeLocalAppScaffold(kind, goal, detail, tasks))
|
|
103
80
|
return tasks;
|
|
@@ -106,7 +83,6 @@ export function ensureCodingPlanFeatureTask(kind, goal, detail, tasks) {
|
|
|
106
83
|
if (tasks.some(looksLikeFeatureImplementTask))
|
|
107
84
|
return tasks;
|
|
108
85
|
const out = [...tasks];
|
|
109
|
-
// Insert after install if present, else after scaffold, else before last (verify)
|
|
110
86
|
const installIdx = out.findIndex(looksLikeInstallTask);
|
|
111
87
|
const scaffoldIdx = out.findIndex(looksLikeScaffoldishTask);
|
|
112
88
|
const runIdx = out.findIndex(looksLikeRunServerTask);
|
|
@@ -122,7 +98,6 @@ export function ensureCodingPlanFeatureTask(kind, goal, detail, tasks) {
|
|
|
122
98
|
out.splice(insertAt, 0, "Implement the requested product feature (replace starter boilerplate with real UI/state)");
|
|
123
99
|
return out;
|
|
124
100
|
}
|
|
125
|
-
/** Ensure local app plans end with shell.start + probe + leave running. */
|
|
126
101
|
export function ensureCodingPlanRunVerifyTask(kind, goal, detail, tasks) {
|
|
127
102
|
if (!looksLikeLocalAppScaffold(kind, goal, detail, tasks))
|
|
128
103
|
return tasks;
|
|
@@ -133,210 +108,19 @@ export function ensureCodingPlanRunVerifyTask(kind, goal, detail, tasks) {
|
|
|
133
108
|
"Start dev server with shell.start, probe localhost, leave running, report URL/port/job id",
|
|
134
109
|
];
|
|
135
110
|
}
|
|
136
|
-
/** Preserve the model/user-authored checklist exactly for fresh coding plans. */
|
|
137
|
-
export function normalizeCodingPlanTasks(_kind, _goal, _detail, tasks) {
|
|
138
|
-
return [...tasks];
|
|
139
|
-
}
|
|
140
|
-
/** Goal is only "run/start the existing app" — do not open a new plan. */
|
|
141
|
-
export function looksLikeRunOnlyGoal(goal, detail) {
|
|
142
|
-
const blob = `${goal} ${detail}`.toLowerCase();
|
|
143
|
-
if (!/\b(run|start|launch|serve|dev\s*server|npm\s+run\s+dev)\b/.test(blob)) {
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
// Exclude fresh scaffold goals
|
|
147
|
-
if (/\b(scaffold|create|build|implement|add feature|from scratch|new app)\b/.test(blob)) {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
return /\b(existing|already|the app|dev server|server|verify|test it|open it)\b/.test(blob)
|
|
151
|
-
|| /^(run|start)\b/.test(blob.trim());
|
|
152
|
-
}
|
|
153
|
-
function nextTaskId(existingIds) {
|
|
154
|
-
let max = 0;
|
|
155
|
-
for (const id of existingIds) {
|
|
156
|
-
const m = /^t(\d+)$/i.exec(id);
|
|
157
|
-
if (m)
|
|
158
|
-
max = Math.max(max, Number(m[1]));
|
|
159
|
-
}
|
|
160
|
-
return `t${max + 1}`;
|
|
161
|
-
}
|
|
162
|
-
/** Coerce model-sloppy plan.create fields into clean titles. */
|
|
163
|
-
function normalizePlanGoal(args) {
|
|
164
|
-
const raw = args.goal ?? args.objective ?? args.title ?? args.name;
|
|
165
|
-
if (typeof raw === "string")
|
|
166
|
-
return raw.trim();
|
|
167
|
-
if (raw && typeof raw === "object") {
|
|
168
|
-
const o = raw;
|
|
169
|
-
for (const k of ["title", "text", "goal", "name", "summary"]) {
|
|
170
|
-
if (typeof o[k] === "string" && o[k].toString().trim()) {
|
|
171
|
-
return String(o[k]).trim();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
return "";
|
|
176
|
-
}
|
|
177
|
-
function normalizePlanDetail(args) {
|
|
178
|
-
const raw = args.detail ?? args.description ?? args.approach ?? args.notes;
|
|
179
|
-
if (typeof raw === "string")
|
|
180
|
-
return raw.trim();
|
|
181
|
-
if (Array.isArray(raw)) {
|
|
182
|
-
return raw
|
|
183
|
-
.map((x) => (typeof x === "string" ? x : JSON.stringify(x)))
|
|
184
|
-
.join("\n")
|
|
185
|
-
.trim();
|
|
186
|
-
}
|
|
187
|
-
return "";
|
|
188
|
-
}
|
|
189
|
-
function normalizePlanKind(args) {
|
|
190
|
-
const raw = args.kind ?? args.type ?? args.category;
|
|
191
|
-
if (typeof raw === "string" && raw.trim())
|
|
192
|
-
return raw.trim().toLowerCase();
|
|
193
|
-
return "general";
|
|
194
|
-
}
|
|
195
|
-
function normalizeTaskTitle(t) {
|
|
196
|
-
if (typeof t === "string")
|
|
197
|
-
return t.trim();
|
|
198
|
-
if (typeof t === "number" && Number.isFinite(t))
|
|
199
|
-
return String(t);
|
|
200
|
-
if (t && typeof t === "object") {
|
|
201
|
-
const o = t;
|
|
202
|
-
for (const k of [
|
|
203
|
-
"title",
|
|
204
|
-
"task",
|
|
205
|
-
"name",
|
|
206
|
-
"text",
|
|
207
|
-
"description",
|
|
208
|
-
"label",
|
|
209
|
-
"step",
|
|
210
|
-
"summary",
|
|
211
|
-
]) {
|
|
212
|
-
if (typeof o[k] === "string" && o[k].toString().trim()) {
|
|
213
|
-
return String(o[k]).trim();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
return "";
|
|
218
|
-
}
|
|
219
|
-
export function slugifyTaskId(text) {
|
|
220
|
-
return text
|
|
221
|
-
.trim()
|
|
222
|
-
.toLowerCase()
|
|
223
|
-
.replace(/[^a-z0-9]+/g, "_")
|
|
224
|
-
.replace(/^_+|_+$/g, "")
|
|
225
|
-
.slice(0, 64);
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Accept tasks as string[], object[], or a single newline/comma-separated string.
|
|
229
|
-
* Models frequently emit `[{id,title}]` instead of plain strings.
|
|
230
|
-
*/
|
|
231
111
|
function normalizePlanTasks(args) {
|
|
232
112
|
return normalizePlanTaskEntries(args).map((t) => t.title);
|
|
233
113
|
}
|
|
234
|
-
/** Full entries including model-supplied id/name aliases (X3). */
|
|
235
|
-
export function normalizePlanTaskEntries(args) {
|
|
236
|
-
const raw = args.tasks ?? args.steps ?? args.checklist ?? args.items ?? args.todos;
|
|
237
|
-
if (typeof raw === "string") {
|
|
238
|
-
return raw
|
|
239
|
-
.split(/\n|;|(?:,\s*(?=[A-Z0-9\-]))/)
|
|
240
|
-
.map((s) => s.replace(/^\s*[-*\d.)]+\s*/, "").trim())
|
|
241
|
-
.filter(Boolean)
|
|
242
|
-
.map((title) => ({
|
|
243
|
-
title,
|
|
244
|
-
aliases: [],
|
|
245
|
-
dependencies: [],
|
|
246
|
-
dependenciesSpecified: false,
|
|
247
|
-
resourceLocks: [],
|
|
248
|
-
}));
|
|
249
|
-
}
|
|
250
|
-
if (!Array.isArray(raw))
|
|
251
|
-
return [];
|
|
252
|
-
return raw
|
|
253
|
-
.map((t) => {
|
|
254
|
-
const title = normalizeTaskTitle(t);
|
|
255
|
-
if (!title || isBareTaskIdTitle(title))
|
|
256
|
-
return null;
|
|
257
|
-
const aliases = [];
|
|
258
|
-
if (t && typeof t === "object") {
|
|
259
|
-
const o = t;
|
|
260
|
-
for (const k of ["id", "taskId", "key", "slug"]) {
|
|
261
|
-
if (typeof o[k] === "string" && o[k].toString().trim()) {
|
|
262
|
-
aliases.push(String(o[k]).trim());
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
// `name` is often the title; only alias if it differs.
|
|
266
|
-
if (typeof o.name === "string" &&
|
|
267
|
-
o.name.trim() &&
|
|
268
|
-
o.name.trim().toLowerCase() !== title.toLowerCase()) {
|
|
269
|
-
aliases.push(o.name.trim());
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
const slug = slugifyTaskId(title);
|
|
273
|
-
if (slug && !aliases.includes(slug))
|
|
274
|
-
aliases.push(slug);
|
|
275
|
-
const object = t && typeof t === "object" ? t : {};
|
|
276
|
-
const stringArray = (value) => Array.isArray(value)
|
|
277
|
-
? [...new Set(value.filter((item) => typeof item === "string").map((item) => item.trim()).filter(Boolean))]
|
|
278
|
-
: [];
|
|
279
|
-
const rawAcceptance = object.acceptance ??
|
|
280
|
-
object.acceptanceCriteria ??
|
|
281
|
-
object.successCriteria ??
|
|
282
|
-
object.verify;
|
|
283
|
-
const acceptanceCriteria = typeof rawAcceptance === "string"
|
|
284
|
-
? rawAcceptance.trim()
|
|
285
|
-
: Array.isArray(rawAcceptance)
|
|
286
|
-
? rawAcceptance
|
|
287
|
-
.filter((item) => typeof item === "string")
|
|
288
|
-
.map((item) => item.trim())
|
|
289
|
-
.filter(Boolean)
|
|
290
|
-
.join("; ")
|
|
291
|
-
: "";
|
|
292
|
-
return {
|
|
293
|
-
title,
|
|
294
|
-
aliases: [...new Set(aliases)],
|
|
295
|
-
dependencies: stringArray(object.dependencies ?? object.dependsOn),
|
|
296
|
-
dependenciesSpecified: Object.prototype.hasOwnProperty.call(object, "dependencies") ||
|
|
297
|
-
Object.prototype.hasOwnProperty.call(object, "dependsOn"),
|
|
298
|
-
resourceLocks: stringArray(object.resourceLocks ?? object.resources),
|
|
299
|
-
...(acceptanceCriteria ? { acceptanceCriteria } : {}),
|
|
300
|
-
};
|
|
301
|
-
})
|
|
302
|
-
.filter((x) => Boolean(x));
|
|
303
|
-
}
|
|
304
|
-
/** Resolve model taskId (t1 or slug) to the canonical plan task id. */
|
|
305
|
-
export function resolvePlanTaskId(plan, taskId) {
|
|
306
|
-
const raw = taskId.trim();
|
|
307
|
-
if (!raw)
|
|
308
|
-
return undefined;
|
|
309
|
-
if (plan.tasks.some((t) => t.id === raw))
|
|
310
|
-
return raw;
|
|
311
|
-
const lower = raw.toLowerCase();
|
|
312
|
-
const slug = slugifyTaskId(raw);
|
|
313
|
-
for (const t of plan.tasks) {
|
|
314
|
-
if (t.aliases?.some((a) => a === raw || a.toLowerCase() === lower)) {
|
|
315
|
-
return t.id;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return undefined;
|
|
319
|
-
}
|
|
320
|
-
/** Render the portable inline form; the Ink TUI owns its responsive sidebar. */
|
|
321
|
-
export function renderPlanForTerminal(plan) {
|
|
322
|
-
return renderPlanChecklist(plan);
|
|
323
|
-
}
|
|
324
|
-
/** Build the system-context block describing the session's active plan. */
|
|
325
|
-
// Marker that identifies the single live plan message in a request.
|
|
326
114
|
export const PLAN_CONTEXT_PREFIX = "ACTIVE PLAN";
|
|
327
|
-
// Keep exactly one live ACTIVE PLAN copy in the request, as a suffix. The plan
|
|
328
|
-
// is mutable state: a snapshot frozen into the stable system prefix goes stale
|
|
329
|
-
// as tasks advance, and a second re-injected copy lets the model see two
|
|
330
|
-
// disagreeing plans. Every prior copy is dropped before the current one is
|
|
331
|
-
// appended. Call only at protocol-safe points (never between an assistant tool
|
|
332
|
-
// call and its results).
|
|
333
115
|
export function upsertPlanContextMessage(messages, content) {
|
|
334
116
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
335
117
|
const message = messages[index];
|
|
336
118
|
if (message.role === "system" &&
|
|
337
119
|
typeof message.content === "string" &&
|
|
338
120
|
message.content.startsWith(PLAN_CONTEXT_PREFIX)) {
|
|
339
|
-
|
|
121
|
+
if (message.content === content)
|
|
122
|
+
return;
|
|
123
|
+
break;
|
|
340
124
|
}
|
|
341
125
|
}
|
|
342
126
|
messages.push({ role: "system", content });
|
|
@@ -351,1016 +135,4 @@ export function removePlanContextMessage(messages) {
|
|
|
351
135
|
}
|
|
352
136
|
}
|
|
353
137
|
}
|
|
354
|
-
export function planContextMessage(plan, approved) {
|
|
355
|
-
const lines = [];
|
|
356
|
-
lines.push(`ACTIVE PLAN v${plan.version ?? 1} for this session (goal: ${plan.goal}, status: ${plan.status}):`);
|
|
357
|
-
if (plan.detail.trim())
|
|
358
|
-
lines.push(plan.detail.trim());
|
|
359
|
-
lines.push("Tasks:");
|
|
360
|
-
plan.tasks.forEach((t, i) => {
|
|
361
|
-
const aliasHint = t.aliases?.length && t.aliases[0] !== t.id
|
|
362
|
-
? ` [aliases: ${t.aliases.slice(0, 3).join(", ")}]`
|
|
363
|
-
: "";
|
|
364
|
-
const dependencyHint = t.dependencies?.length
|
|
365
|
-
? ` [depends: ${t.dependencies.join(", ")}]`
|
|
366
|
-
: "";
|
|
367
|
-
const resourceHint = t.resourceLocks?.length
|
|
368
|
-
? ` [locks: ${t.resourceLocks.join(", ")}]`
|
|
369
|
-
: "";
|
|
370
|
-
const evidenceHint = t.evidence?.successWorkCount
|
|
371
|
-
? ` [evidence: ${t.evidence.successWorkCount} successful tool${t.evidence.successWorkCount === 1 ? "" : "s"}${t.evidence.lastOkTool ? `; last ${t.evidence.lastOkTool}` : ""}]`
|
|
372
|
-
: "";
|
|
373
|
-
const acceptanceHint = t.acceptanceCriteria?.trim()
|
|
374
|
-
? ` [acceptance: ${t.acceptanceCriteria.trim()}]`
|
|
375
|
-
: "";
|
|
376
|
-
const hierarchyHint = t.parentTaskId ? ` [child of ${t.parentTaskId}]` : "";
|
|
377
|
-
const jobHint = t.jobId
|
|
378
|
-
? ` [responder job=${t.jobId}${t.processId ? ` pid=${t.processId}` : ""}]`
|
|
379
|
-
: "";
|
|
380
|
-
lines.push(` ${i + 1}. [${t.id}] (${t.state}) ${t.title}${hierarchyHint}${jobHint}${aliasHint}${dependencyHint}${resourceHint}${acceptanceHint}${evidenceHint}`);
|
|
381
|
-
});
|
|
382
|
-
lines.push("task.update taskId MUST be t1, t2, … from this list (or a listed alias). Use task.add for newly discovered work; it is placed before unfinished report creation. Use task.move with position/beforeTaskId/afterTaskId to rearrange work without changing ids or evidence. Responder-owned job tasks advance automatically; never task.update them. After analyzing a delivered Responder result, job.read its job or notification before finalizing.");
|
|
383
|
-
if (plan.meta?.projectRoot) {
|
|
384
|
-
lines.push(`project_root: ${plan.meta.projectRoot}`);
|
|
385
|
-
}
|
|
386
|
-
if (plan.meta?.packageManager) {
|
|
387
|
-
lines.push(`package_manager: ${plan.meta.packageManager}`);
|
|
388
|
-
}
|
|
389
|
-
if (approved) {
|
|
390
|
-
const inProgress = plan.tasks.find((task) => task.state === "in_progress" && !task.responderOwned);
|
|
391
|
-
const failed = plan.tasks.find((task) => task.state === "failed" && !task.responderOwned);
|
|
392
|
-
const firstPending = readyPlanTasks(plan)[0];
|
|
393
|
-
const hasOpenWork = plan.tasks.some((task) => !task.responderOwned &&
|
|
394
|
-
(task.state === "in_progress" ||
|
|
395
|
-
task.state === "pending" ||
|
|
396
|
-
task.state === "failed"));
|
|
397
|
-
lines.push("The user APPROVED this plan. Execute it NOW. Tasks are checkpoints — you still own the user's requested boundary. Their states are authoritative for tracked work, but a completed phase is not completion of an explicitly requested whole roadmap/program.");
|
|
398
|
-
if (inProgress) {
|
|
399
|
-
lines.push(`RESUME TASK ${inProgress.id} (${inProgress.title}) — it was started but interrupted. ` +
|
|
400
|
-
"Retry what was in progress; do NOT restart completed work from scratch. " +
|
|
401
|
-
"Do NOT re-do tasks already marked done.");
|
|
402
|
-
}
|
|
403
|
-
else if (failed) {
|
|
404
|
-
lines.push(`RETRY FAILED TASK ${failed.id} (${failed.title}) — reopen it (task.update in_progress), ` +
|
|
405
|
-
"fix the root cause, then re-verify before marking done. Do NOT re-do tasks already marked done.");
|
|
406
|
-
}
|
|
407
|
-
else if (firstPending) {
|
|
408
|
-
lines.push(`START WITH TASK ${firstPending.id} (${firstPending.title}). ` +
|
|
409
|
-
"Do NOT re-do tasks already marked done.");
|
|
410
|
-
}
|
|
411
|
-
if (hasOpenWork) {
|
|
412
|
-
lines.push("FIRST THIS TURN — reconcile with this task list before doing anything else. It persists across abort and " +
|
|
413
|
-
"compaction, is re-injected here every turn, and is the CURRENT source of truth for what is done vs pending. " +
|
|
414
|
-
"It OVERRIDES any 'current state', 'remaining work', 'ready to…', or completion wording in the compacted memory " +
|
|
415
|
-
"summary; when the summary and these task states disagree, trust these task states.");
|
|
416
|
-
lines.push("Let task states identify the current foreground outcome and avoid rediscovering settled work. Read that task's " +
|
|
417
|
-
"artifacts plus only the prior evidence needed for its dependencies. One foreground task stays in_progress for " +
|
|
418
|
-
"state integrity, but the plan is a living outcome map rather than an inflexible script: if evidence exposes " +
|
|
419
|
-
"required work or invalidates priority, add the discovery, return the current task to pending when necessary, " +
|
|
420
|
-
"and deliberately open the new highest-priority ready task. Preserve completed evidence and never re-scan the " +
|
|
421
|
-
"whole project merely to recover status. You may stop with open tasks only when genuinely blocked, told to stop, " +
|
|
422
|
-
"or waiting on declared external work; report the exact remainder honestly.");
|
|
423
|
-
}
|
|
424
|
-
lines.push("Flow: task.update in_progress → pursue the task's outcome using the evidence-appropriate method → WAIT for and READ every result → " +
|
|
425
|
-
"verify its acceptance evidence → mark done only when the outcome holds → open the next ready task. " +
|
|
426
|
-
"A launched command is not evidence of completion, and one successful path may not cover the task's relevant edge, integration, or regression surface. " +
|
|
427
|
-
"Capture unrelated or newly required discoveries with task.add; do not silently broaden scope or discard them. " +
|
|
428
|
-
"A durable background launch creates a Responder-owned child task: launch high-value slow work early only when independent work remains, and never busy-poll or duplicate it. " +
|
|
429
|
-
"If only Responder-owned child tasks remain, yield honestly; Responder will inject the durable completion. " +
|
|
430
|
-
"Durable evidence beside a task survives resume; reuse it rather than repeating confirmed work. " +
|
|
431
|
-
"Independent read-only lookups may parallelize when their results do not depend on each other. " +
|
|
432
|
-
"If a tool fails, interpret why, revise the hypothesis or environment, and retry with a materially improved approach instead of ritual repetition. " +
|
|
433
|
-
"Before finalizing, reconcile every requested acceptance criterion, task, affected surface, and material residual uncertainty. " +
|
|
434
|
-
"For software, use applicable automated and runtime/integration proof. For security, use remote target evidence and explicit attack-surface residuals. " +
|
|
435
|
-
"Do not re-open done tasks.");
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
lines.push("This plan is NOT yet approved — do not execute tasks (no scaffold/write/install/exploit). " +
|
|
439
|
-
"User free-text is PLAN REVISION feedback, not approval — even if it sounds like an instruction. " +
|
|
440
|
-
"On revision: call plan.create with the COMPLETE intended checklist (drop obsolete tasks; " +
|
|
441
|
-
"matching titles keep stable ids). Be decisive — one coherent rewrite, then STOP. " +
|
|
442
|
-
"User may Accept, Discard, View, or Suggest changes (or /implement / /discard).");
|
|
443
|
-
}
|
|
444
|
-
return lines.join("\n");
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* Handle plan.create / task.update inline. These are session-scoped and
|
|
448
|
-
* persisted via the plan store so the user can view the plan (Ctrl+P) and
|
|
449
|
-
* the agent keeps it in context across the whole session.
|
|
450
|
-
*/
|
|
451
|
-
export async function handlePlanTool(call, session, ctx) {
|
|
452
|
-
const autoApprove = Boolean(ctx.autoApprove);
|
|
453
|
-
void ctx.loopGuard;
|
|
454
|
-
void ctx.step;
|
|
455
|
-
// Defensive init for the sync-guard holders (legacy/hand-built policies).
|
|
456
|
-
if (!session.pendingDependency)
|
|
457
|
-
session.pendingDependency = { value: undefined };
|
|
458
|
-
if (!session.pendingTaskBatch)
|
|
459
|
-
session.pendingTaskBatch = { value: undefined };
|
|
460
|
-
if (call.name === "plan.create") {
|
|
461
|
-
const goal = normalizePlanGoal(call.args);
|
|
462
|
-
const detail = normalizePlanDetail(call.args);
|
|
463
|
-
const kind = normalizePlanKind(call.args);
|
|
464
|
-
const taskEntries = normalizePlanTaskEntries(call.args);
|
|
465
|
-
const taskTitles = taskEntries.map((t) => t.title);
|
|
466
|
-
if (!goal || taskTitles.length === 0) {
|
|
467
|
-
return {
|
|
468
|
-
handled: true,
|
|
469
|
-
ok: false,
|
|
470
|
-
display: chalk.red(" ✗ plan.create needs a non-empty goal and at least one task title\n"),
|
|
471
|
-
modelNote: "plan.create failed: provide a string goal and a non-empty tasks array. " +
|
|
472
|
-
'Accepted task shapes: ["step 1","step 2"] or [{"title":"step 1"},{"id":"t1","title":"step 2"}]. ' +
|
|
473
|
-
'Example: {"name":"plan.create","args":{"goal":"Assess example.com","detail":"…","tasks":["DNS enum","Port scan","HTTP fingerprint"],"kind":"pentest"}}',
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
// Reject a low-quality "everything in one step" plan. A single task that
|
|
477
|
-
// itself enumerates many files/actions (commas, "and", slashes) is a sign
|
|
478
|
-
// the model lumped the whole build into one checkbox — split it so the
|
|
479
|
-
// user gets a real, trackable checklist and the executor works step by step.
|
|
480
|
-
if (isLumpedSingleTask(taskTitles)) {
|
|
481
|
-
return {
|
|
482
|
-
handled: true,
|
|
483
|
-
ok: false,
|
|
484
|
-
display: chalk.red(" ✗ plan.create: that single task lumps the whole build into one step\n"),
|
|
485
|
-
modelNote: "plan.create rejected: you put everything into ONE task. Break it into separate " +
|
|
486
|
-
"ordered tasks — each a distinct action (scaffold, implement feature, install, run/verify). " +
|
|
487
|
-
"Call plan.create again with a proper tasks array.",
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
const existingPlan = await loadPlan(session.sessionId).catch(() => undefined);
|
|
491
|
-
// X12: do not open a second full plan just to run an existing app.
|
|
492
|
-
if (existingPlan &&
|
|
493
|
-
(existingPlan.status === "completed" ||
|
|
494
|
-
existingPlan.tasks.every((t) => t.state === "done" || t.state === "skipped" || t.state === "failed")) &&
|
|
495
|
-
looksLikeRunOnlyGoal(goal, detail)) {
|
|
496
|
-
return {
|
|
497
|
-
handled: true,
|
|
498
|
-
ok: false,
|
|
499
|
-
display: chalk.yellow(" ⚠ plan.create skipped — use tools to run the existing app\n"),
|
|
500
|
-
modelNote: "plan.create rejected: the previous plan is already finished and this goal is only run/verify. " +
|
|
501
|
-
"Do NOT create a new plan or re-list old scaffold tasks. " +
|
|
502
|
-
"Just shell.start the dev server, shell.tail until ready, probe localhost " +
|
|
503
|
-
"(curl or http.fetch with iOwnThis:true), LEAVE the server running, and tell the user " +
|
|
504
|
-
"the URL (http://localhost:<port>), port, and job id.",
|
|
505
|
-
};
|
|
506
|
-
}
|
|
507
|
-
const appendingToActivePlan = existingPlan &&
|
|
508
|
-
existingPlan.status !== "draft" &&
|
|
509
|
-
!isPlanTerminal(existingPlan) &&
|
|
510
|
-
(session.planApproved.value ||
|
|
511
|
-
existingPlan.status === "approved" ||
|
|
512
|
-
existingPlan.status === "in_progress");
|
|
513
|
-
if (appendingToActivePlan) {
|
|
514
|
-
const priorIds = new Set(existingPlan.tasks.map((task) => task.id));
|
|
515
|
-
let invalidDependency;
|
|
516
|
-
const appended = await mutatePlan(existingPlan.sessionId, (draft) => {
|
|
517
|
-
let changed = false;
|
|
518
|
-
let previousForegroundId = [...draft.tasks]
|
|
519
|
-
.reverse()
|
|
520
|
-
.find((task) => !task.responderOwned)?.id;
|
|
521
|
-
for (const entry of taskEntries) {
|
|
522
|
-
if (isBareTaskIdTitle(entry.title) ||
|
|
523
|
-
draft.tasks.some((task) => titlesMatchForPlan(task.title, entry.title))) {
|
|
524
|
-
continue;
|
|
525
|
-
}
|
|
526
|
-
const dependencies = entry.dependenciesSpecified
|
|
527
|
-
? entry.dependencies.map((reference) => {
|
|
528
|
-
const resolved = resolvePlanTaskId(draft, reference);
|
|
529
|
-
if (!resolved)
|
|
530
|
-
invalidDependency = reference;
|
|
531
|
-
return resolved;
|
|
532
|
-
})
|
|
533
|
-
: previousForegroundId
|
|
534
|
-
? [previousForegroundId]
|
|
535
|
-
: [];
|
|
536
|
-
if (invalidDependency)
|
|
537
|
-
return false;
|
|
538
|
-
const task = appendPlanTask(draft, {
|
|
539
|
-
title: entry.title,
|
|
540
|
-
state: "pending",
|
|
541
|
-
aliases: entry.aliases,
|
|
542
|
-
dependencies: dependencies.filter((dependency) => Boolean(dependency)),
|
|
543
|
-
resourceLocks: entry.resourceLocks,
|
|
544
|
-
});
|
|
545
|
-
previousForegroundId = task.id;
|
|
546
|
-
changed = true;
|
|
547
|
-
}
|
|
548
|
-
return changed;
|
|
549
|
-
}).catch(() => undefined);
|
|
550
|
-
if (!appended?.ok || !appended.plan) {
|
|
551
|
-
const reason = invalidDependency
|
|
552
|
-
? `unknown dependency "${invalidDependency}"`
|
|
553
|
-
: "every proposed task already exists in ACTIVE PLAN";
|
|
554
|
-
return {
|
|
555
|
-
handled: true,
|
|
556
|
-
ok: false,
|
|
557
|
-
display: chalk.yellow(` ⚠ plan.create kept the active plan — ${reason}\n`),
|
|
558
|
-
modelNote: `plan.create did not replace ACTIVE PLAN: ${reason}. ` +
|
|
559
|
-
"Continue its current in_progress task. Use task.add once per genuinely new task; never recreate or renumber active work.",
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
session.planApproved.value = true;
|
|
563
|
-
const addedTasks = appended.plan.tasks.filter((task) => !priorIds.has(task.id));
|
|
564
|
-
const checklist = renderPlanForTerminal(appended.plan);
|
|
565
|
-
return {
|
|
566
|
-
handled: true,
|
|
567
|
-
ok: true,
|
|
568
|
-
plan: appended.plan,
|
|
569
|
-
display: chalk.cyan(" ● active plan extended (append-only)\n") +
|
|
570
|
-
checklist +
|
|
571
|
-
"\n" +
|
|
572
|
-
chalk.dim(` ✦ preserved all existing ids/states; appended ${addedTasks.length} new task(s).\n`),
|
|
573
|
-
modelNote: `ACTIVE PLAN was preserved and ${addedTasks.length} genuinely new task(s) were appended as ${addedTasks.map((task) => task.id).join(", ")}. ` +
|
|
574
|
-
"Continue the existing in_progress task first. For later discoveries use task.add, not plan.create; never re-run completed work.",
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
const revisablePlan = existingPlan &&
|
|
578
|
-
(!isPlanTerminal(existingPlan) ||
|
|
579
|
-
titlesMatchForPlan(existingPlan.goal, goal))
|
|
580
|
-
? existingPlan
|
|
581
|
-
: undefined;
|
|
582
|
-
// Preserve authored task count/order. Build, install, and verification
|
|
583
|
-
// evidence may span tasks; the runtime must not inject regex-derived
|
|
584
|
-
// checkpoints that change IDs or make progress diverge from the plan.
|
|
585
|
-
const normalizedTitles = revisablePlan
|
|
586
|
-
? taskTitles
|
|
587
|
-
: normalizeCodingPlanTasks(kind, goal, detail, taskTitles);
|
|
588
|
-
const root = getActiveProjectRoot();
|
|
589
|
-
const pm = root ? detectPackageManager(root) : undefined;
|
|
590
|
-
const meta = root || revisablePlan?.meta
|
|
591
|
-
? {
|
|
592
|
-
...(revisablePlan?.meta ?? {}),
|
|
593
|
-
...(root ? { projectRoot: root } : {}),
|
|
594
|
-
...(pm ? { packageManager: pm } : {}),
|
|
595
|
-
}
|
|
596
|
-
: undefined;
|
|
597
|
-
const plan = createPlan({
|
|
598
|
-
sessionId: session.sessionId,
|
|
599
|
-
goal,
|
|
600
|
-
detail,
|
|
601
|
-
taskTitles: normalizedTitles,
|
|
602
|
-
kind,
|
|
603
|
-
meta,
|
|
604
|
-
});
|
|
605
|
-
// Attach model-supplied slug aliases so task.update can resolve them (X3).
|
|
606
|
-
for (let i = 0; i < plan.tasks.length; i++) {
|
|
607
|
-
const aliases = taskEntries[i]?.aliases ?? [];
|
|
608
|
-
if (aliases.length)
|
|
609
|
-
plan.tasks[i].aliases = aliases;
|
|
610
|
-
const locks = taskEntries[i]?.resourceLocks ?? [];
|
|
611
|
-
if (locks.length)
|
|
612
|
-
plan.tasks[i].resourceLocks = locks;
|
|
613
|
-
const acceptanceCriteria = taskEntries[i]?.acceptanceCriteria;
|
|
614
|
-
if (acceptanceCriteria)
|
|
615
|
-
plan.tasks[i].acceptanceCriteria = acceptanceCriteria;
|
|
616
|
-
}
|
|
617
|
-
for (let i = 0; i < plan.tasks.length; i++) {
|
|
618
|
-
const rawDependencies = taskEntries[i]?.dependencies ?? [];
|
|
619
|
-
const dependencies = rawDependencies.map((dependency) => resolvePlanTaskId(plan, dependency) ?? dependency);
|
|
620
|
-
if (taskEntries[i]?.dependenciesSpecified) {
|
|
621
|
-
plan.tasks[i].dependencies = [...new Set(dependencies)];
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
let additiveOnly = false;
|
|
625
|
-
if (revisablePlan) {
|
|
626
|
-
plan.version = (revisablePlan.version ?? 1) + 1;
|
|
627
|
-
const usedOldIds = new Set();
|
|
628
|
-
const matchedIndices = new Set();
|
|
629
|
-
const mappedNewTasks = plan.tasks.map((task, index) => {
|
|
630
|
-
const match = revisablePlan.tasks.find((t) => !usedOldIds.has(t.id) && titlesMatchForPlan(t.title, task.title));
|
|
631
|
-
if (match) {
|
|
632
|
-
usedOldIds.add(match.id);
|
|
633
|
-
matchedIndices.add(index);
|
|
634
|
-
return {
|
|
635
|
-
...task,
|
|
636
|
-
id: match.id,
|
|
637
|
-
state: match.state,
|
|
638
|
-
note: match.note,
|
|
639
|
-
acceptanceCriteria: task.acceptanceCriteria ?? match.acceptanceCriteria,
|
|
640
|
-
evidence: match.evidence,
|
|
641
|
-
parentTaskId: match.parentTaskId,
|
|
642
|
-
jobId: match.jobId,
|
|
643
|
-
processId: match.processId,
|
|
644
|
-
responderOwned: match.responderOwned,
|
|
645
|
-
};
|
|
646
|
-
}
|
|
647
|
-
return task;
|
|
648
|
-
});
|
|
649
|
-
// Free ids for unmatched tasks only. Matched tasks keep prior ids;
|
|
650
|
-
// new createPlan ids must not collide (e.g. t3 new step vs remapped Verify→t3).
|
|
651
|
-
const taken = new Set([...matchedIndices].map((i) => mappedNewTasks[i].id));
|
|
652
|
-
for (let i = 0; i < mappedNewTasks.length; i++) {
|
|
653
|
-
if (matchedIndices.has(i))
|
|
654
|
-
continue;
|
|
655
|
-
const task = mappedNewTasks[i];
|
|
656
|
-
if (taken.has(task.id)) {
|
|
657
|
-
let id = nextTaskId([...taken]);
|
|
658
|
-
while (taken.has(id))
|
|
659
|
-
id = nextTaskId([...taken, id]);
|
|
660
|
-
task.id = id;
|
|
661
|
-
}
|
|
662
|
-
taken.add(task.id);
|
|
663
|
-
}
|
|
664
|
-
// Draft (awaiting accept): plan.create is an authoritative rewrite.
|
|
665
|
-
// Keeping unmatched old pending tasks made "suggest changes" leave
|
|
666
|
-
// obsolete steps (e.g. Prisma/JWT) beside the revised frontend list.
|
|
667
|
-
const isDraftRewrite = revisablePlan.status === "draft" && !session.planApproved.value;
|
|
668
|
-
if (isDraftRewrite) {
|
|
669
|
-
plan.tasks = mappedNewTasks.filter((t) => !isBareTaskIdTitle(t.title));
|
|
670
|
-
}
|
|
671
|
-
else {
|
|
672
|
-
// Post-approval / mid-execution: preserve finished work not re-listed;
|
|
673
|
-
// drop unmatched pending; soft-skip unmatched in_progress.
|
|
674
|
-
const oldTasksToKeep = revisablePlan.tasks
|
|
675
|
-
.filter((oldTask) => !isBareTaskIdTitle(oldTask.title) &&
|
|
676
|
-
!mappedNewTasks.some((newTask) => titlesMatchForPlan(oldTask.title, newTask.title)))
|
|
677
|
-
.map((oldTask) => {
|
|
678
|
-
if (oldTask.responderOwned)
|
|
679
|
-
return oldTask;
|
|
680
|
-
if (oldTask.state === "done" ||
|
|
681
|
-
oldTask.state === "skipped" ||
|
|
682
|
-
oldTask.state === "failed") {
|
|
683
|
-
return oldTask;
|
|
684
|
-
}
|
|
685
|
-
if (oldTask.state === "in_progress") {
|
|
686
|
-
return {
|
|
687
|
-
...oldTask,
|
|
688
|
-
state: "skipped",
|
|
689
|
-
note: oldTask.note ?? "superseded by plan revision",
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
// Unmatched pending → obsolete after rewrite; drop.
|
|
693
|
-
return null;
|
|
694
|
-
})
|
|
695
|
-
.filter((t) => Boolean(t));
|
|
696
|
-
plan.tasks = [...oldTasksToKeep, ...mappedNewTasks].filter((t) => !isBareTaskIdTitle(t.title));
|
|
697
|
-
}
|
|
698
|
-
// Map input-facing references (positional t1.., aliases, titles) → final ids.
|
|
699
|
-
// Positional keys must win over identity: a remapped task may keep id "t3"
|
|
700
|
-
// while input "t3" still means "third item in this plan.create call".
|
|
701
|
-
const finalIdByInputReference = new Map();
|
|
702
|
-
for (let index = 0; index < mappedNewTasks.length; index += 1) {
|
|
703
|
-
const task = mappedNewTasks[index];
|
|
704
|
-
const entry = taskEntries[index];
|
|
705
|
-
finalIdByInputReference.set(task.id, task.id);
|
|
706
|
-
finalIdByInputReference.set(slugifyTaskId(task.title), task.id);
|
|
707
|
-
for (const alias of entry?.aliases ?? []) {
|
|
708
|
-
finalIdByInputReference.set(alias, task.id);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
for (let index = 0; index < mappedNewTasks.length; index += 1) {
|
|
712
|
-
finalIdByInputReference.set(`t${index + 1}`, mappedNewTasks[index].id);
|
|
713
|
-
}
|
|
714
|
-
for (let index = 0; index < mappedNewTasks.length; index += 1) {
|
|
715
|
-
const task = mappedNewTasks[index];
|
|
716
|
-
const entry = taskEntries[index];
|
|
717
|
-
// Default chain: depend on the previous task in THIS create call by
|
|
718
|
-
// its final id (not positional tN, which collides after id remap).
|
|
719
|
-
const references = entry?.dependenciesSpecified
|
|
720
|
-
? entry.dependencies
|
|
721
|
-
: index > 0
|
|
722
|
-
? [mappedNewTasks[index - 1].id]
|
|
723
|
-
: [];
|
|
724
|
-
task.dependencies = [
|
|
725
|
-
...new Set(references
|
|
726
|
-
.map((reference) => finalIdByInputReference.get(reference) ??
|
|
727
|
-
resolvePlanTaskId(plan, reference) ??
|
|
728
|
-
reference)
|
|
729
|
-
.filter((id) => id !== task.id)),
|
|
730
|
-
];
|
|
731
|
-
}
|
|
732
|
-
// X7: keep approval when only additive pending work remains.
|
|
733
|
-
const priorFinished = revisablePlan.tasks.filter((t) => t.state === "done" || t.state === "skipped" || t.state === "failed");
|
|
734
|
-
const finishedStillFinished = priorFinished.length > 0 &&
|
|
735
|
-
priorFinished.every((old) => plan.tasks.some((n) => titlesMatchForPlan(old.title, n.title) &&
|
|
736
|
-
(n.state === "done" ||
|
|
737
|
-
n.state === "skipped" ||
|
|
738
|
-
n.state === "failed")));
|
|
739
|
-
const hasNewPending = plan.tasks.some((t) => t.state === "pending");
|
|
740
|
-
const noDoneReopened = !plan.tasks.some((n) => {
|
|
741
|
-
const old = revisablePlan.tasks.find((t) => titlesMatchForPlan(t.title, n.title));
|
|
742
|
-
return (old &&
|
|
743
|
-
(old.state === "done" || old.state === "skipped") &&
|
|
744
|
-
n.state === "pending");
|
|
745
|
-
});
|
|
746
|
-
additiveOnly =
|
|
747
|
-
finishedStillFinished &&
|
|
748
|
-
hasNewPending &&
|
|
749
|
-
noDoneReopened &&
|
|
750
|
-
(session.planApproved.value ||
|
|
751
|
-
revisablePlan.status === "approved" ||
|
|
752
|
-
revisablePlan.status === "in_progress" ||
|
|
753
|
-
revisablePlan.status === "completed");
|
|
754
|
-
if (additiveOnly) {
|
|
755
|
-
plan.status = "in_progress";
|
|
756
|
-
plan.createdAt = revisablePlan.createdAt;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
// After id remaps, re-derive a sane sequential DAG from list order so
|
|
760
|
-
// remapped ids never leave edges like t2 → t9 (forward / circular mess).
|
|
761
|
-
normalizeTaskDependencies(plan.tasks);
|
|
762
|
-
const dag = validateSessionPlan(plan);
|
|
763
|
-
if (!dag.ok) {
|
|
764
|
-
// Last resort: pure linear chain by list order, then re-validate.
|
|
765
|
-
for (let i = 0; i < plan.tasks.length; i++) {
|
|
766
|
-
plan.tasks[i].dependencies = i > 0 ? [plan.tasks[i - 1].id] : [];
|
|
767
|
-
}
|
|
768
|
-
const again = validateSessionPlan(plan);
|
|
769
|
-
if (!again.ok) {
|
|
770
|
-
return {
|
|
771
|
-
handled: true,
|
|
772
|
-
ok: false,
|
|
773
|
-
display: chalk.red(` ✗ plan.create: invalid dependency graph — ${again.reason}\n`),
|
|
774
|
-
modelNote: `plan.create failed: ${again.reason}. Use only declared task ids/aliases and remove dependency cycles.`,
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
if (additiveOnly) {
|
|
779
|
-
session.planApproved.value = true;
|
|
780
|
-
plan.status = "in_progress";
|
|
781
|
-
}
|
|
782
|
-
else if (autoApprove) {
|
|
783
|
-
session.planApproved.value = true;
|
|
784
|
-
plan.status = "approved";
|
|
785
|
-
}
|
|
786
|
-
else {
|
|
787
|
-
session.planApproved.value = false;
|
|
788
|
-
}
|
|
789
|
-
// A revision is a foreground snapshot; responder children keep
|
|
790
|
-
// their process-authoritative state. A brand-new plan has nothing stored
|
|
791
|
-
// yet, so fall back to a plain create.
|
|
792
|
-
const revised = await mutatePlan(plan.sessionId, (draft) => {
|
|
793
|
-
applyForegroundSnapshot(draft, plan);
|
|
794
|
-
return true;
|
|
795
|
-
}).catch(() => undefined);
|
|
796
|
-
if (!revised?.ok) {
|
|
797
|
-
await savePlan(plan).catch(() => undefined);
|
|
798
|
-
}
|
|
799
|
-
else if (revised.plan) {
|
|
800
|
-
plan.tasks = revised.plan.tasks;
|
|
801
|
-
plan.version = revised.plan.version;
|
|
802
|
-
}
|
|
803
|
-
const checklist = renderPlanForTerminal(plan);
|
|
804
|
-
const display = additiveOnly
|
|
805
|
-
? chalk.cyan(" ● plan updated (additive)\n") +
|
|
806
|
-
checklist +
|
|
807
|
-
"\n" +
|
|
808
|
-
chalk.dim(" ✦ done tasks preserved — continue from the first pending task only.\n" +
|
|
809
|
-
" Do NOT re-run completed scaffold/build work.\n")
|
|
810
|
-
: autoApprove
|
|
811
|
-
? chalk.cyan(" ● plan created (auto-approved)\n") +
|
|
812
|
-
checklist +
|
|
813
|
-
"\n" +
|
|
814
|
-
chalk.dim(" ✦ plan approved in agent mode — continue executing task by task.\n")
|
|
815
|
-
: chalk.cyan(" ● planning\n") +
|
|
816
|
-
checklist +
|
|
817
|
-
"\n" +
|
|
818
|
-
chalk.dim(" ✦ plan created — Accept to run, Discard, View, or Suggest changes\n" +
|
|
819
|
-
" (/implement, /discard, Ctrl+P also work).\n");
|
|
820
|
-
const firstPending = readyPlanTasks(plan)[0];
|
|
821
|
-
return {
|
|
822
|
-
handled: true,
|
|
823
|
-
ok: true,
|
|
824
|
-
plan,
|
|
825
|
-
display,
|
|
826
|
-
modelNote: additiveOnly
|
|
827
|
-
? `Plan updated with additive task(s); ${plan.tasks.filter((t) => t.state === "done" || t.state === "skipped").length} prior task(s) stay done. ` +
|
|
828
|
-
"Do NOT re-execute completed tasks (no re-scaffold). " +
|
|
829
|
-
(firstPending
|
|
830
|
-
? `Continue from [${firstPending.id}] "${firstPending.title}" only. `
|
|
831
|
-
: "") +
|
|
832
|
-
"If the only new work is run/verify on an existing app, prefer shell.start + probe + report URL — " +
|
|
833
|
-
"do not reboot the world. When the run/verify task finishes, final message MUST include " +
|
|
834
|
-
"http://localhost:<port>, port, job id, and that the server is still running."
|
|
835
|
-
: autoApprove
|
|
836
|
-
? `Plan saved and approved with ${plan.tasks.length} task(s). Execute now. ` +
|
|
837
|
-
(firstPending
|
|
838
|
-
? `Start with [${firstPending.id}] "${firstPending.title}". `
|
|
839
|
-
: "") +
|
|
840
|
-
"task.update in_progress → work → verify → done. When run/verify completes: report URL, port, job id, server still running."
|
|
841
|
-
: `Plan saved with ${plan.tasks.length} task(s). STOP here and wait — produce NO other tool calls now. ` +
|
|
842
|
-
"Do NOT start executing until the user accepts the plan. " +
|
|
843
|
-
"If the user's next message gives feedback, that is a REVISION: call plan.create once with the COMPLETE " +
|
|
844
|
-
"updated goal/detail/tasks (full list — omit obsolete steps; do not leave old backend/DB tasks when " +
|
|
845
|
-
"the user dropped them). Then STOP again. Be decisive; do not monologue alternatives. " +
|
|
846
|
-
"The user may discard the plan. After acceptance: task.update in_progress → work → verify → done. " +
|
|
847
|
-
"When run/verify completes: report URL, port, job id, and that the server is still running.",
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
if (call.name === "plan.clear") {
|
|
851
|
-
const plan = await loadPlan(session.sessionId).catch(() => undefined);
|
|
852
|
-
if (!plan) {
|
|
853
|
-
return {
|
|
854
|
-
handled: true,
|
|
855
|
-
ok: false,
|
|
856
|
-
display: chalk.red(" ✗ plan.clear: no active plan to clear\n"),
|
|
857
|
-
modelNote: "plan.clear failed: there is no active plan.",
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
const activeResponder = plan.tasks.find((task) => task.responderOwned &&
|
|
861
|
-
(task.state === "pending" || task.state === "in_progress"));
|
|
862
|
-
if (activeResponder) {
|
|
863
|
-
return {
|
|
864
|
-
handled: true,
|
|
865
|
-
ok: false,
|
|
866
|
-
display: chalk.yellow(` ⚠ plan.clear: [${activeResponder.id}] is still owned by an active Responder job\n`),
|
|
867
|
-
modelNote: `plan.clear held: [${activeResponder.id}] "${activeResponder.title}" is still responder-owned and active. ` +
|
|
868
|
-
"Wait for it to settle before clearing the plan so its result is not orphaned.",
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
|
-
try {
|
|
872
|
-
await deletePlan(session.sessionId);
|
|
873
|
-
}
|
|
874
|
-
catch {
|
|
875
|
-
return {
|
|
876
|
-
handled: true,
|
|
877
|
-
ok: false,
|
|
878
|
-
display: chalk.red(" ✗ plan.clear: could not remove the active plan\n"),
|
|
879
|
-
modelNote: "plan.clear failed: the plan could not be durably removed. The active plan remains unchanged.",
|
|
880
|
-
};
|
|
881
|
-
}
|
|
882
|
-
session.planApproved.value = false;
|
|
883
|
-
return {
|
|
884
|
-
handled: true,
|
|
885
|
-
ok: true,
|
|
886
|
-
cleared: true,
|
|
887
|
-
display: chalk.dim(" ✦ plan cleared — no active plan\n"),
|
|
888
|
-
modelNote: "Plan cleared. No active plan exists for this session; the task checklist and approval state were discarded. " +
|
|
889
|
-
"Continue without a plan, or call plan.create only if a fresh durable plan is genuinely needed.",
|
|
890
|
-
};
|
|
891
|
-
}
|
|
892
|
-
// task.add / task.update
|
|
893
|
-
const plan = await loadPlan(session.sessionId).catch(() => undefined);
|
|
894
|
-
if (!plan) {
|
|
895
|
-
return {
|
|
896
|
-
handled: true,
|
|
897
|
-
ok: false,
|
|
898
|
-
display: chalk.red(` ✗ ${call.name}: no active plan — call plan.create first\n`),
|
|
899
|
-
modelNote: `${call.name} failed: there is no active plan. Call plan.create first.`,
|
|
900
|
-
};
|
|
901
|
-
}
|
|
902
|
-
if (call.name === "task.move") {
|
|
903
|
-
const taskRaw = typeof call.args.taskId === "string" ? call.args.taskId.trim() : "";
|
|
904
|
-
const taskId = resolvePlanTaskId(plan, taskRaw) ?? taskRaw;
|
|
905
|
-
const beforeRaw = typeof call.args.beforeTaskId === "string"
|
|
906
|
-
? call.args.beforeTaskId.trim()
|
|
907
|
-
: "";
|
|
908
|
-
const afterRaw = typeof call.args.afterTaskId === "string"
|
|
909
|
-
? call.args.afterTaskId.trim()
|
|
910
|
-
: "";
|
|
911
|
-
const position = typeof call.args.position === "number" ? call.args.position : undefined;
|
|
912
|
-
const selectors = [Boolean(beforeRaw), Boolean(afterRaw), position !== undefined]
|
|
913
|
-
.filter(Boolean).length;
|
|
914
|
-
if (!plan.tasks.some((task) => task.id === taskId) || selectors !== 1) {
|
|
915
|
-
return {
|
|
916
|
-
handled: true,
|
|
917
|
-
ok: false,
|
|
918
|
-
display: chalk.red(" ✗ task.move needs a valid taskId and exactly one destination\n"),
|
|
919
|
-
modelNote: "task.move failed: use a valid taskId plus exactly one of position, beforeTaskId, or afterTaskId.",
|
|
920
|
-
};
|
|
921
|
-
}
|
|
922
|
-
const remaining = plan.tasks.filter((task) => task.id !== taskId);
|
|
923
|
-
let index = 0;
|
|
924
|
-
if (position !== undefined) {
|
|
925
|
-
if (!Number.isInteger(position) || position < 1) {
|
|
926
|
-
return {
|
|
927
|
-
handled: true,
|
|
928
|
-
ok: false,
|
|
929
|
-
display: chalk.red(" ✗ task.move position must be a positive integer\n"),
|
|
930
|
-
modelNote: "task.move failed: position is one-based and must be a positive integer.",
|
|
931
|
-
};
|
|
932
|
-
}
|
|
933
|
-
index = Math.min(position - 1, remaining.length);
|
|
934
|
-
}
|
|
935
|
-
else {
|
|
936
|
-
const anchorRaw = beforeRaw || afterRaw;
|
|
937
|
-
const anchorId = resolvePlanTaskId(plan, anchorRaw) ?? anchorRaw;
|
|
938
|
-
if (anchorId === taskId || !remaining.some((task) => task.id === anchorId)) {
|
|
939
|
-
return {
|
|
940
|
-
handled: true,
|
|
941
|
-
ok: false,
|
|
942
|
-
display: chalk.red(` ✗ task.move: invalid anchor "${anchorRaw}"\n`),
|
|
943
|
-
modelNote: `task.move failed: "${anchorRaw}" is not a different task in ACTIVE PLAN.`,
|
|
944
|
-
};
|
|
945
|
-
}
|
|
946
|
-
const anchorIndex = remaining.findIndex((task) => task.id === anchorId);
|
|
947
|
-
index = beforeRaw ? anchorIndex : anchorIndex + 1;
|
|
948
|
-
}
|
|
949
|
-
const updated = applySessionPlanOperation(plan, {
|
|
950
|
-
type: "moveTask",
|
|
951
|
-
expectedVersion: plan.version ?? 1,
|
|
952
|
-
stepId: taskId,
|
|
953
|
-
index,
|
|
954
|
-
});
|
|
955
|
-
await mutatePlan(plan.sessionId, (draft) => {
|
|
956
|
-
applyForegroundSnapshot(draft, updated);
|
|
957
|
-
return true;
|
|
958
|
-
}).catch(() => undefined);
|
|
959
|
-
return {
|
|
960
|
-
handled: true,
|
|
961
|
-
ok: true,
|
|
962
|
-
plan: updated,
|
|
963
|
-
display: renderPlanForTerminal(updated) + "\n",
|
|
964
|
-
modelNote: `Moved [${taskId}] to position ${updated.tasks.findIndex((task) => task.id === taskId) + 1}. ` +
|
|
965
|
-
"Task id, state, evidence, dependencies, and responder linkage were preserved.",
|
|
966
|
-
};
|
|
967
|
-
}
|
|
968
|
-
if (call.name === "task.add") {
|
|
969
|
-
const title = normalizeTaskTitle(call.args.title ?? call.args.task ?? call.args.name);
|
|
970
|
-
if (!title || isBareTaskIdTitle(title)) {
|
|
971
|
-
return {
|
|
972
|
-
handled: true,
|
|
973
|
-
ok: false,
|
|
974
|
-
display: chalk.red(" ✗ task.add needs a descriptive title\n"),
|
|
975
|
-
modelNote: "task.add failed: provide a descriptive title, not a bare task id.",
|
|
976
|
-
};
|
|
977
|
-
}
|
|
978
|
-
const parentRaw = typeof call.args.parentTaskId === "string"
|
|
979
|
-
? call.args.parentTaskId
|
|
980
|
-
: typeof call.args.parentId === "string"
|
|
981
|
-
? call.args.parentId
|
|
982
|
-
: undefined;
|
|
983
|
-
const parentTaskId = parentRaw
|
|
984
|
-
? resolvePlanTaskId(plan, parentRaw)
|
|
985
|
-
: undefined;
|
|
986
|
-
if (parentRaw && !parentTaskId) {
|
|
987
|
-
return {
|
|
988
|
-
handled: true,
|
|
989
|
-
ok: false,
|
|
990
|
-
display: chalk.red(` ✗ task.add: unknown parent "${parentRaw}"\n`),
|
|
991
|
-
modelNote: `task.add failed: unknown parentTaskId "${parentRaw}". Use a canonical id from ACTIVE PLAN.`,
|
|
992
|
-
};
|
|
993
|
-
}
|
|
994
|
-
const stringArray = (value) => Array.isArray(value)
|
|
995
|
-
? [...new Set(value.filter((item) => typeof item === "string").map((item) => item.trim()).filter(Boolean))]
|
|
996
|
-
: [];
|
|
997
|
-
const dependencies = stringArray(call.args.dependencies ?? call.args.dependsOn).map((dependency) => resolvePlanTaskId(plan, dependency) ?? dependency);
|
|
998
|
-
const unknownDependency = dependencies.find((dependency) => !plan.tasks.some((task) => task.id === dependency));
|
|
999
|
-
if (unknownDependency) {
|
|
1000
|
-
return {
|
|
1001
|
-
handled: true,
|
|
1002
|
-
ok: false,
|
|
1003
|
-
display: chalk.red(` ✗ task.add: unknown dependency "${unknownDependency}"\n`),
|
|
1004
|
-
modelNote: `task.add failed: unknown dependency "${unknownDependency}". Use canonical ids from ACTIVE PLAN.`,
|
|
1005
|
-
};
|
|
1006
|
-
}
|
|
1007
|
-
const tasksBeforeAdd = plan.tasks.map((candidate) => ({
|
|
1008
|
-
...candidate,
|
|
1009
|
-
dependencies: [...(candidate.dependencies ?? [])],
|
|
1010
|
-
resourceLocks: [...(candidate.resourceLocks ?? [])],
|
|
1011
|
-
}));
|
|
1012
|
-
const statusBeforeAdd = plan.status;
|
|
1013
|
-
const versionBeforeAdd = plan.version;
|
|
1014
|
-
const updatedAtBeforeAdd = plan.updatedAt;
|
|
1015
|
-
const task = appendPlanTask(plan, {
|
|
1016
|
-
title,
|
|
1017
|
-
state: "pending",
|
|
1018
|
-
note: typeof call.args.note === "string" ? call.args.note : undefined,
|
|
1019
|
-
acceptanceCriteria: typeof call.args.acceptanceCriteria === "string"
|
|
1020
|
-
? call.args.acceptanceCriteria.trim()
|
|
1021
|
-
: typeof call.args.acceptance === "string"
|
|
1022
|
-
? call.args.acceptance.trim()
|
|
1023
|
-
: undefined,
|
|
1024
|
-
aliases: [slugifyTaskId(title)].filter(Boolean),
|
|
1025
|
-
dependencies,
|
|
1026
|
-
resourceLocks: stringArray(call.args.resourceLocks ?? call.args.resources),
|
|
1027
|
-
parentTaskId,
|
|
1028
|
-
});
|
|
1029
|
-
let reportDeferral = "";
|
|
1030
|
-
if (classifyTaskTitle(task.title, { planKind: plan.kind }) !== "report") {
|
|
1031
|
-
const report = plan.tasks.find((candidate) => !candidate.responderOwned &&
|
|
1032
|
-
classifyTaskTitle(candidate.title, { planKind: plan.kind }) === "report");
|
|
1033
|
-
if (report &&
|
|
1034
|
-
report.id !== task.id &&
|
|
1035
|
-
report.state !== "done" &&
|
|
1036
|
-
report.state !== "skipped" &&
|
|
1037
|
-
!task.dependencies?.includes(report.id)) {
|
|
1038
|
-
const taskIndex = plan.tasks.findIndex((candidate) => candidate.id === task.id);
|
|
1039
|
-
plan.tasks.splice(taskIndex, 1);
|
|
1040
|
-
const reportIndex = plan.tasks.findIndex((candidate) => candidate.id === report.id);
|
|
1041
|
-
plan.tasks.splice(reportIndex, 0, task);
|
|
1042
|
-
report.dependencies = [...new Set([...(report.dependencies ?? []), task.id])];
|
|
1043
|
-
if (report.state === "in_progress")
|
|
1044
|
-
report.state = "pending";
|
|
1045
|
-
report.note = report.note
|
|
1046
|
-
? `${report.note}; deferred for newly discovered work ${task.id}`
|
|
1047
|
-
: `deferred for newly discovered work ${task.id}`;
|
|
1048
|
-
reportDeferral = ` Report [${report.id}] was deferred behind this new work.`;
|
|
1049
|
-
}
|
|
1050
|
-
else if (report?.state === "done") {
|
|
1051
|
-
const update = appendPlanTask(plan, {
|
|
1052
|
-
title: `Update final report with findings from ${task.id}`,
|
|
1053
|
-
state: "pending",
|
|
1054
|
-
aliases: [],
|
|
1055
|
-
dependencies: [task.id],
|
|
1056
|
-
resourceLocks: [],
|
|
1057
|
-
note: `final report update after newly discovered work ${task.id}`,
|
|
1058
|
-
});
|
|
1059
|
-
reportDeferral = ` Added [${update.id}] to update the completed report after this work.`;
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
if (session.planApproved.value &&
|
|
1063
|
-
(plan.status === "approved" || plan.status === "completed" || plan.status === "abandoned")) {
|
|
1064
|
-
plan.status = "in_progress";
|
|
1065
|
-
}
|
|
1066
|
-
const validation = validateSessionPlan(plan);
|
|
1067
|
-
if (!validation.ok) {
|
|
1068
|
-
plan.tasks = tasksBeforeAdd;
|
|
1069
|
-
plan.status = statusBeforeAdd;
|
|
1070
|
-
plan.version = versionBeforeAdd;
|
|
1071
|
-
plan.updatedAt = updatedAtBeforeAdd;
|
|
1072
|
-
return {
|
|
1073
|
-
handled: true,
|
|
1074
|
-
ok: false,
|
|
1075
|
-
display: chalk.red(` ✗ task.add: ${validation.reason}\n`),
|
|
1076
|
-
modelNote: `task.add failed: ${validation.reason}.`,
|
|
1077
|
-
};
|
|
1078
|
-
}
|
|
1079
|
-
// Apply the authored foreground layout onto fresh state so a
|
|
1080
|
-
// concurrent responder settlement is preserved.
|
|
1081
|
-
await mutatePlan(plan.sessionId, (draft) => {
|
|
1082
|
-
applyForegroundSnapshot(draft, plan);
|
|
1083
|
-
return true;
|
|
1084
|
-
}).catch(() => undefined);
|
|
1085
|
-
return {
|
|
1086
|
-
handled: true,
|
|
1087
|
-
ok: true,
|
|
1088
|
-
plan,
|
|
1089
|
-
display: renderPlanForTerminal(plan) + "\n",
|
|
1090
|
-
modelNote: `Added [${task.id}] "${task.title}"${parentTaskId ? ` under [${parentTaskId}]` : ""} without rewriting existing tasks.${reportDeferral} ` +
|
|
1091
|
-
`Open it with task.update when it becomes ready. Preserve completed work and continue the current task unless this new task is the immediate evidence-driven next action.`,
|
|
1092
|
-
};
|
|
1093
|
-
}
|
|
1094
|
-
const taskIdRaw = typeof call.args.taskId === "string"
|
|
1095
|
-
? call.args.taskId
|
|
1096
|
-
: typeof call.args.id === "string"
|
|
1097
|
-
? call.args.id
|
|
1098
|
-
: "";
|
|
1099
|
-
const stateRaw = typeof call.args.state === "string" ? call.args.state : "";
|
|
1100
|
-
const note = typeof call.args.note === "string" ? call.args.note : undefined;
|
|
1101
|
-
const validStates = [
|
|
1102
|
-
"pending",
|
|
1103
|
-
"in_progress",
|
|
1104
|
-
"done",
|
|
1105
|
-
"failed",
|
|
1106
|
-
"skipped",
|
|
1107
|
-
];
|
|
1108
|
-
if (!validStates.includes(stateRaw)) {
|
|
1109
|
-
return {
|
|
1110
|
-
handled: true,
|
|
1111
|
-
ok: false,
|
|
1112
|
-
display: chalk.red(` ✗ task.update: state must be one of ${validStates.join(", ")}\n`),
|
|
1113
|
-
modelNote: `task.update failed: state must be one of ${validStates.join(", ")}.`,
|
|
1114
|
-
};
|
|
1115
|
-
}
|
|
1116
|
-
// X3: accept t1..tn or model slug aliases / title slugs.
|
|
1117
|
-
const taskId = resolvePlanTaskId(plan, taskIdRaw) ?? taskIdRaw;
|
|
1118
|
-
const taskTarget = plan.tasks.find((task) => task.id === taskId);
|
|
1119
|
-
if (taskTarget?.responderOwned) {
|
|
1120
|
-
return {
|
|
1121
|
-
handled: true,
|
|
1122
|
-
ok: false,
|
|
1123
|
-
display: chalk.yellow(` ⚠ task.update: [${taskId}] is owned by Responder job ${taskTarget.jobId ?? "?"}\n`),
|
|
1124
|
-
modelNote: `task.update held: [${taskId}] is a Responder-owned background-job subtask. ` +
|
|
1125
|
-
`Do not change it manually; continue independent work or yield. Responder will advance it from the real process result and wake you when analysis is actionable.`,
|
|
1126
|
-
};
|
|
1127
|
-
}
|
|
1128
|
-
let dependencyWarning;
|
|
1129
|
-
let dependencyWarningToast;
|
|
1130
|
-
if (stateRaw === "in_progress") {
|
|
1131
|
-
const target = plan.tasks.find((task) => task.id === taskId);
|
|
1132
|
-
const ready = readyPlanTasks(plan).some((task) => task.id === taskId);
|
|
1133
|
-
const retryingFailedTask = target?.state === "failed";
|
|
1134
|
-
if (target?.state === "done" || target?.state === "skipped") {
|
|
1135
|
-
const nextPending = readyPlanTasks(plan)[0];
|
|
1136
|
-
const nextHint = nextPending
|
|
1137
|
-
? ` Continue with task.update {taskId:"${nextPending.id}", state:"in_progress"} ("${nextPending.title}").`
|
|
1138
|
-
: " All ready work is finished — write the final summary if needed.";
|
|
1139
|
-
return {
|
|
1140
|
-
handled: true,
|
|
1141
|
-
ok: false,
|
|
1142
|
-
display: chalk.red(` ✗ task.update: [${taskId}] is already ${target.state} — do not re-open\n`),
|
|
1143
|
-
modelNote: `task.update failed: [${taskId}] is already ${target.state}. ` +
|
|
1144
|
-
`Do not re-run completed tasks.${nextHint}`,
|
|
1145
|
-
};
|
|
1146
|
-
}
|
|
1147
|
-
if (target?.state !== "in_progress") {
|
|
1148
|
-
const otherActive = plan.tasks.find((task) => task.id !== taskId &&
|
|
1149
|
-
task.state === "in_progress" &&
|
|
1150
|
-
!task.responderOwned);
|
|
1151
|
-
if (otherActive) {
|
|
1152
|
-
return {
|
|
1153
|
-
handled: true,
|
|
1154
|
-
ok: false,
|
|
1155
|
-
display: chalk.red(` ✗ task.update: [${otherActive.id}] is still in progress — only one foreground task may be active\n`),
|
|
1156
|
-
modelNote: `task.update failed: [${otherActive.id}] "${otherActive.title}" is still in_progress. ` +
|
|
1157
|
-
`Defer it first with task.update {taskId:"${otherActive.id}", state:"pending"} (or finish it with "done"; use "failed"/"skipped" with a reason), then open [${taskId}]. ` +
|
|
1158
|
-
`Exactly one foreground task may be active at a time; Responder-owned subtasks are exempt.`,
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
const incompleteDependencies = (target?.dependencies ?? []).filter((dependency) => {
|
|
1162
|
-
const dependencyTask = plan.tasks.find((task) => task.id === dependency);
|
|
1163
|
-
return !dependencyTask || (dependencyTask.state !== "done" && dependencyTask.state !== "skipped");
|
|
1164
|
-
});
|
|
1165
|
-
const heldLocks = new Set(plan.tasks
|
|
1166
|
-
.filter((task) => task.state === "in_progress" && task.id !== taskId)
|
|
1167
|
-
.flatMap((task) => task.resourceLocks ?? []));
|
|
1168
|
-
const conflictingLocks = (target?.resourceLocks ?? []).filter((lock) => heldLocks.has(lock));
|
|
1169
|
-
if (target &&
|
|
1170
|
-
incompleteDependencies.length > 0 &&
|
|
1171
|
-
!retryingFailedTask &&
|
|
1172
|
-
conflictingLocks.length === 0) {
|
|
1173
|
-
dependencyWarning = buildDependencyReminder({
|
|
1174
|
-
taskId,
|
|
1175
|
-
title: target.title,
|
|
1176
|
-
targetState: stateRaw,
|
|
1177
|
-
blockers: incompleteDependencies.map((id) => ({
|
|
1178
|
-
id,
|
|
1179
|
-
title: plan.tasks.find((task) => task.id === id)?.title ?? "",
|
|
1180
|
-
})),
|
|
1181
|
-
});
|
|
1182
|
-
dependencyWarningToast = dependencyToast(taskId);
|
|
1183
|
-
}
|
|
1184
|
-
else if ((!ready && !retryingFailedTask) || conflictingLocks.length > 0) {
|
|
1185
|
-
const nextReady = readyPlanTasks(plan)[0];
|
|
1186
|
-
return {
|
|
1187
|
-
handled: true,
|
|
1188
|
-
ok: false,
|
|
1189
|
-
display: chalk.red(` ✗ task.update: [${taskId}] is not dependency/resource ready\n`),
|
|
1190
|
-
modelNote: `task.update failed: [${taskId}] is not ready. ` +
|
|
1191
|
-
(incompleteDependencies.length ? `Incomplete dependencies: ${incompleteDependencies.join(", ")}. ` : "") +
|
|
1192
|
-
(conflictingLocks.length ? `Resources currently locked: ${conflictingLocks.join(", ")}. ` : "") +
|
|
1193
|
-
(nextReady
|
|
1194
|
-
? `Open the next ready task first: ${nextReady.id} ("${nextReady.title}").`
|
|
1195
|
-
: ""),
|
|
1196
|
-
};
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
// A retry is a new execution attempt. Previous receipts proved only the
|
|
1200
|
-
// failed attempt and must not close the task before recovery work succeeds.
|
|
1201
|
-
if (retryingFailedTask && target)
|
|
1202
|
-
target.evidence = undefined;
|
|
1203
|
-
}
|
|
1204
|
-
if (stateRaw === "done") {
|
|
1205
|
-
const target = plan.tasks.find((task) => task.id === taskId);
|
|
1206
|
-
const incompleteDependencies = (target?.dependencies ?? []).filter((dependency) => {
|
|
1207
|
-
const dependencyTask = plan.tasks.find((task) => task.id === dependency);
|
|
1208
|
-
return !dependencyTask || (dependencyTask.state !== "done" && dependencyTask.state !== "skipped");
|
|
1209
|
-
});
|
|
1210
|
-
if (incompleteDependencies.length > 0) {
|
|
1211
|
-
return {
|
|
1212
|
-
handled: true,
|
|
1213
|
-
ok: false,
|
|
1214
|
-
display: chalk.red(` ✗ task.update: cannot complete [${taskId}] before dependencies\n`),
|
|
1215
|
-
modelNote: `task.update failed: earlier task/dependency ${incompleteDependencies.join(", ")} is not complete for [${taskId}].`,
|
|
1216
|
-
};
|
|
1217
|
-
}
|
|
1218
|
-
if (target && target.state !== "in_progress") {
|
|
1219
|
-
// Soft-auto: pending + dependency-ready → open then complete in one call.
|
|
1220
|
-
// Models often skip the ritual in_progress step after work already landed.
|
|
1221
|
-
if (target.state === "pending" && incompleteDependencies.length === 0) {
|
|
1222
|
-
const opened = markTask(plan, taskId, "in_progress", note);
|
|
1223
|
-
if (!opened) {
|
|
1224
|
-
return {
|
|
1225
|
-
handled: true,
|
|
1226
|
-
ok: false,
|
|
1227
|
-
display: chalk.red(` ✗ task.update: could not auto-open [${taskId}] before completion\n`),
|
|
1228
|
-
modelNote: `task.update failed: could not auto-open pending [${taskId}].`,
|
|
1229
|
-
};
|
|
1230
|
-
}
|
|
1231
|
-
// Fall through to mark done below (state is now in_progress).
|
|
1232
|
-
}
|
|
1233
|
-
else if (target.state === "failed") {
|
|
1234
|
-
return {
|
|
1235
|
-
handled: true,
|
|
1236
|
-
ok: false,
|
|
1237
|
-
display: chalk.red(` ✗ task.update: [${taskId}] is failed — retry with in_progress first\n`),
|
|
1238
|
-
modelNote: `task.update failed: [${taskId}] is failed. ` +
|
|
1239
|
-
`Call task.update {taskId:"${taskId}", state:"in_progress"} to retry, then mark done after recovery work.`,
|
|
1240
|
-
};
|
|
1241
|
-
}
|
|
1242
|
-
else {
|
|
1243
|
-
const nextReady = readyPlanTasks(plan)[0];
|
|
1244
|
-
return {
|
|
1245
|
-
handled: true,
|
|
1246
|
-
ok: false,
|
|
1247
|
-
display: chalk.red(` ✗ task.update: [${taskId}] must be in_progress before completion\n`),
|
|
1248
|
-
modelNote: `task.update failed: [${taskId}] is ${target.state}. ` +
|
|
1249
|
-
"Start or retry it, perform fresh work, then mark it done." +
|
|
1250
|
-
(nextReady
|
|
1251
|
-
? ` Open next ready: ${nextReady.id} ("${nextReady.title}").`
|
|
1252
|
-
: ""),
|
|
1253
|
-
};
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
const transitionTarget = plan.tasks.find((task) => task.id === taskId);
|
|
1258
|
-
if (transitionTarget) {
|
|
1259
|
-
const verdict = evaluateTaskTransition(transitionTarget.state, stateRaw);
|
|
1260
|
-
if (!verdict.allowed) {
|
|
1261
|
-
const nextReady = readyPlanTasks(plan)[0];
|
|
1262
|
-
return {
|
|
1263
|
-
handled: true,
|
|
1264
|
-
ok: false,
|
|
1265
|
-
display: chalk.red(` ✗ task.update: [${taskId}] ${transitionTarget.state} → ${stateRaw} is not a valid transition\n`),
|
|
1266
|
-
modelNote: `task.update failed: [${taskId}] ${verdict.reason}. ` +
|
|
1267
|
-
(nextReady
|
|
1268
|
-
? `Continue with ${nextReady.id} ("${nextReady.title}").`
|
|
1269
|
-
: "All ready work is finished — write the final summary if needed."),
|
|
1270
|
-
};
|
|
1271
|
-
}
|
|
1272
|
-
}
|
|
1273
|
-
const ok = markTask(plan, taskId, stateRaw, note);
|
|
1274
|
-
if (!ok) {
|
|
1275
|
-
const idMap = plan.tasks
|
|
1276
|
-
.map((t) => `${t.id}="${t.title}"` +
|
|
1277
|
-
(t.aliases?.length ? ` (also: ${t.aliases.join(", ")})` : ""))
|
|
1278
|
-
.join("; ");
|
|
1279
|
-
return {
|
|
1280
|
-
handled: true,
|
|
1281
|
-
ok: false,
|
|
1282
|
-
display: chalk.red(` ✗ task.update: unknown taskId "${taskIdRaw}" (have: ${plan.tasks.map((t) => t.id).join(", ")})\n`),
|
|
1283
|
-
modelNote: `task.update failed: unknown taskId "${taskIdRaw}". ` +
|
|
1284
|
-
`Valid ids (use these, not title text): ${idMap}.`,
|
|
1285
|
-
};
|
|
1286
|
-
}
|
|
1287
|
-
if (plan.status === "draft" || plan.status === "approved") {
|
|
1288
|
-
plan.status = "in_progress";
|
|
1289
|
-
}
|
|
1290
|
-
const terminal = isPlanTerminal(plan);
|
|
1291
|
-
const successful = isPlanSuccessful(plan);
|
|
1292
|
-
if (terminal)
|
|
1293
|
-
plan.status = successful ? "completed" : "abandoned";
|
|
1294
|
-
// Persist the transition (not the whole snapshot) so a concurrent
|
|
1295
|
-
// responder settlement or evidence patch survives.
|
|
1296
|
-
const committedStates = new Map(plan.tasks.map((task) => [
|
|
1297
|
-
task.id,
|
|
1298
|
-
{ state: task.state, note: task.note },
|
|
1299
|
-
]));
|
|
1300
|
-
await mutatePlan(plan.sessionId, (draft) => {
|
|
1301
|
-
for (const task of draft.tasks) {
|
|
1302
|
-
const desired = committedStates.get(task.id);
|
|
1303
|
-
if (!desired)
|
|
1304
|
-
continue;
|
|
1305
|
-
// Responder children are owned by process settlement, never by task.update.
|
|
1306
|
-
if (task.responderOwned)
|
|
1307
|
-
continue;
|
|
1308
|
-
task.state = desired.state;
|
|
1309
|
-
if (desired.note !== undefined)
|
|
1310
|
-
task.note = desired.note;
|
|
1311
|
-
}
|
|
1312
|
-
draft.status = plan.status;
|
|
1313
|
-
return true;
|
|
1314
|
-
}).catch(() => undefined);
|
|
1315
|
-
const checklist = renderPlanForTerminal(plan);
|
|
1316
|
-
const nextPending = readyPlanTasks(plan)[0];
|
|
1317
|
-
let modelNote;
|
|
1318
|
-
if (successful) {
|
|
1319
|
-
modelNote =
|
|
1320
|
-
"Task updated. All required tasks succeeded or were explicitly skipped. Verify the result and give your final summary. " +
|
|
1321
|
-
"If a dev server was started: report URL, port, job id, and that it is still running.";
|
|
1322
|
-
}
|
|
1323
|
-
else if (terminal) {
|
|
1324
|
-
const failed = plan.tasks.filter((task) => task.state === "failed");
|
|
1325
|
-
modelNote =
|
|
1326
|
-
`Task updated. The plan is terminal but NOT successful: ${failed.length} task(s) failed. ` +
|
|
1327
|
-
"Do not claim completion. Report a failed/partial outcome with the failed tasks and remaining user outcome.";
|
|
1328
|
-
}
|
|
1329
|
-
else if (stateRaw === "done" && nextPending) {
|
|
1330
|
-
modelNote =
|
|
1331
|
-
`Task [${taskId}] marked done after verified work. ` +
|
|
1332
|
-
`NEXT: open only the next task with task.update {taskId:"${nextPending.id}", state:"in_progress"}, ` +
|
|
1333
|
-
`then do work for "${nextPending.title}" only. Wait for tool results before marking that one done. ` +
|
|
1334
|
-
"Do not batch later tasks. Do not start a later task's tools early.";
|
|
1335
|
-
}
|
|
1336
|
-
else if (stateRaw === "in_progress") {
|
|
1337
|
-
modelNote =
|
|
1338
|
-
`Task [${taskId}] is now in_progress and owns the foreground outcome. Choose the method from current evidence, ` +
|
|
1339
|
-
`read each result, and keep working until the task's acceptance evidence holds. Capture newly discovered required ` +
|
|
1340
|
-
`work with task.add. If a discovery must preempt this task, move [${taskId}] back to pending before opening the ` +
|
|
1341
|
-
`higher-priority task; otherwise preserve focus and avoid starting unrelated later work. Mark done only after verification.`;
|
|
1342
|
-
}
|
|
1343
|
-
else if (stateRaw === "pending") {
|
|
1344
|
-
modelNote =
|
|
1345
|
-
`Task [${taskId}] is pending. If you deferred it to switch priorities, ` +
|
|
1346
|
-
`explicitly open the intended task with task.update {taskId:"...", state:"in_progress"} before doing work.`;
|
|
1347
|
-
}
|
|
1348
|
-
else {
|
|
1349
|
-
modelNote = "Task updated. Continue with the next pending task.";
|
|
1350
|
-
}
|
|
1351
|
-
return {
|
|
1352
|
-
handled: true,
|
|
1353
|
-
ok: true,
|
|
1354
|
-
plan,
|
|
1355
|
-
display: checklist +
|
|
1356
|
-
"\n" +
|
|
1357
|
-
(dependencyWarning
|
|
1358
|
-
? chalk.yellow(` ⚠ ${dependencyWarning}\n`)
|
|
1359
|
-
: ""),
|
|
1360
|
-
modelNote: dependencyWarning
|
|
1361
|
-
? `${dependencyWarning}\n${modelNote}`
|
|
1362
|
-
: modelNote,
|
|
1363
|
-
...(dependencyWarningToast ? { toast: dependencyWarningToast } : {}),
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
138
|
//# sourceMappingURL=plan-tool.js.map
|