@pentoshi/clai 4.11.5 → 4.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/compaction/summary-execution.d.ts +32 -0
- package/dist/agent/compaction/summary-execution.js +407 -0
- package/dist/agent/compaction/summary-execution.js.map +1 -0
- package/dist/agent/compaction-attempt.d.ts +5 -1
- package/dist/agent/compaction-attempt.js +22 -12
- package/dist/agent/compaction-attempt.js.map +1 -1
- package/dist/agent/compaction-executor.d.ts +5 -53
- package/dist/agent/compaction-executor.js +11 -442
- 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 +6 -464
- 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.d.ts +2 -0
- package/dist/agent/message-slim.js +45 -2
- package/dist/agent/message-slim.js.map +1 -1
- package/dist/agent/outcomes.d.ts +0 -1
- package/dist/agent/outcomes.js +0 -11
- package/dist/agent/outcomes.js.map +1 -1
- package/dist/agent/parser/arg-formatting.d.ts +3 -0
- package/dist/agent/parser/arg-formatting.js +99 -0
- package/dist/agent/parser/arg-formatting.js.map +1 -0
- package/dist/agent/parser/bare-recognition.d.ts +6 -0
- package/dist/agent/parser/bare-recognition.js +106 -0
- package/dist/agent/parser/bare-recognition.js.map +1 -0
- package/dist/agent/parser/parse-entry.d.ts +9 -0
- package/dist/agent/parser/parse-entry.js +198 -0
- package/dist/agent/parser/parse-entry.js.map +1 -0
- package/dist/agent/parser/repetition.d.ts +1 -0
- package/dist/agent/parser/repetition.js +72 -0
- package/dist/agent/parser/repetition.js.map +1 -0
- package/dist/agent/parser/salvage.d.ts +8 -0
- package/dist/agent/parser/salvage.js +100 -0
- package/dist/agent/parser/salvage.js.map +1 -0
- package/dist/agent/parser/vendor-protocols.d.ts +21 -0
- package/dist/agent/parser/vendor-protocols.js +265 -0
- package/dist/agent/parser/vendor-protocols.js.map +1 -0
- package/dist/agent/parser/xml-protocol.d.ts +7 -0
- package/dist/agent/parser/xml-protocol.js +455 -0
- package/dist/agent/parser/xml-protocol.js.map +1 -0
- package/dist/agent/plan/actions/plan-clear.d.ts +4 -0
- package/dist/agent/plan/actions/plan-clear.js +46 -0
- package/dist/agent/plan/actions/plan-clear.js.map +1 -0
- package/dist/agent/plan/actions/plan-create.d.ts +4 -0
- package/dist/agent/plan/actions/plan-create.js +371 -0
- package/dist/agent/plan/actions/plan-create.js.map +1 -0
- package/dist/agent/plan/actions/task-add.d.ts +5 -0
- package/dist/agent/plan/actions/task-add.js +131 -0
- package/dist/agent/plan/actions/task-add.js.map +1 -0
- package/dist/agent/plan/actions/task-move.d.ts +5 -0
- package/dist/agent/plan/actions/task-move.js +72 -0
- package/dist/agent/plan/actions/task-move.js.map +1 -0
- package/dist/agent/plan/context-message.d.ts +2 -0
- package/dist/agent/plan/context-message.js +91 -0
- package/dist/agent/plan/context-message.js.map +1 -0
- package/dist/agent/plan/handle-plan-tool.d.ts +24 -0
- package/dist/agent/plan/handle-plan-tool.js +310 -0
- package/dist/agent/plan/handle-plan-tool.js.map +1 -0
- package/dist/agent/plan/normalization.d.ts +19 -0
- package/dist/agent/plan/normalization.js +175 -0
- package/dist/agent/plan/normalization.js.map +1 -0
- package/dist/agent/plan-implement-compact.d.ts +0 -20
- package/dist/agent/plan-implement-compact.js +0 -21
- package/dist/agent/plan-implement-compact.js.map +1 -1
- package/dist/agent/plan-mode-reminders.d.ts +0 -24
- package/dist/agent/plan-mode-reminders.js +0 -21
- package/dist/agent/plan-mode-reminders.js.map +1 -1
- package/dist/agent/plan-tool.d.ts +5 -60
- package/dist/agent/plan-tool.js +7 -1235
- package/dist/agent/plan-tool.js.map +1 -1
- package/dist/agent/progress-pause-policy.d.ts +0 -1
- package/dist/agent/progress-pause-policy.js +1 -5
- package/dist/agent/progress-pause-policy.js.map +1 -1
- package/dist/agent/progress.d.ts +0 -5
- package/dist/agent/progress.js +0 -14
- package/dist/agent/progress.js.map +1 -1
- package/dist/agent/project-root.d.ts +0 -21
- package/dist/agent/project-root.js +0 -36
- package/dist/agent/project-root.js.map +1 -1
- package/dist/agent/prompt-composer.d.ts +0 -1
- package/dist/agent/prompt-composer.js +0 -2
- package/dist/agent/prompt-composer.js.map +1 -1
- package/dist/agent/reliability-policy.d.ts +0 -38
- package/dist/agent/reliability-policy.js +0 -39
- package/dist/agent/reliability-policy.js.map +1 -1
- package/dist/agent/request-accounting.d.ts +0 -30
- package/dist/agent/request-accounting.js +2 -26
- 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 +404 -5057
- 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 +13 -1716
- package/dist/agent/tool-call-parser.js.map +1 -1
- package/dist/agent/tool-history-projection.d.ts +7 -0
- package/dist/agent/tool-history-projection.js +455 -0
- package/dist/agent/tool-history-projection.js.map +1 -0
- package/dist/agent/tool-history.d.ts +8 -67
- package/dist/agent/tool-history.js +156 -219
- package/dist/agent/tool-history.js.map +1 -1
- package/dist/agent/tool-output-formatting.d.ts +0 -18
- package/dist/agent/tool-output-formatting.js +0 -28
- package/dist/agent/tool-output-formatting.js.map +1 -1
- package/dist/agent/turn/automatic-compaction-execution.d.ts +14 -0
- package/dist/agent/turn/automatic-compaction-execution.js +19 -0
- package/dist/agent/turn/automatic-compaction-execution.js.map +1 -0
- package/dist/agent/turn/compaction-admission.d.ts +25 -0
- package/dist/agent/turn/compaction-admission.js +40 -0
- package/dist/agent/turn/compaction-admission.js.map +1 -0
- package/dist/agent/turn/compaction-candidate.d.ts +10 -0
- package/dist/agent/turn/compaction-candidate.js +12 -0
- package/dist/agent/turn/compaction-candidate.js.map +1 -0
- package/dist/agent/turn/compaction-coordinator.d.ts +42 -0
- package/dist/agent/turn/compaction-coordinator.js +169 -0
- package/dist/agent/turn/compaction-coordinator.js.map +1 -0
- package/dist/agent/turn/compaction-durable-envelope.d.ts +24 -0
- package/dist/agent/turn/compaction-durable-envelope.js +54 -0
- package/dist/agent/turn/compaction-durable-envelope.js.map +1 -0
- package/dist/agent/turn/compaction-final-fit.d.ts +10 -0
- package/dist/agent/turn/compaction-final-fit.js +14 -0
- package/dist/agent/turn/compaction-final-fit.js.map +1 -0
- package/dist/agent/turn/compaction-messages.d.ts +6 -0
- package/dist/agent/turn/compaction-messages.js +15 -0
- package/dist/agent/turn/compaction-messages.js.map +1 -0
- package/dist/agent/turn/compaction-replay-selection.d.ts +10 -0
- package/dist/agent/turn/compaction-replay-selection.js +27 -0
- package/dist/agent/turn/compaction-replay-selection.js.map +1 -0
- package/dist/agent/turn/compaction-request-estimator.d.ts +7 -0
- package/dist/agent/turn/compaction-request-estimator.js +13 -0
- package/dist/agent/turn/compaction-request-estimator.js.map +1 -0
- package/dist/agent/turn/compaction-summarizer.d.ts +21 -0
- package/dist/agent/turn/compaction-summarizer.js +41 -0
- package/dist/agent/turn/compaction-summarizer.js.map +1 -0
- package/dist/agent/turn/continuation-overlap.d.ts +1 -0
- package/dist/agent/turn/continuation-overlap.js +35 -0
- package/dist/agent/turn/continuation-overlap.js.map +1 -0
- package/dist/agent/turn/contracts.d.ts +25 -0
- package/dist/agent/turn/contracts.js +2 -0
- package/dist/agent/turn/contracts.js.map +1 -0
- package/dist/agent/turn/event-emitter.d.ts +21 -0
- package/dist/agent/turn/event-emitter.js +116 -0
- package/dist/agent/turn/event-emitter.js.map +1 -0
- package/dist/agent/turn/evidence-flags.d.ts +16 -0
- package/dist/agent/turn/evidence-flags.js +44 -0
- package/dist/agent/turn/evidence-flags.js.map +1 -0
- package/dist/agent/turn/finalizer.d.ts +28 -0
- package/dist/agent/turn/finalizer.js +44 -0
- package/dist/agent/turn/finalizer.js.map +1 -0
- package/dist/agent/turn/history-writer.d.ts +17 -0
- package/dist/agent/turn/history-writer.js +72 -0
- package/dist/agent/turn/history-writer.js.map +1 -0
- package/dist/agent/turn/inserted-text.d.ts +1 -0
- package/dist/agent/turn/inserted-text.js +2 -0
- package/dist/agent/turn/inserted-text.js.map +1 -0
- package/dist/agent/turn/loop/answer-assessment.d.ts +22 -0
- package/dist/agent/turn/loop/answer-assessment.js +30 -0
- package/dist/agent/turn/loop/answer-assessment.js.map +1 -0
- package/dist/agent/turn/loop/answer-path.d.ts +20 -0
- package/dist/agent/turn/loop/answer-path.js +92 -0
- package/dist/agent/turn/loop/answer-path.js.map +1 -0
- package/dist/agent/turn/loop/call-binding.d.ts +17 -0
- package/dist/agent/turn/loop/call-binding.js +42 -0
- package/dist/agent/turn/loop/call-binding.js.map +1 -0
- package/dist/agent/turn/loop/canonicalize-turn-call.d.ts +5 -0
- package/dist/agent/turn/loop/canonicalize-turn-call.js +12 -0
- package/dist/agent/turn/loop/canonicalize-turn-call.js.map +1 -0
- package/dist/agent/turn/loop/completion-interpretation.d.ts +34 -0
- package/dist/agent/turn/loop/completion-interpretation.js +71 -0
- package/dist/agent/turn/loop/completion-interpretation.js.map +1 -0
- package/dist/agent/turn/loop/deps.d.ts +98 -0
- package/dist/agent/turn/loop/deps.js +2 -0
- package/dist/agent/turn/loop/deps.js.map +1 -0
- package/dist/agent/turn/loop/empty-response.d.ts +22 -0
- package/dist/agent/turn/loop/empty-response.js +51 -0
- package/dist/agent/turn/loop/empty-response.js.map +1 -0
- package/dist/agent/turn/loop/final-outcome.d.ts +15 -0
- package/dist/agent/turn/loop/final-outcome.js +49 -0
- package/dist/agent/turn/loop/final-outcome.js.map +1 -0
- package/dist/agent/turn/loop/group-execution.d.ts +14 -0
- package/dist/agent/turn/loop/group-execution.js +44 -0
- package/dist/agent/turn/loop/group-execution.js.map +1 -0
- package/dist/agent/turn/loop/model-only-rounds.d.ts +31 -0
- package/dist/agent/turn/loop/model-only-rounds.js +49 -0
- package/dist/agent/turn/loop/model-only-rounds.js.map +1 -0
- package/dist/agent/turn/loop/native-tool-calls.d.ts +12 -0
- package/dist/agent/turn/loop/native-tool-calls.js +57 -0
- package/dist/agent/turn/loop/native-tool-calls.js.map +1 -0
- package/dist/agent/turn/loop/native-write-salvage.d.ts +18 -0
- package/dist/agent/turn/loop/native-write-salvage.js +92 -0
- package/dist/agent/turn/loop/native-write-salvage.js.map +1 -0
- package/dist/agent/turn/loop/output-budget.d.ts +40 -0
- package/dist/agent/turn/loop/output-budget.js +76 -0
- package/dist/agent/turn/loop/output-budget.js.map +1 -0
- package/dist/agent/turn/loop/plan-call-deferral.d.ts +12 -0
- package/dist/agent/turn/loop/plan-call-deferral.js +32 -0
- package/dist/agent/turn/loop/plan-call-deferral.js.map +1 -0
- package/dist/agent/turn/loop/request-assembly.d.ts +32 -0
- package/dist/agent/turn/loop/request-assembly.js +97 -0
- package/dist/agent/turn/loop/request-assembly.js.map +1 -0
- package/dist/agent/turn/loop/round-closeout.d.ts +56 -0
- package/dist/agent/turn/loop/round-closeout.js +77 -0
- package/dist/agent/turn/loop/round-closeout.js.map +1 -0
- package/dist/agent/turn/loop/round-recorder.d.ts +38 -0
- package/dist/agent/turn/loop/round-recorder.js +71 -0
- package/dist/agent/turn/loop/round-recorder.js.map +1 -0
- package/dist/agent/turn/loop/round-request.d.ts +19 -0
- package/dist/agent/turn/loop/round-request.js +169 -0
- package/dist/agent/turn/loop/round-request.js.map +1 -0
- package/dist/agent/turn/loop/round-state.d.ts +11 -0
- package/dist/agent/turn/loop/round-state.js +11 -0
- package/dist/agent/turn/loop/round-state.js.map +1 -0
- package/dist/agent/turn/loop/run-rounds.d.ts +5 -0
- package/dist/agent/turn/loop/run-rounds.js +664 -0
- package/dist/agent/turn/loop/run-rounds.js.map +1 -0
- package/dist/agent/turn/loop/sequence-suppression.d.ts +54 -0
- package/dist/agent/turn/loop/sequence-suppression.js +112 -0
- package/dist/agent/turn/loop/sequence-suppression.js.map +1 -0
- package/dist/agent/turn/loop/state.d.ts +38 -0
- package/dist/agent/turn/loop/state.js +29 -0
- package/dist/agent/turn/loop/state.js.map +1 -0
- package/dist/agent/turn/loop/stream-failure.d.ts +55 -0
- package/dist/agent/turn/loop/stream-failure.js +149 -0
- package/dist/agent/turn/loop/stream-failure.js.map +1 -0
- package/dist/agent/turn/loop/stream-request.d.ts +16 -0
- package/dist/agent/turn/loop/stream-request.js +21 -0
- package/dist/agent/turn/loop/stream-request.js.map +1 -0
- package/dist/agent/turn/loop/stream-session.d.ts +41 -0
- package/dist/agent/turn/loop/stream-session.js +136 -0
- package/dist/agent/turn/loop/stream-session.js.map +1 -0
- package/dist/agent/turn/loop/tool-call-recovery.d.ts +25 -0
- package/dist/agent/turn/loop/tool-call-recovery.js +162 -0
- package/dist/agent/turn/loop/tool-call-recovery.js.map +1 -0
- package/dist/agent/turn/loop/unrun-calls.d.ts +12 -0
- package/dist/agent/turn/loop/unrun-calls.js +27 -0
- package/dist/agent/turn/loop/unrun-calls.js.map +1 -0
- package/dist/agent/turn/loop/wire-occurrences.d.ts +31 -0
- package/dist/agent/turn/loop/wire-occurrences.js +45 -0
- package/dist/agent/turn/loop/wire-occurrences.js.map +1 -0
- package/dist/agent/turn/mcp-agent-tools.d.ts +17 -0
- package/dist/agent/turn/mcp-agent-tools.js +69 -0
- package/dist/agent/turn/mcp-agent-tools.js.map +1 -0
- package/dist/agent/turn/message-assembly.d.ts +14 -0
- package/dist/agent/turn/message-assembly.js +22 -0
- package/dist/agent/turn/message-assembly.js.map +1 -0
- package/dist/agent/turn/outcome-accounting.d.ts +27 -0
- package/dist/agent/turn/outcome-accounting.js +91 -0
- package/dist/agent/turn/outcome-accounting.js.map +1 -0
- package/dist/agent/turn/plan-mode-gate.d.ts +16 -0
- package/dist/agent/turn/plan-mode-gate.js +36 -0
- package/dist/agent/turn/plan-mode-gate.js.map +1 -0
- package/dist/agent/turn/plan-persistence.d.ts +28 -0
- package/dist/agent/turn/plan-persistence.js +56 -0
- package/dist/agent/turn/plan-persistence.js.map +1 -0
- package/dist/agent/turn/prompt-sections.d.ts +9 -0
- package/dist/agent/turn/prompt-sections.js +67 -0
- package/dist/agent/turn/prompt-sections.js.map +1 -0
- package/dist/agent/turn/responder-claims.d.ts +16 -0
- package/dist/agent/turn/responder-claims.js +37 -0
- package/dist/agent/turn/responder-claims.js.map +1 -0
- package/dist/agent/turn/responder-dependency.d.ts +3 -0
- package/dist/agent/turn/responder-dependency.js +36 -0
- package/dist/agent/turn/responder-dependency.js.map +1 -0
- package/dist/agent/turn/responder-inbox.d.ts +28 -0
- package/dist/agent/turn/responder-inbox.js +57 -0
- package/dist/agent/turn/responder-inbox.js.map +1 -0
- package/dist/agent/turn/responder-job-linkage.d.ts +30 -0
- package/dist/agent/turn/responder-job-linkage.js +124 -0
- package/dist/agent/turn/responder-job-linkage.js.map +1 -0
- package/dist/agent/turn/responder-read-tool.d.ts +26 -0
- package/dist/agent/turn/responder-read-tool.js +83 -0
- package/dist/agent/turn/responder-read-tool.js.map +1 -0
- package/dist/agent/turn/scaffold-outcome.d.ts +7 -0
- package/dist/agent/turn/scaffold-outcome.js +93 -0
- package/dist/agent/turn/scaffold-outcome.js.map +1 -0
- package/dist/agent/turn/scaffold-preflight.d.ts +8 -0
- package/dist/agent/turn/scaffold-preflight.js +31 -0
- package/dist/agent/turn/scaffold-preflight.js.map +1 -0
- package/dist/agent/turn/session-state-projection.d.ts +18 -0
- package/dist/agent/turn/session-state-projection.js +46 -0
- package/dist/agent/turn/session-state-projection.js.map +1 -0
- package/dist/agent/turn/setup/compaction-services.d.ts +55 -0
- package/dist/agent/turn/setup/compaction-services.js +69 -0
- package/dist/agent/turn/setup/compaction-services.js.map +1 -0
- package/dist/agent/turn/setup/evidence-rehydration.d.ts +3 -0
- package/dist/agent/turn/setup/evidence-rehydration.js +22 -0
- package/dist/agent/turn/setup/evidence-rehydration.js.map +1 -0
- package/dist/agent/turn/setup/mcp-agent-ports.d.ts +29 -0
- package/dist/agent/turn/setup/mcp-agent-ports.js +26 -0
- package/dist/agent/turn/setup/mcp-agent-ports.js.map +1 -0
- package/dist/agent/turn/setup/prompt-classification.d.ts +10 -0
- package/dist/agent/turn/setup/prompt-classification.js +18 -0
- package/dist/agent/turn/setup/prompt-classification.js.map +1 -0
- package/dist/agent/turn/setup/responder-wake.d.ts +16 -0
- package/dist/agent/turn/setup/responder-wake.js +18 -0
- package/dist/agent/turn/setup/responder-wake.js.map +1 -0
- package/dist/agent/turn/setup/session-state.d.ts +20 -0
- package/dist/agent/turn/setup/session-state.js +23 -0
- package/dist/agent/turn/setup/session-state.js.map +1 -0
- package/dist/agent/turn/setup/task-gate-setup.d.ts +19 -0
- package/dist/agent/turn/setup/task-gate-setup.js +21 -0
- package/dist/agent/turn/setup/task-gate-setup.js.map +1 -0
- package/dist/agent/turn/setup/turn-budget.d.ts +19 -0
- package/dist/agent/turn/setup/turn-budget.js +34 -0
- package/dist/agent/turn/setup/turn-budget.js.map +1 -0
- package/dist/agent/turn/setup/turn-messages.d.ts +25 -0
- package/dist/agent/turn/setup/turn-messages.js +38 -0
- package/dist/agent/turn/setup/turn-messages.js.map +1 -0
- package/dist/agent/turn/setup/turn-state-machine.d.ts +13 -0
- package/dist/agent/turn/setup/turn-state-machine.js +52 -0
- package/dist/agent/turn/setup/turn-state-machine.js.map +1 -0
- package/dist/agent/turn/system-sections.d.ts +36 -0
- package/dist/agent/turn/system-sections.js +157 -0
- package/dist/agent/turn/system-sections.js.map +1 -0
- package/dist/agent/turn/task-autostart.d.ts +12 -0
- package/dist/agent/turn/task-autostart.js +35 -0
- package/dist/agent/turn/task-autostart.js.map +1 -0
- package/dist/agent/turn/task-batch-guard.d.ts +18 -0
- package/dist/agent/turn/task-batch-guard.js +83 -0
- package/dist/agent/turn/task-batch-guard.js.map +1 -0
- package/dist/agent/turn/task-credit.d.ts +15 -0
- package/dist/agent/turn/task-credit.js +49 -0
- package/dist/agent/turn/task-credit.js.map +1 -0
- package/dist/agent/turn/task-gate.d.ts +13 -0
- package/dist/agent/turn/task-gate.js +34 -0
- package/dist/agent/turn/task-gate.js.map +1 -0
- package/dist/agent/turn/task-update-gate.d.ts +13 -0
- package/dist/agent/turn/task-update-gate.js +40 -0
- package/dist/agent/turn/task-update-gate.js.map +1 -0
- package/dist/agent/turn/task-work-signals.d.ts +3 -0
- package/dist/agent/turn/task-work-signals.js +44 -0
- package/dist/agent/turn/task-work-signals.js.map +1 -0
- package/dist/agent/turn/tool-call-preparation.d.ts +20 -0
- package/dist/agent/turn/tool-call-preparation.js +67 -0
- package/dist/agent/turn/tool-call-preparation.js.map +1 -0
- package/dist/agent/turn/tool-evidence-signals.d.ts +22 -0
- package/dist/agent/turn/tool-evidence-signals.js +101 -0
- package/dist/agent/turn/tool-evidence-signals.js.map +1 -0
- package/dist/agent/turn/tool-execution/authorization.d.ts +32 -0
- package/dist/agent/turn/tool-execution/authorization.js +100 -0
- package/dist/agent/turn/tool-execution/authorization.js.map +1 -0
- package/dist/agent/turn/tool-execution/deps.d.ts +74 -0
- package/dist/agent/turn/tool-execution/deps.js +2 -0
- package/dist/agent/turn/tool-execution/deps.js.map +1 -0
- package/dist/agent/turn/tool-execution/dispatch.d.ts +27 -0
- package/dist/agent/turn/tool-execution/dispatch.js +76 -0
- package/dist/agent/turn/tool-execution/dispatch.js.map +1 -0
- package/dist/agent/turn/tool-execution/engagement-checkpoint.d.ts +7 -0
- package/dist/agent/turn/tool-execution/engagement-checkpoint.js +32 -0
- package/dist/agent/turn/tool-execution/engagement-checkpoint.js.map +1 -0
- package/dist/agent/turn/tool-execution/engagement-gate.d.ts +16 -0
- package/dist/agent/turn/tool-execution/engagement-gate.js +55 -0
- package/dist/agent/turn/tool-execution/engagement-gate.js.map +1 -0
- package/dist/agent/turn/tool-execution/gates.d.ts +21 -0
- package/dist/agent/turn/tool-execution/gates.js +45 -0
- package/dist/agent/turn/tool-execution/gates.js.map +1 -0
- package/dist/agent/turn/tool-execution/guards.d.ts +42 -0
- package/dist/agent/turn/tool-execution/guards.js +62 -0
- package/dist/agent/turn/tool-execution/guards.js.map +1 -0
- package/dist/agent/turn/tool-execution/meta-tools.d.ts +50 -0
- package/dist/agent/turn/tool-execution/meta-tools.js +114 -0
- package/dist/agent/turn/tool-execution/meta-tools.js.map +1 -0
- package/dist/agent/turn/tool-execution/plan-tool-ledger.d.ts +10 -0
- package/dist/agent/turn/tool-execution/plan-tool-ledger.js +50 -0
- package/dist/agent/turn/tool-execution/plan-tool-ledger.js.map +1 -0
- package/dist/agent/turn/tool-execution/result-framing.d.ts +36 -0
- package/dist/agent/turn/tool-execution/result-framing.js +54 -0
- package/dist/agent/turn/tool-execution/result-framing.js.map +1 -0
- package/dist/agent/turn/tool-execution/run-setup.d.ts +29 -0
- package/dist/agent/turn/tool-execution/run-setup.js +64 -0
- package/dist/agent/turn/tool-execution/run-setup.js.map +1 -0
- package/dist/agent/turn/tool-execution/single-tool.d.ts +4 -0
- package/dist/agent/turn/tool-execution/single-tool.js +613 -0
- package/dist/agent/turn/tool-execution/single-tool.js.map +1 -0
- package/dist/agent/turn/tool-execution/state.d.ts +19 -0
- package/dist/agent/turn/tool-execution/state.js +13 -0
- package/dist/agent/turn/tool-execution/state.js.map +1 -0
- package/dist/agent/turn/tool-execution/supervision.d.ts +20 -0
- package/dist/agent/turn/tool-execution/supervision.js +44 -0
- package/dist/agent/turn/tool-execution/supervision.js.map +1 -0
- package/dist/agent/turn/tool-result-recorder.d.ts +26 -0
- package/dist/agent/turn/tool-result-recorder.js +54 -0
- package/dist/agent/turn/tool-result-recorder.js.map +1 -0
- package/dist/agent/turn/tool-routing.d.ts +23 -0
- package/dist/agent/turn/tool-routing.js +58 -0
- package/dist/agent/turn/tool-routing.js.map +1 -0
- package/dist/agent/turn/tool-watchdog.d.ts +22 -0
- package/dist/agent/turn/tool-watchdog.js +135 -0
- package/dist/agent/turn/tool-watchdog.js.map +1 -0
- package/dist/agent/turn/turn-counters.d.ts +9 -0
- package/dist/agent/turn/turn-counters.js +13 -0
- package/dist/agent/turn/turn-counters.js.map +1 -0
- package/dist/agent/turn/workspace-setup.d.ts +29 -0
- package/dist/agent/turn/workspace-setup.js +74 -0
- package/dist/agent/turn/workspace-setup.js.map +1 -0
- package/dist/agent/workspace-orient.d.ts +0 -45
- package/dist/agent/workspace-orient.js +3 -69
- package/dist/agent/workspace-orient.js.map +1 -1
- package/dist/app/adapters/agent-event-adapter.d.ts +0 -1
- package/dist/app/adapters/agent-event-adapter.js +1 -4
- package/dist/app/adapters/agent-event-adapter.js.map +1 -1
- package/dist/app/adapters/current-interactive-sessions-adapter.d.ts +0 -1
- package/dist/app/adapters/current-interactive-sessions-adapter.js +0 -1
- package/dist/app/adapters/current-interactive-sessions-adapter.js.map +1 -1
- package/dist/app/adapters/current-jobs-adapter.d.ts +0 -1
- package/dist/app/adapters/current-jobs-adapter.js +0 -1
- package/dist/app/adapters/current-jobs-adapter.js.map +1 -1
- package/dist/app/adapters/current-store-adapter.d.ts +0 -1
- package/dist/app/adapters/current-store-adapter.js +0 -1
- package/dist/app/adapters/current-store-adapter.js.map +1 -1
- package/dist/app/adapters/quiet-meta-tools.d.ts +0 -11
- package/dist/app/adapters/quiet-meta-tools.js +0 -11
- package/dist/app/adapters/quiet-meta-tools.js.map +1 -1
- package/dist/app/commands/catalog.d.ts +0 -8
- package/dist/app/commands/catalog.js +10 -32
- package/dist/app/commands/catalog.js.map +1 -1
- package/dist/app/commands/command.d.ts +0 -4
- package/dist/app/commands/command.js.map +1 -1
- package/dist/app/commands/registry.d.ts +0 -3
- package/dist/app/commands/registry.js +1 -7
- package/dist/app/commands/registry.js.map +1 -1
- package/dist/app/confirm-prompt-text.d.ts +0 -6
- package/dist/app/confirm-prompt-text.js +0 -6
- package/dist/app/confirm-prompt-text.js.map +1 -1
- package/dist/app/controllers/cancel-all-result.d.ts +0 -5
- package/dist/app/controllers/cancel-all-result.js +0 -5
- package/dist/app/controllers/cancel-all-result.js.map +1 -1
- package/dist/app/controllers/plan-controller.d.ts +0 -6
- package/dist/app/controllers/plan-controller.js +0 -11
- package/dist/app/controllers/plan-controller.js.map +1 -1
- package/dist/app/controllers/session-compact-helper.d.ts +0 -9
- package/dist/app/controllers/session-compact-helper.js +14 -21
- 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 +11 -49
- package/dist/app/controllers/session-controller.js.map +1 -1
- package/dist/app/controllers/session-naming.d.ts +0 -4
- package/dist/app/controllers/session-naming.js +0 -4
- package/dist/app/controllers/session-naming.js.map +1 -1
- package/dist/app/controllers/session-persistence.d.ts +0 -6
- package/dist/app/controllers/session-persistence.js +0 -10
- package/dist/app/controllers/session-persistence.js.map +1 -1
- package/dist/app/controllers/session-responder.js +0 -4
- package/dist/app/controllers/session-responder.js.map +1 -1
- package/dist/app/controllers/session-turn-request.d.ts +0 -1
- package/dist/app/controllers/session-turn-request.js +0 -1
- package/dist/app/controllers/session-turn-request.js.map +1 -1
- package/dist/app/controllers/session-usage-ledger.d.ts +6 -1
- package/dist/app/controllers/session-usage-ledger.js +43 -3
- package/dist/app/controllers/session-usage-ledger.js.map +1 -1
- package/dist/app/controllers/turn-controller.js +2 -6
- package/dist/app/controllers/turn-controller.js.map +1 -1
- package/dist/app/events/app-event.d.ts +1 -11
- package/dist/app/events/app-event.js +0 -1
- package/dist/app/events/app-event.js.map +1 -1
- package/dist/app/events/event-buffer.d.ts +0 -6
- package/dist/app/events/event-buffer.js +0 -6
- package/dist/app/events/event-buffer.js.map +1 -1
- package/dist/app/events/sequencer.d.ts +0 -2
- package/dist/app/events/sequencer.js +0 -1
- package/dist/app/events/sequencer.js.map +1 -1
- package/dist/app/ports/agent-port.d.ts +0 -19
- package/dist/app/ports/interactive-sessions-port.d.ts +0 -13
- package/dist/app/ports/interactive-sessions-port.js +0 -7
- package/dist/app/ports/interactive-sessions-port.js.map +1 -1
- package/dist/app/ports/persistence-port.d.ts +0 -14
- package/dist/app/ports/updates-port.d.ts +0 -5
- package/dist/classic/app/ClassicApp.js +0 -2
- package/dist/classic/app/ClassicApp.js.map +1 -1
- package/dist/classic/app/action-handlers.js +0 -4
- package/dist/classic/app/action-handlers.js.map +1 -1
- package/dist/classic/app/git-branch.js +0 -1
- package/dist/classic/app/git-branch.js.map +1 -1
- package/dist/classic/app/use-feed.d.ts +0 -7
- package/dist/classic/app/use-feed.js +0 -5
- package/dist/classic/app/use-feed.js.map +1 -1
- package/dist/classic/app/wiring-interactions.js +0 -2
- package/dist/classic/app/wiring-interactions.js.map +1 -1
- package/dist/classic/blocks/assistant-lines.d.ts +0 -1
- package/dist/classic/blocks/assistant-lines.js +0 -1
- package/dist/classic/blocks/assistant-lines.js.map +1 -1
- package/dist/classic/blocks/batch-lines.d.ts +0 -1
- package/dist/classic/blocks/batch-lines.js +0 -1
- package/dist/classic/blocks/batch-lines.js.map +1 -1
- package/dist/classic/blocks/block-context.d.ts +0 -7
- package/dist/classic/blocks/block-context.js +0 -1
- package/dist/classic/blocks/block-context.js.map +1 -1
- package/dist/classic/blocks/compacted-lines.d.ts +0 -1
- package/dist/classic/blocks/compacted-lines.js +0 -1
- package/dist/classic/blocks/compacted-lines.js.map +1 -1
- package/dist/classic/blocks/diff-lines.d.ts +0 -3
- package/dist/classic/blocks/diff-lines.js +0 -4
- package/dist/classic/blocks/diff-lines.js.map +1 -1
- package/dist/classic/blocks/intro-lines.d.ts +0 -5
- package/dist/classic/blocks/intro-lines.js +0 -5
- package/dist/classic/blocks/intro-lines.js.map +1 -1
- package/dist/classic/blocks/notice-lines.d.ts +0 -4
- package/dist/classic/blocks/notice-lines.js +0 -6
- package/dist/classic/blocks/notice-lines.js.map +1 -1
- package/dist/classic/blocks/thinking-lines.d.ts +0 -1
- package/dist/classic/blocks/thinking-lines.js +0 -1
- package/dist/classic/blocks/thinking-lines.js.map +1 -1
- package/dist/classic/blocks/tool-lines.d.ts +0 -7
- package/dist/classic/blocks/tool-lines.js +0 -10
- package/dist/classic/blocks/tool-lines.js.map +1 -1
- package/dist/classic/blocks/user-lines.d.ts +0 -1
- package/dist/classic/blocks/user-lines.js +0 -1
- package/dist/classic/blocks/user-lines.js.map +1 -1
- package/dist/classic/bootstrap/osc52-renderer.js +0 -1
- package/dist/classic/bootstrap/osc52-renderer.js.map +1 -1
- package/dist/classic/chrome/Chrome.d.ts +0 -1
- package/dist/classic/chrome/Chrome.js.map +1 -1
- package/dist/classic/chrome/Composer.d.ts +0 -5
- package/dist/classic/chrome/Composer.js +0 -5
- package/dist/classic/chrome/Composer.js.map +1 -1
- package/dist/classic/chrome/composer-controller.js +0 -4
- package/dist/classic/chrome/composer-controller.js.map +1 -1
- package/dist/classic/chrome/composer-frame.d.ts +0 -3
- package/dist/classic/chrome/composer-frame.js +0 -3
- package/dist/classic/chrome/composer-frame.js.map +1 -1
- package/dist/classic/chrome/directory-row.d.ts +0 -7
- package/dist/classic/chrome/directory-row.js +0 -7
- package/dist/classic/chrome/directory-row.js.map +1 -1
- package/dist/classic/chrome/row-budget.d.ts +0 -2
- package/dist/classic/chrome/row-budget.js +0 -8
- package/dist/classic/chrome/row-budget.js.map +1 -1
- package/dist/classic/chrome/status-rows.d.ts +0 -12
- package/dist/classic/chrome/status-rows.js +0 -16
- package/dist/classic/chrome/status-rows.js.map +1 -1
- package/dist/classic/chrome/toast-rows.d.ts +0 -4
- package/dist/classic/chrome/toast-rows.js +0 -9
- package/dist/classic/chrome/toast-rows.js.map +1 -1
- package/dist/classic/feed/Feed.d.ts +0 -5
- package/dist/classic/feed/Feed.js +0 -4
- package/dist/classic/feed/Feed.js.map +1 -1
- package/dist/classic/feed/FeedStatic.d.ts +0 -8
- package/dist/classic/feed/FeedStatic.js +0 -8
- package/dist/classic/feed/FeedStatic.js.map +1 -1
- package/dist/classic/feed/ScrollbarGutter.js +0 -1
- package/dist/classic/feed/ScrollbarGutter.js.map +1 -1
- package/dist/classic/feed/block-height.d.ts +0 -7
- package/dist/classic/feed/block-height.js +0 -7
- package/dist/classic/feed/block-height.js.map +1 -1
- package/dist/classic/feed/commit-ledger.d.ts +0 -12
- package/dist/classic/feed/commit-ledger.js +0 -10
- package/dist/classic/feed/commit-ledger.js.map +1 -1
- package/dist/classic/feed/feed-blocks.d.ts +0 -8
- package/dist/classic/feed/feed-blocks.js +0 -6
- package/dist/classic/feed/feed-blocks.js.map +1 -1
- package/dist/classic/feed/live-tail-policy.d.ts +0 -13
- package/dist/classic/feed/live-tail-policy.js +0 -11
- package/dist/classic/feed/live-tail-policy.js.map +1 -1
- package/dist/classic/feed/scrollbar-rows.d.ts +0 -1
- package/dist/classic/feed/scrollbar-rows.js +0 -1
- package/dist/classic/feed/scrollbar-rows.js.map +1 -1
- package/dist/classic/feed/transcript-window.d.ts +0 -10
- package/dist/classic/feed/transcript-window.js +0 -6
- package/dist/classic/feed/transcript-window.js.map +1 -1
- package/dist/classic/input/input-router.js +0 -2
- package/dist/classic/input/input-router.js.map +1 -1
- package/dist/classic/panels/completion-rows.js +2 -1
- package/dist/classic/panels/completion-rows.js.map +1 -1
- package/dist/classic/panels/keys-panel.d.ts +0 -1
- package/dist/classic/panels/keys-panel.js +0 -1
- package/dist/classic/panels/keys-panel.js.map +1 -1
- package/dist/classic/panels/pager-panel.d.ts +0 -5
- package/dist/classic/panels/pager-panel.js +0 -11
- package/dist/classic/panels/pager-panel.js.map +1 -1
- package/dist/classic/panels/panel-controller.d.ts +0 -2
- package/dist/classic/panels/panel-controller.js +0 -2
- package/dist/classic/panels/panel-controller.js.map +1 -1
- package/dist/classic/panels/panel-frame.js +0 -2
- package/dist/classic/panels/panel-frame.js.map +1 -1
- package/dist/classic/panels/panel-wheel.d.ts +0 -5
- package/dist/classic/panels/panel-wheel.js +0 -5
- package/dist/classic/panels/panel-wheel.js.map +1 -1
- package/dist/classic/panels/secret-panel.d.ts +0 -1
- package/dist/classic/panels/secret-panel.js +0 -1
- package/dist/classic/panels/secret-panel.js.map +1 -1
- package/dist/classic/panels/text-editor-panel.d.ts +0 -1
- package/dist/classic/panels/text-editor-panel.js +0 -1
- package/dist/classic/panels/text-editor-panel.js.map +1 -1
- package/dist/classic/render/ansi-text.d.ts +0 -19
- package/dist/classic/render/ansi-text.js +0 -19
- package/dist/classic/render/ansi-text.js.map +1 -1
- package/dist/classic/render/glyphs.d.ts +0 -4
- package/dist/classic/render/glyphs.js +0 -4
- package/dist/classic/render/glyphs.js.map +1 -1
- package/dist/classic/render/ink-theme.d.ts +0 -10
- package/dist/classic/render/ink-theme.js +0 -6
- package/dist/classic/render/ink-theme.js.map +1 -1
- package/dist/classic/render/measure.d.ts +0 -12
- package/dist/classic/render/measure.js +0 -12
- package/dist/classic/render/measure.js.map +1 -1
- package/dist/classic/render/shell-width.d.ts +0 -8
- package/dist/classic/render/shell-width.js +0 -8
- package/dist/classic/render/shell-width.js.map +1 -1
- package/dist/classic/render/wrap.d.ts +0 -11
- package/dist/classic/render/wrap.js +0 -8
- package/dist/classic/render/wrap.js.map +1 -1
- package/dist/commands/doctor.js +0 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/providers.d.ts +0 -1
- package/dist/commands/providers.js +0 -22
- package/dist/commands/providers.js.map +1 -1
- package/dist/commands/search-providers.d.ts +0 -1
- package/dist/commands/search-providers.js +0 -4
- package/dist/commands/search-providers.js.map +1 -1
- package/dist/commands/update/installers.d.ts +61 -0
- package/dist/commands/update/installers.js +505 -0
- package/dist/commands/update/installers.js.map +1 -0
- package/dist/commands/update-install.d.ts +4 -65
- package/dist/commands/update-install.js +6 -506
- package/dist/commands/update-install.js.map +1 -1
- package/dist/commands/update.d.ts +0 -6
- package/dist/commands/update.js +1 -11
- package/dist/commands/update.js.map +1 -1
- package/dist/index.js +3 -10
- package/dist/index.js.map +1 -1
- package/dist/interactive-session/artifact-writer.d.ts +0 -1
- package/dist/interactive-session/artifact-writer.js +0 -1
- package/dist/interactive-session/artifact-writer.js.map +1 -1
- package/dist/interactive-session/cleanup.d.ts +0 -10
- package/dist/interactive-session/cleanup.js +0 -13
- package/dist/interactive-session/cleanup.js.map +1 -1
- package/dist/interactive-session/config.d.ts +0 -16
- package/dist/interactive-session/config.js +0 -13
- package/dist/interactive-session/config.js.map +1 -1
- package/dist/interactive-session/manager.d.ts +0 -27
- package/dist/interactive-session/manager.js +0 -42
- package/dist/interactive-session/manager.js.map +1 -1
- package/dist/interactive-session/output-store.d.ts +0 -6
- package/dist/interactive-session/output-store.js +0 -5
- package/dist/interactive-session/output-store.js.map +1 -1
- package/dist/interactive-session/output-view.d.ts +0 -4
- package/dist/interactive-session/output-view.js +0 -12
- package/dist/interactive-session/output-view.js.map +1 -1
- package/dist/interactive-session/recovery-journal.d.ts +0 -7
- package/dist/interactive-session/recovery-journal.js +0 -7
- package/dist/interactive-session/recovery-journal.js.map +1 -1
- package/dist/interactive-session/registry.d.ts +0 -25
- package/dist/interactive-session/registry.js +0 -27
- package/dist/interactive-session/registry.js.map +1 -1
- package/dist/interactive-session/runtime.d.ts +0 -30
- package/dist/interactive-session/runtime.js +0 -23
- package/dist/interactive-session/runtime.js.map +1 -1
- package/dist/interactive-session/session-runtime.d.ts +0 -9
- package/dist/interactive-session/session-runtime.js +0 -10
- package/dist/interactive-session/session-runtime.js.map +1 -1
- package/dist/interactive-session/streaming-redactor.d.ts +0 -14
- package/dist/interactive-session/streaming-redactor.js +0 -18
- package/dist/interactive-session/streaming-redactor.js.map +1 -1
- package/dist/interactive-session/telemetry.d.ts +0 -8
- package/dist/interactive-session/telemetry.js +0 -7
- package/dist/interactive-session/telemetry.js.map +1 -1
- package/dist/interactive-session/transport-factory.d.ts +0 -5
- package/dist/interactive-session/transport-factory.js +0 -5
- package/dist/interactive-session/transport-factory.js.map +1 -1
- package/dist/interactive-session/transport-pipe.d.ts +0 -7
- package/dist/interactive-session/transport-pipe.js +0 -14
- package/dist/interactive-session/transport-pipe.js.map +1 -1
- package/dist/interactive-session/transport.d.ts +0 -26
- package/dist/interactive-session/transport.js +0 -20
- package/dist/interactive-session/transport.js.map +1 -1
- package/dist/interactive-session/types.d.ts +0 -19
- package/dist/interactive-session/types.js +0 -22
- package/dist/interactive-session/types.js.map +1 -1
- package/dist/llm/adapters/anthropic-stream-events.d.ts +38 -0
- package/dist/llm/adapters/anthropic-stream-events.js +144 -0
- package/dist/llm/adapters/anthropic-stream-events.js.map +1 -0
- package/dist/llm/adapters/anthropic-tools.d.ts +5 -55
- package/dist/llm/adapters/anthropic-tools.js +6 -208
- package/dist/llm/adapters/anthropic-tools.js.map +1 -1
- package/dist/llm/adapters/anthropic-wire-blocks.d.ts +9 -0
- package/dist/llm/adapters/anthropic-wire-blocks.js +59 -0
- package/dist/llm/adapters/anthropic-wire-blocks.js.map +1 -0
- package/dist/llm/adapters/gemini-tools.d.ts +0 -6
- package/dist/llm/adapters/gemini-tools.js +0 -24
- package/dist/llm/adapters/gemini-tools.js.map +1 -1
- package/dist/llm/adapters/ollama-tools.js +0 -5
- package/dist/llm/adapters/ollama-tools.js.map +1 -1
- package/dist/llm/adapters/openai-tools.d.ts +0 -4
- package/dist/llm/adapters/openai-tools.js +2 -11
- package/dist/llm/adapters/openai-tools.js.map +1 -1
- package/dist/llm/agentrouter.d.ts +0 -9
- package/dist/llm/agentrouter.js +10 -60
- package/dist/llm/agentrouter.js.map +1 -1
- package/dist/llm/anthropic.d.ts +0 -7
- package/dist/llm/anthropic.js +2 -30
- package/dist/llm/anthropic.js.map +1 -1
- package/dist/llm/artifacts/legacy-blocks.d.ts +3 -0
- package/dist/llm/artifacts/legacy-blocks.js +109 -0
- package/dist/llm/artifacts/legacy-blocks.js.map +1 -0
- package/dist/llm/artifacts/replay-selection.d.ts +9 -0
- package/dist/llm/artifacts/replay-selection.js +48 -0
- package/dist/llm/artifacts/replay-selection.js.map +1 -0
- package/dist/llm/aws-mantle.js +2 -4
- package/dist/llm/aws-mantle.js.map +1 -1
- package/dist/llm/bynara.js +2 -0
- package/dist/llm/bynara.js.map +1 -1
- package/dist/llm/cache-affinity.d.ts +1 -0
- package/dist/llm/cache-affinity.js +6 -0
- package/dist/llm/cache-affinity.js.map +1 -1
- package/dist/llm/capabilities.d.ts +7 -36
- package/dist/llm/capabilities.js +11 -502
- package/dist/llm/capabilities.js.map +1 -1
- package/dist/llm/capability/state.d.ts +25 -0
- package/dist/llm/capability/state.js +125 -0
- package/dist/llm/capability/state.js.map +1 -0
- package/dist/llm/capability/tool-dialect.d.ts +3 -0
- package/dist/llm/capability/tool-dialect.js +78 -0
- package/dist/llm/capability/tool-dialect.js.map +1 -0
- package/dist/llm/capability/vision-patterns.d.ts +4 -0
- package/dist/llm/capability/vision-patterns.js +188 -0
- package/dist/llm/capability/vision-patterns.js.map +1 -0
- package/dist/llm/capability/vision-registry.d.ts +20 -0
- package/dist/llm/capability/vision-registry.js +112 -0
- package/dist/llm/capability/vision-registry.js.map +1 -0
- package/dist/llm/context-snapshot.d.ts +0 -18
- package/dist/llm/context-snapshot.js +1 -8
- package/dist/llm/context-snapshot.js.map +1 -1
- package/dist/llm/context-windows.d.ts +0 -6
- package/dist/llm/context-windows.js +0 -30
- package/dist/llm/context-windows.js.map +1 -1
- package/dist/llm/custom-provider-profile.d.ts +4 -23
- package/dist/llm/custom-provider-profile.js +4 -515
- package/dist/llm/custom-provider-profile.js.map +1 -1
- package/dist/llm/custom-providers.d.ts +0 -23
- package/dist/llm/custom-providers.js +2 -27
- package/dist/llm/custom-providers.js.map +1 -1
- package/dist/llm/effort-fallback.d.ts +0 -38
- package/dist/llm/effort-fallback.js +0 -38
- package/dist/llm/effort-fallback.js.map +1 -1
- package/dist/llm/fireworks.js +2 -0
- package/dist/llm/fireworks.js.map +1 -1
- package/dist/llm/free.js +7 -2
- package/dist/llm/free.js.map +1 -1
- package/dist/llm/gemini.d.ts +0 -1
- package/dist/llm/gemini.js +2 -19
- package/dist/llm/gemini.js.map +1 -1
- package/dist/llm/hetzner.js +2 -0
- package/dist/llm/hetzner.js.map +1 -1
- package/dist/llm/http.d.ts +24 -251
- package/dist/llm/http.js +19 -2021
- package/dist/llm/http.js.map +1 -1
- package/dist/llm/key-rotation.d.ts +0 -32
- package/dist/llm/key-rotation.js +6 -37
- package/dist/llm/key-rotation.js.map +1 -1
- package/dist/llm/lightning.d.ts +0 -8
- package/dist/llm/lightning.js +3 -18
- package/dist/llm/lightning.js.map +1 -1
- package/dist/llm/merge-gateway.d.ts +0 -9
- package/dist/llm/merge-gateway.js +2 -44
- package/dist/llm/merge-gateway.js.map +1 -1
- package/dist/llm/modal.js +3 -15
- package/dist/llm/modal.js.map +1 -1
- package/dist/llm/model-families.d.ts +0 -5
- package/dist/llm/model-families.js +0 -5
- package/dist/llm/model-families.js.map +1 -1
- package/dist/llm/model-layers/model-patterns.d.ts +7 -0
- package/dist/llm/model-layers/model-patterns.js +30 -0
- package/dist/llm/model-layers/model-patterns.js.map +1 -0
- package/dist/llm/model-layers/model-rules.d.ts +8 -0
- package/dist/llm/model-layers/model-rules.js +221 -0
- package/dist/llm/model-layers/model-rules.js.map +1 -0
- package/dist/llm/model-layers/nvidia-layer.d.ts +2 -0
- package/dist/llm/model-layers/nvidia-layer.js +135 -0
- package/dist/llm/model-layers/nvidia-layer.js.map +1 -0
- package/dist/llm/nvidia.js +3 -11
- package/dist/llm/nvidia.js.map +1 -1
- package/dist/llm/ollama.js +2 -11
- package/dist/llm/ollama.js.map +1 -1
- package/dist/llm/openai.js +2 -0
- package/dist/llm/openai.js.map +1 -1
- package/dist/llm/openrouter.js +3 -1
- package/dist/llm/openrouter.js.map +1 -1
- package/dist/llm/operation-ledger.d.ts +0 -6
- package/dist/llm/operation-ledger.js +0 -6
- package/dist/llm/operation-ledger.js.map +1 -1
- package/dist/llm/operation-usage.d.ts +2 -0
- package/dist/llm/operation-usage.js +27 -0
- package/dist/llm/operation-usage.js.map +1 -1
- package/dist/llm/orcarouter.d.ts +0 -4
- package/dist/llm/orcarouter.js +3 -26
- package/dist/llm/orcarouter.js.map +1 -1
- package/dist/llm/profile/control-rejections.d.ts +14 -0
- package/dist/llm/profile/control-rejections.js +75 -0
- package/dist/llm/profile/control-rejections.js.map +1 -0
- package/dist/llm/profile/custom-layer.d.ts +3 -0
- package/dist/llm/profile/custom-layer.js +83 -0
- package/dist/llm/profile/custom-layer.js.map +1 -0
- package/dist/llm/profile/layer-merge.d.ts +3 -0
- package/dist/llm/profile/layer-merge.js +185 -0
- package/dist/llm/profile/layer-merge.js.map +1 -0
- package/dist/llm/profile/spec-validation.d.ts +5 -0
- package/dist/llm/profile/spec-validation.js +289 -0
- package/dist/llm/profile/spec-validation.js.map +1 -0
- package/dist/llm/profile/spec-vocabulary.d.ts +21 -0
- package/dist/llm/profile/spec-vocabulary.js +142 -0
- package/dist/llm/profile/spec-vocabulary.js.map +1 -0
- package/dist/llm/provider-identity.d.ts +5 -0
- package/dist/llm/provider-identity.js +130 -0
- package/dist/llm/provider-identity.js.map +1 -0
- package/dist/llm/provider-info-text.d.ts +1 -0
- package/dist/llm/provider-info-text.js +587 -0
- package/dist/llm/provider-info-text.js.map +1 -0
- package/dist/llm/provider-model-layers.d.ts +2 -0
- package/dist/llm/provider-model-layers.js +6 -380
- package/dist/llm/provider-model-layers.js.map +1 -1
- package/dist/llm/provider-profile-layers.js +0 -2
- package/dist/llm/provider-profile-layers.js.map +1 -1
- package/dist/llm/provider-profile.d.ts +10 -12
- package/dist/llm/provider-profile.js +6 -265
- package/dist/llm/provider-profile.js.map +1 -1
- package/dist/llm/provider.d.ts +4 -16
- package/dist/llm/provider.js +6 -760
- package/dist/llm/provider.js.map +1 -1
- package/dist/llm/qwen-cloud.js +2 -4
- package/dist/llm/qwen-cloud.js.map +1 -1
- package/dist/llm/reasoning-artifacts.d.ts +5 -50
- package/dist/llm/reasoning-artifacts.js +11 -198
- package/dist/llm/reasoning-artifacts.js.map +1 -1
- package/dist/llm/reasoning-capability.js +0 -16
- package/dist/llm/reasoning-capability.js.map +1 -1
- package/dist/llm/request-fingerprint.d.ts +0 -4
- package/dist/llm/request-fingerprint.js +0 -4
- package/dist/llm/request-fingerprint.js.map +1 -1
- package/dist/llm/request-plan.d.ts +0 -14
- package/dist/llm/request-plan.js +0 -23
- package/dist/llm/request-plan.js.map +1 -1
- package/dist/llm/responses/item-events.d.ts +3 -0
- package/dist/llm/responses/item-events.js +93 -0
- package/dist/llm/responses/item-events.js.map +1 -0
- package/dist/llm/responses-complete.d.ts +1 -1
- package/dist/llm/responses-complete.js +2 -1
- package/dist/llm/responses-complete.js.map +1 -1
- package/dist/llm/responses-config.js.map +1 -1
- package/dist/llm/responses-http.d.ts +1 -0
- package/dist/llm/responses-http.js +3 -1
- package/dist/llm/responses-http.js.map +1 -1
- package/dist/llm/responses-parse.d.ts +3 -0
- package/dist/llm/responses-parse.js +19 -6
- package/dist/llm/responses-parse.js.map +1 -1
- package/dist/llm/responses-request.d.ts +2 -1
- package/dist/llm/responses-request.js +7 -2
- package/dist/llm/responses-request.js.map +1 -1
- package/dist/llm/responses-shape.d.ts +5 -0
- package/dist/llm/responses-shape.js +16 -0
- package/dist/llm/responses-shape.js.map +1 -0
- package/dist/llm/responses-stream-accumulator.d.ts +1 -1
- package/dist/llm/responses-stream-accumulator.js +8 -9
- package/dist/llm/responses-stream-accumulator.js.map +1 -1
- package/dist/llm/responses-stream-events.d.ts +2 -0
- package/dist/llm/responses-stream-events.js +34 -102
- package/dist/llm/responses-stream-events.js.map +1 -1
- package/dist/llm/responses-stream-watchdog.js.map +1 -1
- package/dist/llm/responses-stream.js +9 -4
- package/dist/llm/responses-stream.js.map +1 -1
- package/dist/llm/router.d.ts +7 -44
- package/dist/llm/router.js +24 -1145
- package/dist/llm/router.js.map +1 -1
- package/dist/llm/routing/attempt-complete.d.ts +3 -0
- package/dist/llm/routing/attempt-complete.js +120 -0
- package/dist/llm/routing/attempt-complete.js.map +1 -0
- package/dist/llm/routing/attempt-request.d.ts +21 -0
- package/dist/llm/routing/attempt-request.js +99 -0
- package/dist/llm/routing/attempt-request.js.map +1 -0
- package/dist/llm/routing/attempt-stream.d.ts +3 -0
- package/dist/llm/routing/attempt-stream.js +256 -0
- package/dist/llm/routing/attempt-stream.js.map +1 -0
- package/dist/llm/routing/error-classification.d.ts +15 -0
- package/dist/llm/routing/error-classification.js +151 -0
- package/dist/llm/routing/error-classification.js.map +1 -0
- package/dist/llm/routing/failure-report.d.ts +22 -0
- package/dist/llm/routing/failure-report.js +128 -0
- package/dist/llm/routing/failure-report.js.map +1 -0
- package/dist/llm/routing/key-rotation.d.ts +21 -0
- package/dist/llm/routing/key-rotation.js +207 -0
- package/dist/llm/routing/key-rotation.js.map +1 -0
- package/dist/llm/routing/provider-selection.d.ts +8 -0
- package/dist/llm/routing/provider-selection.js +119 -0
- package/dist/llm/routing/provider-selection.js.map +1 -0
- package/dist/llm/sampling.d.ts +0 -15
- package/dist/llm/sampling.js +0 -9
- package/dist/llm/sampling.js.map +1 -1
- package/dist/llm/session-affinity.d.ts +2 -0
- package/dist/llm/session-affinity.js +9 -0
- package/dist/llm/session-affinity.js.map +1 -0
- package/dist/llm/stream-progress.d.ts +0 -1
- package/dist/llm/stream-progress.js +0 -15
- package/dist/llm/stream-progress.js.map +1 -1
- package/dist/llm/system-messages.d.ts +0 -22
- package/dist/llm/system-messages.js +6 -22
- package/dist/llm/system-messages.js.map +1 -1
- package/dist/llm/token-estimate-calibration.d.ts +0 -6
- package/dist/llm/token-estimate-calibration.js +0 -26
- package/dist/llm/token-estimate-calibration.js.map +1 -1
- package/dist/llm/token-usage.d.ts +8 -69
- package/dist/llm/token-usage.js +10 -257
- package/dist/llm/token-usage.js.map +1 -1
- package/dist/llm/tokenrouter.d.ts +0 -12
- package/dist/llm/tokenrouter.js +3 -14
- package/dist/llm/tokenrouter.js.map +1 -1
- package/dist/llm/tool-protocol.d.ts +3 -22
- package/dist/llm/tool-protocol.js +20 -155
- package/dist/llm/tool-protocol.js.map +1 -1
- package/dist/llm/tool-wire/argument-repair.d.ts +4 -0
- package/dist/llm/tool-wire/argument-repair.js +174 -0
- package/dist/llm/tool-wire/argument-repair.js.map +1 -0
- package/dist/llm/transport-events.d.ts +12 -0
- package/dist/llm/transport-events.js +29 -0
- package/dist/llm/transport-events.js.map +1 -0
- package/dist/llm/usage/provider-parsers.d.ts +11 -0
- package/dist/llm/usage/provider-parsers.js +220 -0
- package/dist/llm/usage/provider-parsers.js.map +1 -0
- package/dist/llm/wire/abort-race.d.ts +1 -0
- package/dist/llm/wire/abort-race.js +34 -0
- package/dist/llm/wire/abort-race.js.map +1 -0
- package/dist/llm/wire/capability-errors.d.ts +11 -0
- package/dist/llm/wire/capability-errors.js +92 -0
- package/dist/llm/wire/capability-errors.js.map +1 -0
- package/dist/llm/wire/chat-body.d.ts +40 -0
- package/dist/llm/wire/chat-body.js +172 -0
- package/dist/llm/wire/chat-body.js.map +1 -0
- package/dist/llm/wire/model-catalog.d.ts +4 -0
- package/dist/llm/wire/model-catalog.js +34 -0
- package/dist/llm/wire/model-catalog.js.map +1 -0
- package/dist/llm/wire/openai-complete.d.ts +27 -0
- package/dist/llm/wire/openai-complete.js +138 -0
- package/dist/llm/wire/openai-complete.js.map +1 -0
- package/dist/llm/wire/openai-stream.d.ts +36 -0
- package/dist/llm/wire/openai-stream.js +665 -0
- package/dist/llm/wire/openai-stream.js.map +1 -0
- package/dist/llm/wire/reasoning-artifacts.d.ts +45 -0
- package/dist/llm/wire/reasoning-artifacts.js +140 -0
- package/dist/llm/wire/reasoning-artifacts.js.map +1 -0
- package/dist/llm/wire/reasoning-payload.d.ts +9 -0
- package/dist/llm/wire/reasoning-payload.js +212 -0
- package/dist/llm/wire/reasoning-payload.js.map +1 -0
- package/dist/llm/wire/response-errors.d.ts +5 -0
- package/dist/llm/wire/response-errors.js +182 -0
- package/dist/llm/wire/response-errors.js.map +1 -0
- package/dist/llm/wire/responses-first.d.ts +30 -0
- package/dist/llm/wire/responses-first.js +335 -0
- package/dist/llm/wire/responses-first.js.map +1 -0
- package/dist/llm/wire/stream-framing.d.ts +38 -0
- package/dist/llm/wire/stream-framing.js +217 -0
- package/dist/llm/wire/stream-framing.js.map +1 -0
- package/dist/mcp/runtime.d.ts +0 -15
- package/dist/mcp/runtime.js +0 -8
- package/dist/mcp/runtime.js.map +1 -1
- package/dist/modes/ask.d.ts +0 -3
- package/dist/modes/ask.js +0 -22
- package/dist/modes/ask.js.map +1 -1
- package/dist/noninteractive/blocks/tool-blocks.d.ts +35 -0
- package/dist/noninteractive/blocks/tool-blocks.js +206 -0
- package/dist/noninteractive/blocks/tool-blocks.js.map +1 -0
- package/dist/noninteractive/readline-prompts.d.ts +0 -21
- package/dist/noninteractive/readline-prompts.js +0 -31
- package/dist/noninteractive/readline-prompts.js.map +1 -1
- package/dist/noninteractive/stdio-confirm-port.d.ts +0 -9
- package/dist/noninteractive/stdio-confirm-port.js +0 -9
- package/dist/noninteractive/stdio-confirm-port.js.map +1 -1
- package/dist/noninteractive/stream-blocks.d.ts +3 -49
- package/dist/noninteractive/stream-blocks.js +14 -234
- package/dist/noninteractive/stream-blocks.js.map +1 -1
- package/dist/noninteractive/stream-renderer.d.ts +0 -10
- package/dist/noninteractive/stream-renderer.js +0 -10
- package/dist/noninteractive/stream-renderer.js.map +1 -1
- package/dist/noninteractive/stream-spinner.d.ts +0 -8
- package/dist/noninteractive/stream-spinner.js +0 -8
- package/dist/noninteractive/stream-spinner.js.map +1 -1
- package/dist/os/bun-runtime.d.ts +0 -15
- package/dist/os/bun-runtime.js +0 -33
- package/dist/os/bun-runtime.js.map +1 -1
- package/dist/os/command.d.ts +0 -6
- package/dist/os/command.js +0 -13
- package/dist/os/command.js.map +1 -1
- package/dist/os/cwd.d.ts +0 -5
- package/dist/os/cwd.js +0 -6
- package/dist/os/cwd.js.map +1 -1
- package/dist/os/permissions.d.ts +0 -11
- package/dist/os/permissions.js +0 -13
- package/dist/os/permissions.js.map +1 -1
- package/dist/os/process-identity.d.ts +0 -22
- package/dist/os/process-identity.js +0 -23
- package/dist/os/process-identity.js.map +1 -1
- package/dist/os/process-tree.d.ts +0 -7
- package/dist/os/process-tree.js +0 -8
- package/dist/os/process-tree.js.map +1 -1
- package/dist/prompts/embedded.js +1 -1
- package/dist/prompts/embedded.js.map +1 -1
- package/dist/prompts/index.d.ts +0 -36
- package/dist/prompts/index.js +2 -47
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/system.agent.md +2 -2
- package/dist/safety/classifier.d.ts +5 -26
- package/dist/safety/classifier.js +5 -573
- package/dist/safety/classifier.js.map +1 -1
- package/dist/safety/engagement-policy.d.ts +0 -13
- package/dist/safety/engagement-policy.js +0 -32
- package/dist/safety/engagement-policy.js.map +1 -1
- package/dist/safety/patterns.d.ts +0 -108
- package/dist/safety/patterns.js +0 -159
- package/dist/safety/patterns.js.map +1 -1
- package/dist/safety/shell-classification.d.ts +19 -0
- package/dist/safety/shell-classification.js +215 -0
- package/dist/safety/shell-classification.js.map +1 -0
- package/dist/safety/tool-classification.d.ts +4 -0
- package/dist/safety/tool-classification.js +260 -0
- package/dist/safety/tool-classification.js.map +1 -0
- package/dist/store/config/endpoints.d.ts +85 -0
- package/dist/store/config/endpoints.js +298 -0
- package/dist/store/config/endpoints.js.map +1 -0
- package/dist/store/config/settings.d.ts +11 -0
- package/dist/store/config/settings.js +52 -0
- package/dist/store/config/settings.js.map +1 -0
- package/dist/store/config.d.ts +6 -169
- package/dist/store/config.js +4 -411
- package/dist/store/config.js.map +1 -1
- package/dist/store/engagement.d.ts +0 -1
- package/dist/store/engagement.js +0 -3
- package/dist/store/engagement.js.map +1 -1
- package/dist/store/history/jsonl-backend.d.ts +7 -0
- package/dist/store/history/jsonl-backend.js +151 -0
- package/dist/store/history/jsonl-backend.js.map +1 -0
- package/dist/store/history/jsonl-lock.d.ts +2 -0
- package/dist/store/history/jsonl-lock.js +100 -0
- package/dist/store/history/jsonl-lock.js.map +1 -0
- package/dist/store/history/lifecycle.d.ts +14 -0
- package/dist/store/history/lifecycle.js +316 -0
- package/dist/store/history/lifecycle.js.map +1 -0
- package/dist/store/history/recovery.d.ts +62 -0
- package/dist/store/history/recovery.js +253 -0
- package/dist/store/history/recovery.js.map +1 -0
- package/dist/store/history/session-queries.d.ts +9 -0
- package/dist/store/history/session-queries.js +142 -0
- package/dist/store/history/session-queries.js.map +1 -0
- package/dist/store/history/sqlite-backend.d.ts +25 -0
- package/dist/store/history/sqlite-backend.js +209 -0
- package/dist/store/history/sqlite-backend.js.map +1 -0
- package/dist/store/history-index.d.ts +0 -5
- package/dist/store/history-index.js +0 -10
- package/dist/store/history-index.js.map +1 -1
- package/dist/store/history.d.ts +12 -97
- package/dist/store/history.js +12 -1214
- package/dist/store/history.js.map +1 -1
- package/dist/store/keys/search-providers.d.ts +33 -0
- package/dist/store/keys/search-providers.js +211 -0
- package/dist/store/keys/search-providers.js.map +1 -0
- package/dist/store/keys/secret-store.d.ts +40 -0
- package/dist/store/keys/secret-store.js +249 -0
- package/dist/store/keys/secret-store.js.map +1 -0
- package/dist/store/keys.d.ts +8 -95
- package/dist/store/keys.js +7 -537
- package/dist/store/keys.js.map +1 -1
- package/dist/store/logs.d.ts +0 -1
- package/dist/store/logs.js +1 -7
- package/dist/store/logs.js.map +1 -1
- package/dist/store/paths.d.ts +0 -12
- package/dist/store/paths.js +0 -12
- package/dist/store/paths.js.map +1 -1
- package/dist/store/plan/jsonl-backend.d.ts +7 -0
- package/dist/store/plan/jsonl-backend.js +115 -0
- package/dist/store/plan/jsonl-backend.js.map +1 -0
- package/dist/store/plan/mutation.d.ts +25 -0
- package/dist/store/plan/mutation.js +270 -0
- package/dist/store/plan/mutation.js.map +1 -0
- package/dist/store/plan/sqlite-backend.d.ts +66 -0
- package/dist/store/plan/sqlite-backend.js +66 -0
- package/dist/store/plan/sqlite-backend.js.map +1 -0
- package/dist/store/plan/task-normalization.d.ts +8 -0
- package/dist/store/plan/task-normalization.js +165 -0
- package/dist/store/plan/task-normalization.js.map +1 -0
- package/dist/store/plan.d.ts +9 -176
- package/dist/store/plan.js +11 -742
- package/dist/store/plan.js.map +1 -1
- package/dist/store/project.js +0 -5
- package/dist/store/project.js.map +1 -1
- package/dist/store/responder-settlement.d.ts +0 -1
- package/dist/store/responder-settlement.js +0 -3
- package/dist/store/responder-settlement.js.map +1 -1
- package/dist/store/scope.d.ts +0 -16
- package/dist/store/scope.js +0 -22
- package/dist/store/scope.js.map +1 -1
- package/dist/store/session-workspace.d.ts +0 -51
- package/dist/store/session-workspace.js +0 -57
- package/dist/store/session-workspace.js.map +1 -1
- package/dist/store/task-transitions.d.ts +0 -7
- package/dist/store/task-transitions.js +0 -6
- package/dist/store/task-transitions.js.map +1 -1
- package/dist/tools/batch/batch-parsing.d.ts +11 -0
- package/dist/tools/batch/batch-parsing.js +78 -0
- package/dist/tools/batch/batch-parsing.js.map +1 -0
- package/dist/tools/batch/limits.d.ts +6 -0
- package/dist/tools/batch/limits.js +17 -0
- package/dist/tools/batch/limits.js.map +1 -0
- package/dist/tools/batch/run-batch.d.ts +3 -0
- package/dist/tools/batch/run-batch.js +402 -0
- package/dist/tools/batch/run-batch.js.map +1 -0
- package/dist/tools/batch-fail-policy.d.ts +0 -29
- package/dist/tools/batch-fail-policy.js +0 -31
- package/dist/tools/batch-fail-policy.js.map +1 -1
- package/dist/tools/call-normalization.d.ts +2 -0
- package/dist/tools/call-normalization.js +165 -0
- package/dist/tools/call-normalization.js.map +1 -0
- package/dist/tools/capabilities.d.ts +0 -1
- package/dist/tools/capabilities.js +0 -28
- package/dist/tools/capabilities.js.map +1 -1
- package/dist/tools/command-intent.d.ts +0 -19
- package/dist/tools/command-intent.js +0 -65
- package/dist/tools/command-intent.js.map +1 -1
- package/dist/tools/definitions/aggregate.d.ts +2 -0
- package/dist/tools/definitions/aggregate.js +263 -0
- package/dist/tools/definitions/aggregate.js.map +1 -0
- package/dist/tools/definitions/context-1.d.ts +2 -0
- package/dist/tools/definitions/context-1.js +8 -0
- package/dist/tools/definitions/context-1.js.map +1 -0
- package/dist/tools/definitions/context-2.d.ts +2 -0
- package/dist/tools/definitions/context-2.js +90 -0
- package/dist/tools/definitions/context-2.js.map +1 -0
- package/dist/tools/definitions/define.d.ts +7 -0
- package/dist/tools/definitions/define.js +53 -0
- package/dist/tools/definitions/define.js.map +1 -0
- package/dist/tools/definitions/files.d.ts +2 -0
- package/dist/tools/definitions/files.js +193 -0
- package/dist/tools/definitions/files.js.map +1 -0
- package/dist/tools/definitions/network-1.d.ts +2 -0
- package/dist/tools/definitions/network-1.js +72 -0
- package/dist/tools/definitions/network-1.js.map +1 -0
- package/dist/tools/definitions/network-2.d.ts +2 -0
- package/dist/tools/definitions/network-2.js +22 -0
- package/dist/tools/definitions/network-2.js.map +1 -0
- package/dist/tools/definitions/orchestration.d.ts +2 -0
- package/dist/tools/definitions/orchestration.js +122 -0
- package/dist/tools/definitions/orchestration.js.map +1 -0
- package/dist/tools/definitions/pentest.d.ts +2 -0
- package/dist/tools/definitions/pentest.js +91 -0
- package/dist/tools/definitions/pentest.js.map +1 -0
- package/dist/tools/definitions/selection.d.ts +9 -0
- package/dist/tools/definitions/selection.js +84 -0
- package/dist/tools/definitions/selection.js.map +1 -0
- package/dist/tools/definitions/shell.d.ts +2 -0
- package/dist/tools/definitions/shell.js +83 -0
- package/dist/tools/definitions/shell.js.map +1 -0
- package/dist/tools/definitions/terminal.d.ts +2 -0
- package/dist/tools/definitions/terminal.js +91 -0
- package/dist/tools/definitions/terminal.js.map +1 -0
- package/dist/tools/definitions/web-1.d.ts +2 -0
- package/dist/tools/definitions/web-1.js +68 -0
- package/dist/tools/definitions/web-1.js.map +1 -0
- package/dist/tools/definitions/web-2.d.ts +2 -0
- package/dist/tools/definitions/web-2.js +59 -0
- package/dist/tools/definitions/web-2.js.map +1 -0
- package/dist/tools/definitions.d.ts +3 -16
- package/dist/tools/definitions.js +8 -1238
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/diff/line-ops.d.ts +34 -0
- package/dist/tools/diff/line-ops.js +218 -0
- package/dist/tools/diff/line-ops.js.map +1 -0
- package/dist/tools/dns-native.d.ts +0 -5
- package/dist/tools/dns-native.js +0 -16
- package/dist/tools/dns-native.js.map +1 -1
- package/dist/tools/external-tools.d.ts +0 -8
- package/dist/tools/external-tools.js.map +1 -1
- package/dist/tools/file-diff.d.ts +3 -78
- package/dist/tools/file-diff.js +2 -271
- package/dist/tools/file-diff.js.map +1 -1
- package/dist/tools/fs/internals-2.d.ts +1 -0
- package/dist/tools/fs/internals-2.js +6 -0
- package/dist/tools/fs/internals-2.js.map +1 -0
- package/dist/tools/fs/internals.d.ts +4 -0
- package/dist/tools/fs/internals.js +23 -0
- package/dist/tools/fs/internals.js.map +1 -0
- package/dist/tools/fs/mutations.d.ts +17 -0
- package/dist/tools/fs/mutations.js +396 -0
- package/dist/tools/fs/mutations.js.map +1 -0
- package/dist/tools/fs/read-window.d.ts +14 -0
- package/dist/tools/fs/read-window.js +288 -0
- package/dist/tools/fs/read-window.js.map +1 -0
- package/dist/tools/fs/read.d.ts +7 -0
- package/dist/tools/fs/read.js +164 -0
- package/dist/tools/fs/read.js.map +1 -0
- package/dist/tools/fs/search.d.ts +13 -0
- package/dist/tools/fs/search.js +125 -0
- package/dist/tools/fs/search.js.map +1 -0
- package/dist/tools/fs.d.ts +4 -79
- package/dist/tools/fs.js +26 -1115
- package/dist/tools/fs.js.map +1 -1
- package/dist/tools/handlers/args.d.ts +8 -0
- package/dist/tools/handlers/args.js +50 -0
- package/dist/tools/handlers/args.js.map +1 -0
- package/dist/tools/handlers/context-1.d.ts +2 -0
- package/dist/tools/handlers/context-1.js +7 -0
- package/dist/tools/handlers/context-1.js.map +1 -0
- package/dist/tools/handlers/context-2.d.ts +2 -0
- package/dist/tools/handlers/context-2.js +14 -0
- package/dist/tools/handlers/context-2.js.map +1 -0
- package/dist/tools/handlers/files-1.d.ts +2 -0
- package/dist/tools/handlers/files-1.js +51 -0
- package/dist/tools/handlers/files-1.js.map +1 -0
- package/dist/tools/handlers/files-2.d.ts +2 -0
- package/dist/tools/handlers/files-2.js +31 -0
- package/dist/tools/handlers/files-2.js.map +1 -0
- package/dist/tools/handlers/network-1.d.ts +2 -0
- package/dist/tools/handlers/network-1.js +52 -0
- package/dist/tools/handlers/network-1.js.map +1 -0
- package/dist/tools/handlers/network-2.d.ts +2 -0
- package/dist/tools/handlers/network-2.js +32 -0
- package/dist/tools/handlers/network-2.js.map +1 -0
- package/dist/tools/handlers/network-3.d.ts +2 -0
- package/dist/tools/handlers/network-3.js +17 -0
- package/dist/tools/handlers/network-3.js.map +1 -0
- package/dist/tools/handlers/nmap-preparation.d.ts +13 -0
- package/dist/tools/handlers/nmap-preparation.js +66 -0
- package/dist/tools/handlers/nmap-preparation.js.map +1 -0
- package/dist/tools/handlers/orchestration-1.d.ts +2 -0
- package/dist/tools/handlers/orchestration-1.js +7 -0
- package/dist/tools/handlers/orchestration-1.js.map +1 -0
- package/dist/tools/handlers/orchestration-2.d.ts +2 -0
- package/dist/tools/handlers/orchestration-2.js +16 -0
- package/dist/tools/handlers/orchestration-2.js.map +1 -0
- package/dist/tools/handlers/pentest.d.ts +2 -0
- package/dist/tools/handlers/pentest.js +208 -0
- package/dist/tools/handlers/pentest.js.map +1 -0
- package/dist/tools/handlers/responder-job-options.d.ts +3 -0
- package/dist/tools/handlers/responder-job-options.js +16 -0
- package/dist/tools/handlers/responder-job-options.js.map +1 -0
- package/dist/tools/handlers/shell-1.d.ts +2 -0
- package/dist/tools/handlers/shell-1.js +94 -0
- package/dist/tools/handlers/shell-1.js.map +1 -0
- package/dist/tools/handlers/shell-2.d.ts +2 -0
- package/dist/tools/handlers/shell-2.js +49 -0
- package/dist/tools/handlers/shell-2.js.map +1 -0
- package/dist/tools/handlers/shell-3.d.ts +2 -0
- package/dist/tools/handlers/shell-3.js +47 -0
- package/dist/tools/handlers/shell-3.js.map +1 -0
- package/dist/tools/handlers/web.d.ts +2 -0
- package/dist/tools/handlers/web.js +168 -0
- package/dist/tools/handlers/web.js.map +1 -0
- package/dist/tools/http/agents.d.ts +10 -0
- package/dist/tools/http/agents.js +63 -0
- package/dist/tools/http/agents.js.map +1 -0
- package/dist/tools/http/evidence-format.d.ts +37 -0
- package/dist/tools/http/evidence-format.js +181 -0
- package/dist/tools/http/evidence-format.js.map +1 -0
- package/dist/tools/http/fetch.d.ts +31 -0
- package/dist/tools/http/fetch.js +480 -0
- package/dist/tools/http/fetch.js.map +1 -0
- package/dist/tools/http/retry-policy.d.ts +14 -0
- package/dist/tools/http/retry-policy.js +144 -0
- package/dist/tools/http/retry-policy.js.map +1 -0
- package/dist/tools/http.d.ts +1 -45
- package/dist/tools/http.js +1 -920
- package/dist/tools/http.js.map +1 -1
- package/dist/tools/image.d.ts +0 -15
- package/dist/tools/image.js +0 -21
- package/dist/tools/image.js.map +1 -1
- package/dist/tools/interactive-session-tools.d.ts +0 -7
- package/dist/tools/interactive-session-tools.js +0 -13
- package/dist/tools/interactive-session-tools.js.map +1 -1
- package/dist/tools/jobs/helpers.d.ts +6 -0
- package/dist/tools/jobs/helpers.js +63 -0
- package/dist/tools/jobs/helpers.js.map +1 -0
- package/dist/tools/jobs/limits.d.ts +20 -0
- package/dist/tools/jobs/limits.js +21 -0
- package/dist/tools/jobs/limits.js.map +1 -0
- package/dist/tools/jobs/polling-policy.d.ts +11 -0
- package/dist/tools/jobs/polling-policy.js +33 -0
- package/dist/tools/jobs/polling-policy.js.map +1 -0
- package/dist/tools/jobs/process-identity.d.ts +5 -0
- package/dist/tools/jobs/process-identity.js +80 -0
- package/dist/tools/jobs/process-identity.js.map +1 -0
- package/dist/tools/jobs/redacted-writer.d.ts +25 -0
- package/dist/tools/jobs/redacted-writer.js +134 -0
- package/dist/tools/jobs/redacted-writer.js.map +1 -0
- package/dist/tools/jobs/types.d.ts +152 -0
- package/dist/tools/jobs/types.js +2 -0
- package/dist/tools/jobs/types.js.map +1 -0
- package/dist/tools/jobs.d.ts +8 -210
- package/dist/tools/jobs.js +13 -453
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/net-ping-sweep.d.ts +0 -8
- package/dist/tools/net-ping-sweep.js +0 -22
- package/dist/tools/net-ping-sweep.js.map +1 -1
- package/dist/tools/network-context.d.ts +0 -4
- package/dist/tools/network-context.js +0 -8
- package/dist/tools/network-context.js.map +1 -1
- package/dist/tools/nmap-runner.d.ts +0 -21
- package/dist/tools/nmap-runner.js +0 -43
- package/dist/tools/nmap-runner.js.map +1 -1
- package/dist/tools/output-selection.d.ts +0 -1
- package/dist/tools/output-selection.js +0 -3
- package/dist/tools/output-selection.js.map +1 -1
- package/dist/tools/package-binary.js +0 -7
- package/dist/tools/package-binary.js.map +1 -1
- package/dist/tools/pdf/read.d.ts +6 -0
- package/dist/tools/pdf/read.js +529 -0
- package/dist/tools/pdf/read.js.map +1 -0
- package/dist/tools/pdf.d.ts +2 -6
- package/dist/tools/pdf.js +1 -528
- package/dist/tools/pdf.js.map +1 -1
- package/dist/tools/pentest-workflows.js +0 -12
- package/dist/tools/pentest-workflows.js.map +1 -1
- package/dist/tools/policies/output-policy.d.ts +0 -17
- package/dist/tools/policies/output-policy.js +0 -18
- package/dist/tools/policies/output-policy.js.map +1 -1
- package/dist/tools/reducers/ffuf.d.ts +0 -5
- package/dist/tools/reducers/ffuf.js +0 -8
- package/dist/tools/reducers/ffuf.js.map +1 -1
- package/dist/tools/reducers/gobuster.js +0 -1
- package/dist/tools/reducers/gobuster.js.map +1 -1
- package/dist/tools/reducers/httpx.js +0 -1
- package/dist/tools/reducers/httpx.js.map +1 -1
- package/dist/tools/reducers/nmap.d.ts +0 -5
- package/dist/tools/reducers/nmap.js +0 -5
- package/dist/tools/reducers/nmap.js.map +1 -1
- package/dist/tools/reducers/nuclei.js +0 -1
- package/dist/tools/reducers/nuclei.js.map +1 -1
- package/dist/tools/reducers/subdomains.d.ts +0 -4
- package/dist/tools/reducers/subdomains.js +0 -4
- package/dist/tools/reducers/subdomains.js.map +1 -1
- package/dist/tools/reducers/types.d.ts +0 -5
- package/dist/tools/registry.d.ts +4 -20
- package/dist/tools/registry.js +42 -1636
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/shell/artifact-name.d.ts +1 -0
- package/dist/tools/shell/artifact-name.js +6 -0
- package/dist/tools/shell/artifact-name.js.map +1 -0
- package/dist/tools/shell/capture.d.ts +31 -0
- package/dist/tools/shell/capture.js +135 -0
- package/dist/tools/shell/capture.js.map +1 -0
- package/dist/tools/shell/exec-attempt.d.ts +10 -0
- package/dist/tools/shell/exec-attempt.js +288 -0
- package/dist/tools/shell/exec-attempt.js.map +1 -0
- package/dist/tools/shell/internals-2.d.ts +16 -0
- package/dist/tools/shell/internals-2.js +48 -0
- package/dist/tools/shell/internals-2.js.map +1 -0
- package/dist/tools/shell/internals.d.ts +10 -0
- package/dist/tools/shell/internals.js +51 -0
- package/dist/tools/shell/internals.js.map +1 -0
- package/dist/tools/shell/spawn-argv.d.ts +17 -0
- package/dist/tools/shell/spawn-argv.js +248 -0
- package/dist/tools/shell/spawn-argv.js.map +1 -0
- package/dist/tools/shell-quoting.d.ts +1 -0
- package/dist/tools/shell-quoting.js +7 -0
- package/dist/tools/shell-quoting.js.map +1 -0
- package/dist/tools/shell.d.ts +4 -82
- package/dist/tools/shell.js +7 -845
- package/dist/tools/shell.js.map +1 -1
- package/dist/tools/sudo-session.d.ts +0 -41
- package/dist/tools/sudo-session.js +0 -44
- package/dist/tools/sudo-session.js.map +1 -1
- package/dist/tools/tool-types.d.ts +0 -7
- package/dist/tools/validate.d.ts +0 -35
- package/dist/tools/validate.js +2 -67
- package/dist/tools/validate.js.map +1 -1
- package/dist/tools/web/audit.d.ts +0 -74
- package/dist/tools/web/audit.js +0 -39
- package/dist/tools/web/audit.js.map +1 -1
- package/dist/tools/web/budget.d.ts +0 -35
- package/dist/tools/web/budget.js +0 -75
- package/dist/tools/web/budget.js.map +1 -1
- package/dist/tools/web/capture.d.ts +0 -106
- package/dist/tools/web/capture.js +0 -148
- package/dist/tools/web/capture.js.map +1 -1
- package/dist/tools/web/decode.d.ts +0 -8
- package/dist/tools/web/decode.js +0 -9
- package/dist/tools/web/decode.js.map +1 -1
- package/dist/tools/web/fetch-core.d.ts +2 -32
- package/dist/tools/web/fetch-core.js +4 -1058
- package/dist/tools/web/fetch-core.js.map +1 -1
- package/dist/tools/web/fetch.d.ts +0 -29
- package/dist/tools/web/fetch.js +0 -46
- package/dist/tools/web/fetch.js.map +1 -1
- package/dist/tools/web/issue-hop.d.ts +57 -0
- package/dist/tools/web/issue-hop.js +396 -0
- package/dist/tools/web/issue-hop.js.map +1 -0
- package/dist/tools/web/providers/brave.d.ts +0 -40
- package/dist/tools/web/providers/brave.js +1 -100
- package/dist/tools/web/providers/brave.js.map +1 -1
- package/dist/tools/web/providers/duckduckgo.d.ts +0 -41
- package/dist/tools/web/providers/duckduckgo.js +0 -104
- package/dist/tools/web/providers/duckduckgo.js.map +1 -1
- package/dist/tools/web/providers/exa.d.ts +0 -43
- package/dist/tools/web/providers/exa.js +1 -102
- package/dist/tools/web/providers/exa.js.map +1 -1
- package/dist/tools/web/providers/provider.d.ts +0 -69
- package/dist/tools/web/providers/provider.js +0 -28
- package/dist/tools/web/providers/provider.js.map +1 -1
- package/dist/tools/web/providers/tavily.d.ts +0 -46
- package/dist/tools/web/providers/tavily.js +1 -111
- package/dist/tools/web/providers/tavily.js.map +1 -1
- package/dist/tools/web/readable.d.ts +0 -62
- package/dist/tools/web/readable.js +1 -132
- package/dist/tools/web/readable.js.map +1 -1
- package/dist/tools/web/redact.d.ts +0 -26
- package/dist/tools/web/redact.js +0 -2
- package/dist/tools/web/redact.js.map +1 -1
- package/dist/tools/web/request-loop.d.ts +38 -0
- package/dist/tools/web/request-loop.js +172 -0
- package/dist/tools/web/request-loop.js.map +1 -0
- package/dist/tools/web/response-body.d.ts +41 -0
- package/dist/tools/web/response-body.js +174 -0
- package/dist/tools/web/response-body.js.map +1 -0
- package/dist/tools/web/search-attempts.d.ts +20 -0
- package/dist/tools/web/search-attempts.js +303 -0
- package/dist/tools/web/search-attempts.js.map +1 -0
- package/dist/tools/web/search.d.ts +0 -33
- package/dist/tools/web/search.js +3 -396
- package/dist/tools/web/search.js.map +1 -1
- package/dist/tools/web/ssrf-guard.d.ts +0 -42
- package/dist/tools/web/ssrf-guard.js +0 -57
- package/dist/tools/web/ssrf-guard.js.map +1 -1
- package/dist/tools/web/types.d.ts +0 -197
- package/dist/tools/web/types.js +0 -41
- package/dist/tools/web/types.js.map +1 -1
- package/dist/tools/web/validate-args.d.ts +11 -0
- package/dist/tools/web/validate-args.js +107 -0
- package/dist/tools/web/validate-args.js.map +1 -0
- package/dist/tools/whois-native.d.ts +0 -4
- package/dist/tools/whois-native.js +0 -6
- package/dist/tools/whois-native.js.map +1 -1
- package/dist/tools/wordlists.js +0 -32
- package/dist/tools/wordlists.js.map +1 -1
- package/dist/tui-v2/app/App.d.ts +0 -10
- package/dist/tui-v2/app/App.js +67 -112
- package/dist/tui-v2/app/App.js.map +1 -1
- package/dist/tui-v2/bootstrap/pager-export.d.ts +0 -8
- package/dist/tui-v2/bootstrap/pager-export.js +0 -11
- package/dist/tui-v2/bootstrap/pager-export.js.map +1 -1
- package/dist/tui-v2/bootstrap/patch-opentui-text.d.ts +0 -5
- package/dist/tui-v2/bootstrap/patch-opentui-text.js +0 -5
- package/dist/tui-v2/bootstrap/patch-opentui-text.js.map +1 -1
- package/dist/tui-v2/bootstrap/resize-repaint.d.ts +16 -20
- package/dist/tui-v2/bootstrap/resize-repaint.js +34 -13
- package/dist/tui-v2/bootstrap/resize-repaint.js.map +1 -1
- package/dist/tui-v2/bootstrap/start-tui-v2.d.ts +0 -7
- package/dist/tui-v2/bootstrap/start-tui-v2.js +10 -27
- package/dist/tui-v2/bootstrap/start-tui-v2.js.map +1 -1
- package/dist/tui-v2/components/completion/completion-menu.d.ts +0 -4
- package/dist/tui-v2/components/completion/completion-menu.js +2 -6
- package/dist/tui-v2/components/completion/completion-menu.js.map +1 -1
- package/dist/tui-v2/components/composer/composer-input-box.d.ts +0 -4
- package/dist/tui-v2/components/composer/composer-input-box.js +1 -10
- package/dist/tui-v2/components/composer/composer-input-box.js.map +1 -1
- package/dist/tui-v2/components/composer/paste-chip.d.ts +0 -7
- package/dist/tui-v2/components/composer/paste-chip.js +0 -7
- package/dist/tui-v2/components/composer/paste-chip.js.map +1 -1
- package/dist/tui-v2/components/jobs/jobs-panel.d.ts +0 -12
- package/dist/tui-v2/components/jobs/jobs-panel.js +0 -34
- package/dist/tui-v2/components/jobs/jobs-panel.js.map +1 -1
- package/dist/tui-v2/components/modal/confirm-modal.d.ts +0 -8
- package/dist/tui-v2/components/modal/confirm-modal.js +0 -4
- package/dist/tui-v2/components/modal/confirm-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/keys-modal.d.ts +0 -11
- package/dist/tui-v2/components/modal/keys-modal.js +0 -24
- package/dist/tui-v2/components/modal/keys-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/prompt-actions-modal.d.ts +0 -6
- package/dist/tui-v2/components/modal/prompt-actions-modal.js +4 -13
- package/dist/tui-v2/components/modal/prompt-actions-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/scope-modal.d.ts +0 -5
- package/dist/tui-v2/components/modal/scope-modal.js +0 -12
- package/dist/tui-v2/components/modal/scope-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/secret-modal.d.ts +0 -8
- package/dist/tui-v2/components/modal/secret-modal.js +0 -17
- package/dist/tui-v2/components/modal/secret-modal.js.map +1 -1
- package/dist/tui-v2/components/modal/text-editor-modal.d.ts +0 -6
- package/dist/tui-v2/components/modal/text-editor-modal.js +0 -6
- package/dist/tui-v2/components/modal/text-editor-modal.js.map +1 -1
- package/dist/tui-v2/components/overlay/overlay-host.d.ts +0 -14
- package/dist/tui-v2/components/overlay/overlay-host.js +0 -2
- package/dist/tui-v2/components/overlay/overlay-host.js.map +1 -1
- package/dist/tui-v2/components/pager/pager-line.d.ts +0 -5
- package/dist/tui-v2/components/pager/pager-line.js +0 -10
- package/dist/tui-v2/components/pager/pager-line.js.map +1 -1
- package/dist/tui-v2/components/pager/pager.d.ts +0 -14
- package/dist/tui-v2/components/pager/pager.js +3 -58
- package/dist/tui-v2/components/pager/pager.js.map +1 -1
- package/dist/tui-v2/components/picker/picker.d.ts +0 -6
- package/dist/tui-v2/components/picker/picker.js +3 -12
- package/dist/tui-v2/components/picker/picker.js.map +1 -1
- package/dist/tui-v2/components/plan/plan-pane-anim.d.ts +0 -25
- package/dist/tui-v2/components/plan/plan-pane-anim.js +0 -23
- package/dist/tui-v2/components/plan/plan-pane-anim.js.map +1 -1
- package/dist/tui-v2/components/plan/plan-view.d.ts +0 -7
- package/dist/tui-v2/components/plan/plan-view.js +0 -20
- package/dist/tui-v2/components/plan/plan-view.js.map +1 -1
- package/dist/tui-v2/components/plan/use-pane-presence.d.ts +0 -9
- package/dist/tui-v2/components/plan/use-pane-presence.js +0 -9
- package/dist/tui-v2/components/plan/use-pane-presence.js.map +1 -1
- package/dist/tui-v2/components/queue/queue-panel.d.ts +0 -12
- package/dist/tui-v2/components/queue/queue-panel.js +2 -4
- package/dist/tui-v2/components/queue/queue-panel.js.map +1 -1
- package/dist/tui-v2/components/status/status-line.d.ts +0 -17
- package/dist/tui-v2/components/status/status-line.js +0 -10
- package/dist/tui-v2/components/status/status-line.js.map +1 -1
- package/dist/tui-v2/components/toast/toast-anim.d.ts +0 -20
- package/dist/tui-v2/components/toast/toast-anim.js +0 -15
- package/dist/tui-v2/components/toast/toast-anim.js.map +1 -1
- package/dist/tui-v2/components/toast/toast-host.d.ts +0 -12
- package/dist/tui-v2/components/toast/toast-host.js +1 -29
- package/dist/tui-v2/components/toast/toast-host.js.map +1 -1
- package/dist/tui-v2/components/transcript/assistant-message.d.ts +0 -11
- package/dist/tui-v2/components/transcript/assistant-message.js +3 -24
- package/dist/tui-v2/components/transcript/assistant-message.js.map +1 -1
- package/dist/tui-v2/components/transcript/compacted-row.d.ts +0 -6
- package/dist/tui-v2/components/transcript/compacted-row.js +2 -6
- package/dist/tui-v2/components/transcript/compacted-row.js.map +1 -1
- package/dist/tui-v2/components/transcript/file-diff-card.d.ts +0 -9
- package/dist/tui-v2/components/transcript/file-diff-card.js +0 -16
- package/dist/tui-v2/components/transcript/file-diff-card.js.map +1 -1
- package/dist/tui-v2/components/transcript/intro-card.d.ts +0 -9
- package/dist/tui-v2/components/transcript/intro-card.js +2 -13
- package/dist/tui-v2/components/transcript/intro-card.js.map +1 -1
- package/dist/tui-v2/components/transcript/linkable-text.d.ts +0 -16
- package/dist/tui-v2/components/transcript/linkable-text.js +0 -11
- package/dist/tui-v2/components/transcript/linkable-text.js.map +1 -1
- package/dist/tui-v2/components/transcript/notice-row.d.ts +0 -7
- package/dist/tui-v2/components/transcript/notice-row.js +2 -18
- package/dist/tui-v2/components/transcript/notice-row.js.map +1 -1
- package/dist/tui-v2/components/transcript/search-bar.d.ts +0 -10
- package/dist/tui-v2/components/transcript/search-bar.js +0 -3
- package/dist/tui-v2/components/transcript/search-bar.js.map +1 -1
- package/dist/tui-v2/components/transcript/selectable-line.d.ts +0 -16
- package/dist/tui-v2/components/transcript/selectable-line.js +0 -9
- package/dist/tui-v2/components/transcript/selectable-line.js.map +1 -1
- package/dist/tui-v2/components/transcript/thinking-block.d.ts +0 -18
- package/dist/tui-v2/components/transcript/thinking-block.js +2 -40
- package/dist/tui-v2/components/transcript/thinking-block.js.map +1 -1
- package/dist/tui-v2/components/transcript/tool-card.d.ts +0 -19
- package/dist/tui-v2/components/transcript/tool-card.js +2 -42
- package/dist/tui-v2/components/transcript/tool-card.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-row.d.ts +0 -14
- package/dist/tui-v2/components/transcript/transcript-row.js +0 -13
- package/dist/tui-v2/components/transcript/transcript-row.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-scroll-port.d.ts +0 -32
- package/dist/tui-v2/components/transcript/transcript-scroll-port.js +0 -22
- package/dist/tui-v2/components/transcript/transcript-scroll-port.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-view.d.ts +0 -9
- package/dist/tui-v2/components/transcript/transcript-view.js +4 -67
- package/dist/tui-v2/components/transcript/transcript-view.js.map +1 -1
- package/dist/tui-v2/components/transcript/use-click-without-drag.d.ts +0 -7
- package/dist/tui-v2/components/transcript/use-click-without-drag.js +1 -11
- package/dist/tui-v2/components/transcript/use-click-without-drag.js.map +1 -1
- package/dist/tui-v2/components/transcript/use-native-selection-copy.d.ts +0 -7
- package/dist/tui-v2/components/transcript/use-native-selection-copy.js +0 -9
- package/dist/tui-v2/components/transcript/use-native-selection-copy.js.map +1 -1
- package/dist/tui-v2/components/transcript/use-transcript-selection.d.ts +0 -1
- package/dist/tui-v2/components/transcript/use-transcript-selection.js +0 -14
- package/dist/tui-v2/components/transcript/use-transcript-selection.js.map +1 -1
- package/dist/tui-v2/components/transcript/user-message.d.ts +0 -2
- package/dist/tui-v2/components/transcript/user-message.js +2 -7
- package/dist/tui-v2/components/transcript/user-message.js.map +1 -1
- package/dist/tui-v2/composer/composer-editor.d.ts +0 -20
- package/dist/tui-v2/composer/composer-editor.js +0 -61
- package/dist/tui-v2/composer/composer-editor.js.map +1 -1
- package/dist/tui-v2/composer/composer-wheel.d.ts +0 -17
- package/dist/tui-v2/composer/composer-wheel.js +0 -17
- package/dist/tui-v2/composer/composer-wheel.js.map +1 -1
- package/dist/tui-v2/composer/disable-native-textarea-scroll.d.ts +0 -12
- package/dist/tui-v2/composer/disable-native-textarea-scroll.js +0 -13
- package/dist/tui-v2/composer/disable-native-textarea-scroll.js.map +1 -1
- package/dist/tui-v2/composer/textarea-keybindings.d.ts +0 -19
- package/dist/tui-v2/composer/textarea-keybindings.js +0 -34
- package/dist/tui-v2/composer/textarea-keybindings.js.map +1 -1
- package/dist/tui-v2/composer/use-draft-actions.d.ts +0 -10
- package/dist/tui-v2/composer/use-draft-actions.js +0 -5
- package/dist/tui-v2/composer/use-draft-actions.js.map +1 -1
- package/dist/tui-v2/hooks/terminal-dimensions.d.ts +6 -0
- package/dist/tui-v2/hooks/terminal-dimensions.js +14 -0
- package/dist/tui-v2/hooks/terminal-dimensions.js.map +1 -0
- package/dist/tui-v2/input/chord-from-opentui-key.d.ts +0 -17
- package/dist/tui-v2/input/chord-from-opentui-key.js +0 -17
- package/dist/tui-v2/input/chord-from-opentui-key.js.map +1 -1
- package/dist/tui-v2/rendering/ansi-to-styled.d.ts +0 -12
- package/dist/tui-v2/rendering/ansi-to-styled.js +0 -10
- package/dist/tui-v2/rendering/ansi-to-styled.js.map +1 -1
- package/dist/tui-v2/rendering/pager-markdown.d.ts +0 -18
- package/dist/tui-v2/rendering/pager-markdown.js +0 -14
- package/dist/tui-v2/rendering/pager-markdown.js.map +1 -1
- package/dist/types.d.ts +2 -135
- package/dist/types.js +0 -3
- package/dist/types.js.map +1 -1
- package/dist/ui/mentions/expand.d.ts +26 -0
- package/dist/ui/mentions/expand.js +308 -0
- package/dist/ui/mentions/expand.js.map +1 -0
- package/dist/ui/mentions/file-suggestions.d.ts +7 -0
- package/dist/ui/mentions/file-suggestions.js +106 -0
- package/dist/ui/mentions/file-suggestions.js.map +1 -0
- package/dist/ui/mentions.d.ts +6 -70
- package/dist/ui/mentions.js +8 -482
- package/dist/ui/mentions.js.map +1 -1
- package/dist/ui/plan-pane.d.ts +0 -15
- package/dist/ui/plan-pane.js +1 -16
- package/dist/ui/plan-pane.js.map +1 -1
- package/dist/ui/thinking.d.ts +0 -8
- package/dist/ui/thinking.js +0 -13
- package/dist/ui/thinking.js.map +1 -1
- package/dist/ui-core/actions/action-id.d.ts +0 -8
- package/dist/ui-core/actions/action-id.js +0 -25
- package/dist/ui-core/actions/action-id.js.map +1 -1
- package/dist/ui-core/actions/action-router.d.ts +0 -10
- package/dist/ui-core/actions/action-router.js +0 -16
- package/dist/ui-core/actions/action-router.js.map +1 -1
- package/dist/ui-core/actions/cancel-timing.d.ts +0 -3
- package/dist/ui-core/actions/cancel-timing.js +0 -3
- package/dist/ui-core/actions/cancel-timing.js.map +1 -1
- package/dist/ui-core/actions/format-shortcuts.d.ts +0 -9
- package/dist/ui-core/actions/format-shortcuts.js +0 -9
- package/dist/ui-core/actions/format-shortcuts.js.map +1 -1
- package/dist/ui-core/actions/keymap.d.ts +0 -9
- package/dist/ui-core/actions/keymap.js +0 -39
- package/dist/ui-core/actions/keymap.js.map +1 -1
- package/dist/ui-core/actions/mode-cycle.d.ts +0 -2
- package/dist/ui-core/actions/mode-cycle.js +0 -4
- package/dist/ui-core/actions/mode-cycle.js.map +1 -1
- package/dist/ui-core/bootstrap/can-use-tui.d.ts +0 -6
- package/dist/ui-core/bootstrap/can-use-tui.js +0 -9
- package/dist/ui-core/bootstrap/can-use-tui.js.map +1 -1
- package/dist/ui-core/bootstrap/capabilities.d.ts +0 -8
- package/dist/ui-core/bootstrap/capabilities.js +1 -8
- package/dist/ui-core/bootstrap/capabilities.js.map +1 -1
- package/dist/ui-core/bootstrap/composition-root.d.ts +0 -17
- package/dist/ui-core/bootstrap/composition-root.js +30 -19
- package/dist/ui-core/bootstrap/composition-root.js.map +1 -1
- package/dist/ui-core/bootstrap/console-guard.d.ts +0 -15
- package/dist/ui-core/bootstrap/console-guard.js +32 -0
- package/dist/ui-core/bootstrap/console-guard.js.map +1 -1
- package/dist/ui-core/bootstrap/console-suppress.js +2 -7
- package/dist/ui-core/bootstrap/console-suppress.js.map +1 -1
- package/dist/ui-core/bootstrap/exit-epilogue.d.ts +0 -6
- package/dist/ui-core/bootstrap/exit-epilogue.js +0 -5
- package/dist/ui-core/bootstrap/exit-epilogue.js.map +1 -1
- package/dist/ui-core/bootstrap/lifecycle.d.ts +0 -42
- package/dist/ui-core/bootstrap/lifecycle.js +0 -31
- package/dist/ui-core/bootstrap/lifecycle.js.map +1 -1
- package/dist/ui-core/bootstrap/overlay-ports.d.ts +0 -11
- package/dist/ui-core/bootstrap/overlay-ports.js +0 -13
- package/dist/ui-core/bootstrap/overlay-ports.js.map +1 -1
- package/dist/ui-core/bootstrap/theme-mode-cache.js +0 -5
- package/dist/ui-core/bootstrap/theme-mode-cache.js.map +1 -1
- package/dist/ui-core/commands/command-handlers.d.ts +0 -6
- package/dist/ui-core/commands/command-handlers.js +0 -6
- package/dist/ui-core/commands/command-handlers.js.map +1 -1
- package/dist/ui-core/commands/config-commands.d.ts +0 -3
- package/dist/ui-core/commands/config-commands.js +0 -7
- package/dist/ui-core/commands/config-commands.js.map +1 -1
- package/dist/ui-core/commands/key-commands.d.ts +2 -0
- package/dist/ui-core/commands/key-commands.js +79 -213
- package/dist/ui-core/commands/key-commands.js.map +1 -1
- package/dist/ui-core/commands/keys/editors.d.ts +15 -0
- package/dist/ui-core/commands/keys/editors.js +127 -0
- package/dist/ui-core/commands/keys/editors.js.map +1 -0
- package/dist/ui-core/commands/mcp-commands.js +0 -6
- package/dist/ui-core/commands/mcp-commands.js.map +1 -1
- package/dist/ui-core/commands/picker-commands.d.ts +3 -14
- package/dist/ui-core/commands/picker-commands.js +6 -694
- package/dist/ui-core/commands/picker-commands.js.map +1 -1
- package/dist/ui-core/commands/pickers/custom-provider.d.ts +3 -0
- package/dist/ui-core/commands/pickers/custom-provider.js +170 -0
- package/dist/ui-core/commands/pickers/custom-provider.js.map +1 -0
- package/dist/ui-core/commands/pickers/history.d.ts +3 -0
- package/dist/ui-core/commands/pickers/history.js +185 -0
- package/dist/ui-core/commands/pickers/history.js.map +1 -0
- package/dist/ui-core/commands/pickers/output-pager.d.ts +5 -0
- package/dist/ui-core/commands/pickers/output-pager.js +90 -0
- package/dist/ui-core/commands/pickers/output-pager.js.map +1 -0
- package/dist/ui-core/commands/pickers/search-reasoning.d.ts +4 -0
- package/dist/ui-core/commands/pickers/search-reasoning.js +184 -0
- package/dist/ui-core/commands/pickers/search-reasoning.js.map +1 -0
- package/dist/ui-core/commands/session-commands.d.ts +0 -4
- package/dist/ui-core/commands/session-commands.js +23 -17
- package/dist/ui-core/commands/session-commands.js.map +1 -1
- package/dist/ui-core/commands/startup-update.d.ts +0 -6
- package/dist/ui-core/commands/startup-update.js +0 -6
- package/dist/ui-core/commands/startup-update.js.map +1 -1
- package/dist/ui-core/composer/arrow-intent.d.ts +0 -10
- package/dist/ui-core/composer/arrow-intent.js +0 -14
- package/dist/ui-core/composer/arrow-intent.js.map +1 -1
- package/dist/ui-core/composer/completion.d.ts +0 -9
- package/dist/ui-core/composer/completion.js +1 -13
- package/dist/ui-core/composer/completion.js.map +1 -1
- package/dist/ui-core/composer/composer-action-port.d.ts +0 -10
- package/dist/ui-core/composer/composer-action-port.js +0 -10
- package/dist/ui-core/composer/composer-action-port.js.map +1 -1
- package/dist/ui-core/composer/composer-height.d.ts +0 -12
- package/dist/ui-core/composer/composer-height.js +0 -12
- package/dist/ui-core/composer/composer-height.js.map +1 -1
- package/dist/ui-core/composer/composer-wheel.d.ts +0 -17
- package/dist/ui-core/composer/composer-wheel.js +0 -17
- package/dist/ui-core/composer/composer-wheel.js.map +1 -1
- package/dist/ui-core/composer/draft-actions.d.ts +0 -14
- package/dist/ui-core/composer/draft-actions.js +0 -13
- package/dist/ui-core/composer/draft-actions.js.map +1 -1
- package/dist/ui-core/composer/history-nav.d.ts +0 -9
- package/dist/ui-core/composer/history-nav.js +0 -9
- package/dist/ui-core/composer/history-nav.js.map +1 -1
- package/dist/ui-core/composer/input-history.d.ts +0 -1
- package/dist/ui-core/composer/input-history.js +0 -1
- package/dist/ui-core/composer/input-history.js.map +1 -1
- package/dist/ui-core/composer/newline-hint.d.ts +0 -7
- package/dist/ui-core/composer/newline-hint.js +0 -9
- package/dist/ui-core/composer/newline-hint.js.map +1 -1
- package/dist/ui-core/composer/paste-placeholder.d.ts +0 -23
- package/dist/ui-core/composer/paste-placeholder.js +0 -21
- package/dist/ui-core/composer/paste-placeholder.js.map +1 -1
- package/dist/ui-core/composer/prompt-history.d.ts +0 -11
- package/dist/ui-core/composer/prompt-history.js +0 -11
- package/dist/ui-core/composer/prompt-history.js.map +1 -1
- package/dist/ui-core/composer/secret-buffer.d.ts +0 -8
- package/dist/ui-core/composer/secret-buffer.js +0 -8
- package/dist/ui-core/composer/secret-buffer.js.map +1 -1
- package/dist/ui-core/composer/textarea-keybindings.d.ts +0 -15
- package/dist/ui-core/composer/textarea-keybindings.js +0 -30
- package/dist/ui-core/composer/textarea-keybindings.js.map +1 -1
- package/dist/ui-core/controllers/focus-controller.d.ts +0 -11
- package/dist/ui-core/controllers/focus-controller.js +0 -11
- package/dist/ui-core/controllers/focus-controller.js.map +1 -1
- package/dist/ui-core/controllers/interruptible-controller.d.ts +0 -6
- package/dist/ui-core/controllers/interruptible-controller.js +0 -6
- package/dist/ui-core/controllers/interruptible-controller.js.map +1 -1
- package/dist/ui-core/controllers/overlay-controller.d.ts +1 -81
- package/dist/ui-core/controllers/overlay-controller.js +1 -48
- package/dist/ui-core/controllers/overlay-controller.js.map +1 -1
- package/dist/ui-core/controllers/selection-controller.d.ts +0 -9
- package/dist/ui-core/controllers/selection-controller.js +0 -7
- package/dist/ui-core/controllers/selection-controller.js.map +1 -1
- package/dist/ui-core/controllers/toast-controller.d.ts +0 -24
- package/dist/ui-core/controllers/toast-controller.js +0 -15
- package/dist/ui-core/controllers/toast-controller.js.map +1 -1
- package/dist/ui-core/layout/compute-layout.d.ts +0 -19
- package/dist/ui-core/layout/compute-layout.js +0 -32
- package/dist/ui-core/layout/compute-layout.js.map +1 -1
- package/dist/ui-core/motion/ease.d.ts +0 -6
- package/dist/ui-core/motion/ease.js +0 -6
- package/dist/ui-core/motion/ease.js.map +1 -1
- package/dist/ui-core/notify.d.ts +0 -8
- package/dist/ui-core/notify.js +0 -8
- package/dist/ui-core/notify.js.map +1 -1
- package/dist/ui-core/plan/plan-lifecycle.d.ts +0 -27
- package/dist/ui-core/plan/plan-lifecycle.js +0 -45
- package/dist/ui-core/plan/plan-lifecycle.js.map +1 -1
- package/dist/ui-core/ports/clipboard-osc52.d.ts +0 -8
- package/dist/ui-core/ports/clipboard-osc52.js +0 -7
- package/dist/ui-core/ports/clipboard-osc52.js.map +1 -1
- package/dist/ui-core/ports/pager-export-port.js +0 -2
- package/dist/ui-core/ports/pager-export-port.js.map +1 -1
- package/dist/ui-core/ports/renderer-port.d.ts +0 -6
- package/dist/ui-core/react/providers.d.ts +0 -7
- package/dist/ui-core/react/providers.js +0 -7
- package/dist/ui-core/react/providers.js.map +1 -1
- package/dist/ui-core/react/use-has-draft.d.ts +0 -5
- package/dist/ui-core/react/use-has-draft.js +0 -5
- package/dist/ui-core/react/use-has-draft.js.map +1 -1
- package/dist/ui-core/react/use-overlay.d.ts +0 -1
- package/dist/ui-core/react/use-overlay.js +0 -1
- package/dist/ui-core/react/use-overlay.js.map +1 -1
- package/dist/ui-core/react/use-plan.d.ts +0 -1
- package/dist/ui-core/react/use-plan.js +0 -1
- package/dist/ui-core/react/use-plan.js.map +1 -1
- package/dist/ui-core/react/use-toast.d.ts +0 -1
- package/dist/ui-core/react/use-toast.js +0 -3
- package/dist/ui-core/react/use-toast.js.map +1 -1
- package/dist/ui-core/react/use-transcript-store.d.ts +0 -7
- package/dist/ui-core/react/use-transcript-store.js +0 -7
- package/dist/ui-core/react/use-transcript-store.js.map +1 -1
- package/dist/ui-core/rendering/artifact-pager-source.d.ts +0 -7
- package/dist/ui-core/rendering/artifact-pager-source.js +0 -3
- package/dist/ui-core/rendering/artifact-pager-source.js.map +1 -1
- package/dist/ui-core/rendering/batch-sections.d.ts +0 -38
- package/dist/ui-core/rendering/batch-sections.js +1 -47
- package/dist/ui-core/rendering/batch-sections.js.map +1 -1
- package/dist/ui-core/rendering/code-block.d.ts +0 -25
- package/dist/ui-core/rendering/code-block.js +0 -47
- package/dist/ui-core/rendering/code-block.js.map +1 -1
- package/dist/ui-core/rendering/context-limit.js +0 -2
- package/dist/ui-core/rendering/context-limit.js.map +1 -1
- package/dist/ui-core/rendering/duration.js +0 -3
- package/dist/ui-core/rendering/duration.js.map +1 -1
- package/dist/ui-core/rendering/exit-summary/table.d.ts +23 -0
- package/dist/ui-core/rendering/exit-summary/table.js +194 -0
- package/dist/ui-core/rendering/exit-summary/table.js.map +1 -0
- package/dist/ui-core/rendering/exit-summary.js +1 -210
- package/dist/ui-core/rendering/exit-summary.js.map +1 -1
- package/dist/ui-core/rendering/file-diff-view.d.ts +0 -27
- package/dist/ui-core/rendering/file-diff-view.js +0 -29
- package/dist/ui-core/rendering/file-diff-view.js.map +1 -1
- package/dist/ui-core/rendering/format-help.d.ts +0 -13
- package/dist/ui-core/rendering/format-help.js +0 -18
- package/dist/ui-core/rendering/format-help.js.map +1 -1
- package/dist/ui-core/rendering/format-keys.js +0 -2
- package/dist/ui-core/rendering/format-keys.js.map +1 -1
- package/dist/ui-core/rendering/format-usage.js +18 -5
- package/dist/ui-core/rendering/format-usage.js.map +1 -1
- package/dist/ui-core/rendering/incremental-strip.js +0 -13
- package/dist/ui-core/rendering/incremental-strip.js.map +1 -1
- package/dist/ui-core/rendering/intro-header.js +0 -1
- package/dist/ui-core/rendering/intro-header.js.map +1 -1
- package/dist/ui-core/rendering/job-tail-source.d.ts +0 -9
- package/dist/ui-core/rendering/job-tail-source.js +0 -9
- package/dist/ui-core/rendering/job-tail-source.js.map +1 -1
- package/dist/ui-core/rendering/link-detector.d.ts +0 -8
- package/dist/ui-core/rendering/link-detector.js +0 -10
- package/dist/ui-core/rendering/link-detector.js.map +1 -1
- package/dist/ui-core/rendering/markdown/tables.d.ts +8 -0
- package/dist/ui-core/rendering/markdown/tables.js +276 -0
- package/dist/ui-core/rendering/markdown/tables.js.map +1 -0
- package/dist/ui-core/rendering/markdown.d.ts +4 -9
- package/dist/ui-core/rendering/markdown.js +224 -593
- package/dist/ui-core/rendering/markdown.js.map +1 -1
- package/dist/ui-core/rendering/open-tool-output.d.ts +0 -30
- package/dist/ui-core/rendering/open-tool-output.js +0 -39
- package/dist/ui-core/rendering/open-tool-output.js.map +1 -1
- package/dist/ui-core/rendering/pager-chrome.d.ts +0 -20
- package/dist/ui-core/rendering/pager-chrome.js +0 -24
- package/dist/ui-core/rendering/pager-chrome.js.map +1 -1
- package/dist/ui-core/rendering/pager-source.d.ts +0 -17
- package/dist/ui-core/rendering/pager-source.js +0 -27
- package/dist/ui-core/rendering/pager-source.js.map +1 -1
- package/dist/ui-core/rendering/pager-text.d.ts +0 -21
- package/dist/ui-core/rendering/pager-text.js +0 -31
- package/dist/ui-core/rendering/pager-text.js.map +1 -1
- package/dist/ui-core/rendering/pager-view-policy.d.ts +0 -24
- package/dist/ui-core/rendering/pager-view-policy.js +0 -31
- package/dist/ui-core/rendering/pager-view-policy.js.map +1 -1
- package/dist/ui-core/rendering/picker-filter.d.ts +0 -11
- package/dist/ui-core/rendering/picker-filter.js +0 -11
- package/dist/ui-core/rendering/picker-filter.js.map +1 -1
- package/dist/ui-core/rendering/plan-view.d.ts +0 -39
- package/dist/ui-core/rendering/plan-view.js +0 -37
- package/dist/ui-core/rendering/plan-view.js.map +1 -1
- package/dist/ui-core/rendering/prompt-preview.d.ts +0 -5
- package/dist/ui-core/rendering/prompt-preview.js +0 -5
- package/dist/ui-core/rendering/prompt-preview.js.map +1 -1
- package/dist/ui-core/rendering/sanitize-display.d.ts +0 -10
- package/dist/ui-core/rendering/sanitize-display.js +0 -14
- package/dist/ui-core/rendering/sanitize-display.js.map +1 -1
- package/dist/ui-core/rendering/status-segments.js +3 -3
- package/dist/ui-core/rendering/status-segments.js.map +1 -1
- package/dist/ui-core/rendering/streaming-markdown.js +0 -11
- package/dist/ui-core/rendering/streaming-markdown.js.map +1 -1
- package/dist/ui-core/rendering/syntax/clike.d.ts +22 -0
- package/dist/ui-core/rendering/syntax/clike.js +168 -0
- package/dist/ui-core/rendering/syntax/clike.js.map +1 -0
- package/dist/ui-core/rendering/syntax/keywords.d.ts +24 -0
- package/dist/ui-core/rendering/syntax/keywords.js +169 -0
- package/dist/ui-core/rendering/syntax/keywords.js.map +1 -0
- package/dist/ui-core/rendering/syntax/language-highlighters.d.ts +18 -0
- package/dist/ui-core/rendering/syntax/language-highlighters.js +538 -0
- package/dist/ui-core/rendering/syntax/language-highlighters.js.map +1 -0
- package/dist/ui-core/rendering/syntax/language-table.d.ts +3 -0
- package/dist/ui-core/rendering/syntax/language-table.js +244 -0
- package/dist/ui-core/rendering/syntax/language-table.js.map +1 -0
- package/dist/ui-core/rendering/syntax-highlight.d.ts +6 -28
- package/dist/ui-core/rendering/syntax-highlight.js +5 -1177
- package/dist/ui-core/rendering/syntax-highlight.js.map +1 -1
- package/dist/ui-core/rendering/text-format.d.ts +0 -3
- package/dist/ui-core/rendering/text-format.js +0 -3
- package/dist/ui-core/rendering/text-format.js.map +1 -1
- package/dist/ui-core/rendering/text-width.d.ts +0 -26
- package/dist/ui-core/rendering/text-width.js +0 -26
- package/dist/ui-core/rendering/text-width.js.map +1 -1
- package/dist/ui-core/rendering/theme.d.ts +0 -65
- package/dist/ui-core/rendering/theme.js +0 -24
- package/dist/ui-core/rendering/theme.js.map +1 -1
- package/dist/ui-core/rendering/thinking-tail.js +0 -3
- package/dist/ui-core/rendering/thinking-tail.js.map +1 -1
- package/dist/ui-core/rendering/tool-presenter.d.ts +0 -41
- package/dist/ui-core/rendering/tool-presenter.js +1 -67
- package/dist/ui-core/rendering/tool-presenter.js.map +1 -1
- package/dist/ui-core/rendering/transcript-semantic.d.ts +0 -8
- package/dist/ui-core/rendering/transcript-semantic.js +0 -13
- package/dist/ui-core/rendering/transcript-semantic.js.map +1 -1
- package/dist/ui-core/rendering/user-message-wrap.d.ts +0 -16
- package/dist/ui-core/rendering/user-message-wrap.js +0 -16
- package/dist/ui-core/rendering/user-message-wrap.js.map +1 -1
- package/dist/ui-core/rendering/wordmark.d.ts +0 -8
- package/dist/ui-core/rendering/wordmark.js +0 -21
- package/dist/ui-core/rendering/wordmark.js.map +1 -1
- package/dist/ui-core/state/hydrate/classic-transcript.d.ts +8 -0
- package/dist/ui-core/state/hydrate/classic-transcript.js +168 -0
- package/dist/ui-core/state/hydrate/classic-transcript.js.map +1 -0
- package/dist/ui-core/state/hydrate/from-messages.d.ts +6 -0
- package/dist/ui-core/state/hydrate/from-messages.js +237 -0
- package/dist/ui-core/state/hydrate/from-messages.js.map +1 -0
- package/dist/ui-core/state/pager-search.d.ts +0 -9
- package/dist/ui-core/state/pager-search.js +1 -8
- package/dist/ui-core/state/pager-search.js.map +1 -1
- package/dist/ui-core/state/semantic-document.d.ts +0 -8
- package/dist/ui-core/state/semantic-document.js +0 -8
- package/dist/ui-core/state/semantic-document.js.map +1 -1
- package/dist/ui-core/state/thinking-copy.d.ts +0 -8
- package/dist/ui-core/state/thinking-copy.js +0 -8
- package/dist/ui-core/state/thinking-copy.js.map +1 -1
- package/dist/ui-core/state/transcript/apply-app-event.d.ts +8 -0
- package/dist/ui-core/state/transcript/apply-app-event.js +406 -0
- package/dist/ui-core/state/transcript/apply-app-event.js.map +1 -0
- package/dist/ui-core/state/transcript/message-lifecycle.d.ts +7 -0
- package/dist/ui-core/state/transcript/message-lifecycle.js +285 -0
- package/dist/ui-core/state/transcript/message-lifecycle.js.map +1 -0
- package/dist/ui-core/state/transcript-compaction.d.ts +0 -19
- package/dist/ui-core/state/transcript-compaction.js +0 -21
- package/dist/ui-core/state/transcript-compaction.js.map +1 -1
- package/dist/ui-core/state/transcript-hydrate.d.ts +6 -52
- package/dist/ui-core/state/transcript-hydrate.js +5 -470
- package/dist/ui-core/state/transcript-hydrate.js.map +1 -1
- package/dist/ui-core/state/transcript-reducer.d.ts +1 -15
- package/dist/ui-core/state/transcript-reducer.js +1 -708
- package/dist/ui-core/state/transcript-reducer.js.map +1 -1
- package/dist/ui-core/state/transcript-search.d.ts +0 -8
- package/dist/ui-core/state/transcript-search.js +0 -8
- package/dist/ui-core/state/transcript-search.js.map +1 -1
- package/dist/ui-core/state/transcript-store.d.ts +0 -26
- package/dist/ui-core/state/transcript-store.js +0 -28
- package/dist/ui-core/state/transcript-store.js.map +1 -1
- package/dist/ui-core/state/transcript-types.d.ts +0 -33
- package/dist/ui-core/state/transcript-types.js +0 -17
- package/dist/ui-core/state/transcript-types.js.map +1 -1
- package/dist/ui-core/state/transcript-window.d.ts +0 -8
- package/dist/ui-core/state/transcript-window.js +0 -8
- package/dist/ui-core/state/transcript-window.js.map +1 -1
- package/dist/version.generated.d.ts +2 -2
- package/dist/version.generated.js +2 -2
- package/package.json +19 -2
- package/dist/agent/finalize-gate.d.ts +0 -54
- package/dist/agent/finalize-gate.js +0 -97
- package/dist/agent/finalize-gate.js.map +0 -1
- package/dist/agent/must-continue.d.ts +0 -36
- package/dist/agent/must-continue.js +0 -172
- package/dist/agent/must-continue.js.map +0 -1
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import chalk, { Chalk } from "chalk";
|
|
2
|
-
import { renderColumns } from "./text-width.js";
|
|
3
2
|
import { codeBlockBottom, codeBlockFitWidth, codeBlockRows, codeBlockTop, codeBlockWidth, isCodeFenceClose, matchCodeFenceOpen, openCodeFence, trimCodeBlockBody, } from "./code-block.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// token-streaming inputs (line-buffered).
|
|
3
|
+
import { BR_RE_GLOBAL, isTableRowLine, isTableSeparatorLine, renderInlineMarkdown, renderTableBlock } from "./markdown/tables.js";
|
|
4
|
+
import { renderColumns } from "./text-width.js";
|
|
5
|
+
export { renderInlineMarkdown };
|
|
8
6
|
const CHALK_LEVEL = {
|
|
9
7
|
none: 0,
|
|
10
8
|
"16": 1,
|
|
@@ -22,122 +20,6 @@ function renderContext(appearance) {
|
|
|
22
20
|
function repeat(char, count) {
|
|
23
21
|
return char.repeat(Math.max(0, count));
|
|
24
22
|
}
|
|
25
|
-
// Walk inline markdown tokens and convert them to ANSI styles. Designed to
|
|
26
|
-
// handle one logical line at a time (so it can run after a newline arrives
|
|
27
|
-
// in the token stream).
|
|
28
|
-
export function renderInlineMarkdown(text, paint = chalk) {
|
|
29
|
-
let out = "";
|
|
30
|
-
let i = 0;
|
|
31
|
-
while (i < text.length) {
|
|
32
|
-
// ``code`` (longer fences first to avoid eating the inner ticks)
|
|
33
|
-
if (text.startsWith("``", i)) {
|
|
34
|
-
const end = text.indexOf("``", i + 2);
|
|
35
|
-
if (end > i + 2) {
|
|
36
|
-
out += paint.cyan(`\`${text.slice(i + 2, end)}\``);
|
|
37
|
-
i = end + 2;
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// `code`
|
|
42
|
-
if (text[i] === "`") {
|
|
43
|
-
const end = text.indexOf("`", i + 1);
|
|
44
|
-
if (end > i + 1) {
|
|
45
|
-
out += paint.cyan(text.slice(i + 1, end));
|
|
46
|
-
i = end + 1;
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// ***bold-italic***
|
|
51
|
-
if (text.startsWith("***", i)) {
|
|
52
|
-
const end = text.indexOf("***", i + 3);
|
|
53
|
-
if (end > i + 3) {
|
|
54
|
-
out += paint.bold.italic(renderInlineMarkdown(text.slice(i + 3, end), paint));
|
|
55
|
-
i = end + 3;
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// **bold**
|
|
60
|
-
if (text.startsWith("**", i)) {
|
|
61
|
-
const end = text.indexOf("**", i + 2);
|
|
62
|
-
if (end > i + 2) {
|
|
63
|
-
out += paint.bold(renderInlineMarkdown(text.slice(i + 2, end), paint));
|
|
64
|
-
i = end + 2;
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
// __bold__
|
|
69
|
-
if (text.startsWith("__", i)) {
|
|
70
|
-
const end = text.indexOf("__", i + 2);
|
|
71
|
-
if (end > i + 2) {
|
|
72
|
-
out += paint.bold(renderInlineMarkdown(text.slice(i + 2, end), paint));
|
|
73
|
-
i = end + 2;
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// *italic* — only when surrounded by non-word boundaries to avoid
|
|
78
|
-
// chewing through `*` characters in code or maths.
|
|
79
|
-
if (text[i] === "*" && text[i + 1] !== "*") {
|
|
80
|
-
const end = text.indexOf("*", i + 1);
|
|
81
|
-
if (end > i + 1 && text[end + 1] !== "*") {
|
|
82
|
-
const inner = text.slice(i + 1, end);
|
|
83
|
-
if (inner.length > 0 &&
|
|
84
|
-
!inner.startsWith(" ") &&
|
|
85
|
-
!inner.endsWith(" ")) {
|
|
86
|
-
out += paint.italic(renderInlineMarkdown(inner, paint));
|
|
87
|
-
i = end + 1;
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
// _italic_ (skip if it looks like part of a snake_case word)
|
|
93
|
-
if (text[i] === "_") {
|
|
94
|
-
const prev = text[i - 1];
|
|
95
|
-
const isWordBoundary = !prev || /[\s\W]/.test(prev);
|
|
96
|
-
if (isWordBoundary) {
|
|
97
|
-
const end = text.indexOf("_", i + 1);
|
|
98
|
-
if (end > i + 1) {
|
|
99
|
-
const after = text[end + 1];
|
|
100
|
-
const isAfterBoundary = !after || /[\s\W]/.test(after);
|
|
101
|
-
const inner = text.slice(i + 1, end);
|
|
102
|
-
if (isAfterBoundary &&
|
|
103
|
-
inner.length > 0 &&
|
|
104
|
-
!inner.startsWith(" ") &&
|
|
105
|
-
!inner.endsWith(" ")) {
|
|
106
|
-
out += paint.italic(renderInlineMarkdown(inner, paint));
|
|
107
|
-
i = end + 1;
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
// ~~strike~~
|
|
114
|
-
if (text.startsWith("~~", i)) {
|
|
115
|
-
const end = text.indexOf("~~", i + 2);
|
|
116
|
-
if (end > i + 2) {
|
|
117
|
-
out += paint.strikethrough(renderInlineMarkdown(text.slice(i + 2, end), paint));
|
|
118
|
-
i = end + 2;
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
// [label](url)
|
|
123
|
-
if (text[i] === "[") {
|
|
124
|
-
const close = text.indexOf("]", i + 1);
|
|
125
|
-
if (close > i && text[close + 1] === "(") {
|
|
126
|
-
const urlEnd = text.indexOf(")", close + 2);
|
|
127
|
-
if (urlEnd > close + 2) {
|
|
128
|
-
const label = text.slice(i + 1, close);
|
|
129
|
-
const url = text.slice(close + 2, urlEnd);
|
|
130
|
-
out += paint.cyan.underline(label) + paint.dim(`(${url})`);
|
|
131
|
-
i = urlEnd + 1;
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
out += text[i];
|
|
137
|
-
i += 1;
|
|
138
|
-
}
|
|
139
|
-
return out;
|
|
140
|
-
}
|
|
141
23
|
const DEFAULT_FENCE_WIDTH = 60;
|
|
142
24
|
function panelWidth(state) {
|
|
143
25
|
return codeBlockWidth(state.fenceWidth ?? DEFAULT_FENCE_WIDTH);
|
|
@@ -152,12 +34,6 @@ function closeFencePanel(state, context) {
|
|
|
152
34
|
state.fence = undefined;
|
|
153
35
|
return codeBlockBottom(panelWidth(state), context.appearance);
|
|
154
36
|
}
|
|
155
|
-
/**
|
|
156
|
-
* Render a complete fence as a content-sized panel. Used by the one-shot
|
|
157
|
-
* renderer (chat + pager), which can see the whole block before it paints.
|
|
158
|
-
* An unterminated fence still gets a footer so a streaming reply reads as a
|
|
159
|
-
* finished box.
|
|
160
|
-
*/
|
|
161
37
|
function renderCodeBlock(open, bodyLines, wrapWidth, context) {
|
|
162
38
|
const fence = openCodeFence(open.marker, open.info);
|
|
163
39
|
const body = trimCodeBlockBody(bodyLines);
|
|
@@ -169,7 +45,6 @@ function renderCodeBlock(open, bodyLines, wrapWidth, context) {
|
|
|
169
45
|
out.push(codeBlockBottom(width, context.appearance));
|
|
170
46
|
return out;
|
|
171
47
|
}
|
|
172
|
-
/** Fence lines and code bodies as complete panel rows (may be empty). */
|
|
173
48
|
function fencePanelRows(line, state, context) {
|
|
174
49
|
if (state.inFence && state.fence) {
|
|
175
50
|
if (isCodeFenceClose(line, state.fence.marker)) {
|
|
@@ -184,7 +59,6 @@ function fencePanelRows(line, state, context) {
|
|
|
184
59
|
}
|
|
185
60
|
function renderBlockLine(line, state, context) {
|
|
186
61
|
const { paint } = context;
|
|
187
|
-
// Headings
|
|
188
62
|
const heading = line.match(/^(#{1,6})\s+(.*)$/);
|
|
189
63
|
if (heading) {
|
|
190
64
|
const level = heading[1].length;
|
|
@@ -197,15 +71,12 @@ function renderBlockLine(line, state, context) {
|
|
|
197
71
|
}
|
|
198
72
|
return paint.bold(renderInlineMarkdown(body, paint));
|
|
199
73
|
}
|
|
200
|
-
// Horizontal rule
|
|
201
74
|
if (/^\s*[-*_]{3,}\s*$/.test(line)) {
|
|
202
75
|
return paint.dim(repeat("─", 60));
|
|
203
76
|
}
|
|
204
|
-
// Markdown table separator: | --- | --- |
|
|
205
77
|
if (/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(line)) {
|
|
206
78
|
return paint.dim(repeat("─", Math.max(20, line.length)));
|
|
207
79
|
}
|
|
208
|
-
// Markdown table row: | cell | cell |
|
|
209
80
|
if (/^\s*\|.*\|\s*$/.test(line)) {
|
|
210
81
|
const cells = line
|
|
211
82
|
.replace(/^\s*\|/, "")
|
|
@@ -214,12 +85,10 @@ function renderBlockLine(line, state, context) {
|
|
|
214
85
|
.map((cell) => renderInlineMarkdown(cell.trim(), paint));
|
|
215
86
|
return (paint.dim("│ ") + cells.join(paint.dim(" │ ")) + paint.dim(" │"));
|
|
216
87
|
}
|
|
217
|
-
// Blockquote
|
|
218
88
|
if (line.startsWith("> ")) {
|
|
219
89
|
return (paint.dim("│ ") +
|
|
220
90
|
paint.dim.italic(renderInlineMarkdown(line.slice(2), paint)));
|
|
221
91
|
}
|
|
222
|
-
// GitHub-style task list: - [ ] todo / - [x] done
|
|
223
92
|
const task = line.match(/^(\s*)[-*+]\s+\[([ xX])\]\s+(.*)$/);
|
|
224
93
|
if (task) {
|
|
225
94
|
const checked = /[xX]/.test(task[2]);
|
|
@@ -227,25 +96,238 @@ function renderBlockLine(line, state, context) {
|
|
|
227
96
|
const body = renderInlineMarkdown(task[3], paint);
|
|
228
97
|
return `${task[1]}${box} ${checked ? paint.dim(body) : body}`;
|
|
229
98
|
}
|
|
230
|
-
// Ordered list
|
|
231
99
|
const ordered = line.match(/^(\s*)(\d+)\.\s+(.*)$/);
|
|
232
100
|
if (ordered) {
|
|
233
101
|
return `${ordered[1]}${paint.cyan(`${ordered[2]}.`)} ${renderInlineMarkdown(ordered[3], paint)}`;
|
|
234
102
|
}
|
|
235
|
-
// Unordered list
|
|
236
103
|
const unordered = line.match(/^(\s*)[-*+]\s+(.*)$/);
|
|
237
104
|
if (unordered) {
|
|
238
105
|
return `${unordered[1]}${paint.cyan("•")} ${renderInlineMarkdown(unordered[2], paint)}`;
|
|
239
106
|
}
|
|
240
107
|
return renderInlineMarkdown(line, paint);
|
|
241
108
|
}
|
|
242
|
-
/** Left margin for all rendered output so text doesn't go edge-to-edge. */
|
|
243
109
|
const OUTPUT_INDENT = " ";
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
110
|
+
export function indentAndWrapText(text, indent = " ") {
|
|
111
|
+
if (!text)
|
|
112
|
+
return text;
|
|
113
|
+
const cols = process.stdout.columns || 80;
|
|
114
|
+
const wrapWidth = Math.max(40, cols - 6);
|
|
115
|
+
return text
|
|
116
|
+
.split("\n")
|
|
117
|
+
.map((line) => {
|
|
118
|
+
const wrapped = wrapAnsiLine(line, wrapWidth);
|
|
119
|
+
return wrapped.map((wl) => `${indent}${wl}`).join("\n");
|
|
120
|
+
})
|
|
121
|
+
.join("\n");
|
|
122
|
+
}
|
|
123
|
+
function wrapMarkdownLine(line, wrapWidth, state, context) {
|
|
124
|
+
const { paint } = context;
|
|
125
|
+
state.fenceWidth = wrapWidth;
|
|
126
|
+
const fenceRows = fencePanelRows(line, state, context);
|
|
127
|
+
if (fenceRows)
|
|
128
|
+
return fenceRows;
|
|
129
|
+
if (/^\s*[-*_]{3,}\s*$/.test(line)) {
|
|
130
|
+
return [renderBlockLine(line, state, context)];
|
|
131
|
+
}
|
|
132
|
+
if (line.startsWith("> ")) {
|
|
133
|
+
const content = line.slice(2);
|
|
134
|
+
const prefix = paint.dim("│ ");
|
|
135
|
+
const renderedContent = renderInlineMarkdown(content, paint);
|
|
136
|
+
const wrapped = wrapAnsiLine(renderedContent, Math.max(10, wrapWidth - 2));
|
|
137
|
+
return wrapped.map((wl) => prefix + paint.dim.italic(wl));
|
|
138
|
+
}
|
|
139
|
+
const task = line.match(/^(\s*)[-*+]\s+\[([ xX])\]\s+(.*)$/);
|
|
140
|
+
if (task) {
|
|
141
|
+
const indent = task[1] ?? "";
|
|
142
|
+
const checked = /[xX]/.test(task[2]);
|
|
143
|
+
const box = checked ? paint.green("☑") : paint.dim("☐");
|
|
144
|
+
const content = task[3] ?? "";
|
|
145
|
+
const prefix = `${indent}${box} `;
|
|
146
|
+
const prefixLength = indent.length + 2;
|
|
147
|
+
let renderedContent = renderInlineMarkdown(content, paint);
|
|
148
|
+
if (checked) {
|
|
149
|
+
renderedContent = paint.dim(renderedContent);
|
|
150
|
+
}
|
|
151
|
+
const wrapped = wrapAnsiLine(renderedContent, Math.max(10, wrapWidth - prefixLength));
|
|
152
|
+
return wrapped.map((wl, idx) => {
|
|
153
|
+
if (idx === 0)
|
|
154
|
+
return prefix + wl;
|
|
155
|
+
return " ".repeat(prefixLength) + wl;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const ordered = line.match(/^(\s*)(\d+)\.\s+(.*)$/);
|
|
159
|
+
if (ordered) {
|
|
160
|
+
const indent = ordered[1] ?? "";
|
|
161
|
+
const num = ordered[2] ?? "";
|
|
162
|
+
const content = ordered[3] ?? "";
|
|
163
|
+
const prefix = `${indent}${paint.cyan(`${num}.`)} `;
|
|
164
|
+
const prefixLength = indent.length + num.length + 2;
|
|
165
|
+
const renderedContent = renderInlineMarkdown(content, paint);
|
|
166
|
+
const wrapped = wrapAnsiLine(renderedContent, Math.max(10, wrapWidth - prefixLength));
|
|
167
|
+
return wrapped.map((wl, idx) => {
|
|
168
|
+
if (idx === 0)
|
|
169
|
+
return prefix + wl;
|
|
170
|
+
return " ".repeat(prefixLength) + wl;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
const unordered = line.match(/^(\s*)[-*+]\s+(.*)$/);
|
|
174
|
+
if (unordered) {
|
|
175
|
+
const indent = unordered[1] ?? "";
|
|
176
|
+
const content = unordered[2] ?? "";
|
|
177
|
+
const prefix = `${indent}${paint.cyan("•")} `;
|
|
178
|
+
const prefixLength = indent.length + 2;
|
|
179
|
+
const renderedContent = renderInlineMarkdown(content, paint);
|
|
180
|
+
const wrapped = wrapAnsiLine(renderedContent, Math.max(10, wrapWidth - prefixLength));
|
|
181
|
+
return wrapped.map((wl, idx) => {
|
|
182
|
+
if (idx === 0)
|
|
183
|
+
return prefix + wl;
|
|
184
|
+
return " ".repeat(prefixLength) + wl;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
const rendered = renderBlockLine(line, state, context);
|
|
188
|
+
return wrapAnsiLine(rendered, wrapWidth);
|
|
189
|
+
}
|
|
190
|
+
const BR_RE = /<br\s*\/?>/i;
|
|
191
|
+
export function renderMarkdown(text, width, appearance) {
|
|
192
|
+
if (!text)
|
|
193
|
+
return text;
|
|
194
|
+
const context = renderContext(appearance);
|
|
195
|
+
const state = { inFence: false };
|
|
196
|
+
const lines = text.split("\n");
|
|
197
|
+
const resultLines = [];
|
|
198
|
+
const hasWidth = typeof width === "number";
|
|
199
|
+
const cols = width ?? (process.stdout.columns || 80);
|
|
200
|
+
const wrapWidth = hasWidth ? Math.max(12, cols - 2) : Math.max(40, cols - 6);
|
|
201
|
+
let i = 0;
|
|
202
|
+
while (i < lines.length) {
|
|
203
|
+
const line = lines[i];
|
|
204
|
+
const fenceOpen = matchCodeFenceOpen(line);
|
|
205
|
+
if (fenceOpen) {
|
|
206
|
+
let j = i + 1;
|
|
207
|
+
const body = [];
|
|
208
|
+
while (j < lines.length && !isCodeFenceClose(lines[j], fenceOpen.marker)) {
|
|
209
|
+
body.push(lines[j]);
|
|
210
|
+
j += 1;
|
|
211
|
+
}
|
|
212
|
+
for (const rendered of renderCodeBlock(fenceOpen, body, wrapWidth, context)) {
|
|
213
|
+
resultLines.push(`${OUTPUT_INDENT}${rendered}`);
|
|
214
|
+
}
|
|
215
|
+
i = j < lines.length ? j + 1 : j;
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
if (!state.inFence &&
|
|
219
|
+
isTableRowLine(line) &&
|
|
220
|
+
i + 1 < lines.length &&
|
|
221
|
+
isTableSeparatorLine(lines[i + 1])) {
|
|
222
|
+
const block = [line, lines[i + 1]];
|
|
223
|
+
let j = i + 2;
|
|
224
|
+
while (j < lines.length &&
|
|
225
|
+
lines[j].trim().length > 0 &&
|
|
226
|
+
(isTableRowLine(lines[j]) || isTableSeparatorLine(lines[j]))) {
|
|
227
|
+
block.push(lines[j]);
|
|
228
|
+
j++;
|
|
229
|
+
}
|
|
230
|
+
for (const rendered of renderTableBlock(block, wrapWidth, context.paint)) {
|
|
231
|
+
resultLines.push(`${OUTPUT_INDENT}${rendered}`);
|
|
232
|
+
}
|
|
233
|
+
i = j;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
const pieces = !state.inFence && BR_RE.test(line) ? line.split(BR_RE_GLOBAL) : [line];
|
|
237
|
+
for (const piece of pieces) {
|
|
238
|
+
for (const wl of wrapMarkdownLine(piece, wrapWidth, state, context)) {
|
|
239
|
+
resultLines.push(`${OUTPUT_INDENT}${wl}`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
i++;
|
|
243
|
+
}
|
|
244
|
+
if (state.inFence) {
|
|
245
|
+
resultLines.push(`${OUTPUT_INDENT}${closeFencePanel(state, context)}`);
|
|
246
|
+
}
|
|
247
|
+
return resultLines.join("\n");
|
|
248
|
+
}
|
|
249
|
+
export function createMarkdownStreamWriter(write, appearance) {
|
|
250
|
+
const context = renderContext(appearance);
|
|
251
|
+
const state = { inFence: false };
|
|
252
|
+
let buffer = "";
|
|
253
|
+
let outputEndsWithNewline = true;
|
|
254
|
+
let tableBuffer = [];
|
|
255
|
+
const cols = process.stdout.columns || 80;
|
|
256
|
+
const wrapWidth = Math.max(40, cols - 6);
|
|
257
|
+
const emit = (chunk) => {
|
|
258
|
+
if (!chunk)
|
|
259
|
+
return;
|
|
260
|
+
write(chunk);
|
|
261
|
+
outputEndsWithNewline = chunk.endsWith("\n");
|
|
262
|
+
};
|
|
263
|
+
const emitLine = (line, withNewline) => {
|
|
264
|
+
const pieces = !state.inFence && BR_RE.test(line) ? line.split(BR_RE_GLOBAL) : [line];
|
|
265
|
+
for (let p = 0; p < pieces.length; p++) {
|
|
266
|
+
const piece = pieces[p];
|
|
267
|
+
const lastPiece = p === pieces.length - 1;
|
|
268
|
+
const physical = wrapMarkdownLine(piece, wrapWidth, state, context);
|
|
269
|
+
for (let q = 0; q < physical.length; q++) {
|
|
270
|
+
emit(`${OUTPUT_INDENT}${physical[q]}`);
|
|
271
|
+
const isVeryLast = lastPiece && q === physical.length - 1;
|
|
272
|
+
if (!isVeryLast || withNewline)
|
|
273
|
+
emit("\n");
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
const flushTable = () => {
|
|
278
|
+
if (tableBuffer.length === 0)
|
|
279
|
+
return;
|
|
280
|
+
const looksLikeTable = tableBuffer.length >= 2 &&
|
|
281
|
+
isTableRowLine(tableBuffer[0]) &&
|
|
282
|
+
isTableSeparatorLine(tableBuffer[1]);
|
|
283
|
+
if (looksLikeTable) {
|
|
284
|
+
for (const rendered of renderTableBlock(tableBuffer, wrapWidth, context.paint)) {
|
|
285
|
+
emit(`${OUTPUT_INDENT}${rendered}\n`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
for (const line of tableBuffer)
|
|
290
|
+
emitLine(line, true);
|
|
291
|
+
}
|
|
292
|
+
tableBuffer = [];
|
|
293
|
+
};
|
|
294
|
+
const handleLine = (line, withNewline) => {
|
|
295
|
+
const collecting = tableBuffer.length > 0;
|
|
296
|
+
const isTableLine = !state.inFence &&
|
|
297
|
+
(collecting
|
|
298
|
+
? isTableRowLine(line) || isTableSeparatorLine(line)
|
|
299
|
+
: isTableRowLine(line));
|
|
300
|
+
if (isTableLine) {
|
|
301
|
+
tableBuffer.push(line);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
flushTable();
|
|
305
|
+
emitLine(line, withNewline);
|
|
306
|
+
};
|
|
307
|
+
return {
|
|
308
|
+
push(token) {
|
|
309
|
+
buffer += token;
|
|
310
|
+
let newlineIndex = buffer.indexOf("\n");
|
|
311
|
+
while (newlineIndex !== -1) {
|
|
312
|
+
const line = buffer.slice(0, newlineIndex);
|
|
313
|
+
buffer = buffer.slice(newlineIndex + 1);
|
|
314
|
+
handleLine(line, true);
|
|
315
|
+
newlineIndex = buffer.indexOf("\n");
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
finish() {
|
|
319
|
+
if (buffer.length > 0) {
|
|
320
|
+
handleLine(buffer, false);
|
|
321
|
+
buffer = "";
|
|
322
|
+
}
|
|
323
|
+
flushTable();
|
|
324
|
+
if (state.inFence) {
|
|
325
|
+
const separator = outputEndsWithNewline ? "" : "\n";
|
|
326
|
+
emit(`${separator}${OUTPUT_INDENT}${closeFencePanel(state, context)}`);
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
}
|
|
249
331
|
export function visibleWidth(str) {
|
|
250
332
|
return renderColumns(str);
|
|
251
333
|
}
|
|
@@ -281,7 +363,6 @@ function sgrHasStyle(state) {
|
|
|
281
363
|
state.fg ||
|
|
282
364
|
state.bg);
|
|
283
365
|
}
|
|
284
|
-
/** Apply one CSI … m sequence into a mutable style carry. */
|
|
285
366
|
function applySgrSequence(state, sequence) {
|
|
286
367
|
if (!sequence.startsWith("\x1b[") || !sequence.endsWith("m"))
|
|
287
368
|
return;
|
|
@@ -349,7 +430,6 @@ function applySgrSequence(state, sequence) {
|
|
|
349
430
|
i += 1;
|
|
350
431
|
continue;
|
|
351
432
|
}
|
|
352
|
-
// 256-color / truecolor FG
|
|
353
433
|
if (code === 38) {
|
|
354
434
|
const mode = parts[i + 1];
|
|
355
435
|
if (mode === 5 && parts[i + 2] !== undefined) {
|
|
@@ -368,7 +448,6 @@ function applySgrSequence(state, sequence) {
|
|
|
368
448
|
i += 1;
|
|
369
449
|
continue;
|
|
370
450
|
}
|
|
371
|
-
// 256-color / truecolor BG
|
|
372
451
|
if (code === 48) {
|
|
373
452
|
const mode = parts[i + 1];
|
|
374
453
|
if (mode === 5 && parts[i + 2] !== undefined) {
|
|
@@ -400,7 +479,6 @@ function applySgrSequence(state, sequence) {
|
|
|
400
479
|
i += 1;
|
|
401
480
|
}
|
|
402
481
|
}
|
|
403
|
-
/** Walk text and update style state for every SGR sequence found. */
|
|
404
482
|
function applySgrInText(state, text) {
|
|
405
483
|
let i = 0;
|
|
406
484
|
while (i < text.length) {
|
|
@@ -428,10 +506,8 @@ function splitWord(tokens, maxWidth) {
|
|
|
428
506
|
applySgrSequence(style, token.value);
|
|
429
507
|
}
|
|
430
508
|
else {
|
|
431
|
-
// type === "char" (may be a wide glyph worth 2 columns)
|
|
432
509
|
if (currentSegmentVisibleLength > 0 &&
|
|
433
510
|
currentSegmentVisibleLength + token.width > maxWidth) {
|
|
434
|
-
// Close open styles on this segment; next segment reopens them.
|
|
435
511
|
const open = sgrOpen(style);
|
|
436
512
|
const closed = sgrHasStyle(style)
|
|
437
513
|
? `${currentSegmentText}\x1b[0m`
|
|
@@ -455,11 +531,6 @@ function splitWord(tokens, maxWidth) {
|
|
|
455
531
|
}
|
|
456
532
|
return segments;
|
|
457
533
|
}
|
|
458
|
-
/**
|
|
459
|
-
* Soft-wrap a line that may contain ANSI SGR styles.
|
|
460
|
-
* Continuation lines re-open any style still active at the break so cyan/bold
|
|
461
|
-
* etc. never fall back to the default body color mid-phrase.
|
|
462
|
-
*/
|
|
463
534
|
export function wrapAnsiLine(line, maxWidth) {
|
|
464
535
|
const visibleLength = visibleWidth(line);
|
|
465
536
|
if (visibleLength <= maxWidth)
|
|
@@ -486,9 +557,6 @@ export function wrapAnsiLine(line, maxWidth) {
|
|
|
486
557
|
i = j;
|
|
487
558
|
}
|
|
488
559
|
else {
|
|
489
|
-
// Advance by a full Unicode code point (not a UTF-16 code unit) so a
|
|
490
|
-
// surrogate-pair emoji is never split in half, then measure its real
|
|
491
|
-
// terminal column width (many emoji/symbols render as 2 columns).
|
|
492
560
|
const codePoint = line.codePointAt(i);
|
|
493
561
|
const charLength = codePoint > 0xffff ? 2 : 1;
|
|
494
562
|
const val = line.slice(i, i + charLength);
|
|
@@ -538,7 +606,6 @@ export function wrapAnsiLine(line, maxWidth) {
|
|
|
538
606
|
const trimmed = currentLineText.replace(/\s+$/, "");
|
|
539
607
|
if (!trimmed && lines.length === 0)
|
|
540
608
|
return;
|
|
541
|
-
// Close open styles so the next physical row starts clean, then reopen.
|
|
542
609
|
const closed = sgrHasStyle(lineStyle) && !trimmed.endsWith("\x1b[0m")
|
|
543
610
|
? `${trimmed}\x1b[0m`
|
|
544
611
|
: trimmed;
|
|
@@ -554,7 +621,6 @@ export function wrapAnsiLine(line, maxWidth) {
|
|
|
554
621
|
continue;
|
|
555
622
|
}
|
|
556
623
|
if (currentLineVisibleLength === 0) {
|
|
557
|
-
// Re-open styles active after the previous wrap break.
|
|
558
624
|
const reopen = sgrOpen(lineStyle);
|
|
559
625
|
currentLineText = reopen + word.text;
|
|
560
626
|
currentLineVisibleLength = word.visibleLength;
|
|
@@ -567,7 +633,6 @@ export function wrapAnsiLine(line, maxWidth) {
|
|
|
567
633
|
}
|
|
568
634
|
else {
|
|
569
635
|
flushLine();
|
|
570
|
-
// lineStyle still holds the style at end of previous line — reopen it.
|
|
571
636
|
const reopen = sgrOpen(lineStyle);
|
|
572
637
|
currentLineText = reopen + word.text;
|
|
573
638
|
currentLineVisibleLength = word.visibleLength;
|
|
@@ -579,438 +644,4 @@ export function wrapAnsiLine(line, maxWidth) {
|
|
|
579
644
|
}
|
|
580
645
|
return lines.length > 0 ? lines : [line];
|
|
581
646
|
}
|
|
582
|
-
export function indentAndWrapText(text, indent = " ") {
|
|
583
|
-
if (!text)
|
|
584
|
-
return text;
|
|
585
|
-
const cols = process.stdout.columns || 80;
|
|
586
|
-
const wrapWidth = Math.max(40, cols - 6);
|
|
587
|
-
return text
|
|
588
|
-
.split("\n")
|
|
589
|
-
.map((line) => {
|
|
590
|
-
const wrapped = wrapAnsiLine(line, wrapWidth);
|
|
591
|
-
return wrapped.map((wl) => `${indent}${wl}`).join("\n");
|
|
592
|
-
})
|
|
593
|
-
.join("\n");
|
|
594
|
-
}
|
|
595
|
-
function wrapMarkdownLine(line, wrapWidth, state, context) {
|
|
596
|
-
const { paint } = context;
|
|
597
|
-
// Keep panel chrome + code within wrapWidth (never truncate with …).
|
|
598
|
-
state.fenceWidth = wrapWidth;
|
|
599
|
-
const fenceRows = fencePanelRows(line, state, context);
|
|
600
|
-
if (fenceRows)
|
|
601
|
-
return fenceRows;
|
|
602
|
-
// If it's a horizontal rule, don't wrap it
|
|
603
|
-
if (/^\s*[-*_]{3,}\s*$/.test(line)) {
|
|
604
|
-
return [renderBlockLine(line, state, context)];
|
|
605
|
-
}
|
|
606
|
-
// Check if it's a blockquote
|
|
607
|
-
if (line.startsWith("> ")) {
|
|
608
|
-
const content = line.slice(2);
|
|
609
|
-
const prefix = paint.dim("│ ");
|
|
610
|
-
const renderedContent = renderInlineMarkdown(content, paint);
|
|
611
|
-
// Wrap the content at wrapWidth - 2 (since prefix is 2 chars)
|
|
612
|
-
const wrapped = wrapAnsiLine(renderedContent, Math.max(10, wrapWidth - 2));
|
|
613
|
-
return wrapped.map((wl) => prefix + paint.dim.italic(wl));
|
|
614
|
-
}
|
|
615
|
-
// Check if it's a task list
|
|
616
|
-
const task = line.match(/^(\s*)[-*+]\s+\[([ xX])\]\s+(.*)$/);
|
|
617
|
-
if (task) {
|
|
618
|
-
const indent = task[1] ?? "";
|
|
619
|
-
const checked = /[xX]/.test(task[2]);
|
|
620
|
-
const box = checked ? paint.green("☑") : paint.dim("☐");
|
|
621
|
-
const content = task[3] ?? "";
|
|
622
|
-
const prefix = `${indent}${box} `;
|
|
623
|
-
const prefixLength = indent.length + 2;
|
|
624
|
-
let renderedContent = renderInlineMarkdown(content, paint);
|
|
625
|
-
if (checked) {
|
|
626
|
-
renderedContent = paint.dim(renderedContent);
|
|
627
|
-
}
|
|
628
|
-
const wrapped = wrapAnsiLine(renderedContent, Math.max(10, wrapWidth - prefixLength));
|
|
629
|
-
return wrapped.map((wl, idx) => {
|
|
630
|
-
if (idx === 0)
|
|
631
|
-
return prefix + wl;
|
|
632
|
-
return " ".repeat(prefixLength) + wl;
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
// Check if it's an ordered list
|
|
636
|
-
const ordered = line.match(/^(\s*)(\d+)\.\s+(.*)$/);
|
|
637
|
-
if (ordered) {
|
|
638
|
-
const indent = ordered[1] ?? "";
|
|
639
|
-
const num = ordered[2] ?? "";
|
|
640
|
-
const content = ordered[3] ?? "";
|
|
641
|
-
const prefix = `${indent}${paint.cyan(`${num}.`)} `;
|
|
642
|
-
const prefixLength = indent.length + num.length + 2;
|
|
643
|
-
const renderedContent = renderInlineMarkdown(content, paint);
|
|
644
|
-
const wrapped = wrapAnsiLine(renderedContent, Math.max(10, wrapWidth - prefixLength));
|
|
645
|
-
return wrapped.map((wl, idx) => {
|
|
646
|
-
if (idx === 0)
|
|
647
|
-
return prefix + wl;
|
|
648
|
-
return " ".repeat(prefixLength) + wl;
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
// Check if it's an unordered list
|
|
652
|
-
const unordered = line.match(/^(\s*)[-*+]\s+(.*)$/);
|
|
653
|
-
if (unordered) {
|
|
654
|
-
const indent = unordered[1] ?? "";
|
|
655
|
-
const content = unordered[2] ?? "";
|
|
656
|
-
const prefix = `${indent}${paint.cyan("•")} `;
|
|
657
|
-
const prefixLength = indent.length + 2;
|
|
658
|
-
const renderedContent = renderInlineMarkdown(content, paint);
|
|
659
|
-
const wrapped = wrapAnsiLine(renderedContent, Math.max(10, wrapWidth - prefixLength));
|
|
660
|
-
return wrapped.map((wl, idx) => {
|
|
661
|
-
if (idx === 0)
|
|
662
|
-
return prefix + wl;
|
|
663
|
-
return " ".repeat(prefixLength) + wl;
|
|
664
|
-
});
|
|
665
|
-
}
|
|
666
|
-
// Otherwise, treat as a normal paragraph/line
|
|
667
|
-
const rendered = renderBlockLine(line, state, context);
|
|
668
|
-
return wrapAnsiLine(rendered, wrapWidth);
|
|
669
|
-
}
|
|
670
|
-
// Markdown tables
|
|
671
|
-
// `<br>` (and `<br/>`, `<br />`) inside cells become stacked lines.
|
|
672
|
-
const BR_RE = /<br\s*\/?>/i;
|
|
673
|
-
const BR_RE_GLOBAL = /<br\s*\/?>/gi;
|
|
674
|
-
/** A `| cell | cell |` style row (must open and close with a pipe). */
|
|
675
|
-
function isTableRowLine(line) {
|
|
676
|
-
return /^\s*\|.*\|\s*$/.test(line);
|
|
677
|
-
}
|
|
678
|
-
/** A `| --- | :--: |` style alignment/separator row. */
|
|
679
|
-
function isTableSeparatorLine(line) {
|
|
680
|
-
const t = line.trim();
|
|
681
|
-
if (!t.includes("|") || !t.includes("-"))
|
|
682
|
-
return false;
|
|
683
|
-
return /^\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?$/.test(t);
|
|
684
|
-
}
|
|
685
|
-
/** Split a table row into trimmed cells, honoring escaped `\|`. */
|
|
686
|
-
function splitTableCells(line) {
|
|
687
|
-
const body = line.trim().replace(/^\|/, "").replace(/\|$/, "");
|
|
688
|
-
const cells = [];
|
|
689
|
-
let cur = "";
|
|
690
|
-
for (let i = 0; i < body.length; i++) {
|
|
691
|
-
const ch = body[i];
|
|
692
|
-
if (ch === "\\" && body[i + 1] === "|") {
|
|
693
|
-
cur += "|";
|
|
694
|
-
i++;
|
|
695
|
-
continue;
|
|
696
|
-
}
|
|
697
|
-
if (ch === "|") {
|
|
698
|
-
cells.push(cur);
|
|
699
|
-
cur = "";
|
|
700
|
-
continue;
|
|
701
|
-
}
|
|
702
|
-
cur += ch;
|
|
703
|
-
}
|
|
704
|
-
cells.push(cur);
|
|
705
|
-
return cells.map((c) => c.trim());
|
|
706
|
-
}
|
|
707
|
-
/** Derive per-column alignment from the `:---:` markers in the separator. */
|
|
708
|
-
function parseColumnAligns(separator, columns) {
|
|
709
|
-
const cells = splitTableCells(separator);
|
|
710
|
-
const aligns = [];
|
|
711
|
-
for (let c = 0; c < columns; c++) {
|
|
712
|
-
const cell = (cells[c] ?? "").trim();
|
|
713
|
-
const left = cell.startsWith(":");
|
|
714
|
-
const right = cell.endsWith(":");
|
|
715
|
-
if (left && right)
|
|
716
|
-
aligns.push("center");
|
|
717
|
-
else if (right)
|
|
718
|
-
aligns.push("right");
|
|
719
|
-
else
|
|
720
|
-
aligns.push("left");
|
|
721
|
-
}
|
|
722
|
-
return aligns;
|
|
723
|
-
}
|
|
724
|
-
function padCell(rendered, contentWidth, columnWidth, align) {
|
|
725
|
-
const slack = Math.max(0, columnWidth - contentWidth);
|
|
726
|
-
if (align === "right")
|
|
727
|
-
return " ".repeat(slack) + rendered;
|
|
728
|
-
if (align === "center") {
|
|
729
|
-
const left = Math.floor(slack / 2);
|
|
730
|
-
return " ".repeat(left) + rendered + " ".repeat(slack - left);
|
|
731
|
-
}
|
|
732
|
-
return rendered + " ".repeat(slack);
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Render a contiguous markdown table (header row, separator row, then
|
|
736
|
-
* zero or more body rows) into aligned, box-drawn terminal lines.
|
|
737
|
-
*
|
|
738
|
-
* Columns are sized to their content, shrunk to fit `availWidth` when
|
|
739
|
-
* necessary (widest column first, never below one visible column), and
|
|
740
|
-
* `<br>` markers split a cell into stacked lines so multi-line cells
|
|
741
|
-
* stay inside their column instead of bleeding across the row.
|
|
742
|
-
*/
|
|
743
|
-
function renderTableBlock(rawLines, availWidth, paint) {
|
|
744
|
-
const separatorIndex = rawLines.findIndex(isTableSeparatorLine);
|
|
745
|
-
const headerLines = separatorIndex > 0
|
|
746
|
-
? rawLines.slice(0, separatorIndex)
|
|
747
|
-
: [rawLines[0] ?? ""];
|
|
748
|
-
const separatorLine = separatorIndex >= 0 ? rawLines[separatorIndex] : "";
|
|
749
|
-
const bodyLines = (separatorIndex >= 0 ? rawLines.slice(separatorIndex + 1) : rawLines.slice(1)).filter((l) => l.trim().length > 0);
|
|
750
|
-
const headerCellRows = headerLines.map(splitTableCells);
|
|
751
|
-
const bodyCellRows = bodyLines.map(splitTableCells);
|
|
752
|
-
const columns = Math.max(1, ...headerCellRows.map((r) => r.length), ...bodyCellRows.map((r) => r.length));
|
|
753
|
-
const aligns = parseColumnAligns(separatorLine, columns);
|
|
754
|
-
const toCell = (text) => text.split(BR_RE_GLOBAL).map((part) => {
|
|
755
|
-
const trimmed = part.trim();
|
|
756
|
-
const bulletMatch = trimmed.match(/^([-\*+])\s+(.*)$/);
|
|
757
|
-
if (bulletMatch) {
|
|
758
|
-
const content = renderInlineMarkdown(bulletMatch[2], paint);
|
|
759
|
-
const rendered = `${paint.cyan("•")} ${content}`;
|
|
760
|
-
return { rendered, width: visibleWidth(rendered) };
|
|
761
|
-
}
|
|
762
|
-
const numberMatch = trimmed.match(/^(\d+)\.\s+(.*)$/);
|
|
763
|
-
if (numberMatch) {
|
|
764
|
-
const content = renderInlineMarkdown(numberMatch[2], paint);
|
|
765
|
-
const rendered = `${paint.cyan(`${numberMatch[1]}.`)} ${content}`;
|
|
766
|
-
return { rendered, width: visibleWidth(rendered) };
|
|
767
|
-
}
|
|
768
|
-
const rendered = renderInlineMarkdown(trimmed, paint);
|
|
769
|
-
return { rendered, width: visibleWidth(rendered) };
|
|
770
|
-
});
|
|
771
|
-
const buildRow = (cells) => {
|
|
772
|
-
const row = [];
|
|
773
|
-
for (let c = 0; c < columns; c++)
|
|
774
|
-
row.push(toCell(cells[c] ?? ""));
|
|
775
|
-
return row;
|
|
776
|
-
};
|
|
777
|
-
const headerRows = headerCellRows.map(buildRow);
|
|
778
|
-
const bodyRows = bodyCellRows.map(buildRow);
|
|
779
|
-
// Natural column widths (floor of 1 so empty columns still render).
|
|
780
|
-
const colWidths = new Array(columns).fill(1);
|
|
781
|
-
for (const row of [...headerRows, ...bodyRows]) {
|
|
782
|
-
for (let c = 0; c < columns; c++) {
|
|
783
|
-
for (const cell of row[c] ?? []) {
|
|
784
|
-
if (cell.width > colWidths[c])
|
|
785
|
-
colWidths[c] = cell.width;
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
// Shrink to fit: each column costs width + 2 padding spaces, plus one
|
|
790
|
-
// vertical border per column and a leading border (3*columns + 1). Reserve
|
|
791
|
-
// one extra column of margin so an exact-fit table can't be clipped by the
|
|
792
|
-
// TUI's own width-aware truncation (e.g. small rounding differences
|
|
793
|
-
// between this module's width math and the terminal renderer's).
|
|
794
|
-
const budget = Math.max(columns, availWidth - (3 * columns + 1) - 1);
|
|
795
|
-
let total = colWidths.reduce((a, b) => a + b, 0);
|
|
796
|
-
while (total > budget) {
|
|
797
|
-
let widest = 0;
|
|
798
|
-
for (let c = 1; c < columns; c++) {
|
|
799
|
-
if (colWidths[c] > colWidths[widest])
|
|
800
|
-
widest = c;
|
|
801
|
-
}
|
|
802
|
-
if (colWidths[widest] <= 1)
|
|
803
|
-
break;
|
|
804
|
-
colWidths[widest]--;
|
|
805
|
-
total--;
|
|
806
|
-
}
|
|
807
|
-
const wrapCell = (cell, width) => {
|
|
808
|
-
const out = [];
|
|
809
|
-
for (const line of cell) {
|
|
810
|
-
for (const piece of wrapAnsiLine(line.rendered, width)) {
|
|
811
|
-
// Drop any trailing spaces a wrap left behind so the cell's
|
|
812
|
-
// right border stays aligned (padCell re-adds exact padding).
|
|
813
|
-
const trimmed = piece.replace(/ +$/, "");
|
|
814
|
-
out.push({ rendered: trimmed, width: visibleWidth(trimmed) });
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
return out.length > 0 ? out : [{ rendered: "", width: 0 }];
|
|
818
|
-
};
|
|
819
|
-
const dim = paint.dim;
|
|
820
|
-
const renderRow = (row, bold) => {
|
|
821
|
-
const wrapped = row.map((cell, c) => wrapCell(cell, colWidths[c]));
|
|
822
|
-
const height = Math.max(1, ...wrapped.map((w) => w.length));
|
|
823
|
-
const lines = [];
|
|
824
|
-
for (let h = 0; h < height; h++) {
|
|
825
|
-
let s = dim("│");
|
|
826
|
-
for (let c = 0; c < columns; c++) {
|
|
827
|
-
const piece = wrapped[c][h] ?? { rendered: "", width: 0 };
|
|
828
|
-
const content = bold && piece.rendered ? paint.bold(piece.rendered) : piece.rendered;
|
|
829
|
-
s +=
|
|
830
|
-
" " +
|
|
831
|
-
padCell(content, piece.width, colWidths[c], aligns[c]) +
|
|
832
|
-
" " +
|
|
833
|
-
dim("│");
|
|
834
|
-
}
|
|
835
|
-
lines.push(s);
|
|
836
|
-
}
|
|
837
|
-
return lines;
|
|
838
|
-
};
|
|
839
|
-
const border = (left, mid, right) => {
|
|
840
|
-
let s = left;
|
|
841
|
-
for (let c = 0; c < columns; c++) {
|
|
842
|
-
s += "─".repeat(colWidths[c] + 2);
|
|
843
|
-
s += c < columns - 1 ? mid : right;
|
|
844
|
-
}
|
|
845
|
-
return dim(s);
|
|
846
|
-
};
|
|
847
|
-
const out = [border("┌", "┬", "┐")];
|
|
848
|
-
for (const row of headerRows)
|
|
849
|
-
out.push(...renderRow(row, true));
|
|
850
|
-
out.push(border("├", "┼", "┤"));
|
|
851
|
-
for (let i = 0; i < bodyRows.length; i++) {
|
|
852
|
-
if (i > 0) {
|
|
853
|
-
const spacer = Array.from({ length: columns }, () => [
|
|
854
|
-
{ rendered: "", width: 0 },
|
|
855
|
-
]);
|
|
856
|
-
out.push(...renderRow(spacer, false));
|
|
857
|
-
}
|
|
858
|
-
out.push(...renderRow(bodyRows[i], false));
|
|
859
|
-
}
|
|
860
|
-
out.push(border("└", "┴", "┘"));
|
|
861
|
-
return out;
|
|
862
|
-
}
|
|
863
|
-
export function renderMarkdown(text, width, appearance) {
|
|
864
|
-
if (!text)
|
|
865
|
-
return text;
|
|
866
|
-
const context = renderContext(appearance);
|
|
867
|
-
const state = { inFence: false };
|
|
868
|
-
const lines = text.split("\n");
|
|
869
|
-
const resultLines = [];
|
|
870
|
-
const hasWidth = typeof width === "number";
|
|
871
|
-
const cols = width ?? (process.stdout.columns || 80);
|
|
872
|
-
const wrapWidth = hasWidth ? Math.max(12, cols - 2) : Math.max(40, cols - 6);
|
|
873
|
-
let i = 0;
|
|
874
|
-
while (i < lines.length) {
|
|
875
|
-
const line = lines[i];
|
|
876
|
-
// Fenced code is consumed as a whole block so the panel can be sized to
|
|
877
|
-
// its widest line instead of stretching a one-liner across the pane.
|
|
878
|
-
// Also keeps table/`<br>` heuristics away from code bodies entirely.
|
|
879
|
-
const fenceOpen = matchCodeFenceOpen(line);
|
|
880
|
-
if (fenceOpen) {
|
|
881
|
-
let j = i + 1;
|
|
882
|
-
const body = [];
|
|
883
|
-
while (j < lines.length && !isCodeFenceClose(lines[j], fenceOpen.marker)) {
|
|
884
|
-
body.push(lines[j]);
|
|
885
|
-
j += 1;
|
|
886
|
-
}
|
|
887
|
-
for (const rendered of renderCodeBlock(fenceOpen, body, wrapWidth, context)) {
|
|
888
|
-
resultLines.push(`${OUTPUT_INDENT}${rendered}`);
|
|
889
|
-
}
|
|
890
|
-
i = j < lines.length ? j + 1 : j;
|
|
891
|
-
continue;
|
|
892
|
-
}
|
|
893
|
-
// A table is a row line immediately followed by a separator line.
|
|
894
|
-
if (!state.inFence &&
|
|
895
|
-
isTableRowLine(line) &&
|
|
896
|
-
i + 1 < lines.length &&
|
|
897
|
-
isTableSeparatorLine(lines[i + 1])) {
|
|
898
|
-
const block = [line, lines[i + 1]];
|
|
899
|
-
let j = i + 2;
|
|
900
|
-
while (j < lines.length &&
|
|
901
|
-
lines[j].trim().length > 0 &&
|
|
902
|
-
(isTableRowLine(lines[j]) || isTableSeparatorLine(lines[j]))) {
|
|
903
|
-
block.push(lines[j]);
|
|
904
|
-
j++;
|
|
905
|
-
}
|
|
906
|
-
for (const rendered of renderTableBlock(block, wrapWidth, context.paint)) {
|
|
907
|
-
resultLines.push(`${OUTPUT_INDENT}${rendered}`);
|
|
908
|
-
}
|
|
909
|
-
i = j;
|
|
910
|
-
continue;
|
|
911
|
-
}
|
|
912
|
-
// Expand `<br>` into real line breaks outside fences/tables.
|
|
913
|
-
const pieces = !state.inFence && BR_RE.test(line) ? line.split(BR_RE_GLOBAL) : [line];
|
|
914
|
-
for (const piece of pieces) {
|
|
915
|
-
for (const wl of wrapMarkdownLine(piece, wrapWidth, state, context)) {
|
|
916
|
-
resultLines.push(`${OUTPUT_INDENT}${wl}`);
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
i++;
|
|
920
|
-
}
|
|
921
|
-
// A fence still open at the end means the reply is mid-stream or the model
|
|
922
|
-
// never closed it — footer it so the panel always reads as a finished box.
|
|
923
|
-
if (state.inFence) {
|
|
924
|
-
resultLines.push(`${OUTPUT_INDENT}${closeFencePanel(state, context)}`);
|
|
925
|
-
}
|
|
926
|
-
return resultLines.join("\n");
|
|
927
|
-
}
|
|
928
|
-
// Streaming variant: buffers tokens and emits ANSI-rendered output
|
|
929
|
-
// whenever a complete line arrives. Fenced code blocks stream as a bordered,
|
|
930
|
-
// syntax-highlighted panel.
|
|
931
|
-
export function createMarkdownStreamWriter(write, appearance) {
|
|
932
|
-
const context = renderContext(appearance);
|
|
933
|
-
const state = { inFence: false };
|
|
934
|
-
let buffer = "";
|
|
935
|
-
let outputEndsWithNewline = true;
|
|
936
|
-
// Table rows are buffered until the block ends so columns can be
|
|
937
|
-
// sized across every row before anything is emitted.
|
|
938
|
-
let tableBuffer = [];
|
|
939
|
-
const cols = process.stdout.columns || 80;
|
|
940
|
-
const wrapWidth = Math.max(40, cols - 6);
|
|
941
|
-
const emit = (chunk) => {
|
|
942
|
-
if (!chunk)
|
|
943
|
-
return;
|
|
944
|
-
write(chunk);
|
|
945
|
-
outputEndsWithNewline = chunk.endsWith("\n");
|
|
946
|
-
};
|
|
947
|
-
const emitLine = (line, withNewline) => {
|
|
948
|
-
const pieces = !state.inFence && BR_RE.test(line) ? line.split(BR_RE_GLOBAL) : [line];
|
|
949
|
-
for (let p = 0; p < pieces.length; p++) {
|
|
950
|
-
const piece = pieces[p];
|
|
951
|
-
const lastPiece = p === pieces.length - 1;
|
|
952
|
-
const physical = wrapMarkdownLine(piece, wrapWidth, state, context);
|
|
953
|
-
for (let q = 0; q < physical.length; q++) {
|
|
954
|
-
emit(`${OUTPUT_INDENT}${physical[q]}`);
|
|
955
|
-
const isVeryLast = lastPiece && q === physical.length - 1;
|
|
956
|
-
if (!isVeryLast || withNewline)
|
|
957
|
-
emit("\n");
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
};
|
|
961
|
-
const flushTable = () => {
|
|
962
|
-
if (tableBuffer.length === 0)
|
|
963
|
-
return;
|
|
964
|
-
const looksLikeTable = tableBuffer.length >= 2 &&
|
|
965
|
-
isTableRowLine(tableBuffer[0]) &&
|
|
966
|
-
isTableSeparatorLine(tableBuffer[1]);
|
|
967
|
-
if (looksLikeTable) {
|
|
968
|
-
for (const rendered of renderTableBlock(tableBuffer, wrapWidth, context.paint)) {
|
|
969
|
-
emit(`${OUTPUT_INDENT}${rendered}\n`);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
else {
|
|
973
|
-
for (const line of tableBuffer)
|
|
974
|
-
emitLine(line, true);
|
|
975
|
-
}
|
|
976
|
-
tableBuffer = [];
|
|
977
|
-
};
|
|
978
|
-
const handleLine = (line, withNewline) => {
|
|
979
|
-
const collecting = tableBuffer.length > 0;
|
|
980
|
-
const isTableLine = !state.inFence &&
|
|
981
|
-
(collecting
|
|
982
|
-
? isTableRowLine(line) || isTableSeparatorLine(line)
|
|
983
|
-
: isTableRowLine(line));
|
|
984
|
-
if (isTableLine) {
|
|
985
|
-
tableBuffer.push(line);
|
|
986
|
-
return;
|
|
987
|
-
}
|
|
988
|
-
flushTable();
|
|
989
|
-
emitLine(line, withNewline);
|
|
990
|
-
};
|
|
991
|
-
return {
|
|
992
|
-
push(token) {
|
|
993
|
-
buffer += token;
|
|
994
|
-
let newlineIndex = buffer.indexOf("\n");
|
|
995
|
-
while (newlineIndex !== -1) {
|
|
996
|
-
const line = buffer.slice(0, newlineIndex);
|
|
997
|
-
buffer = buffer.slice(newlineIndex + 1);
|
|
998
|
-
handleLine(line, true);
|
|
999
|
-
newlineIndex = buffer.indexOf("\n");
|
|
1000
|
-
}
|
|
1001
|
-
},
|
|
1002
|
-
finish() {
|
|
1003
|
-
if (buffer.length > 0) {
|
|
1004
|
-
handleLine(buffer, false);
|
|
1005
|
-
buffer = "";
|
|
1006
|
-
}
|
|
1007
|
-
flushTable();
|
|
1008
|
-
if (state.inFence) {
|
|
1009
|
-
// Close the panel without inserting a blank row after completed lines.
|
|
1010
|
-
const separator = outputEndsWithNewline ? "" : "\n";
|
|
1011
|
-
emit(`${separator}${OUTPUT_INDENT}${closeFencePanel(state, context)}`);
|
|
1012
|
-
}
|
|
1013
|
-
},
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
647
|
//# sourceMappingURL=markdown.js.map
|