@pentoshi/clai 4.11.7 → 4.11.9
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 -41
- package/dist/agent/reliability-policy.js +0 -46
- 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 +31 -0
- package/dist/agent/turn/loop/request-assembly.js +91 -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 +164 -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 +661 -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 +37 -0
- package/dist/agent/turn/loop/state.js +28 -0
- package/dist/agent/turn/loop/state.js.map +1 -0
- package/dist/agent/turn/loop/stream-failure.d.ts +54 -0
- package/dist/agent/turn/loop/stream-failure.js +146 -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 +26 -0
- package/dist/agent/turn/setup/turn-messages.js +50 -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 +2 -2
- 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 +13 -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 +6 -18
- 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 +9 -47
- package/dist/app/controllers/session-controller.js.map +1 -1
- package/dist/app/controllers/session-naming.d.ts +10 -4
- package/dist/app/controllers/session-naming.js +26 -8
- 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 +2 -15
- 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 +1 -6
- package/dist/llm/model-families.js +2 -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 +21 -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 +1 -17
- 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 +3 -1
- package/dist/llm/responses-request.js +18 -3
- 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 +226 -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 +366 -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 +86 -0
- package/dist/store/config/endpoints.js +297 -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 +63 -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 +26 -0
- package/dist/store/history/sqlite-backend.js +212 -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-model.d.ts +2 -1
- package/dist/store/session-model.js +27 -1
- package/dist/store/session-model.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 +95 -131
- 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 +39 -38
- 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 +5 -14
- package/dist/tui-v2/components/jobs/jobs-panel.js +8 -37
- 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 +3 -15
- package/dist/tui-v2/components/overlay/overlay-host.js +6 -3
- 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 +3 -8
- package/dist/tui-v2/components/plan/plan-view.js +5 -22
- 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 +3 -13
- package/dist/tui-v2/components/queue/queue-panel.js +8 -5
- package/dist/tui-v2/components/queue/queue-panel.js.map +1 -1
- package/dist/tui-v2/components/status/status-line.d.ts +3 -18
- package/dist/tui-v2/components/status/status-line.js +5 -12
- 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 +3 -13
- package/dist/tui-v2/components/toast/toast-host.js +6 -31
- 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 +2 -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-scrollbar.d.ts +6 -2
- package/dist/tui-v2/components/transcript/transcript-scrollbar.js +15 -4
- package/dist/tui-v2/components/transcript/transcript-scrollbar.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 +9 -104
- 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 +3 -21
- package/dist/tui-v2/composer/composer-editor.js +5 -63
- 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/perf/render-counters.d.ts +5 -0
- package/dist/tui-v2/perf/render-counters.js +54 -0
- package/dist/tui-v2/perf/render-counters.js.map +1 -0
- 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/session-resume.js +10 -2
- package/dist/ui-core/bootstrap/session-resume.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 +11 -695
- 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 +197 -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-meta.d.ts +7 -0
- package/dist/ui-core/react/use-transcript-meta.js +36 -0
- package/dist/ui-core/react/use-transcript-meta.js.map +1 -0
- 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-follow-key.d.ts +2 -0
- package/dist/ui-core/state/transcript-follow-key.js +37 -0
- package/dist/ui-core/state/transcript-follow-key.js.map +1 -0
- 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 +1 -9
- package/dist/ui-core/state/transcript-window.js +1 -9
- 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/tools/registry.js
CHANGED
|
@@ -1,95 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { detectPackageManager, assertSafePackageName, commandAvailable, } from "../os/pkgmgr.js";
|
|
3
|
-
import { safeCwd } from "../os/cwd.js";
|
|
4
|
-
import { fsEdit, fsDelete, fsList, fsRead, fsSearch, fsWrite, fsWriteMany, fsReplaceLines, fsAppend, } from "./fs.js";
|
|
5
|
-
import { httpFetch } from "./http.js";
|
|
6
|
-
import { createInteractiveSessionHandlers, INTERACTIVE_SESSION_TOOL_NAMES, } from "./interactive-session-tools.js";
|
|
7
|
-
import { shellExec, spawnArgv } from "./shell.js";
|
|
8
|
-
import { isLongQuietInstallOrScaffoldCommand, isLongRunningTestOrBuildCommand, } from "../agent/task-evidence.js";
|
|
9
|
-
import { imageOcr, imageView } from "./image.js";
|
|
10
|
-
import { pdfRead } from "./pdf.js";
|
|
11
|
-
import { webFetch } from "./web/fetch.js";
|
|
12
|
-
import { webSearch } from "./web/search.js";
|
|
13
|
-
import { RESPONSE_MODES, SEARCH_TIMEOUT_MS, } from "./web/types.js";
|
|
14
|
-
import { classifyToolCall } from "../safety/classifier.js";
|
|
1
|
+
import { createInteractiveSessionHandlers, } from "./interactive-session-tools.js";
|
|
15
2
|
import { instructionsRecordTool } from "./instructions.js";
|
|
16
|
-
import { canonicalizeExternalToolName, externalToolDispatcher, externalToolNames, isExternalToolName,
|
|
3
|
+
import { canonicalizeExternalToolName, externalToolDispatcher, externalToolNames, isExternalToolName, } from "./external-tools.js";
|
|
17
4
|
import { isCanonicalToolName } from "../mcp/names.js";
|
|
18
5
|
import { skillListTool, skillLoadTool } from "./skills.js";
|
|
19
|
-
import {
|
|
20
|
-
import { parseHost, parsePortSpec, parseLegacyFlags, normalizeScanProfile, profileToNmapArgs, nmapScanNeedsPrivilege, toConnectScanArgv, withNmapSkipDiscovery, } from "./validate.js";
|
|
21
|
-
import { getNetworkContext } from "./network-context.js";
|
|
22
|
-
import { pingSweep } from "./net-ping-sweep.js";
|
|
23
|
-
import { toolCheckHandler } from "./capabilities.js";
|
|
24
|
-
import { wordlistFind } from "./wordlists.js";
|
|
25
|
-
import { jobManager, } from "./jobs.js";
|
|
26
|
-
import { resolveShellExecBackgroundPolicy } from "./command-intent.js";
|
|
27
|
-
import { packageBinaryName } from "./package-binary.js";
|
|
28
|
-
import { resolveNmapTimeoutPolicy, runNmapScan } from "./nmap-runner.js";
|
|
29
|
-
import { compareAuthorizationContexts, discoverWebSurface, enumerateApi } from "./pentest-workflows.js";
|
|
30
|
-
import { nativeDnsLookup } from "./dns-native.js";
|
|
31
|
-
import { nativeWhoisLookup } from "./whois-native.js";
|
|
6
|
+
import { resolveNmapTimeoutPolicy } from "./nmap-runner.js";
|
|
32
7
|
import { elidedStubReuseMessage, findElidedStubArg, stripSupersededElidedArgs, } from "../agent/message-slim.js";
|
|
33
|
-
import { fromWireName
|
|
8
|
+
import { fromWireName } from "../llm/tool-protocol.js";
|
|
34
9
|
import { NON_REGISTRY_TOOL_NAMES } from "./definitions.js";
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
10
|
+
import { buildPentestReconNmapArgv } from "./handlers/nmap-preparation.js";
|
|
11
|
+
import { toolRegistry_SHELL_1 } from "./handlers/shell-1.js";
|
|
12
|
+
import { toolRegistry_FILES_1 } from "./handlers/files-1.js";
|
|
13
|
+
import { toolRegistry_SHELL_2 } from "./handlers/shell-2.js";
|
|
14
|
+
import { toolRegistry_NETWORK_1 } from "./handlers/network-1.js";
|
|
15
|
+
import { toolRegistry_WEB } from "./handlers/web.js";
|
|
16
|
+
import { toolRegistry_CONTEXT_1 } from "./handlers/context-1.js";
|
|
17
|
+
import { toolRegistry_NETWORK_2 } from "./handlers/network-2.js";
|
|
18
|
+
import { toolRegistry_PENTEST } from "./handlers/pentest.js";
|
|
19
|
+
import { toolRegistry_ORCHESTRATION_1 } from "./handlers/orchestration-1.js";
|
|
20
|
+
import { toolRegistry_NETWORK_3 } from "./handlers/network-3.js";
|
|
21
|
+
import { toolRegistry_ORCHESTRATION_2 } from "./handlers/orchestration-2.js";
|
|
22
|
+
import { toolRegistry_CONTEXT_2 } from "./handlers/context-2.js";
|
|
23
|
+
import { toolRegistry_SHELL_3 } from "./handlers/shell-3.js";
|
|
24
|
+
import { toolRegistry_FILES_2 } from "./handlers/files-2.js";
|
|
25
|
+
import { normalizeToolCall } from "./call-normalization.js";
|
|
26
|
+
export { normalizeToolCall };
|
|
27
|
+
export { buildPentestReconNmapArgv };
|
|
38
28
|
export { parseBatchFailPolicy, compileBatchFailMode, evaluateCancelTargets, formatBatchCancelReason, } from "./batch-fail-policy.js";
|
|
39
|
-
function requireString(args, key) {
|
|
40
|
-
const value = args[key];
|
|
41
|
-
if (typeof value !== "string" || value.length === 0) {
|
|
42
|
-
throw new Error(`Tool argument "${key}" must be a non-empty string`);
|
|
43
|
-
}
|
|
44
|
-
return value;
|
|
45
|
-
}
|
|
46
|
-
/** Like requireString but allows empty string (e.g. replaceLines delete). */
|
|
47
|
-
function requireStringAllowEmpty(args, key) {
|
|
48
|
-
const value = args[key];
|
|
49
|
-
if (typeof value !== "string") {
|
|
50
|
-
throw new Error(`Tool argument "${key}" must be a string`);
|
|
51
|
-
}
|
|
52
|
-
return value;
|
|
53
|
-
}
|
|
54
|
-
function optionalString(args, key) {
|
|
55
|
-
const value = args[key];
|
|
56
|
-
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
57
|
-
}
|
|
58
|
-
function optionalNumber(args, key) {
|
|
59
|
-
const value = args[key];
|
|
60
|
-
if (typeof value === "number" && Number.isFinite(value))
|
|
61
|
-
return value;
|
|
62
|
-
// Handle string numbers (e.g. "300000" from JSON) and coerce to number
|
|
63
|
-
if (typeof value === "string" && value.trim() !== "") {
|
|
64
|
-
const parsed = Number(value);
|
|
65
|
-
if (Number.isFinite(parsed))
|
|
66
|
-
return parsed;
|
|
67
|
-
}
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
function requireNumber(args, key) {
|
|
71
|
-
const value = args[key];
|
|
72
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
73
|
-
throw new Error(`Tool argument "${key}" must be a finite number`);
|
|
74
|
-
}
|
|
75
|
-
return value;
|
|
76
|
-
}
|
|
77
|
-
function optionalBoolean(args, key) {
|
|
78
|
-
const value = args[key];
|
|
79
|
-
return typeof value === "boolean" ? value : undefined;
|
|
80
|
-
}
|
|
81
|
-
function responderJobOptions(options) {
|
|
82
|
-
const responderLeaseId = jobManager.getResponderLeaseId(options?.sessionId);
|
|
83
|
-
return {
|
|
84
|
-
...(options?.sessionId ? { ownerSessionId: options.sessionId } : {}),
|
|
85
|
-
...(options?.taskId ? { taskId: options.taskId } : {}),
|
|
86
|
-
...(options?.parentTaskId ? { parentTaskId: options.parentTaskId } : {}),
|
|
87
|
-
...(options?.delegationId ? { delegationId: options.delegationId } : {}),
|
|
88
|
-
...(options?.wakeOnCompletion !== undefined ? { wakeOnCompletion: options.wakeOnCompletion } : {}),
|
|
89
|
-
...(options?.monitor !== undefined ? { monitor: options.monitor } : {}),
|
|
90
|
-
...(responderLeaseId ? { responderLeaseId } : {}),
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
29
|
export function estimateScanResources(argv) {
|
|
94
30
|
const policy = resolveNmapTimeoutPolicy(argv, {});
|
|
95
31
|
const estimatedSeconds = policy.depth === "full" ? 1_800 : policy.depth === "deep" ? 600 : 120;
|
|
@@ -100,818 +36,22 @@ export function estimateScanResources(argv) {
|
|
|
100
36
|
durableRecommended: policy.depth !== "standard",
|
|
101
37
|
};
|
|
102
38
|
}
|
|
103
|
-
async function prepareDurableNmapJob(argv, options, prompt) {
|
|
104
|
-
if (!nmapScanNeedsPrivilege(argv)) {
|
|
105
|
-
return { prepared: true, spec: { command: "nmap", argv: [...argv] } };
|
|
106
|
-
}
|
|
107
|
-
const elevated = await preparePrivilegedBackgroundArgv("nmap", argv, {
|
|
108
|
-
signal: options?.signal,
|
|
109
|
-
onOutput: options?.onOutput,
|
|
110
|
-
requestSecret: options?.requestSecret,
|
|
111
|
-
title: "Administrator access for nmap",
|
|
112
|
-
prompt,
|
|
113
|
-
});
|
|
114
|
-
if (elevated.prepared || options?.signal?.aborted)
|
|
115
|
-
return elevated;
|
|
116
|
-
if (argv.includes("-sU") || argv.includes("-sO")) {
|
|
117
|
-
return {
|
|
118
|
-
prepared: false,
|
|
119
|
-
result: {
|
|
120
|
-
...elevated.result,
|
|
121
|
-
output: `${elevated.result.output}\n` +
|
|
122
|
-
"The requested UDP/protocol scan has no equivalent unprivileged fallback. Authentication will not be reopened automatically; choose a TCP connect scan explicitly to continue without elevation.",
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
const fallbackArgv = withNmapSkipDiscovery(toConnectScanArgv(argv));
|
|
127
|
-
options?.onOutput?.("\nAdministrator scan was cancelled or unavailable. Starting one unprivileged TCP connect fallback (-sT -Pn); authentication will not be requested again.\n", "stderr");
|
|
128
|
-
return {
|
|
129
|
-
prepared: true,
|
|
130
|
-
spec: { command: "nmap", argv: fallbackArgv },
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
/** nmap argv for pentest.recon — ports configurable (default top-100). */
|
|
134
|
-
export function buildPentestReconNmapArgv(args, host) {
|
|
135
|
-
const argv = ["-sS", "-sV"];
|
|
136
|
-
const full = args.full === true || args.full === "true";
|
|
137
|
-
const portsRaw = typeof args.ports === "string" && args.ports.trim()
|
|
138
|
-
? args.ports.trim()
|
|
139
|
-
: undefined;
|
|
140
|
-
// "top-1000" / "top ports 1000" style specs map to --top-ports, not -p.
|
|
141
|
-
const topPortsSpec = portsRaw
|
|
142
|
-
? /^top[\s_-]*(?:ports?[\s_-]*)?(\d{1,5})$/i.exec(portsRaw)
|
|
143
|
-
: null;
|
|
144
|
-
const ports = portsRaw && !topPortsSpec ? portsRaw : undefined;
|
|
145
|
-
let topPorts;
|
|
146
|
-
if (typeof args.topPorts === "number" && Number.isFinite(args.topPorts)) {
|
|
147
|
-
topPorts = Math.max(1, Math.min(65535, Math.floor(args.topPorts)));
|
|
148
|
-
}
|
|
149
|
-
else if (typeof args.topPorts === "string" && /^\d+$/.test(args.topPorts)) {
|
|
150
|
-
topPorts = Math.max(1, Math.min(65535, Number(args.topPorts)));
|
|
151
|
-
}
|
|
152
|
-
if (topPortsSpec && topPorts === undefined) {
|
|
153
|
-
topPorts = Math.max(1, Math.min(65535, Number(topPortsSpec[1])));
|
|
154
|
-
}
|
|
155
|
-
if (full) {
|
|
156
|
-
argv.push("-p-");
|
|
157
|
-
}
|
|
158
|
-
else if (ports) {
|
|
159
|
-
const spec = parsePortSpec(ports);
|
|
160
|
-
argv.push("-p", spec);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
argv.push("--top-ports", String(topPorts ?? 100));
|
|
164
|
-
}
|
|
165
|
-
argv.push(host);
|
|
166
|
-
return argv;
|
|
167
|
-
}
|
|
168
|
-
function optionalResponseMode(args, key) {
|
|
169
|
-
const value = args[key];
|
|
170
|
-
if (typeof value === "string" &&
|
|
171
|
-
RESPONSE_MODES.includes(value)) {
|
|
172
|
-
return value;
|
|
173
|
-
}
|
|
174
|
-
return undefined;
|
|
175
|
-
}
|
|
176
39
|
export const toolRegistry = {
|
|
177
40
|
...createInteractiveSessionHandlers(),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
});
|
|
193
|
-
if (elevated && !elevated.prepared)
|
|
194
|
-
return elevated.result;
|
|
195
|
-
const job = await jobManager.startJob(elevated?.prepared ? elevated.spec : command, {
|
|
196
|
-
cwd: optionalString(args, "cwd"),
|
|
197
|
-
...responderJobOptions(options),
|
|
198
|
-
responder,
|
|
199
|
-
wakeOnCompletion: responder,
|
|
200
|
-
});
|
|
201
|
-
if (job.ok) {
|
|
202
|
-
const autoBackgrounded = backgroundMode === "auto";
|
|
203
|
-
const timeoutNote = autoBackgrounded && requestedTimeoutMs !== undefined
|
|
204
|
-
? `\n\nNote: timeoutMs=${requestedTimeoutMs} does not apply — this command was auto-backgrounded${costReason ? ` (${costReason})` : ""}. Pass background:"never" to run it in the foreground with your timeout.`
|
|
205
|
-
: "";
|
|
206
|
-
const costNote = autoBackgrounded && costReason
|
|
207
|
-
? `\n\nAuto-backgrounded because: ${costReason}. Pass background:"never" to force foreground.`
|
|
208
|
-
: "";
|
|
209
|
-
return {
|
|
210
|
-
...job,
|
|
211
|
-
output: `${job.output}${costNote}${timeoutNote}`,
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
return job;
|
|
215
|
-
}
|
|
216
|
-
let timeoutMs = requestedTimeoutMs;
|
|
217
|
-
// Handle seconds vs milliseconds confusion for long-running commands
|
|
218
|
-
// If model sends 300 thinking 300s, but code expects ms, convert small values to ms
|
|
219
|
-
if (timeoutMs !== undefined &&
|
|
220
|
-
timeoutMs > 0 &&
|
|
221
|
-
timeoutMs < 1000 &&
|
|
222
|
-
(isLongQuietInstallOrScaffoldCommand(command) ||
|
|
223
|
-
isLongRunningTestOrBuildCommand(command))) {
|
|
224
|
-
timeoutMs = timeoutMs * 1000;
|
|
225
|
-
}
|
|
226
|
-
timeoutMs =
|
|
227
|
-
timeoutMs ??
|
|
228
|
-
(isLongQuietInstallOrScaffoldCommand(command)
|
|
229
|
-
? 15 * 60_000
|
|
230
|
-
: isLongRunningTestOrBuildCommand(command)
|
|
231
|
-
? 120_000
|
|
232
|
-
: undefined);
|
|
233
|
-
// Password tools must never steal the TTY in OpenTUI (freezes Esc/clicks).
|
|
234
|
-
// Prefer secure modal + sudo -S; otherwise refuse interactive elevation.
|
|
235
|
-
if (looksInteractiveStdin(command)) {
|
|
236
|
-
const elevated = await tryRunElevatedWithoutTty(command, {
|
|
237
|
-
cwd: optionalString(args, "cwd"),
|
|
238
|
-
timeoutMs,
|
|
239
|
-
signal: options?.signal,
|
|
240
|
-
onOutput: options?.onOutput,
|
|
241
|
-
requestSecret: options?.requestSecret,
|
|
242
|
-
});
|
|
243
|
-
if (elevated)
|
|
244
|
-
return elevated;
|
|
245
|
-
const isRoot = process.getuid?.() === 0;
|
|
246
|
-
if (!isRoot && !getAllowInteractiveStdinInherit()) {
|
|
247
|
-
return {
|
|
248
|
-
ok: false,
|
|
249
|
-
exitCode: 1,
|
|
250
|
-
output: "This command needs an interactive password prompt, which this frontend cannot show without freezing the UI. " +
|
|
251
|
-
"Run it in an interactive session (terminal.start, then answer the prompt via terminal.send), " +
|
|
252
|
-
"or re-run from the clai TUI where the secure password modal is available.",
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
return shellExec({
|
|
257
|
-
command,
|
|
258
|
-
cwd: optionalString(args, "cwd"),
|
|
259
|
-
timeoutMs,
|
|
260
|
-
signal: options?.signal,
|
|
261
|
-
onOutput: options?.onOutput,
|
|
262
|
-
// Explicit: never inherit unless classic REPL policy allows it.
|
|
263
|
-
interactiveStdin: getAllowInteractiveStdinInherit() ? "auto" : false,
|
|
264
|
-
});
|
|
265
|
-
},
|
|
266
|
-
async "fs.read"(args, options) {
|
|
267
|
-
return fsRead(requireString(args, "path"), {
|
|
268
|
-
maxBytes: optionalNumber(args, "maxBytes"),
|
|
269
|
-
offset: optionalNumber(args, "offset"),
|
|
270
|
-
limit: optionalNumber(args, "limit"),
|
|
271
|
-
startLine: optionalNumber(args, "startLine"),
|
|
272
|
-
endLine: optionalNumber(args, "endLine"),
|
|
273
|
-
pattern: optionalString(args, "pattern"),
|
|
274
|
-
context: optionalNumber(args, "context"),
|
|
275
|
-
maxMatches: optionalNumber(args, "maxMatches"),
|
|
276
|
-
caseInsensitive: optionalBoolean(args, "caseInsensitive"),
|
|
277
|
-
confirmed: options?.confirmed,
|
|
278
|
-
});
|
|
279
|
-
},
|
|
280
|
-
async "fs.write"(args, options) {
|
|
281
|
-
return fsWrite(requireString(args, "path"), requireString(args, "content"), { confirmed: options?.confirmed });
|
|
282
|
-
},
|
|
283
|
-
async "fs.writeMany"(args, options) {
|
|
284
|
-
const raw = args.files;
|
|
285
|
-
if (!Array.isArray(raw)) {
|
|
286
|
-
throw new Error('fs.writeMany requires a "files" array of { path, content } objects');
|
|
287
|
-
}
|
|
288
|
-
const files = raw;
|
|
289
|
-
return fsWriteMany(files, { confirmed: options?.confirmed });
|
|
290
|
-
},
|
|
291
|
-
async "fs.list"(args, options) {
|
|
292
|
-
return fsList(optionalString(args, "path") ?? safeCwd(), {
|
|
293
|
-
maxEntries: optionalNumber(args, "maxEntries"),
|
|
294
|
-
confirmed: options?.confirmed,
|
|
295
|
-
});
|
|
296
|
-
},
|
|
297
|
-
async "fs.search"(args, options) {
|
|
298
|
-
return fsSearch(requireString(args, "pattern"), optionalString(args, "path"), {
|
|
299
|
-
confirmed: options?.confirmed,
|
|
300
|
-
maxMatches: optionalNumber(args, "maxMatches"),
|
|
301
|
-
maxPerFile: optionalNumber(args, "maxPerFile"),
|
|
302
|
-
glob: optionalString(args, "glob"),
|
|
303
|
-
caseInsensitive: optionalBoolean(args, "caseInsensitive"),
|
|
304
|
-
fixedString: optionalBoolean(args, "fixedString"),
|
|
305
|
-
context: optionalNumber(args, "context"),
|
|
306
|
-
filesOnly: optionalBoolean(args, "filesOnly"),
|
|
307
|
-
hidden: optionalBoolean(args, "hidden"),
|
|
308
|
-
timeoutMs: optionalNumber(args, "timeoutMs"),
|
|
309
|
-
});
|
|
310
|
-
},
|
|
311
|
-
async "pkg.install"(args, options) {
|
|
312
|
-
const tool = assertSafePackageName(requireString(args, "tool"));
|
|
313
|
-
// Skip the install entirely if the tool is already on PATH. The executable
|
|
314
|
-
// a package provides isn't always its package name (ripgrep→rg,
|
|
315
|
-
// dnsutils→dig), so check the known binary alias too. This makes the
|
|
316
|
-
// model's "check-then-install" intent cheap and idempotent.
|
|
317
|
-
const checkArg = optionalString(args, "checkBinary");
|
|
318
|
-
const binary = checkArg ?? packageBinaryName(tool);
|
|
319
|
-
// dig/whois are never required — built-in dns.lookup / whois.lookup cover them.
|
|
320
|
-
const nativeCovered = new Set([
|
|
321
|
-
"dig",
|
|
322
|
-
"whois",
|
|
323
|
-
"bind",
|
|
324
|
-
"bind9",
|
|
325
|
-
"dnsutils",
|
|
326
|
-
"bind-utils",
|
|
327
|
-
"nslookup",
|
|
328
|
-
]);
|
|
329
|
-
if (nativeCovered.has(tool.toLowerCase()) || nativeCovered.has(binary.toLowerCase())) {
|
|
330
|
-
return {
|
|
331
|
-
ok: true,
|
|
332
|
-
output: `${tool} is optional. Use built-in dns.lookup (Node resolver + DNS-over-HTTPS) ` +
|
|
333
|
-
`and whois.lookup (RDAP + port-43) — no system binary install required.`,
|
|
334
|
-
exitCode: 0,
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
if (await commandAvailable(binary)) {
|
|
338
|
-
return {
|
|
339
|
-
ok: true,
|
|
340
|
-
output: `${binary} is already installed and on PATH — skipping install.`,
|
|
341
|
-
exitCode: 0,
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
const pkgmgr = await detectPackageManager();
|
|
345
|
-
const spec = pkgmgr.installArgv(tool);
|
|
346
|
-
if (!spec) {
|
|
347
|
-
// Unknown manager: fall back to an instructional message instead of
|
|
348
|
-
// executing a malformed shell string.
|
|
349
|
-
return { ok: false, output: pkgmgr.installCommand(tool), exitCode: 1 };
|
|
350
|
-
}
|
|
351
|
-
return spawnArgv({
|
|
352
|
-
command: spec.command,
|
|
353
|
-
argv: spec.argv,
|
|
354
|
-
timeoutMs: optionalNumber(args, "timeoutMs") ?? 600_000,
|
|
355
|
-
signal: options?.signal,
|
|
356
|
-
onOutput: options?.onOutput,
|
|
357
|
-
});
|
|
358
|
-
},
|
|
359
|
-
async "net.scan"(args, options) {
|
|
360
|
-
const host = parseHost(requireString(args, "target"));
|
|
361
|
-
const portsRaw = optionalString(args, "ports");
|
|
362
|
-
// Accept natural "top ports" intents (top-1000, top1000, top-ports 1000,
|
|
363
|
-
// "top 1000") as a topPorts profile instead of rejecting them as an
|
|
364
|
-
// invalid literal port spec.
|
|
365
|
-
const topPortsMatch = portsRaw
|
|
366
|
-
? /^top[\s_-]*(?:ports?[\s_-]*)?(\d{1,5})$/i.exec(portsRaw.trim())
|
|
367
|
-
: null;
|
|
368
|
-
const ports = portsRaw && !topPortsMatch ? parsePortSpec(portsRaw) : undefined;
|
|
369
|
-
let profile = normalizeScanProfile(args.profile);
|
|
370
|
-
if (topPortsMatch) {
|
|
371
|
-
const n = Math.max(1, Math.min(65535, Number(topPortsMatch[1])));
|
|
372
|
-
profile = { ...(profile ?? {}), topPorts: profile?.topPorts ?? n };
|
|
373
|
-
}
|
|
374
|
-
const legacyFlags = optionalString(args, "flags");
|
|
375
|
-
// ports and topPorts conflict on the nmap CLI — ports takes priority
|
|
376
|
-
const cleanedProfile = ports && profile?.topPorts
|
|
377
|
-
? { ...profile, topPorts: undefined }
|
|
378
|
-
: profile;
|
|
379
|
-
const profileArgs = profileToNmapArgs(cleanedProfile);
|
|
380
|
-
const legacyArgs = legacyFlags ? parseLegacyFlags(legacyFlags) : [];
|
|
381
|
-
const argv = [];
|
|
382
|
-
if (ports)
|
|
383
|
-
argv.push("-p", ports);
|
|
384
|
-
argv.push(...profileArgs, ...legacyArgs, host.value);
|
|
385
|
-
const estimate = estimateScanResources(argv);
|
|
386
|
-
const durable = args.background === true || args.responder === true;
|
|
387
|
-
if (durable) {
|
|
388
|
-
const prepared = await prepareDurableNmapJob(argv, options, "Enter your password for the nmap raw-socket scan. It is sent only to sudo stdin and is never stored. Esc cancels.");
|
|
389
|
-
if (!prepared.prepared)
|
|
390
|
-
return prepared.result;
|
|
391
|
-
return jobManager.startJob(prepared.spec, {
|
|
392
|
-
name: `nmap-${estimate.profile}-${host.value}`,
|
|
393
|
-
profile: estimate.profile,
|
|
394
|
-
estimatedSeconds: estimate.estimatedSeconds,
|
|
395
|
-
...responderJobOptions(options),
|
|
396
|
-
responder: args.responder === true,
|
|
397
|
-
wakeOnCompletion: args.responder === true,
|
|
398
|
-
...(options?.engagementAuthorization ? { authorization: options.engagementAuthorization } : {}),
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
return runNmapScan(argv, options, optionalNumber(args, "timeoutMs"));
|
|
402
|
-
},
|
|
403
|
-
async "http.fetch"(args, options) {
|
|
404
|
-
const headers = args.headers &&
|
|
405
|
-
typeof args.headers === "object" &&
|
|
406
|
-
!Array.isArray(args.headers)
|
|
407
|
-
? args.headers
|
|
408
|
-
: undefined;
|
|
409
|
-
const url = requireString(args, "url");
|
|
410
|
-
const method = (optionalString(args, "method") ?? "GET").toUpperCase();
|
|
411
|
-
// Local app verify: loopback GET/HEAD is the owner's own process — auto-own
|
|
412
|
-
// so models are not stuck without iOwnThis. Mutating methods and non-loopback
|
|
413
|
-
// private/metadata addresses still require explicit ownership.
|
|
414
|
-
let iOwnThis = args.iOwnThis === true || args.own === true;
|
|
415
|
-
// Keep the caller's host (localhost). httpFetch dual-stacks 127.0.0.1/::1
|
|
416
|
-
// on connection failure — rewriting to 127.0.0.1 alone broke Vite on
|
|
417
|
-
// IPv6-only macOS binds while the browser still worked.
|
|
418
|
-
if (!iOwnThis && (method === "GET" || method === "HEAD")) {
|
|
419
|
-
try {
|
|
420
|
-
const parsed = new URL(url);
|
|
421
|
-
const host = parsed.hostname.replace(/^\[|\]$/g, "").toLowerCase();
|
|
422
|
-
if (host === "localhost" ||
|
|
423
|
-
host === "127.0.0.1" ||
|
|
424
|
-
host === "::1" ||
|
|
425
|
-
host === "localhost.localdomain" ||
|
|
426
|
-
host === "ip6-localhost" ||
|
|
427
|
-
/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host)) {
|
|
428
|
-
iOwnThis = true;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
catch {
|
|
432
|
-
/* invalid URL handled inside httpFetch */
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
const insecureTls = args.insecureTls === true ||
|
|
436
|
-
args.tlsInsecure === true ||
|
|
437
|
-
args.insecure === true;
|
|
438
|
-
return httpFetch(url, {
|
|
439
|
-
method: optionalString(args, "method"),
|
|
440
|
-
body: optionalString(args, "body"),
|
|
441
|
-
headers,
|
|
442
|
-
maxBytes: optionalNumber(args, "maxBytes"),
|
|
443
|
-
iOwnThis,
|
|
444
|
-
retries: optionalNumber(args, "retries"),
|
|
445
|
-
timeoutMs: optionalNumber(args, "timeoutMs"),
|
|
446
|
-
responseMode: optionalString(args, "responseMode") === "readable" ? "readable" : "raw",
|
|
447
|
-
responsePart: (() => {
|
|
448
|
-
const part = optionalString(args, "responsePart");
|
|
449
|
-
return part === "headers" || part === "body" ? part : "full";
|
|
450
|
-
})(),
|
|
451
|
-
topLines: optionalNumber(args, "topLines"),
|
|
452
|
-
bottomLines: optionalNumber(args, "bottomLines"),
|
|
453
|
-
maxOutputBytes: optionalNumber(args, "maxOutputBytes"),
|
|
454
|
-
forwardSensitiveHeaders: optionalBoolean(args, "forwardSensitiveHeaders") ?? false,
|
|
455
|
-
insecureTls,
|
|
456
|
-
signal: options?.signal,
|
|
457
|
-
// Never attach engagement hop checks for owned loopback — leftover
|
|
458
|
-
// pentest scope must not fail local app verify.
|
|
459
|
-
authorizeHop: iOwnThis ? undefined : options?.authorizeNetworkHop,
|
|
460
|
-
});
|
|
461
|
-
},
|
|
462
|
-
async "web.search"(args, options) {
|
|
463
|
-
const query = requireString(args, "query");
|
|
464
|
-
const maxResults = optionalNumber(args, "maxResults");
|
|
465
|
-
const selectedTimeoutMs = optionalNumber(args, "timeoutMs") ?? SEARCH_TIMEOUT_MS;
|
|
466
|
-
// Search providers, fallback attempts, and optional fetchTop page reads
|
|
467
|
-
// share one wall-clock deadline rather than each resetting the budget.
|
|
468
|
-
const deadline = Date.now() + selectedTimeoutMs;
|
|
469
|
-
const remainingMs = () => Math.max(0, deadline - Date.now());
|
|
470
|
-
const result = await webSearch({
|
|
471
|
-
query,
|
|
472
|
-
...(maxResults !== undefined ? { maxResults } : {}),
|
|
473
|
-
}, {
|
|
474
|
-
...(options?.signal ? { signal: options.signal } : {}),
|
|
475
|
-
timeoutMs: Math.max(1, remainingMs()),
|
|
476
|
-
});
|
|
477
|
-
// "Search and read" — like a human (or Claude) following the most
|
|
478
|
-
// relevant links. When fetchTop is set, fetch the readable content of the
|
|
479
|
-
// top N result pages and append it so the agent gets real page text in a
|
|
480
|
-
// SINGLE call instead of only snippets. Capped to 3 pages to stay fast and
|
|
481
|
-
// keep context lean.
|
|
482
|
-
const fetchTop = optionalNumber(args, "fetchTop");
|
|
483
|
-
const want = fetchTop ? Math.max(0, Math.min(3, Math.floor(fetchTop))) : 0;
|
|
484
|
-
if (!result.ok || want === 0)
|
|
485
|
-
return result;
|
|
486
|
-
const urls = extractResultUrls(result.output).slice(0, want);
|
|
487
|
-
if (urls.length === 0)
|
|
488
|
-
return result;
|
|
489
|
-
if (remainingMs() <= 0) {
|
|
490
|
-
return {
|
|
491
|
-
...result,
|
|
492
|
-
output: `${result.output}\n\n(fetchTop skipped: web.search deadline exhausted)`,
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
// Heartbeats reset the runner's stall watchdog (web.search emits no
|
|
496
|
-
// stdout of its own). Honor turn cancel between pages so Esc/Ctrl+C
|
|
497
|
-
// does not wait for every fetchTop page to time out.
|
|
498
|
-
if (options?.signal?.aborted) {
|
|
499
|
-
return {
|
|
500
|
-
...result,
|
|
501
|
-
ok: false,
|
|
502
|
-
output: `${result.output}\n\n(aborted before fetchTop)`,
|
|
503
|
-
exitCode: 130,
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
options?.onOutput?.(`fetchTop: reading ${urls.length} page(s)…\n`, "stdout");
|
|
507
|
-
const pages = await Promise.all(urls.map(async (url, i) => {
|
|
508
|
-
if (options?.signal?.aborted) {
|
|
509
|
-
return `── PAGE: ${url} (aborted)`;
|
|
510
|
-
}
|
|
511
|
-
options?.onOutput?.(`fetchTop [${i + 1}/${urls.length}]: ${url}\n`, "stdout");
|
|
512
|
-
try {
|
|
513
|
-
const pageBudgetMs = remainingMs();
|
|
514
|
-
if (pageBudgetMs <= 0) {
|
|
515
|
-
return `── PAGE: ${url} (skipped: web.search deadline exhausted)`;
|
|
516
|
-
}
|
|
517
|
-
const page = await webFetch({
|
|
518
|
-
url,
|
|
519
|
-
responseMode: "readable",
|
|
520
|
-
includeHeaders: false,
|
|
521
|
-
timeoutMs: pageBudgetMs,
|
|
522
|
-
}, { ...(options?.signal ? { signal: options.signal } : {}) });
|
|
523
|
-
// Never truncate page bodies for the tool result — the UI pager and
|
|
524
|
-
// artifacts must keep the full text. Model context is still budgeted
|
|
525
|
-
// separately in formatToolContext / context compaction.
|
|
526
|
-
const text = page.output.trim();
|
|
527
|
-
return `── PAGE: ${url} ${page.ok ? "" : "(fetch failed)"}\n${text}`;
|
|
528
|
-
}
|
|
529
|
-
catch (error) {
|
|
530
|
-
return `── PAGE: ${url} (fetch error: ${error instanceof Error ? error.message : String(error)})`;
|
|
531
|
-
}
|
|
532
|
-
}));
|
|
533
|
-
return {
|
|
534
|
-
...result,
|
|
535
|
-
output: `${result.output}\n\n${pages.join("\n\n")}`,
|
|
536
|
-
};
|
|
537
|
-
},
|
|
538
|
-
async "web.fetch"(args, options) {
|
|
539
|
-
const url = requireString(args, "url");
|
|
540
|
-
const fetchArgs = { url };
|
|
541
|
-
const maxBytes = optionalNumber(args, "maxBytes");
|
|
542
|
-
if (maxBytes !== undefined)
|
|
543
|
-
fetchArgs.maxBytes = maxBytes;
|
|
544
|
-
const timeoutMs = optionalNumber(args, "timeoutMs");
|
|
545
|
-
if (timeoutMs !== undefined)
|
|
546
|
-
fetchArgs.timeoutMs = timeoutMs;
|
|
547
|
-
const includeHeaders = optionalBoolean(args, "includeHeaders");
|
|
548
|
-
fetchArgs.includeHeaders = includeHeaders ?? false;
|
|
549
|
-
const includeTls = optionalBoolean(args, "includeTls");
|
|
550
|
-
fetchArgs.includeTls = includeTls ?? false;
|
|
551
|
-
const includeTiming = optionalBoolean(args, "includeTiming");
|
|
552
|
-
fetchArgs.includeTiming = includeTiming ?? false;
|
|
553
|
-
const includeRedirectChain = optionalBoolean(args, "includeRedirectChain");
|
|
554
|
-
fetchArgs.includeRedirectChain = includeRedirectChain ?? false;
|
|
555
|
-
const responseMode = optionalResponseMode(args, "responseMode");
|
|
556
|
-
if (responseMode !== undefined)
|
|
557
|
-
fetchArgs.responseMode = responseMode;
|
|
558
|
-
const responsePart = optionalString(args, "responsePart");
|
|
559
|
-
if (responsePart === "full" ||
|
|
560
|
-
responsePart === "headers" ||
|
|
561
|
-
responsePart === "body") {
|
|
562
|
-
fetchArgs.responsePart = responsePart;
|
|
563
|
-
if (responsePart === "headers")
|
|
564
|
-
fetchArgs.includeHeaders = true;
|
|
565
|
-
}
|
|
566
|
-
const topLines = optionalNumber(args, "topLines");
|
|
567
|
-
if (topLines !== undefined)
|
|
568
|
-
fetchArgs.topLines = topLines;
|
|
569
|
-
const bottomLines = optionalNumber(args, "bottomLines");
|
|
570
|
-
if (bottomLines !== undefined)
|
|
571
|
-
fetchArgs.bottomLines = bottomLines;
|
|
572
|
-
const maxOutputBytes = optionalNumber(args, "maxOutputBytes");
|
|
573
|
-
if (maxOutputBytes !== undefined)
|
|
574
|
-
fetchArgs.maxOutputBytes = maxOutputBytes;
|
|
575
|
-
const redactSensitive = optionalBoolean(args, "redactSensitive");
|
|
576
|
-
if (redactSensitive !== undefined)
|
|
577
|
-
fetchArgs.redactSensitive = redactSensitive;
|
|
578
|
-
return webFetch(fetchArgs, {
|
|
579
|
-
...(options?.signal ? { signal: options.signal } : {}),
|
|
580
|
-
});
|
|
581
|
-
},
|
|
582
|
-
async sysinfo() {
|
|
583
|
-
return { ok: true, output: JSON.stringify(detectSystem(), null, 2) };
|
|
584
|
-
},
|
|
585
|
-
/**
|
|
586
|
-
* Run a single DNS query without spinning up a full recon. Use for
|
|
587
|
-
* narrow asks ("what's the A record for X", "find the MX for Y") so
|
|
588
|
-
* the agent doesn't reach for nmap/whois when one dig is enough.
|
|
589
|
-
*/
|
|
590
|
-
async "dns.lookup"(args, options) {
|
|
591
|
-
const host = parseHost(requireString(args, "target"));
|
|
592
|
-
const recordRaw = (optionalString(args, "record") ?? "A").toUpperCase();
|
|
593
|
-
const allowed = new Set([
|
|
594
|
-
"A",
|
|
595
|
-
"AAAA",
|
|
596
|
-
"ANY",
|
|
597
|
-
"CAA",
|
|
598
|
-
"CNAME",
|
|
599
|
-
"MX",
|
|
600
|
-
"NS",
|
|
601
|
-
"PTR",
|
|
602
|
-
"SOA",
|
|
603
|
-
"SRV",
|
|
604
|
-
"TXT",
|
|
605
|
-
]);
|
|
606
|
-
if (!allowed.has(recordRaw)) {
|
|
607
|
-
throw new Error(`dns.lookup: unsupported record type "${recordRaw}". Allowed: ${[...allowed].join(", ")}`);
|
|
608
|
-
}
|
|
609
|
-
return nativeDnsLookup(host.value, recordRaw);
|
|
610
|
-
},
|
|
611
|
-
/**
|
|
612
|
-
* Run a single whois query so callers asking about ownership/registrar
|
|
613
|
-
* never trigger an nmap scan as a side effect.
|
|
614
|
-
*/
|
|
615
|
-
async "whois.lookup"(args, options) {
|
|
616
|
-
const host = parseHost(requireString(args, "target"));
|
|
617
|
-
// Keep whois short-lived: many servers hang or buffer until close. A hard
|
|
618
|
-
// 20s cap beats the outer 60s "no output" stall watchdog aborting mid-recon.
|
|
619
|
-
return nativeWhoisLookup(host.value);
|
|
620
|
-
},
|
|
621
|
-
async "pentest.recon"(args, options) {
|
|
622
|
-
const host = parseHost(requireString(args, "target"));
|
|
623
|
-
const wantWhois = args.whois !== false;
|
|
624
|
-
const wantDns = args.dns !== false;
|
|
625
|
-
const wantNmap = args.nmap !== false;
|
|
626
|
-
const nmapArgv = buildPentestReconNmapArgv(args, host.value);
|
|
627
|
-
const allSteps = [
|
|
628
|
-
{ key: "whois", command: "whois", argv: [host.value] },
|
|
629
|
-
{
|
|
630
|
-
key: "dns",
|
|
631
|
-
command: "dig",
|
|
632
|
-
argv: [host.value, "ANY", "+noall", "+answer"],
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
key: "nmap",
|
|
636
|
-
command: "nmap",
|
|
637
|
-
argv: nmapArgv,
|
|
638
|
-
},
|
|
639
|
-
];
|
|
640
|
-
const steps = allSteps.filter((step) => {
|
|
641
|
-
if (step.key === "whois")
|
|
642
|
-
return wantWhois;
|
|
643
|
-
if (step.key === "dns")
|
|
644
|
-
return wantDns;
|
|
645
|
-
if (step.key === "nmap")
|
|
646
|
-
return wantNmap;
|
|
647
|
-
return true;
|
|
648
|
-
});
|
|
649
|
-
if (steps.length === 0) {
|
|
650
|
-
return {
|
|
651
|
-
ok: false,
|
|
652
|
-
output: "pentest.recon: no steps requested. Set at least one of whois|dns|nmap to true, or omit them all for a full sweep.",
|
|
653
|
-
exitCode: 1,
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
// Allocate one shared artifact file so the user can pop the full
|
|
657
|
-
// recon transcript open in the Ctrl+O pager. Without this, the
|
|
658
|
-
// viewport would have only the model-facing summary and the pager
|
|
659
|
-
// would render "(no artifact file — only the summary is available)".
|
|
660
|
-
const { mkdir, writeFile } = await import("node:fs/promises");
|
|
661
|
-
const { join } = await import("node:path");
|
|
662
|
-
const { getArtifactDir } = await import("../store/paths.js");
|
|
663
|
-
const artifactDir = getArtifactDir();
|
|
664
|
-
let artifactPath;
|
|
665
|
-
try {
|
|
666
|
-
await mkdir(artifactDir, { recursive: true, mode: 0o700 });
|
|
667
|
-
const safeHost = host.value.replace(/[^a-z0-9_.-]+/gi, "-");
|
|
668
|
-
artifactPath = join(artifactDir, `${new Date().toISOString().replace(/[:.]/g, "-")}-recon-${safeHost}.txt`);
|
|
669
|
-
}
|
|
670
|
-
catch {
|
|
671
|
-
// Falling back to no artifact is fine; the model still sees the
|
|
672
|
-
// summary even if the artifact couldn't be created.
|
|
673
|
-
artifactPath = undefined;
|
|
674
|
-
}
|
|
675
|
-
const outputs = [];
|
|
676
|
-
const transcript = [];
|
|
677
|
-
let anyOk = false;
|
|
678
|
-
const userAborted = () => Boolean(options?.signal?.aborted);
|
|
679
|
-
const runStep = async (step) => {
|
|
680
|
-
const display = `${step.command} ${step.argv.join(" ")}`;
|
|
681
|
-
options?.onOutput?.(`\n$ ${display}\n`, "stdout");
|
|
682
|
-
const beat = setInterval(() => {
|
|
683
|
-
options?.onOutput?.(`[recon] ${step.key} still running…\n`, "stdout");
|
|
684
|
-
}, 5_000);
|
|
685
|
-
beat.unref?.();
|
|
686
|
-
try {
|
|
687
|
-
if (step.key === "nmap") {
|
|
688
|
-
const estimate = estimateScanResources(step.argv);
|
|
689
|
-
if (args.background === true || args.responder === true) {
|
|
690
|
-
const prepared = await prepareDurableNmapJob(step.argv, options, "Enter your password for the durable nmap raw-socket scan. It is sent only to sudo stdin and is never stored. Esc cancels.");
|
|
691
|
-
const result = prepared.prepared
|
|
692
|
-
? await jobManager.startJob(prepared.spec, {
|
|
693
|
-
name: `recon-${estimate.profile}-${host.value}`,
|
|
694
|
-
profile: estimate.profile,
|
|
695
|
-
estimatedSeconds: estimate.estimatedSeconds,
|
|
696
|
-
...responderJobOptions(options),
|
|
697
|
-
responder: args.responder === true,
|
|
698
|
-
wakeOnCompletion: args.responder === true,
|
|
699
|
-
...(options?.engagementAuthorization ? { authorization: options.engagementAuthorization } : {}),
|
|
700
|
-
})
|
|
701
|
-
: prepared.result;
|
|
702
|
-
return { key: step.key, display, result };
|
|
703
|
-
}
|
|
704
|
-
return {
|
|
705
|
-
key: step.key,
|
|
706
|
-
display,
|
|
707
|
-
result: await runNmapScan(step.argv, options, optionalNumber(args, "timeoutMs")),
|
|
708
|
-
};
|
|
709
|
-
}
|
|
710
|
-
if (step.key === "dns") {
|
|
711
|
-
return {
|
|
712
|
-
key: step.key,
|
|
713
|
-
display: `native DNS ANY ${host.value}`,
|
|
714
|
-
result: await nativeDnsLookup(host.value, "ANY"),
|
|
715
|
-
};
|
|
716
|
-
}
|
|
717
|
-
if (step.key === "whois") {
|
|
718
|
-
return {
|
|
719
|
-
key: step.key,
|
|
720
|
-
display: `native WHOIS ${host.value}`,
|
|
721
|
-
result: await nativeWhoisLookup(host.value),
|
|
722
|
-
};
|
|
723
|
-
}
|
|
724
|
-
const timeoutMs = step.key === "whois" ? 20_000 : 30_000;
|
|
725
|
-
return {
|
|
726
|
-
key: step.key,
|
|
727
|
-
display,
|
|
728
|
-
result: await spawnArgv({
|
|
729
|
-
command: step.command,
|
|
730
|
-
argv: step.argv,
|
|
731
|
-
timeoutMs,
|
|
732
|
-
signal: options?.signal,
|
|
733
|
-
onOutput: options?.onOutput,
|
|
734
|
-
}),
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
catch (error) {
|
|
738
|
-
return {
|
|
739
|
-
key: step.key,
|
|
740
|
-
display,
|
|
741
|
-
result: { ok: false, output: `${step.key} error: ${error instanceof Error ? error.message : String(error)}`, exitCode: 1 },
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
finally {
|
|
745
|
-
clearInterval(beat);
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
// Passive WHOIS/DNS and the selected scan run independently. Deep/full
|
|
749
|
-
// scans return a durable job receipt immediately while passive results
|
|
750
|
-
// continue to completion in this foreground turn.
|
|
751
|
-
const completed = await Promise.all(steps.map(runStep));
|
|
752
|
-
for (const { display, result } of completed) {
|
|
753
|
-
transcript.push(`$ ${display}`, result.output);
|
|
754
|
-
outputs.push(result.output);
|
|
755
|
-
if (result.ok)
|
|
756
|
-
anyOk = true;
|
|
757
|
-
}
|
|
758
|
-
if (artifactPath) {
|
|
759
|
-
const body = transcript.join("\n\n");
|
|
760
|
-
try {
|
|
761
|
-
await writeFile(artifactPath, body, { encoding: "utf8", mode: 0o600 });
|
|
762
|
-
}
|
|
763
|
-
catch {
|
|
764
|
-
artifactPath = undefined;
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
// Passive successes remain useful evidence, but a requested nmap step
|
|
768
|
-
// that failed authentication or never started must make the composite
|
|
769
|
-
// operation fail rather than disguising it as a successful recon.
|
|
770
|
-
const aborted = userAborted();
|
|
771
|
-
const nmapResult = completed.find((entry) => entry.key === "nmap")?.result;
|
|
772
|
-
const requestedScanFailed = wantNmap && Boolean(nmapResult && !nmapResult.ok);
|
|
773
|
-
const backgroundJob = completed.find((entry) => entry.result.backgroundJob)?.result.backgroundJob;
|
|
774
|
-
const output = outputs.join("\n\n");
|
|
775
|
-
return {
|
|
776
|
-
ok: !aborted && anyOk && !requestedScanFailed,
|
|
777
|
-
output: aborted
|
|
778
|
-
? `${output}\n\nCommand aborted.`.trim()
|
|
779
|
-
: requestedScanFailed
|
|
780
|
-
? `${output}\n\nThe requested nmap scan failed or was not started; passive recon results above are partial only.`.trim()
|
|
781
|
-
: output,
|
|
782
|
-
exitCode: aborted ? 130 : anyOk && !requestedScanFailed ? 0 : 1,
|
|
783
|
-
...(artifactPath ? { outputPath: artifactPath } : {}),
|
|
784
|
-
...(backgroundJob ? { backgroundJob } : {}),
|
|
785
|
-
};
|
|
786
|
-
},
|
|
787
|
-
async "pentest.webDiscover"(args, options) {
|
|
788
|
-
const paths = Array.isArray(args.paths) ? args.paths.filter((value) => typeof value === "string") : [];
|
|
789
|
-
return discoverWebSurface(requireString(args, "baseUrl"), paths, options);
|
|
790
|
-
},
|
|
791
|
-
async "pentest.apiEnumerate"(args, options) {
|
|
792
|
-
return enumerateApi(requireString(args, "specUrl"), options);
|
|
793
|
-
},
|
|
794
|
-
async "pentest.authCompare"(args, options) {
|
|
795
|
-
const contexts = Array.isArray(args.contexts)
|
|
796
|
-
? args.contexts.filter((value) => {
|
|
797
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
798
|
-
return false;
|
|
799
|
-
const candidate = value;
|
|
800
|
-
return typeof candidate.label === "string" && Boolean(candidate.headers) && typeof candidate.headers === "object" && !Array.isArray(candidate.headers);
|
|
801
|
-
})
|
|
802
|
-
: [];
|
|
803
|
-
return compareAuthorizationContexts(requireString(args, "url"), contexts, options);
|
|
804
|
-
},
|
|
805
|
-
async "pentest.scanStatus"(args) {
|
|
806
|
-
const offset = optionalNumber(args, "offset");
|
|
807
|
-
const bytes = optionalNumber(args, "bytes");
|
|
808
|
-
const stream = optionalString(args, "stream");
|
|
809
|
-
return jobManager.tailJob(requireString(args, "id"), {
|
|
810
|
-
...(offset !== undefined ? { offset } : {}),
|
|
811
|
-
...(bytes !== undefined ? { bytes } : {}),
|
|
812
|
-
...(stream !== undefined ? { stream } : {}),
|
|
813
|
-
});
|
|
814
|
-
},
|
|
815
|
-
async "tool.batch"(args, options) {
|
|
816
|
-
return runToolBatch(args, options);
|
|
817
|
-
},
|
|
818
|
-
async "net.context"() {
|
|
819
|
-
return getNetworkContext();
|
|
820
|
-
},
|
|
821
|
-
async "net.pingSweep"(args, options) {
|
|
822
|
-
const target = requireString(args, "target");
|
|
823
|
-
return pingSweep({
|
|
824
|
-
target,
|
|
825
|
-
method: optionalString(args, "method"),
|
|
826
|
-
timeoutMs: optionalNumber(args, "timeoutMs"),
|
|
827
|
-
}, { signal: options?.signal });
|
|
828
|
-
},
|
|
829
|
-
async "tool.check"(args) {
|
|
830
|
-
return toolCheckHandler(args);
|
|
831
|
-
},
|
|
832
|
-
async "wordlist.find"(args) {
|
|
833
|
-
const expand = typeof args.expand === "boolean" ? args.expand : undefined;
|
|
834
|
-
return wordlistFind({
|
|
835
|
-
query: requireString(args, "query"),
|
|
836
|
-
...(expand !== undefined ? { expand } : {}),
|
|
837
|
-
});
|
|
838
|
-
},
|
|
839
|
-
async "image.ocr"(args, options) {
|
|
840
|
-
return imageOcr(args, options);
|
|
841
|
-
},
|
|
842
|
-
async "image.view"(args, options) {
|
|
843
|
-
return imageView(args, options);
|
|
844
|
-
},
|
|
845
|
-
async "pdf.read"(args, options) {
|
|
846
|
-
return pdfRead(args, options);
|
|
847
|
-
},
|
|
848
|
-
async "shell.start"(args, options) {
|
|
849
|
-
const command = requireString(args, "command");
|
|
850
|
-
const elevated = await prepareElevatedBackgroundCommand(command, {
|
|
851
|
-
signal: options?.signal,
|
|
852
|
-
onOutput: options?.onOutput,
|
|
853
|
-
requestSecret: options?.requestSecret,
|
|
854
|
-
});
|
|
855
|
-
if (elevated && !elevated.prepared)
|
|
856
|
-
return elevated.result;
|
|
857
|
-
return jobManager.startJob(elevated?.prepared ? elevated.spec : command, {
|
|
858
|
-
cwd: optionalString(args, "cwd"),
|
|
859
|
-
name: optionalString(args, "name"),
|
|
860
|
-
...responderJobOptions(options),
|
|
861
|
-
responder: false,
|
|
862
|
-
wakeOnCompletion: false,
|
|
863
|
-
});
|
|
864
|
-
},
|
|
865
|
-
async "shell.jobs"(_args, options) {
|
|
866
|
-
return jobManager.listJobs(options?.sessionId);
|
|
867
|
-
},
|
|
868
|
-
async "shell.tail"(args) {
|
|
869
|
-
const offset = optionalNumber(args, "offset");
|
|
870
|
-
const bytes = optionalNumber(args, "bytes");
|
|
871
|
-
const stream = optionalString(args, "stream");
|
|
872
|
-
return jobManager.tailJob(requireString(args, "id"), {
|
|
873
|
-
...(offset !== undefined ? { offset } : {}),
|
|
874
|
-
...(bytes !== undefined ? { bytes } : {}),
|
|
875
|
-
...(stream !== undefined ? { stream } : {}),
|
|
876
|
-
});
|
|
877
|
-
},
|
|
878
|
-
async "shell.stop"(args) {
|
|
879
|
-
return jobManager.stopJob(requireString(args, "id"));
|
|
880
|
-
},
|
|
881
|
-
async "shell.wait"(args, options) {
|
|
882
|
-
const timeoutMs = optionalNumber(args, "timeoutMs");
|
|
883
|
-
return jobManager.waitForJob(requireString(args, "id"), {
|
|
884
|
-
...(timeoutMs !== undefined ? { timeoutMs } : {}),
|
|
885
|
-
...(options?.signal ? { signal: options.signal } : {}),
|
|
886
|
-
});
|
|
887
|
-
},
|
|
888
|
-
async "fs.edit"(args, options) {
|
|
889
|
-
return fsEdit(requireString(args, "path"), requireString(args, "oldText"), requireString(args, "newText"), optionalNumber(args, "expectedReplacements"), { confirmed: options?.confirmed });
|
|
890
|
-
},
|
|
891
|
-
async "fs.replaceLines"(args, options) {
|
|
892
|
-
// Empty content / delete:true removes the line range (X6).
|
|
893
|
-
let content;
|
|
894
|
-
if (args.delete === true) {
|
|
895
|
-
content = "";
|
|
896
|
-
}
|
|
897
|
-
else if (typeof args.content === "string") {
|
|
898
|
-
content = requireStringAllowEmpty(args, "content");
|
|
899
|
-
}
|
|
900
|
-
else {
|
|
901
|
-
throw new Error('Tool argument "content" must be a string (use "" or delete:true to delete the line range)');
|
|
902
|
-
}
|
|
903
|
-
return fsReplaceLines(requireString(args, "path"), requireNumber(args, "startLine"), requireNumber(args, "endLine"), content, { confirmed: options?.confirmed });
|
|
904
|
-
},
|
|
905
|
-
async "fs.append"(args, options) {
|
|
906
|
-
return fsAppend(requireString(args, "path"), requireString(args, "content"), {
|
|
907
|
-
position: optionalString(args, "position"),
|
|
908
|
-
expectedPriorBytes: optionalNumber(args, "expectedPriorBytes"),
|
|
909
|
-
confirmed: options?.confirmed,
|
|
910
|
-
});
|
|
911
|
-
},
|
|
912
|
-
async "fs.delete"(args, options) {
|
|
913
|
-
return fsDelete(requireString(args, "path"), typeof args.recursive === "boolean" ? args.recursive : undefined, { confirmed: options?.confirmed });
|
|
914
|
-
},
|
|
41
|
+
...toolRegistry_SHELL_1,
|
|
42
|
+
...toolRegistry_FILES_1,
|
|
43
|
+
...toolRegistry_SHELL_2,
|
|
44
|
+
...toolRegistry_NETWORK_1,
|
|
45
|
+
...toolRegistry_WEB,
|
|
46
|
+
...toolRegistry_CONTEXT_1,
|
|
47
|
+
...toolRegistry_NETWORK_2,
|
|
48
|
+
...toolRegistry_PENTEST,
|
|
49
|
+
...toolRegistry_ORCHESTRATION_1,
|
|
50
|
+
...toolRegistry_NETWORK_3,
|
|
51
|
+
...toolRegistry_ORCHESTRATION_2,
|
|
52
|
+
...toolRegistry_CONTEXT_2,
|
|
53
|
+
...toolRegistry_SHELL_3,
|
|
54
|
+
...toolRegistry_FILES_2,
|
|
915
55
|
async "skill.list"(args) {
|
|
916
56
|
return skillListTool(args);
|
|
917
57
|
},
|
|
@@ -938,205 +78,6 @@ export function unknownToolErrorMessage(name) {
|
|
|
938
78
|
const extra = external.length > 0 ? `, ${[...external].sort().join(", ")}` : "";
|
|
939
79
|
return `Unknown tool: ${name}.${hint} Tool names are dotted namespace.action pairs (task.update, not task_update). Available tools: ${known.join(", ")}${extra}`;
|
|
940
80
|
}
|
|
941
|
-
/**
|
|
942
|
-
* Keys that mean "this is a file/content payload, not a command line". When a
|
|
943
|
-
* hallucinated call carries one of these, we refuse to synthesize shell text
|
|
944
|
-
* from it: concatenating file content into a command line is how metacharacters
|
|
945
|
-
* in model output become executed shell.
|
|
946
|
-
*/
|
|
947
|
-
const CONTENT_SHAPED_ARG_KEYS = new Set([
|
|
948
|
-
"content",
|
|
949
|
-
"contents",
|
|
950
|
-
"body",
|
|
951
|
-
"text",
|
|
952
|
-
"data",
|
|
953
|
-
"file_text",
|
|
954
|
-
"filetext",
|
|
955
|
-
"new_str",
|
|
956
|
-
"newstr",
|
|
957
|
-
"old_str",
|
|
958
|
-
"oldstr",
|
|
959
|
-
"patch",
|
|
960
|
-
"diff",
|
|
961
|
-
"source",
|
|
962
|
-
"stdin",
|
|
963
|
-
"input",
|
|
964
|
-
]);
|
|
965
|
-
/** Explicit command-bearing fields, in precedence order. */
|
|
966
|
-
const COMMAND_ARG_KEYS = [
|
|
967
|
-
"command",
|
|
968
|
-
"cmd",
|
|
969
|
-
"commandLine",
|
|
970
|
-
"command_line",
|
|
971
|
-
"argv",
|
|
972
|
-
"args",
|
|
973
|
-
"arguments",
|
|
974
|
-
];
|
|
975
|
-
const SHELL_SAFE_TOKEN_RE = /^[A-Za-z0-9_@%+=:,./-]+$/;
|
|
976
|
-
function shellQuoteToken(token) {
|
|
977
|
-
if (SHELL_SAFE_TOKEN_RE.test(token))
|
|
978
|
-
return token;
|
|
979
|
-
return `'${token.replace(/'/g, `'\\''`)}'`;
|
|
980
|
-
}
|
|
981
|
-
/**
|
|
982
|
-
* Build a shell command string from a bare-command tool call. Models often
|
|
983
|
-
* emit the binary as the tool name (`sed`, `awk`, `git`, …) and put the rest
|
|
984
|
-
* into an explicit `command`/`cmd`/`argv`/`args` field. Only those explicit
|
|
985
|
-
* fields are honored: array forms are shell-quoted per element, and calls that
|
|
986
|
-
* look like a file-write shape (content/body/text/patch/...) are rejected so
|
|
987
|
-
* an unknown-tool error is surfaced instead of executing model text.
|
|
988
|
-
*/
|
|
989
|
-
function buildShellCommandFromCall(name, args) {
|
|
990
|
-
const trimmedName = name.trim();
|
|
991
|
-
const keys = Object.keys(args);
|
|
992
|
-
for (const key of keys) {
|
|
993
|
-
if (CONTENT_SHAPED_ARG_KEYS.has(key.toLowerCase()))
|
|
994
|
-
return undefined;
|
|
995
|
-
}
|
|
996
|
-
const asText = (value) => {
|
|
997
|
-
if (typeof value === "string")
|
|
998
|
-
return value;
|
|
999
|
-
if (typeof value === "number")
|
|
1000
|
-
return String(value);
|
|
1001
|
-
if (Array.isArray(value)) {
|
|
1002
|
-
const parts = value
|
|
1003
|
-
.filter((v) => typeof v === "string" || typeof v === "number")
|
|
1004
|
-
.map((v) => shellQuoteToken(String(v)));
|
|
1005
|
-
return parts.length > 0 ? parts.join(" ") : undefined;
|
|
1006
|
-
}
|
|
1007
|
-
return undefined;
|
|
1008
|
-
};
|
|
1009
|
-
let rest;
|
|
1010
|
-
for (const key of COMMAND_ARG_KEYS) {
|
|
1011
|
-
const text = asText(args[key]);
|
|
1012
|
-
if (text !== undefined) {
|
|
1013
|
-
rest = text;
|
|
1014
|
-
break;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
if (rest === undefined) {
|
|
1018
|
-
// No explicit command field. A name-only call with no other arguments is
|
|
1019
|
-
// still runnable (`whoami`); anything else is an unknown tool, not a
|
|
1020
|
-
// command to be assembled out of arbitrary model values.
|
|
1021
|
-
const meaningful = keys.filter((key) => !["cwd", "timeoutMs", "iOwnThis", "own"].includes(key));
|
|
1022
|
-
if (meaningful.length > 0)
|
|
1023
|
-
return undefined;
|
|
1024
|
-
return trimmedName || undefined;
|
|
1025
|
-
}
|
|
1026
|
-
const trimmedRest = rest.trim();
|
|
1027
|
-
if (!trimmedRest)
|
|
1028
|
-
return trimmedName || undefined;
|
|
1029
|
-
// Avoid a doubled binary when `rest` already begins with the tool name.
|
|
1030
|
-
const firstToken = trimmedRest.split(/\s+/)[0];
|
|
1031
|
-
if (!trimmedName.includes(" ") && firstToken === trimmedName) {
|
|
1032
|
-
return trimmedRest;
|
|
1033
|
-
}
|
|
1034
|
-
return `${trimmedName} ${trimmedRest}`.trim();
|
|
1035
|
-
}
|
|
1036
|
-
/**
|
|
1037
|
-
* Normalize a tool call before dispatch. If the name is not a registered
|
|
1038
|
-
* tool but looks like a bare shell command (no `namespace.` dot — clai tools
|
|
1039
|
-
* are all namespaced, e.g. `fs.read`, `web.search`), rewrite it into a
|
|
1040
|
-
* `shell.exec` call instead of dead-ending on "Unknown tool: sed". The
|
|
1041
|
-
* rewritten call still flows through the normal shell safety classifier, so
|
|
1042
|
-
* dangerous commands are gated exactly as a hand-written shell.exec would be.
|
|
1043
|
-
*/
|
|
1044
|
-
const CLASSIC_TOOL_ALIASES = {
|
|
1045
|
-
bash: "shell.exec",
|
|
1046
|
-
read: "fs.read",
|
|
1047
|
-
write: "fs.write",
|
|
1048
|
-
edit: "fs.edit",
|
|
1049
|
-
multiedit: "fs.edit",
|
|
1050
|
-
ls: "fs.list",
|
|
1051
|
-
glob: "fs.list",
|
|
1052
|
-
grep: "fs.search",
|
|
1053
|
-
webfetch: "web.fetch",
|
|
1054
|
-
websearch: "web.search",
|
|
1055
|
-
};
|
|
1056
|
-
function remapClassicArgs(call) {
|
|
1057
|
-
const args = { ...(call.args ?? {}) };
|
|
1058
|
-
if (typeof args.file_path === "string" && args.path === undefined) {
|
|
1059
|
-
args.path = args.file_path;
|
|
1060
|
-
delete args.file_path;
|
|
1061
|
-
}
|
|
1062
|
-
if (typeof args.old_string === "string" && args.oldText === undefined) {
|
|
1063
|
-
args.oldText = args.old_string;
|
|
1064
|
-
delete args.old_string;
|
|
1065
|
-
}
|
|
1066
|
-
if (typeof args.new_string === "string" && args.newText === undefined) {
|
|
1067
|
-
args.newText = args.new_string;
|
|
1068
|
-
delete args.new_string;
|
|
1069
|
-
}
|
|
1070
|
-
return { name: call.name, args };
|
|
1071
|
-
}
|
|
1072
|
-
const GATEWAY_ARG_ENVELOPES = new Set(["input", "arguments", "parameters"]);
|
|
1073
|
-
function unwrapGatewayToolArgs(args) {
|
|
1074
|
-
const keys = Object.keys(args);
|
|
1075
|
-
if (keys.length !== 1 || !GATEWAY_ARG_ENVELOPES.has(keys[0]))
|
|
1076
|
-
return args;
|
|
1077
|
-
const value = args[keys[0]];
|
|
1078
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1079
|
-
return value;
|
|
1080
|
-
}
|
|
1081
|
-
if (typeof value !== "string")
|
|
1082
|
-
return args;
|
|
1083
|
-
try {
|
|
1084
|
-
const parsed = JSON.parse(value.trim());
|
|
1085
|
-
return parsed && typeof parsed === "object" && !Array.isArray(parsed)
|
|
1086
|
-
? parsed
|
|
1087
|
-
: args;
|
|
1088
|
-
}
|
|
1089
|
-
catch {
|
|
1090
|
-
return args;
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
export function normalizeToolCall(call) {
|
|
1094
|
-
let name = typeof call.name === "string" ? call.name.trim() : "";
|
|
1095
|
-
const originalArgs = call.args ?? {};
|
|
1096
|
-
const classic = CLASSIC_TOOL_ALIASES[name.toLowerCase()];
|
|
1097
|
-
if (classic && !toolRegistry[name]) {
|
|
1098
|
-
const args = unwrapGatewayToolArgs(originalArgs);
|
|
1099
|
-
const hasShellShape = COMMAND_ARG_KEYS.some((key) => args[key] !== undefined);
|
|
1100
|
-
if (classic === "shell.exec" || !hasShellShape) {
|
|
1101
|
-
return remapClassicArgs({ name: classic, args });
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
if (name && !toolRegistry[name]) {
|
|
1105
|
-
const cleaned = sanitizeToolName(name);
|
|
1106
|
-
const mapped = fromWireName(cleaned) ?? fromWireName(name) ?? cleaned;
|
|
1107
|
-
if (mapped &&
|
|
1108
|
-
(toolRegistry[mapped] ||
|
|
1109
|
-
NON_REGISTRY_TOOL_NAMES.has(mapped) ||
|
|
1110
|
-
mapped.startsWith("mcp."))) {
|
|
1111
|
-
return { name: mapped, args: unwrapGatewayToolArgs(originalArgs) };
|
|
1112
|
-
}
|
|
1113
|
-
if (cleaned && cleaned !== name)
|
|
1114
|
-
name = cleaned;
|
|
1115
|
-
}
|
|
1116
|
-
if (toolRegistry[name]) {
|
|
1117
|
-
const args = unwrapGatewayToolArgs(originalArgs);
|
|
1118
|
-
return name === call.name && args === originalArgs ? call : { name, args };
|
|
1119
|
-
}
|
|
1120
|
-
if (!name || name.includes(".") || name.includes("/")) {
|
|
1121
|
-
return name === call.name ? call : { name, args: originalArgs };
|
|
1122
|
-
}
|
|
1123
|
-
const command = buildShellCommandFromCall(name, originalArgs);
|
|
1124
|
-
if (!command)
|
|
1125
|
-
return call;
|
|
1126
|
-
const shellArgs = { command };
|
|
1127
|
-
if (typeof originalArgs.cwd === "string")
|
|
1128
|
-
shellArgs.cwd = originalArgs.cwd;
|
|
1129
|
-
if (typeof originalArgs.timeoutMs === "number") {
|
|
1130
|
-
shellArgs.timeoutMs = originalArgs.timeoutMs;
|
|
1131
|
-
}
|
|
1132
|
-
return { name: "shell.exec", args: shellArgs };
|
|
1133
|
-
}
|
|
1134
|
-
/**
|
|
1135
|
-
* Pull the result URLs out of a web.search success output. The output is a
|
|
1136
|
-
* one-line summary followed by a JSON `{ results: [{url, ...}] }` block; we
|
|
1137
|
-
* parse from the first brace. Falls back to a regex scan if JSON parsing
|
|
1138
|
-
* fails so a slightly different shape still yields fetchable URLs.
|
|
1139
|
-
*/
|
|
1140
81
|
export function extractResultUrls(output) {
|
|
1141
82
|
const brace = output.indexOf("{");
|
|
1142
83
|
if (brace >= 0) {
|
|
@@ -1149,7 +90,6 @@ export function extractResultUrls(output) {
|
|
|
1149
90
|
return urls;
|
|
1150
91
|
}
|
|
1151
92
|
catch {
|
|
1152
|
-
// fall through to regex
|
|
1153
93
|
}
|
|
1154
94
|
}
|
|
1155
95
|
const matches = output.match(/https?:\/\/[^\s"]+/g);
|
|
@@ -1203,13 +143,6 @@ export async function runToolCall(call, options = {}) {
|
|
|
1203
143
|
}
|
|
1204
144
|
return normalizeToolResult(normalized.name, await handler(normalized.args, options));
|
|
1205
145
|
}
|
|
1206
|
-
/**
|
|
1207
|
-
* Tools that may run **in parallel** inside `tool.batch` without racing
|
|
1208
|
-
* mutates. Anything outside this set is still allowed in a batch but is
|
|
1209
|
-
* forced serial (and may require confirmation — see {@link runToolBatch}).
|
|
1210
|
-
*
|
|
1211
|
-
* Kept for tests and call-sites that want the parallel-safe set.
|
|
1212
|
-
*/
|
|
1213
146
|
export const BATCH_SAFE_TOOLS = new Set([
|
|
1214
147
|
"fs.read",
|
|
1215
148
|
"fs.list",
|
|
@@ -1234,31 +167,6 @@ export const BATCH_SAFE_TOOLS = new Set([
|
|
|
1234
167
|
"skill.list",
|
|
1235
168
|
"skill.load",
|
|
1236
169
|
]);
|
|
1237
|
-
/**
|
|
1238
|
-
* Tools that must never ride inside tool.batch (session bookkeeping /
|
|
1239
|
-
* recursive batch / mode handoff). Everything else registered is allowed.
|
|
1240
|
-
*/
|
|
1241
|
-
const BATCH_FORBIDDEN_TOOLS = new Set([
|
|
1242
|
-
"tool.batch",
|
|
1243
|
-
...INTERACTIVE_SESSION_TOOL_NAMES,
|
|
1244
|
-
"plan.create",
|
|
1245
|
-
"task.move",
|
|
1246
|
-
"task.read",
|
|
1247
|
-
"task.update",
|
|
1248
|
-
"agent.handoff",
|
|
1249
|
-
"instructions.record",
|
|
1250
|
-
]);
|
|
1251
|
-
const BATCH_MAX_CALLS = 20;
|
|
1252
|
-
const BATCH_DEFAULT_CONCURRENCY = 3;
|
|
1253
|
-
const BATCH_MAX_CONCURRENCY = 6;
|
|
1254
|
-
/** Default batch ceiling; the model may override it with timeoutMs. */
|
|
1255
|
-
const BATCH_HARD_TIMEOUT_MS = 40_000;
|
|
1256
|
-
/** Progress heartbeats keep the outer tool stall watchdog alive. */
|
|
1257
|
-
const BATCH_HEARTBEAT_MS = 5_000;
|
|
1258
|
-
/**
|
|
1259
|
-
* Normalize a batch child tool name: wire forms (`tool_check`, `fs_read`)
|
|
1260
|
-
* and dotted names both resolve to the registry canonical name.
|
|
1261
|
-
*/
|
|
1262
170
|
export function normalizeBatchToolName(raw) {
|
|
1263
171
|
const trimmed = raw.trim();
|
|
1264
172
|
if (!trimmed)
|
|
@@ -1271,8 +179,6 @@ export function normalizeBatchToolName(raw) {
|
|
|
1271
179
|
const mapped = fromWireName(trimmed);
|
|
1272
180
|
if (mapped && (toolRegistry[mapped] || NON_REGISTRY_TOOL_NAMES.has(mapped)))
|
|
1273
181
|
return mapped;
|
|
1274
|
-
// Underscore-all form that fromWireName may still leave as-is if unregistered
|
|
1275
|
-
// mid-name (tool_check → tool.check via first underscore heuristic).
|
|
1276
182
|
if (!trimmed.includes(".") && trimmed.includes("_")) {
|
|
1277
183
|
const dotted = trimmed.replace(/_/g, ".");
|
|
1278
184
|
if (toolRegistry[dotted] || NON_REGISTRY_TOOL_NAMES.has(dotted))
|
|
@@ -1280,508 +186,4 @@ export function normalizeBatchToolName(raw) {
|
|
|
1280
186
|
}
|
|
1281
187
|
return trimmed;
|
|
1282
188
|
}
|
|
1283
|
-
function parseBatchCalls(value) {
|
|
1284
|
-
if (!Array.isArray(value)) {
|
|
1285
|
-
throw new Error("tool.batch expects { calls: [{name, args}, ...] }");
|
|
1286
|
-
}
|
|
1287
|
-
if (value.length === 0) {
|
|
1288
|
-
throw new Error("tool.batch requires at least one call");
|
|
1289
|
-
}
|
|
1290
|
-
if (value.length > BATCH_MAX_CALLS) {
|
|
1291
|
-
throw new Error(`tool.batch accepts at most ${BATCH_MAX_CALLS} calls per invocation`);
|
|
1292
|
-
}
|
|
1293
|
-
const seenIds = new Set();
|
|
1294
|
-
return value.map((entry, index) => {
|
|
1295
|
-
if (!entry ||
|
|
1296
|
-
typeof entry !== "object" ||
|
|
1297
|
-
Array.isArray(entry) ||
|
|
1298
|
-
typeof entry.name !== "string" ||
|
|
1299
|
-
typeof entry.args !== "object" ||
|
|
1300
|
-
entry.args === null) {
|
|
1301
|
-
throw new Error(`tool.batch call #${index} must be { name: string, args: object }`);
|
|
1302
|
-
}
|
|
1303
|
-
const rec = entry;
|
|
1304
|
-
const rawName = rec.name;
|
|
1305
|
-
const args = rec.args;
|
|
1306
|
-
const name = normalizeBatchToolName(rawName);
|
|
1307
|
-
if (BATCH_FORBIDDEN_TOOLS.has(name)) {
|
|
1308
|
-
throw new Error(`tool.batch refuses to run "${rawName}" — ${name} cannot be nested inside a batch`);
|
|
1309
|
-
}
|
|
1310
|
-
if (!toolRegistry[name] && !isExternalToolName(name)) {
|
|
1311
|
-
throw new Error(`tool.batch refuses unknown tool "${rawName}"` +
|
|
1312
|
-
(name !== rawName ? ` (normalized to "${name}")` : "") +
|
|
1313
|
-
`. Available tools: ${knownToolNames().join(", ")}` +
|
|
1314
|
-
(externalToolNames().length > 0
|
|
1315
|
-
? `, ${[...externalToolNames()].sort().join(", ")}`
|
|
1316
|
-
: ""));
|
|
1317
|
-
}
|
|
1318
|
-
const id = resolveBatchCallId(rec, index, seenIds);
|
|
1319
|
-
const cancelOnFail = parseCancelOnFailField(rec, `call #${index}`);
|
|
1320
|
-
return { id, name, args, cancelOnFail, index0: index };
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
/** Combine parent abort + policy abort into one signal for children. */
|
|
1324
|
-
function mergeAbortSignals(a, b) {
|
|
1325
|
-
const anyFn = AbortSignal.any;
|
|
1326
|
-
if (typeof anyFn === "function") {
|
|
1327
|
-
return anyFn([a, b]);
|
|
1328
|
-
}
|
|
1329
|
-
const ac = new AbortController();
|
|
1330
|
-
const forward = () => {
|
|
1331
|
-
if (!ac.signal.aborted)
|
|
1332
|
-
ac.abort();
|
|
1333
|
-
};
|
|
1334
|
-
if (a.aborted || b.aborted) {
|
|
1335
|
-
ac.abort();
|
|
1336
|
-
return ac.signal;
|
|
1337
|
-
}
|
|
1338
|
-
a.addEventListener("abort", forward, { once: true });
|
|
1339
|
-
b.addEventListener("abort", forward, { once: true });
|
|
1340
|
-
return ac.signal;
|
|
1341
|
-
}
|
|
1342
|
-
async function runWithLimit(items, limit, worker) {
|
|
1343
|
-
const queue = items.map((item, index) => ({ item, index }));
|
|
1344
|
-
const runners = [];
|
|
1345
|
-
for (let n = 0; n < Math.min(limit, queue.length); n += 1) {
|
|
1346
|
-
runners.push((async () => {
|
|
1347
|
-
while (queue.length > 0) {
|
|
1348
|
-
const next = queue.shift();
|
|
1349
|
-
if (!next)
|
|
1350
|
-
break;
|
|
1351
|
-
await worker(next.item, next.index);
|
|
1352
|
-
}
|
|
1353
|
-
})());
|
|
1354
|
-
}
|
|
1355
|
-
await Promise.all(runners);
|
|
1356
|
-
}
|
|
1357
|
-
async function runToolBatch(args, options) {
|
|
1358
|
-
const calls = parseBatchCalls(args.calls);
|
|
1359
|
-
const knownIds = new Set(calls.map((c) => c.id));
|
|
1360
|
-
const callMeta = calls.map((c) => ({
|
|
1361
|
-
id: c.id,
|
|
1362
|
-
name: c.name,
|
|
1363
|
-
index1: c.index0 + 1,
|
|
1364
|
-
cancelOnFail: c.cancelOnFail,
|
|
1365
|
-
}));
|
|
1366
|
-
const metaById = new Map(callMeta.map((m) => [m.id, m]));
|
|
1367
|
-
const failMode = compileBatchFailMode(parseBatchFailPolicy(args, knownIds), callMeta, knownIds);
|
|
1368
|
-
// Re-classify each child: block always refused; confirm allowed only when
|
|
1369
|
-
// the parent turn already confirmed (options.confirmed) so shell/fs mutates
|
|
1370
|
-
// cannot sneak past the safety gate as a "safe" batch wrapper.
|
|
1371
|
-
const scope = await loadScopeForSession(options?.sessionId).catch(() => undefined);
|
|
1372
|
-
let needsSerial = false;
|
|
1373
|
-
for (const spec of calls) {
|
|
1374
|
-
const decision = classifyToolCall({ name: spec.name, args: spec.args }, { scope });
|
|
1375
|
-
if (decision.level === "block") {
|
|
1376
|
-
throw new Error(`tool.batch refuses ${spec.name}: ${decision.reason}`);
|
|
1377
|
-
}
|
|
1378
|
-
if (decision.level === "confirm") {
|
|
1379
|
-
if (!options?.confirmed) {
|
|
1380
|
-
throw new Error(`tool.batch refuses ${spec.name}: ${decision.reason} ` +
|
|
1381
|
-
`(confirm-level tools need approval — emit them as top-level tools, or re-run the batch after confirm)`);
|
|
1382
|
-
}
|
|
1383
|
-
needsSerial = true;
|
|
1384
|
-
}
|
|
1385
|
-
// Non-parallel-safe tools always serialize to avoid racing writes/shells.
|
|
1386
|
-
if (!BATCH_SAFE_TOOLS.has(spec.name) &&
|
|
1387
|
-
!isExternalToolParallelSafe(spec.name)) {
|
|
1388
|
-
needsSerial = true;
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
|
-
const requestedConcurrency = Math.max(1, Math.min(typeof args.concurrency === "number"
|
|
1392
|
-
? Math.floor(args.concurrency)
|
|
1393
|
-
: BATCH_DEFAULT_CONCURRENCY, BATCH_MAX_CONCURRENCY));
|
|
1394
|
-
// Parallel only when every child is read-only/safe-parallel. Mixed or
|
|
1395
|
-
// mutating batches run one-at-a-time in order.
|
|
1396
|
-
// Selective/fail-fast policies also force serial so cancel decisions apply
|
|
1397
|
-
// before dependents start (deterministic for models).
|
|
1398
|
-
if (failMode.kind !== "continue") {
|
|
1399
|
-
needsSerial = true;
|
|
1400
|
-
}
|
|
1401
|
-
const concurrency = needsSerial ? 1 : requestedConcurrency;
|
|
1402
|
-
// Local abort that fires on parent cancel OR the batch hard timeout.
|
|
1403
|
-
// Children receive this signal so a hung http.fetch/dns cannot pin the UI
|
|
1404
|
-
// on "● tool.batch running" forever.
|
|
1405
|
-
const batchAc = new AbortController();
|
|
1406
|
-
// Policy cancel (on_fail) — separate from user Esc / hard timeout.
|
|
1407
|
-
const policyAc = new AbortController();
|
|
1408
|
-
const onParentAbort = () => {
|
|
1409
|
-
if (!batchAc.signal.aborted)
|
|
1410
|
-
batchAc.abort();
|
|
1411
|
-
};
|
|
1412
|
-
if (options?.signal) {
|
|
1413
|
-
if (options.signal.aborted)
|
|
1414
|
-
batchAc.abort();
|
|
1415
|
-
else
|
|
1416
|
-
options.signal.addEventListener("abort", onParentAbort, { once: true });
|
|
1417
|
-
}
|
|
1418
|
-
const batchTimeoutMs = Math.max(1_000, Math.min(1_800_000, optionalNumber(args, "timeoutMs") ?? BATCH_HARD_TIMEOUT_MS));
|
|
1419
|
-
const hardTimer = setTimeout(() => {
|
|
1420
|
-
if (!batchAc.signal.aborted)
|
|
1421
|
-
batchAc.abort();
|
|
1422
|
-
}, batchTimeoutMs);
|
|
1423
|
-
hardTimer.unref?.();
|
|
1424
|
-
let finished = 0;
|
|
1425
|
-
const failedIds = new Set();
|
|
1426
|
-
const cancelledIds = new Set();
|
|
1427
|
-
/** id → human reason for policy cancel */
|
|
1428
|
-
const cancelReasons = new Map();
|
|
1429
|
-
let policyCancelCount = 0;
|
|
1430
|
-
const tick = (line) => {
|
|
1431
|
-
// Heartbeats also reset the runner's 60s "stalled tool" watchdog, which
|
|
1432
|
-
// previously aborted silent batches mid-flight and left no tool-result.
|
|
1433
|
-
options?.onOutput?.(line.endsWith("\n") ? line : `${line}\n`, "stdout");
|
|
1434
|
-
};
|
|
1435
|
-
/** Stream a finished child as a nested `── #N` section so the live UI can
|
|
1436
|
-
* expand sub-cards with real output (not just "ok" status ticks). */
|
|
1437
|
-
const streamSection = (outcome) => {
|
|
1438
|
-
const status = outcome.status;
|
|
1439
|
-
const head = `── #${outcome.index + 1} ${outcome.name} [${status}${outcome.exitCode !== undefined ? ` exit=${outcome.exitCode}` : ""}]`;
|
|
1440
|
-
const body = outcome.error
|
|
1441
|
-
? `error: ${outcome.error}`
|
|
1442
|
-
: (outcome.output ?? "").trim();
|
|
1443
|
-
tick(body ? `${head}\n${body}\n\n` : `${head}\n\n`);
|
|
1444
|
-
};
|
|
1445
|
-
const modeLabel = failMode.kind === "continue"
|
|
1446
|
-
? "continue"
|
|
1447
|
-
: failMode.kind === "cancel_pending"
|
|
1448
|
-
? "cancel_pending"
|
|
1449
|
-
: `rules(${failMode.rules.length})`;
|
|
1450
|
-
tick(`[batch] starting ${calls.length} call(s), concurrency=${concurrency}, on_fail=${modeLabel}`);
|
|
1451
|
-
const heartbeat = setInterval(() => {
|
|
1452
|
-
tick(`[batch] still running — ${finished}/${calls.length} finished`);
|
|
1453
|
-
}, BATCH_HEARTBEAT_MS);
|
|
1454
|
-
heartbeat.unref?.();
|
|
1455
|
-
const applyFailPolicy = (justFailedId) => {
|
|
1456
|
-
failedIds.add(justFailedId);
|
|
1457
|
-
const targets = evaluateCancelTargets(failMode, failedIds, calls.map((c) => c.id));
|
|
1458
|
-
if (targets.size === 0)
|
|
1459
|
-
return;
|
|
1460
|
-
const triggerList = [...failedIds];
|
|
1461
|
-
const reason = formatBatchCancelReason(triggerList, metaById);
|
|
1462
|
-
let newly = 0;
|
|
1463
|
-
for (const id of targets) {
|
|
1464
|
-
if (cancelledIds.has(id))
|
|
1465
|
-
continue;
|
|
1466
|
-
// Never mark the just-failed id as cancelled (it has a real outcome).
|
|
1467
|
-
if (failedIds.has(id))
|
|
1468
|
-
continue;
|
|
1469
|
-
const idx = calls.findIndex((c) => c.id === id);
|
|
1470
|
-
if (idx < 0)
|
|
1471
|
-
continue;
|
|
1472
|
-
// Already finished with a result — leave it.
|
|
1473
|
-
if (outcomes[idx])
|
|
1474
|
-
continue;
|
|
1475
|
-
cancelledIds.add(id);
|
|
1476
|
-
cancelReasons.set(id, reason);
|
|
1477
|
-
newly += 1;
|
|
1478
|
-
}
|
|
1479
|
-
if (newly > 0) {
|
|
1480
|
-
policyCancelCount += newly;
|
|
1481
|
-
if (!policyAc.signal.aborted)
|
|
1482
|
-
policyAc.abort();
|
|
1483
|
-
tick(`[batch] on_fail cancelled ${newly} call(s) after ${metaById.get(justFailedId)?.name ?? justFailedId} failed`);
|
|
1484
|
-
}
|
|
1485
|
-
};
|
|
1486
|
-
const outcomes = new Array(calls.length);
|
|
1487
|
-
const childSignal = mergeAbortSignals(batchAc.signal, policyAc.signal);
|
|
1488
|
-
try {
|
|
1489
|
-
await runWithLimit(calls, concurrency, async (spec, index) => {
|
|
1490
|
-
// Policy-cancelled before start (or mid-batch after sibling fail).
|
|
1491
|
-
if (cancelledIds.has(spec.id) && !outcomes[index]) {
|
|
1492
|
-
outcomes[index] = {
|
|
1493
|
-
index,
|
|
1494
|
-
id: spec.id,
|
|
1495
|
-
name: spec.name,
|
|
1496
|
-
status: "cancelled",
|
|
1497
|
-
ok: false,
|
|
1498
|
-
output: cancelReasons.get(spec.id) ??
|
|
1499
|
-
"Cancelled — not run because a sibling call failed",
|
|
1500
|
-
exitCode: 130,
|
|
1501
|
-
};
|
|
1502
|
-
finished += 1;
|
|
1503
|
-
tick(`[batch] #${index + 1} ${spec.name} cancelled`);
|
|
1504
|
-
streamSection(outcomes[index]);
|
|
1505
|
-
return;
|
|
1506
|
-
}
|
|
1507
|
-
if (batchAc.signal.aborted) {
|
|
1508
|
-
outcomes[index] = {
|
|
1509
|
-
index,
|
|
1510
|
-
id: spec.id,
|
|
1511
|
-
name: spec.name,
|
|
1512
|
-
status: "cancelled",
|
|
1513
|
-
ok: false,
|
|
1514
|
-
output: "Aborted before execution.",
|
|
1515
|
-
exitCode: 130,
|
|
1516
|
-
};
|
|
1517
|
-
finished += 1;
|
|
1518
|
-
streamSection(outcomes[index]);
|
|
1519
|
-
return;
|
|
1520
|
-
}
|
|
1521
|
-
// Re-check cancel after waiting in the worker queue.
|
|
1522
|
-
if (cancelledIds.has(spec.id)) {
|
|
1523
|
-
outcomes[index] = {
|
|
1524
|
-
index,
|
|
1525
|
-
id: spec.id,
|
|
1526
|
-
name: spec.name,
|
|
1527
|
-
status: "cancelled",
|
|
1528
|
-
ok: false,
|
|
1529
|
-
output: cancelReasons.get(spec.id) ??
|
|
1530
|
-
"Cancelled — not run because a sibling call failed",
|
|
1531
|
-
exitCode: 130,
|
|
1532
|
-
};
|
|
1533
|
-
finished += 1;
|
|
1534
|
-
tick(`[batch] #${index + 1} ${spec.name} cancelled`);
|
|
1535
|
-
streamSection(outcomes[index]);
|
|
1536
|
-
return;
|
|
1537
|
-
}
|
|
1538
|
-
tick(`[batch] #${index + 1} ${spec.name} starting`);
|
|
1539
|
-
try {
|
|
1540
|
-
// Lightweight child heartbeats so silent tools (whois) never trip the
|
|
1541
|
-
// outer 60s stall watchdog while still running under the batch.
|
|
1542
|
-
const childHeartbeat = setInterval(() => {
|
|
1543
|
-
tick(`[batch] #${index + 1} ${spec.name} still running…`);
|
|
1544
|
-
}, BATCH_HEARTBEAT_MS);
|
|
1545
|
-
childHeartbeat.unref?.();
|
|
1546
|
-
let result;
|
|
1547
|
-
try {
|
|
1548
|
-
result = await runToolCall({ name: spec.name, args: spec.args },
|
|
1549
|
-
// Do not fan full child stdout into the parent spool (parallel
|
|
1550
|
-
// interleaving). Settled section bodies are streamed below so the
|
|
1551
|
-
// live UI can show expanded nested cards immediately.
|
|
1552
|
-
// Forward confirmed so approved mutates inside a batch still run.
|
|
1553
|
-
{
|
|
1554
|
-
signal: childSignal,
|
|
1555
|
-
...(options?.confirmed !== undefined
|
|
1556
|
-
? { confirmed: options.confirmed }
|
|
1557
|
-
: {}),
|
|
1558
|
-
...(options?.requestSecret
|
|
1559
|
-
? { requestSecret: options.requestSecret }
|
|
1560
|
-
: {}),
|
|
1561
|
-
...(options?.authorizeNetworkHop
|
|
1562
|
-
? { authorizeNetworkHop: options.authorizeNetworkHop }
|
|
1563
|
-
: {}),
|
|
1564
|
-
...(options?.engagementAuthorization
|
|
1565
|
-
? { engagementAuthorization: options.engagementAuthorization }
|
|
1566
|
-
: {}),
|
|
1567
|
-
...(options?.sessionId ? { sessionId: options.sessionId } : {}),
|
|
1568
|
-
...(options?.llmProvider ? { llmProvider: options.llmProvider } : {}),
|
|
1569
|
-
...(options?.llmModel ? { llmModel: options.llmModel } : {}),
|
|
1570
|
-
...(options?.taskId ? { taskId: options.taskId } : {}),
|
|
1571
|
-
...(options?.parentTaskId ? { parentTaskId: options.parentTaskId } : {}),
|
|
1572
|
-
...(options?.delegationId ? { delegationId: options.delegationId } : {}),
|
|
1573
|
-
...(options?.wakeOnCompletion !== undefined
|
|
1574
|
-
? { wakeOnCompletion: options.wakeOnCompletion }
|
|
1575
|
-
: {}),
|
|
1576
|
-
...(options?.monitor !== undefined ? { monitor: options.monitor } : {}),
|
|
1577
|
-
});
|
|
1578
|
-
}
|
|
1579
|
-
finally {
|
|
1580
|
-
clearInterval(childHeartbeat);
|
|
1581
|
-
}
|
|
1582
|
-
// If we were policy-aborted mid-flight and the child looks aborted,
|
|
1583
|
-
// surface as cancelled rather than a generic fail when we intended cancel.
|
|
1584
|
-
if (cancelledIds.has(spec.id) ||
|
|
1585
|
-
(policyAc.signal.aborted &&
|
|
1586
|
-
!result.ok &&
|
|
1587
|
-
(result.exitCode === 130 ||
|
|
1588
|
-
/abort|cancel/i.test(result.output ?? "")))) {
|
|
1589
|
-
const reason = cancelReasons.get(spec.id) ??
|
|
1590
|
-
"Cancelled — aborted because a sibling call failed";
|
|
1591
|
-
outcomes[index] = {
|
|
1592
|
-
index,
|
|
1593
|
-
id: spec.id,
|
|
1594
|
-
name: spec.name,
|
|
1595
|
-
status: "cancelled",
|
|
1596
|
-
ok: false,
|
|
1597
|
-
output: reason,
|
|
1598
|
-
exitCode: 130,
|
|
1599
|
-
};
|
|
1600
|
-
cancelledIds.add(spec.id);
|
|
1601
|
-
tick(`[batch] #${index + 1} ${spec.name} cancelled`);
|
|
1602
|
-
streamSection(outcomes[index]);
|
|
1603
|
-
}
|
|
1604
|
-
else if (result.ok) {
|
|
1605
|
-
outcomes[index] = {
|
|
1606
|
-
index,
|
|
1607
|
-
id: spec.id,
|
|
1608
|
-
name: spec.name,
|
|
1609
|
-
status: "ok",
|
|
1610
|
-
ok: true,
|
|
1611
|
-
output: result.output,
|
|
1612
|
-
exitCode: result.exitCode,
|
|
1613
|
-
...(result.suppressedRepeat ? { suppressedRepeat: true } : {}),
|
|
1614
|
-
...(result.images?.length ? { images: result.images } : {}),
|
|
1615
|
-
};
|
|
1616
|
-
tick(`[batch] #${index + 1} ${spec.name} ok` +
|
|
1617
|
-
(result.exitCode !== undefined
|
|
1618
|
-
? ` exit=${result.exitCode}`
|
|
1619
|
-
: ""));
|
|
1620
|
-
streamSection(outcomes[index]);
|
|
1621
|
-
}
|
|
1622
|
-
else {
|
|
1623
|
-
outcomes[index] = {
|
|
1624
|
-
index,
|
|
1625
|
-
id: spec.id,
|
|
1626
|
-
name: spec.name,
|
|
1627
|
-
status: "fail",
|
|
1628
|
-
ok: false,
|
|
1629
|
-
output: result.output,
|
|
1630
|
-
exitCode: result.exitCode,
|
|
1631
|
-
...(result.suppressedRepeat ? { suppressedRepeat: true } : {}),
|
|
1632
|
-
};
|
|
1633
|
-
tick(`[batch] #${index + 1} ${spec.name} fail` +
|
|
1634
|
-
(result.exitCode !== undefined
|
|
1635
|
-
? ` exit=${result.exitCode}`
|
|
1636
|
-
: ""));
|
|
1637
|
-
streamSection(outcomes[index]);
|
|
1638
|
-
applyFailPolicy(spec.id);
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
catch (error) {
|
|
1642
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1643
|
-
// Policy abort while starting/running → cancelled if we marked it.
|
|
1644
|
-
if (cancelledIds.has(spec.id) || policyAc.signal.aborted) {
|
|
1645
|
-
outcomes[index] = {
|
|
1646
|
-
index,
|
|
1647
|
-
id: spec.id,
|
|
1648
|
-
name: spec.name,
|
|
1649
|
-
status: "cancelled",
|
|
1650
|
-
ok: false,
|
|
1651
|
-
output: cancelReasons.get(spec.id) ??
|
|
1652
|
-
"Cancelled — aborted because a sibling call failed",
|
|
1653
|
-
exitCode: 130,
|
|
1654
|
-
};
|
|
1655
|
-
cancelledIds.add(spec.id);
|
|
1656
|
-
tick(`[batch] #${index + 1} ${spec.name} cancelled`);
|
|
1657
|
-
streamSection(outcomes[index]);
|
|
1658
|
-
}
|
|
1659
|
-
else {
|
|
1660
|
-
outcomes[index] = {
|
|
1661
|
-
index,
|
|
1662
|
-
id: spec.id,
|
|
1663
|
-
name: spec.name,
|
|
1664
|
-
status: "fail",
|
|
1665
|
-
ok: false,
|
|
1666
|
-
output: "",
|
|
1667
|
-
error: message,
|
|
1668
|
-
};
|
|
1669
|
-
tick(`[batch] #${index + 1} ${spec.name} error: ${message}`);
|
|
1670
|
-
streamSection(outcomes[index]);
|
|
1671
|
-
applyFailPolicy(spec.id);
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
|
-
finally {
|
|
1675
|
-
finished += 1;
|
|
1676
|
-
}
|
|
1677
|
-
});
|
|
1678
|
-
}
|
|
1679
|
-
finally {
|
|
1680
|
-
clearInterval(heartbeat);
|
|
1681
|
-
clearTimeout(hardTimer);
|
|
1682
|
-
if (options?.signal) {
|
|
1683
|
-
options.signal.removeEventListener("abort", onParentAbort);
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
// Fill any holes left by a mid-batch abort/timeout/policy cancel so we
|
|
1687
|
-
// always emit a complete sectioned body and a tool-result.
|
|
1688
|
-
const parentAborted = Boolean(options?.signal?.aborted);
|
|
1689
|
-
// Hard timeout aborts batchAc; policy cancel only aborts policyAc.
|
|
1690
|
-
const hardTimedOut = batchAc.signal.aborted && !parentAborted;
|
|
1691
|
-
for (let i = 0; i < calls.length; i += 1) {
|
|
1692
|
-
if (outcomes[i])
|
|
1693
|
-
continue;
|
|
1694
|
-
const spec = calls[i];
|
|
1695
|
-
if (cancelledIds.has(spec.id) || cancelReasons.has(spec.id)) {
|
|
1696
|
-
outcomes[i] = {
|
|
1697
|
-
index: i,
|
|
1698
|
-
id: spec.id,
|
|
1699
|
-
name: spec.name,
|
|
1700
|
-
status: "cancelled",
|
|
1701
|
-
ok: false,
|
|
1702
|
-
output: cancelReasons.get(spec.id) ??
|
|
1703
|
-
"Cancelled — not run because a sibling call failed",
|
|
1704
|
-
exitCode: 130,
|
|
1705
|
-
};
|
|
1706
|
-
continue;
|
|
1707
|
-
}
|
|
1708
|
-
if (parentAborted) {
|
|
1709
|
-
outcomes[i] = {
|
|
1710
|
-
index: i,
|
|
1711
|
-
id: spec.id,
|
|
1712
|
-
name: spec.name,
|
|
1713
|
-
status: "cancelled",
|
|
1714
|
-
ok: false,
|
|
1715
|
-
output: "Not run — batch aborted.",
|
|
1716
|
-
exitCode: 130,
|
|
1717
|
-
};
|
|
1718
|
-
continue;
|
|
1719
|
-
}
|
|
1720
|
-
if (hardTimedOut) {
|
|
1721
|
-
outcomes[i] = {
|
|
1722
|
-
index: i,
|
|
1723
|
-
id: spec.id,
|
|
1724
|
-
name: spec.name,
|
|
1725
|
-
status: "fail",
|
|
1726
|
-
ok: false,
|
|
1727
|
-
output: `Not run — tool.batch timed out after ${Math.round(batchTimeoutMs / 1000)}s.`,
|
|
1728
|
-
exitCode: 124,
|
|
1729
|
-
};
|
|
1730
|
-
continue;
|
|
1731
|
-
}
|
|
1732
|
-
outcomes[i] = {
|
|
1733
|
-
index: i,
|
|
1734
|
-
id: spec.id,
|
|
1735
|
-
name: spec.name,
|
|
1736
|
-
status: "cancelled",
|
|
1737
|
-
ok: false,
|
|
1738
|
-
output: "Not run — batch aborted.",
|
|
1739
|
-
exitCode: 130,
|
|
1740
|
-
};
|
|
1741
|
-
}
|
|
1742
|
-
const finalOutcomes = outcomes;
|
|
1743
|
-
const allOk = finalOutcomes.every((outcome) => outcome.ok);
|
|
1744
|
-
const sections = finalOutcomes.map((outcome) => {
|
|
1745
|
-
const status = outcome.status;
|
|
1746
|
-
const head = `── #${outcome.index + 1} ${outcome.name} [${status}${outcome.exitCode !== undefined ? ` exit=${outcome.exitCode}` : ""}]`;
|
|
1747
|
-
const body = outcome.error
|
|
1748
|
-
? `error: ${outcome.error}`
|
|
1749
|
-
: outcome.output.trim();
|
|
1750
|
-
return `${head}\n${body}`;
|
|
1751
|
-
});
|
|
1752
|
-
let output = sections.join("\n\n");
|
|
1753
|
-
if (hardTimedOut && !allOk) {
|
|
1754
|
-
output =
|
|
1755
|
-
`[batch] timed out after ${Math.round(batchTimeoutMs / 1000)}s — partial results below\n\n` +
|
|
1756
|
-
output;
|
|
1757
|
-
}
|
|
1758
|
-
else if (policyCancelCount > 0) {
|
|
1759
|
-
const n = finalOutcomes.filter((o) => o.status === "cancelled").length;
|
|
1760
|
-
if (n > 0) {
|
|
1761
|
-
output =
|
|
1762
|
-
`[batch] on_fail cancelled ${n} call(s) — partial results below\n\n` +
|
|
1763
|
-
output;
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
// `ok` is the signal the runner, loop-guard, and task-evidence layers use, so
|
|
1767
|
-
// it reports the truth: a batch whose children failed is NOT a success. The
|
|
1768
|
-
// original intent (a failed child must not cancel sibling top-level tools) is
|
|
1769
|
-
// preserved by `partial`, which tells the runner this was a partial result
|
|
1770
|
-
// rather than an aborted or hard-failed call.
|
|
1771
|
-
const anyOk = finalOutcomes.some((outcome) => outcome.ok);
|
|
1772
|
-
const allSuppressed = finalOutcomes.length > 0 &&
|
|
1773
|
-
finalOutcomes.every((outcome) => outcome.suppressedRepeat);
|
|
1774
|
-
// Children run in index order in the sectioned body, so keep the same order
|
|
1775
|
-
// here: the model is told "attached in this order" and must be able to match
|
|
1776
|
-
// each image back to the section that requested it.
|
|
1777
|
-
const batchImages = finalOutcomes.flatMap((outcome) => outcome.images ?? []);
|
|
1778
|
-
return {
|
|
1779
|
-
ok: allOk,
|
|
1780
|
-
partial: !allOk && anyOk && !parentAborted && !hardTimedOut,
|
|
1781
|
-
output,
|
|
1782
|
-
exitCode: allOk ? 0 : hardTimedOut ? 124 : parentAborted ? 130 : 1,
|
|
1783
|
-
...(allSuppressed ? { suppressedRepeat: true } : {}),
|
|
1784
|
-
...(batchImages.length ? { images: batchImages } : {}),
|
|
1785
|
-
};
|
|
1786
|
-
}
|
|
1787
189
|
//# sourceMappingURL=registry.js.map
|