@prestyj/cli 4.3.210 → 4.3.237
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/README.md +17 -9
- package/dist/cli/auth.d.ts +4 -0
- package/dist/cli/auth.d.ts.map +1 -0
- package/dist/cli/auth.js +344 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/command-routing.d.ts +28 -0
- package/dist/cli/command-routing.d.ts.map +1 -0
- package/dist/cli/command-routing.js +53 -0
- package/dist/cli/command-routing.js.map +1 -0
- package/dist/cli/command-routing.test.d.ts +2 -0
- package/dist/cli/command-routing.test.d.ts.map +1 -0
- package/dist/cli/command-routing.test.js +60 -0
- package/dist/cli/command-routing.test.js.map +1 -0
- package/dist/cli/mcp.d.ts +2 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/cli/mcp.js +309 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/pixel.d.ts +27 -0
- package/dist/cli/pixel.d.ts.map +1 -0
- package/dist/cli/pixel.js +103 -0
- package/dist/cli/pixel.js.map +1 -0
- package/dist/cli/shared.d.ts +13 -0
- package/dist/cli/shared.d.ts.map +1 -0
- package/dist/cli/shared.js +82 -0
- package/dist/cli/shared.js.map +1 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +174 -732
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +4 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -1
- package/dist/config.js.map +1 -1
- package/dist/config.test.d.ts +2 -0
- package/dist/config.test.d.ts.map +1 -0
- package/dist/config.test.js +29 -0
- package/dist/config.test.js.map +1 -0
- package/dist/core/agent-session-compaction.test.d.ts +2 -0
- package/dist/core/agent-session-compaction.test.d.ts.map +1 -0
- package/dist/core/agent-session-compaction.test.js +114 -0
- package/dist/core/agent-session-compaction.test.js.map +1 -0
- package/dist/core/agent-session.d.ts +0 -23
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +6 -101
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/checkpoint-store.d.ts +93 -0
- package/dist/core/checkpoint-store.d.ts.map +1 -0
- package/dist/core/checkpoint-store.js +188 -0
- package/dist/core/checkpoint-store.js.map +1 -0
- package/dist/core/checkpoint-store.test.d.ts +2 -0
- package/dist/core/checkpoint-store.test.d.ts.map +1 -0
- package/dist/core/checkpoint-store.test.js +111 -0
- package/dist/core/checkpoint-store.test.js.map +1 -0
- package/dist/core/compaction/compactor.d.ts +4 -0
- package/dist/core/compaction/compactor.d.ts.map +1 -1
- package/dist/core/compaction/compactor.js +81 -28
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/compactor.test.js +33 -9
- package/dist/core/compaction/compactor.test.js.map +1 -1
- package/dist/core/compaction/token-estimator.test.js +1 -1
- package/dist/core/continue-replay-inventory.test.d.ts +2 -0
- package/dist/core/continue-replay-inventory.test.d.ts.map +1 -0
- package/dist/core/continue-replay-inventory.test.js +42 -0
- package/dist/core/continue-replay-inventory.test.js.map +1 -0
- package/dist/core/goal-controller.d.ts +4 -0
- package/dist/core/goal-controller.d.ts.map +1 -1
- package/dist/core/goal-controller.js +223 -32
- package/dist/core/goal-controller.js.map +1 -1
- package/dist/core/goal-controller.test.js +387 -22
- package/dist/core/goal-controller.test.js.map +1 -1
- package/dist/core/goal-lifecycle-smoke.test.js +49 -8
- package/dist/core/goal-lifecycle-smoke.test.js.map +1 -1
- package/dist/core/goal-prerequisites.d.ts +23 -0
- package/dist/core/goal-prerequisites.d.ts.map +1 -0
- package/dist/core/goal-prerequisites.js +114 -0
- package/dist/core/goal-prerequisites.js.map +1 -0
- package/dist/core/goal-prerequisites.test.d.ts +2 -0
- package/dist/core/goal-prerequisites.test.d.ts.map +1 -0
- package/dist/core/goal-prerequisites.test.js +118 -0
- package/dist/core/goal-prerequisites.test.js.map +1 -0
- package/dist/core/goal-store.d.ts +12 -1
- package/dist/core/goal-store.d.ts.map +1 -1
- package/dist/core/goal-store.js +146 -40
- package/dist/core/goal-store.js.map +1 -1
- package/dist/core/goal-store.test.js +65 -8
- package/dist/core/goal-store.test.js.map +1 -1
- package/dist/core/goal-verifier.d.ts.map +1 -1
- package/dist/core/goal-verifier.js +4 -1
- package/dist/core/goal-verifier.js.map +1 -1
- package/dist/core/goal-verifier.test.js +43 -0
- package/dist/core/goal-verifier.test.js.map +1 -1
- package/dist/core/goal-worker.d.ts +2 -0
- package/dist/core/goal-worker.d.ts.map +1 -1
- package/dist/core/goal-worker.js +31 -7
- package/dist/core/goal-worker.js.map +1 -1
- package/dist/core/goal-worker.test.js +44 -0
- package/dist/core/goal-worker.test.js.map +1 -1
- package/dist/core/ideal-review.d.ts +20 -0
- package/dist/core/ideal-review.d.ts.map +1 -0
- package/dist/core/ideal-review.js +55 -0
- package/dist/core/ideal-review.js.map +1 -0
- package/dist/core/ideal-review.test.d.ts +2 -0
- package/dist/core/ideal-review.test.d.ts.map +1 -0
- package/dist/core/ideal-review.test.js +59 -0
- package/dist/core/ideal-review.test.js.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/loop-breaker.d.ts +46 -0
- package/dist/core/loop-breaker.d.ts.map +1 -0
- package/dist/core/loop-breaker.js +79 -0
- package/dist/core/loop-breaker.js.map +1 -0
- package/dist/core/loop-breaker.test.d.ts +2 -0
- package/dist/core/loop-breaker.test.d.ts.map +1 -0
- package/dist/core/loop-breaker.test.js +110 -0
- package/dist/core/loop-breaker.test.js.map +1 -0
- package/dist/core/mcp/client.d.ts +20 -0
- package/dist/core/mcp/client.d.ts.map +1 -1
- package/dist/core/mcp/client.js +55 -11
- package/dist/core/mcp/client.js.map +1 -1
- package/dist/core/mcp/defaults.d.ts +7 -0
- package/dist/core/mcp/defaults.d.ts.map +1 -1
- package/dist/core/mcp/defaults.js +14 -0
- package/dist/core/mcp/defaults.js.map +1 -1
- package/dist/core/mcp/index.d.ts +6 -1
- package/dist/core/mcp/index.d.ts.map +1 -1
- package/dist/core/mcp/index.js +3 -1
- package/dist/core/mcp/index.js.map +1 -1
- package/dist/core/mcp/parse-add-command.d.ts +25 -0
- package/dist/core/mcp/parse-add-command.d.ts.map +1 -0
- package/dist/core/mcp/parse-add-command.js +220 -0
- package/dist/core/mcp/parse-add-command.js.map +1 -0
- package/dist/core/mcp/parse-add-command.test.d.ts +2 -0
- package/dist/core/mcp/parse-add-command.test.d.ts.map +1 -0
- package/dist/core/mcp/parse-add-command.test.js +75 -0
- package/dist/core/mcp/parse-add-command.test.js.map +1 -0
- package/dist/core/mcp/store.d.ts +80 -0
- package/dist/core/mcp/store.d.ts.map +1 -0
- package/dist/core/mcp/store.js +157 -0
- package/dist/core/mcp/store.js.map +1 -0
- package/dist/core/mcp/store.test.d.ts +2 -0
- package/dist/core/mcp/store.test.d.ts.map +1 -0
- package/dist/core/mcp/store.test.js +101 -0
- package/dist/core/mcp/store.test.js.map +1 -0
- package/dist/core/model-registry.d.ts +2 -2
- package/dist/core/model-registry.js +4 -4
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-registry.test.js +1 -1
- package/dist/core/model-registry.test.js.map +1 -1
- package/dist/core/prompt-commands.d.ts.map +1 -1
- package/dist/core/prompt-commands.js +64 -894
- package/dist/core/prompt-commands.js.map +1 -1
- package/dist/core/prompt-commands.test.js +49 -41
- package/dist/core/prompt-commands.test.js.map +1 -1
- package/dist/core/regrounding.d.ts +23 -0
- package/dist/core/regrounding.d.ts.map +1 -0
- package/dist/core/regrounding.js +21 -0
- package/dist/core/regrounding.js.map +1 -0
- package/dist/core/regrounding.test.d.ts +2 -0
- package/dist/core/regrounding.test.d.ts.map +1 -0
- package/dist/core/regrounding.test.js +38 -0
- package/dist/core/regrounding.test.js.map +1 -0
- package/dist/core/runtime-mode.d.ts +23 -0
- package/dist/core/runtime-mode.d.ts.map +1 -0
- package/dist/core/runtime-mode.js +30 -0
- package/dist/core/runtime-mode.js.map +1 -0
- package/dist/core/session-manager.d.ts +4 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +20 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-restore-display.test.d.ts +2 -0
- package/dist/core/session-restore-display.test.d.ts.map +1 -0
- package/dist/core/session-restore-display.test.js +78 -0
- package/dist/core/session-restore-display.test.js.map +1 -0
- package/dist/core/settings-manager.d.ts +4 -2
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +3 -6
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts +0 -2
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +10 -15
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/style-packs/index.js +1 -1
- package/dist/core/style-packs/index.js.map +1 -1
- package/dist/core/task-store.d.ts +26 -0
- package/dist/core/task-store.d.ts.map +1 -0
- package/dist/core/task-store.js +147 -0
- package/dist/core/task-store.js.map +1 -0
- package/dist/core/tasks-store.d.ts +24 -0
- package/dist/core/tasks-store.d.ts.map +1 -0
- package/dist/core/tasks-store.js +81 -0
- package/dist/core/tasks-store.js.map +1 -0
- package/dist/core/thinking-level.d.ts +5 -0
- package/dist/core/thinking-level.d.ts.map +1 -0
- package/dist/core/thinking-level.js +59 -0
- package/dist/core/thinking-level.js.map +1 -0
- package/dist/core/thinking-level.test.d.ts +2 -0
- package/dist/core/thinking-level.test.d.ts.map +1 -0
- package/dist/core/thinking-level.test.js +38 -0
- package/dist/core/thinking-level.test.js.map +1 -0
- package/dist/core/verify-commands.js +4 -4
- package/dist/core/verify-commands.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactive.d.ts.map +1 -1
- package/dist/interactive.js +3 -1
- package/dist/interactive.js.map +1 -1
- package/dist/system-prompt.d.ts +5 -1
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +76 -48
- package/dist/system-prompt.js.map +1 -1
- package/dist/system-prompt.test.js +98 -46
- package/dist/system-prompt.test.js.map +1 -1
- package/dist/tools/bash.d.ts +6 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +21 -3
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/checkpoint-hook.test.d.ts +2 -0
- package/dist/tools/checkpoint-hook.test.d.ts.map +1 -0
- package/dist/tools/checkpoint-hook.test.js +65 -0
- package/dist/tools/checkpoint-hook.test.js.map +1 -0
- package/dist/tools/edit-diff.d.ts +17 -4
- package/dist/tools/edit-diff.d.ts.map +1 -1
- package/dist/tools/edit-diff.js +78 -16
- package/dist/tools/edit-diff.js.map +1 -1
- package/dist/tools/edit-diff.test.js +31 -1
- package/dist/tools/edit-diff.test.js.map +1 -1
- package/dist/tools/edit-robustness.test.d.ts +2 -0
- package/dist/tools/edit-robustness.test.d.ts.map +1 -0
- package/dist/tools/edit-robustness.test.js +415 -0
- package/dist/tools/edit-robustness.test.js.map +1 -0
- package/dist/tools/edit.d.ts +8 -2
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +48 -20
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/edit.test.js +23 -22
- package/dist/tools/edit.test.js.map +1 -1
- package/dist/tools/enter-plan.d.ts +1 -3
- package/dist/tools/enter-plan.d.ts.map +1 -1
- package/dist/tools/enter-plan.js +9 -21
- package/dist/tools/enter-plan.js.map +1 -1
- package/dist/tools/exit-plan.d.ts.map +1 -1
- package/dist/tools/exit-plan.js +8 -9
- package/dist/tools/exit-plan.js.map +1 -1
- package/dist/tools/goal-mode.test.d.ts +2 -0
- package/dist/tools/goal-mode.test.d.ts.map +1 -0
- package/dist/tools/goal-mode.test.js +121 -0
- package/dist/tools/goal-mode.test.js.map +1 -0
- package/dist/tools/goals.d.ts +14 -2
- package/dist/tools/goals.d.ts.map +1 -1
- package/dist/tools/goals.js +257 -26
- package/dist/tools/goals.js.map +1 -1
- package/dist/tools/goals.test.js +365 -1
- package/dist/tools/goals.test.js.map +1 -1
- package/dist/tools/html-extract.d.ts +58 -0
- package/dist/tools/html-extract.d.ts.map +1 -0
- package/dist/tools/html-extract.js +130 -0
- package/dist/tools/html-extract.js.map +1 -0
- package/dist/tools/html-extract.test.d.ts +2 -0
- package/dist/tools/html-extract.test.d.ts.map +1 -0
- package/dist/tools/html-extract.test.js +60 -0
- package/dist/tools/html-extract.test.js.map +1 -0
- package/dist/tools/index.d.ts +15 -12
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +12 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/pdf-extract.d.ts +18 -0
- package/dist/tools/pdf-extract.d.ts.map +1 -0
- package/dist/tools/pdf-extract.js +43 -0
- package/dist/tools/pdf-extract.js.map +1 -0
- package/dist/tools/pdf-extract.test.d.ts +2 -0
- package/dist/tools/pdf-extract.test.d.ts.map +1 -0
- package/dist/tools/pdf-extract.test.js +15 -0
- package/dist/tools/pdf-extract.test.js.map +1 -0
- package/dist/tools/plan-mode.test.js +82 -243
- package/dist/tools/plan-mode.test.js.map +1 -1
- package/dist/tools/prompt-hints.d.ts.map +1 -1
- package/dist/tools/prompt-hints.js +6 -9
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/tools/read-only-bash.d.ts +13 -0
- package/dist/tools/read-only-bash.d.ts.map +1 -0
- package/dist/tools/read-only-bash.js +155 -0
- package/dist/tools/read-only-bash.js.map +1 -0
- package/dist/tools/read-only-bash.test.d.ts +2 -0
- package/dist/tools/read-only-bash.test.d.ts.map +1 -0
- package/dist/tools/read-only-bash.test.js +47 -0
- package/dist/tools/read-only-bash.test.js.map +1 -0
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +14 -1
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/read.test.js +4 -0
- package/dist/tools/read.test.js.map +1 -1
- package/dist/tools/screenshot.d.ts +25 -0
- package/dist/tools/screenshot.d.ts.map +1 -0
- package/dist/tools/screenshot.js +165 -0
- package/dist/tools/screenshot.js.map +1 -0
- package/dist/tools/screenshot.test.d.ts +2 -0
- package/dist/tools/screenshot.test.d.ts.map +1 -0
- package/dist/tools/screenshot.test.js +145 -0
- package/dist/tools/screenshot.test.js.map +1 -0
- package/dist/tools/subagent.d.ts +7 -2
- package/dist/tools/subagent.d.ts.map +1 -1
- package/dist/tools/subagent.js +31 -9
- package/dist/tools/subagent.js.map +1 -1
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +22 -58
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/web-fetch.d.ts +16 -1
- package/dist/tools/web-fetch.d.ts.map +1 -1
- package/dist/tools/web-fetch.js +357 -45
- package/dist/tools/web-fetch.js.map +1 -1
- package/dist/tools/web-fetch.test.js +263 -2
- package/dist/tools/web-fetch.test.js.map +1 -1
- package/dist/tools/web-search.d.ts +14 -0
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +321 -35
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools/web-search.test.js +144 -1
- package/dist/tools/web-search.test.js.map +1 -1
- package/dist/tools/write.d.ts +8 -2
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +36 -9
- package/dist/tools/write.js.map +1 -1
- package/dist/tools/write.test.js +0 -16
- package/dist/tools/write.test.js.map +1 -1
- package/dist/ui/App.d.ts +52 -280
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +1608 -2235
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/activity-phrases.d.ts.map +1 -1
- package/dist/ui/activity-phrases.js +0 -2
- package/dist/ui/activity-phrases.js.map +1 -1
- package/dist/ui/app-items.d.ts +276 -0
- package/dist/ui/app-items.d.ts.map +1 -0
- package/dist/ui/app-items.js +52 -0
- package/dist/ui/app-items.js.map +1 -0
- package/dist/ui/app-items.test.d.ts +2 -0
- package/dist/ui/app-items.test.d.ts.map +1 -0
- package/dist/ui/app-items.test.js +38 -0
- package/dist/ui/app-items.test.js.map +1 -0
- package/dist/ui/app-state-persistence.test.js +45 -160
- package/dist/ui/app-state-persistence.test.js.map +1 -1
- package/dist/ui/assistant-stream-flush-parity.test.d.ts +2 -0
- package/dist/ui/assistant-stream-flush-parity.test.d.ts.map +1 -0
- package/dist/ui/assistant-stream-flush-parity.test.js +85 -0
- package/dist/ui/assistant-stream-flush-parity.test.js.map +1 -0
- package/dist/ui/chat-layout-pinning.test.d.ts +2 -0
- package/dist/ui/chat-layout-pinning.test.d.ts.map +1 -0
- package/dist/ui/chat-layout-pinning.test.js +525 -0
- package/dist/ui/chat-layout-pinning.test.js.map +1 -0
- package/dist/ui/components/ActivityIndicator.d.ts +1 -2
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/ui/components/ActivityIndicator.js +63 -94
- package/dist/ui/components/ActivityIndicator.js.map +1 -1
- package/dist/ui/components/AnimationContext.d.ts.map +1 -1
- package/dist/ui/components/AnimationContext.js +3 -5
- package/dist/ui/components/AnimationContext.js.map +1 -1
- package/dist/ui/components/AssistantMessage.d.ts +6 -2
- package/dist/ui/components/AssistantMessage.d.ts.map +1 -1
- package/dist/ui/components/AssistantMessage.js +9 -4
- package/dist/ui/components/AssistantMessage.js.map +1 -1
- package/dist/ui/components/AssistantMessage.test.d.ts +2 -0
- package/dist/ui/components/AssistantMessage.test.d.ts.map +1 -0
- package/dist/ui/components/AssistantMessage.test.js +387 -0
- package/dist/ui/components/AssistantMessage.test.js.map +1 -0
- package/dist/ui/components/BackgroundTasksBar.d.ts +1 -3
- package/dist/ui/components/BackgroundTasksBar.d.ts.map +1 -1
- package/dist/ui/components/BackgroundTasksBar.js +8 -10
- package/dist/ui/components/BackgroundTasksBar.js.map +1 -1
- package/dist/ui/components/Banner.d.ts +1 -2
- package/dist/ui/components/Banner.d.ts.map +1 -1
- package/dist/ui/components/Banner.js +9 -4
- package/dist/ui/components/Banner.js.map +1 -1
- package/dist/ui/components/ChatFooterPane.d.ts +25 -0
- package/dist/ui/components/ChatFooterPane.d.ts.map +1 -0
- package/dist/ui/components/ChatFooterPane.js +15 -0
- package/dist/ui/components/ChatFooterPane.js.map +1 -0
- package/dist/ui/components/ChatInputStack.d.ts +36 -0
- package/dist/ui/components/ChatInputStack.d.ts.map +1 -0
- package/dist/ui/components/ChatInputStack.js +10 -0
- package/dist/ui/components/ChatInputStack.js.map +1 -0
- package/dist/ui/components/ChatLayout.d.ts +37 -0
- package/dist/ui/components/ChatLayout.d.ts.map +1 -0
- package/dist/ui/components/ChatLayout.js +21 -0
- package/dist/ui/components/ChatLayout.js.map +1 -0
- package/dist/ui/components/ChatLivePane.d.ts +18 -0
- package/dist/ui/components/ChatLivePane.d.ts.map +1 -0
- package/dist/ui/components/ChatLivePane.js +22 -0
- package/dist/ui/components/ChatLivePane.js.map +1 -0
- package/dist/ui/components/ChatScreen.d.ts +136 -0
- package/dist/ui/components/ChatScreen.d.ts.map +1 -0
- package/dist/ui/components/ChatScreen.js +16 -0
- package/dist/ui/components/ChatScreen.js.map +1 -0
- package/dist/ui/components/ChatStatusRow.d.ts +34 -0
- package/dist/ui/components/ChatStatusRow.d.ts.map +1 -0
- package/dist/ui/components/ChatStatusRow.js +11 -0
- package/dist/ui/components/ChatStatusRow.js.map +1 -0
- package/dist/ui/components/CompactionNotice.d.ts +4 -2
- package/dist/ui/components/CompactionNotice.d.ts.map +1 -1
- package/dist/ui/components/CompactionNotice.js +4 -4
- package/dist/ui/components/CompactionNotice.js.map +1 -1
- package/dist/ui/components/Footer.d.ts +27 -6
- package/dist/ui/components/Footer.d.ts.map +1 -1
- package/dist/ui/components/Footer.js +75 -30
- package/dist/ui/components/Footer.js.map +1 -1
- package/dist/ui/components/FooterStatusRow.d.ts +20 -0
- package/dist/ui/components/FooterStatusRow.d.ts.map +1 -0
- package/dist/ui/components/FooterStatusRow.js +10 -0
- package/dist/ui/components/FooterStatusRow.js.map +1 -0
- package/dist/ui/components/FullScreenOverlayRouter.d.ts +19 -0
- package/dist/ui/components/FullScreenOverlayRouter.d.ts.map +1 -0
- package/dist/ui/components/FullScreenOverlayRouter.js +18 -0
- package/dist/ui/components/FullScreenOverlayRouter.js.map +1 -0
- package/dist/ui/components/GoalOverlay.d.ts +28 -20
- package/dist/ui/components/GoalOverlay.d.ts.map +1 -1
- package/dist/ui/components/GoalOverlay.js +283 -253
- package/dist/ui/components/GoalOverlay.js.map +1 -1
- package/dist/ui/components/GoalStatusBar.d.ts.map +1 -1
- package/dist/ui/components/GoalStatusBar.js +2 -1
- package/dist/ui/components/GoalStatusBar.js.map +1 -1
- package/dist/ui/components/IdealHookMessage.d.ts +14 -0
- package/dist/ui/components/IdealHookMessage.d.ts.map +1 -0
- package/dist/ui/components/IdealHookMessage.js +26 -0
- package/dist/ui/components/IdealHookMessage.js.map +1 -0
- package/dist/ui/components/InputArea.d.ts +31 -6
- package/dist/ui/components/InputArea.d.ts.map +1 -1
- package/dist/ui/components/InputArea.js +208 -50
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/components/InputArea.test.js +11 -1
- package/dist/ui/components/InputArea.test.js.map +1 -1
- package/dist/ui/components/LiveToolPanel.d.ts +30 -0
- package/dist/ui/components/LiveToolPanel.d.ts.map +1 -0
- package/dist/ui/components/LiveToolPanel.js +66 -0
- package/dist/ui/components/LiveToolPanel.js.map +1 -0
- package/dist/ui/components/Markdown.d.ts +11 -11
- package/dist/ui/components/Markdown.d.ts.map +1 -1
- package/dist/ui/components/Markdown.js +28 -198
- package/dist/ui/components/Markdown.js.map +1 -1
- package/dist/ui/components/ModelSelector.d.ts.map +1 -1
- package/dist/ui/components/ModelSelector.js +18 -18
- package/dist/ui/components/ModelSelector.js.map +1 -1
- package/dist/ui/components/PlanModeLogo.d.ts +3 -0
- package/dist/ui/components/PlanModeLogo.d.ts.map +1 -0
- package/dist/ui/components/PlanModeLogo.js +49 -0
- package/dist/ui/components/PlanModeLogo.js.map +1 -0
- package/dist/ui/components/PlanOverlay.d.ts +7 -0
- package/dist/ui/components/PlanOverlay.d.ts.map +1 -1
- package/dist/ui/components/PlanOverlay.js +17 -3
- package/dist/ui/components/PlanOverlay.js.map +1 -1
- package/dist/ui/components/PlanOverlay.test.d.ts +2 -0
- package/dist/ui/components/PlanOverlay.test.d.ts.map +1 -0
- package/dist/ui/components/PlanOverlay.test.js +24 -0
- package/dist/ui/components/PlanOverlay.test.js.map +1 -0
- package/dist/ui/components/QueueIndicator.d.ts +9 -0
- package/dist/ui/components/QueueIndicator.d.ts.map +1 -0
- package/dist/ui/components/QueueIndicator.js +9 -0
- package/dist/ui/components/QueueIndicator.js.map +1 -0
- package/dist/ui/components/RewindOverlay.d.ts +18 -0
- package/dist/ui/components/RewindOverlay.d.ts.map +1 -0
- package/dist/ui/components/RewindOverlay.js +52 -0
- package/dist/ui/components/RewindOverlay.js.map +1 -0
- package/dist/ui/components/SelectList.d.ts.map +1 -1
- package/dist/ui/components/SelectList.js +5 -0
- package/dist/ui/components/SelectList.js.map +1 -1
- package/dist/ui/components/ServerToolExecution.d.ts +2 -0
- package/dist/ui/components/ServerToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ServerToolExecution.js +7 -23
- package/dist/ui/components/ServerToolExecution.js.map +1 -1
- package/dist/ui/components/SessionSummary.d.ts +5 -0
- package/dist/ui/components/SessionSummary.d.ts.map +1 -0
- package/dist/ui/components/SessionSummary.js +32 -0
- package/dist/ui/components/SessionSummary.js.map +1 -0
- package/dist/ui/components/SlashCommandMenu.d.ts +4 -3
- package/dist/ui/components/SlashCommandMenu.d.ts.map +1 -1
- package/dist/ui/components/SlashCommandMenu.js +38 -26
- package/dist/ui/components/SlashCommandMenu.js.map +1 -1
- package/dist/ui/components/SlashStyledSelectList.d.ts +21 -0
- package/dist/ui/components/SlashStyledSelectList.d.ts.map +1 -0
- package/dist/ui/components/SlashStyledSelectList.js +71 -0
- package/dist/ui/components/SlashStyledSelectList.js.map +1 -0
- package/dist/ui/components/StreamingArea.d.ts +11 -2
- package/dist/ui/components/StreamingArea.d.ts.map +1 -1
- package/dist/ui/components/StreamingArea.js +20 -23
- package/dist/ui/components/StreamingArea.js.map +1 -1
- package/dist/ui/components/StreamingArea.test.d.ts +2 -0
- package/dist/ui/components/StreamingArea.test.d.ts.map +1 -0
- package/dist/ui/components/StreamingArea.test.js +18 -0
- package/dist/ui/components/StreamingArea.test.js.map +1 -0
- package/dist/ui/components/SubAgentPanel.d.ts +2 -1
- package/dist/ui/components/SubAgentPanel.d.ts.map +1 -1
- package/dist/ui/components/SubAgentPanel.js +4 -3
- package/dist/ui/components/SubAgentPanel.js.map +1 -1
- package/dist/ui/components/TaskOverlay.d.ts.map +1 -1
- package/dist/ui/components/TaskOverlay.js +53 -82
- package/dist/ui/components/TaskOverlay.js.map +1 -1
- package/dist/ui/components/TaskPickerMenu.d.ts +9 -0
- package/dist/ui/components/TaskPickerMenu.d.ts.map +1 -0
- package/dist/ui/components/TaskPickerMenu.js +33 -0
- package/dist/ui/components/TaskPickerMenu.js.map +1 -0
- package/dist/ui/components/ThemeSelector.js +2 -2
- package/dist/ui/components/ThemeSelector.js.map +1 -1
- package/dist/ui/components/ToolExecution.d.ts +2 -0
- package/dist/ui/components/ToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolExecution.js +18 -52
- package/dist/ui/components/ToolExecution.js.map +1 -1
- package/dist/ui/components/ToolGroupExecution.d.ts +6 -2
- package/dist/ui/components/ToolGroupExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolGroupExecution.js +15 -147
- package/dist/ui/components/ToolGroupExecution.js.map +1 -1
- package/dist/ui/components/ToolUseLoader.d.ts +3 -1
- package/dist/ui/components/ToolUseLoader.d.ts.map +1 -1
- package/dist/ui/components/ToolUseLoader.js +2 -2
- package/dist/ui/components/ToolUseLoader.js.map +1 -1
- package/dist/ui/components/TranscriptViewport.d.ts +34 -0
- package/dist/ui/components/TranscriptViewport.d.ts.map +1 -0
- package/dist/ui/components/TranscriptViewport.js +45 -0
- package/dist/ui/components/TranscriptViewport.js.map +1 -0
- package/dist/ui/components/UserMessage.d.ts.map +1 -1
- package/dist/ui/components/UserMessage.js +15 -10
- package/dist/ui/components/UserMessage.js.map +1 -1
- package/dist/ui/components/UserMessage.test.d.ts +2 -0
- package/dist/ui/components/UserMessage.test.d.ts.map +1 -0
- package/dist/ui/components/UserMessage.test.js +39 -0
- package/dist/ui/components/UserMessage.test.js.map +1 -0
- package/dist/ui/components/index.d.ts +5 -0
- package/dist/ui/components/index.d.ts.map +1 -1
- package/dist/ui/components/index.js +5 -0
- package/dist/ui/components/index.js.map +1 -1
- package/dist/ui/duration-format.d.ts +2 -0
- package/dist/ui/duration-format.d.ts.map +1 -0
- package/dist/ui/duration-format.js +9 -0
- package/dist/ui/duration-format.js.map +1 -0
- package/dist/ui/duration-summary.d.ts +2 -0
- package/dist/ui/duration-summary.d.ts.map +1 -0
- package/dist/ui/duration-summary.js +66 -0
- package/dist/ui/duration-summary.js.map +1 -0
- package/dist/ui/error-item.d.ts +8 -0
- package/dist/ui/error-item.d.ts.map +1 -0
- package/dist/ui/error-item.js +32 -0
- package/dist/ui/error-item.js.map +1 -0
- package/dist/ui/footer-jump-regression.test.d.ts +2 -0
- package/dist/ui/footer-jump-regression.test.d.ts.map +1 -0
- package/dist/ui/footer-jump-regression.test.js +177 -0
- package/dist/ui/footer-jump-regression.test.js.map +1 -0
- package/dist/ui/footer-status-layout.test.js +22 -7
- package/dist/ui/footer-status-layout.test.js.map +1 -1
- package/dist/ui/goal-events.d.ts.map +1 -1
- package/dist/ui/goal-events.js +14 -6
- package/dist/ui/goal-events.js.map +1 -1
- package/dist/ui/goal-events.test.js +40 -2
- package/dist/ui/goal-events.test.js.map +1 -1
- package/dist/ui/goal-lifecycle-orchestration.test.d.ts +2 -0
- package/dist/ui/goal-lifecycle-orchestration.test.d.ts.map +1 -0
- package/dist/ui/goal-lifecycle-orchestration.test.js +512 -0
- package/dist/ui/goal-lifecycle-orchestration.test.js.map +1 -0
- package/dist/ui/goal-overlay.test.js +122 -44
- package/dist/ui/goal-overlay.test.js.map +1 -1
- package/dist/ui/goal-status-bar.test.js +29 -0
- package/dist/ui/goal-status-bar.test.js.map +1 -1
- package/dist/ui/goal-summary.d.ts +14 -0
- package/dist/ui/goal-summary.d.ts.map +1 -0
- package/dist/ui/goal-summary.js +194 -0
- package/dist/ui/goal-summary.js.map +1 -0
- package/dist/ui/hooks/useAgentLoop.d.ts +25 -4
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +197 -22
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.test.d.ts +2 -0
- package/dist/ui/hooks/useAgentLoop.test.d.ts.map +1 -0
- package/dist/ui/hooks/useAgentLoop.test.js +8 -0
- package/dist/ui/hooks/useAgentLoop.test.js.map +1 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.d.ts +45 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.d.ts.map +1 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.js +97 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.js.map +1 -0
- package/dist/ui/hooks/useContextCompaction.d.ts +41 -0
- package/dist/ui/hooks/useContextCompaction.d.ts.map +1 -0
- package/dist/ui/hooks/useContextCompaction.js +149 -0
- package/dist/ui/hooks/useContextCompaction.js.map +1 -0
- package/dist/ui/hooks/useModeState.d.ts +56 -0
- package/dist/ui/hooks/useModeState.d.ts.map +1 -0
- package/dist/ui/hooks/useModeState.js +65 -0
- package/dist/ui/hooks/useModeState.js.map +1 -0
- package/dist/ui/hooks/usePixelFixFlow.d.ts +57 -0
- package/dist/ui/hooks/usePixelFixFlow.d.ts.map +1 -0
- package/dist/ui/hooks/usePixelFixFlow.js +102 -0
- package/dist/ui/hooks/usePixelFixFlow.js.map +1 -0
- package/dist/ui/hooks/useSessionPersistence.d.ts +34 -0
- package/dist/ui/hooks/useSessionPersistence.d.ts.map +1 -0
- package/dist/ui/hooks/useSessionPersistence.js +67 -0
- package/dist/ui/hooks/useSessionPersistence.js.map +1 -0
- package/dist/ui/hooks/useTaskPickerController.d.ts +19 -0
- package/dist/ui/hooks/useTaskPickerController.d.ts.map +1 -0
- package/dist/ui/hooks/useTaskPickerController.js +41 -0
- package/dist/ui/hooks/useTaskPickerController.js.map +1 -0
- package/dist/ui/hooks/useTerminalSize.d.ts +13 -10
- package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -1
- package/dist/ui/hooks/useTerminalSize.js +21 -16
- package/dist/ui/hooks/useTerminalSize.js.map +1 -1
- package/dist/ui/hooks/useTranscriptHistory.d.ts +48 -0
- package/dist/ui/hooks/useTranscriptHistory.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptHistory.js +113 -0
- package/dist/ui/hooks/useTranscriptHistory.js.map +1 -0
- package/dist/ui/hooks/useTranscriptHistory.test.d.ts +2 -0
- package/dist/ui/hooks/useTranscriptHistory.test.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptHistory.test.js +61 -0
- package/dist/ui/hooks/useTranscriptHistory.test.js.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.d.ts +30 -0
- package/dist/ui/hooks/useTranscriptScroll.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.js +44 -0
- package/dist/ui/hooks/useTranscriptScroll.js.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.test.d.ts +2 -0
- package/dist/ui/hooks/useTranscriptScroll.test.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.test.js +119 -0
- package/dist/ui/hooks/useTranscriptScroll.test.js.map +1 -0
- package/dist/ui/item-helpers.d.ts +26 -0
- package/dist/ui/item-helpers.d.ts.map +1 -0
- package/dist/ui/item-helpers.js +114 -0
- package/dist/ui/item-helpers.js.map +1 -0
- package/dist/ui/layout-decisions.d.ts +81 -0
- package/dist/ui/layout-decisions.d.ts.map +1 -0
- package/dist/ui/layout-decisions.js +89 -0
- package/dist/ui/layout-decisions.js.map +1 -0
- package/dist/ui/live-area-clamp.test.d.ts +2 -0
- package/dist/ui/live-area-clamp.test.d.ts.map +1 -0
- package/dist/ui/live-area-clamp.test.js +88 -0
- package/dist/ui/live-area-clamp.test.js.map +1 -0
- package/dist/ui/live-area-height.d.ts +35 -0
- package/dist/ui/live-area-height.d.ts.map +1 -0
- package/dist/ui/live-area-height.js +80 -0
- package/dist/ui/live-area-height.js.map +1 -0
- package/dist/ui/live-area-height.test.d.ts +2 -0
- package/dist/ui/live-area-height.test.d.ts.map +1 -0
- package/dist/ui/live-area-height.test.js +67 -0
- package/dist/ui/live-area-height.test.js.map +1 -0
- package/dist/ui/live-frame-height.test.d.ts +2 -0
- package/dist/ui/live-frame-height.test.d.ts.map +1 -0
- package/dist/ui/live-frame-height.test.js +116 -0
- package/dist/ui/live-frame-height.test.js.map +1 -0
- package/dist/ui/live-item-flush.d.ts +2 -2
- package/dist/ui/live-item-flush.d.ts.map +1 -1
- package/dist/ui/live-item-flush.js +8 -4
- package/dist/ui/live-item-flush.js.map +1 -1
- package/dist/ui/login.js +1 -1
- package/dist/ui/long-prompt-regression-harness.test.d.ts +2 -0
- package/dist/ui/long-prompt-regression-harness.test.d.ts.map +1 -0
- package/dist/ui/long-prompt-regression-harness.test.js +195 -0
- package/dist/ui/long-prompt-regression-harness.test.js.map +1 -0
- package/dist/ui/mcp.d.ts +62 -0
- package/dist/ui/mcp.d.ts.map +1 -0
- package/dist/ui/mcp.js +306 -0
- package/dist/ui/mcp.js.map +1 -0
- package/dist/ui/plan-overlay.test.js +7 -29
- package/dist/ui/plan-overlay.test.js.map +1 -1
- package/dist/ui/prompt-routing.d.ts +11 -0
- package/dist/ui/prompt-routing.d.ts.map +1 -0
- package/dist/ui/prompt-routing.js +61 -0
- package/dist/ui/prompt-routing.js.map +1 -0
- package/dist/ui/queued-message.test.d.ts +2 -0
- package/dist/ui/queued-message.test.d.ts.map +1 -0
- package/dist/ui/queued-message.test.js +162 -0
- package/dist/ui/queued-message.test.js.map +1 -0
- package/dist/ui/render.d.ts +38 -42
- package/dist/ui/render.d.ts.map +1 -1
- package/dist/ui/render.js +128 -42
- package/dist/ui/render.js.map +1 -1
- package/dist/ui/render.test.d.ts +2 -0
- package/dist/ui/render.test.d.ts.map +1 -0
- package/dist/ui/render.test.js +16 -0
- package/dist/ui/render.test.js.map +1 -0
- package/dist/ui/scroll-stabilization.test.js +1 -7
- package/dist/ui/scroll-stabilization.test.js.map +1 -1
- package/dist/ui/session-summary.d.ts +63 -0
- package/dist/ui/session-summary.d.ts.map +1 -0
- package/dist/ui/session-summary.js +81 -0
- package/dist/ui/session-summary.js.map +1 -0
- package/dist/ui/slash-command-images.test.js +12 -11
- package/dist/ui/slash-command-images.test.js.map +1 -1
- package/dist/ui/stores/transcript-scroll-store.d.ts +27 -0
- package/dist/ui/stores/transcript-scroll-store.d.ts.map +1 -0
- package/dist/ui/stores/transcript-scroll-store.js +73 -0
- package/dist/ui/stores/transcript-scroll-store.js.map +1 -0
- package/dist/ui/stores/transcript-scroll-store.test.d.ts +2 -0
- package/dist/ui/stores/transcript-scroll-store.test.d.ts.map +1 -0
- package/dist/ui/stores/transcript-scroll-store.test.js +73 -0
- package/dist/ui/stores/transcript-scroll-store.test.js.map +1 -0
- package/dist/ui/streaming-flush-bounce.test.d.ts +2 -0
- package/dist/ui/streaming-flush-bounce.test.d.ts.map +1 -0
- package/dist/ui/streaming-flush-bounce.test.js +156 -0
- package/dist/ui/streaming-flush-bounce.test.js.map +1 -0
- package/dist/ui/submit-prompt-command.d.ts +49 -0
- package/dist/ui/submit-prompt-command.d.ts.map +1 -0
- package/dist/ui/submit-prompt-command.js +107 -0
- package/dist/ui/submit-prompt-command.js.map +1 -0
- package/dist/ui/submit-slash-commands.d.ts +12 -0
- package/dist/ui/submit-slash-commands.d.ts.map +1 -0
- package/dist/ui/submit-slash-commands.js +32 -0
- package/dist/ui/submit-slash-commands.js.map +1 -0
- package/dist/ui/terminal-history-format.d.ts +43 -0
- package/dist/ui/terminal-history-format.d.ts.map +1 -0
- package/dist/ui/terminal-history-format.js +133 -0
- package/dist/ui/terminal-history-format.js.map +1 -0
- package/dist/ui/terminal-history-retry-dedup.test.d.ts +2 -0
- package/dist/ui/terminal-history-retry-dedup.test.d.ts.map +1 -0
- package/dist/ui/terminal-history-retry-dedup.test.js +61 -0
- package/dist/ui/terminal-history-retry-dedup.test.js.map +1 -0
- package/dist/ui/terminal-history-spacing.d.ts +2 -0
- package/dist/ui/terminal-history-spacing.d.ts.map +1 -0
- package/dist/ui/terminal-history-spacing.js +2 -0
- package/dist/ui/terminal-history-spacing.js.map +1 -0
- package/dist/ui/terminal-history-status-renderers.d.ts +15 -0
- package/dist/ui/terminal-history-status-renderers.d.ts.map +1 -0
- package/dist/ui/terminal-history-status-renderers.js +99 -0
- package/dist/ui/terminal-history-status-renderers.js.map +1 -0
- package/dist/ui/terminal-history.d.ts +26 -0
- package/dist/ui/terminal-history.d.ts.map +1 -0
- package/dist/ui/terminal-history.js +916 -0
- package/dist/ui/terminal-history.js.map +1 -0
- package/dist/ui/terminal-history.test.d.ts +2 -0
- package/dist/ui/terminal-history.test.d.ts.map +1 -0
- package/dist/ui/terminal-history.test.js +550 -0
- package/dist/ui/terminal-history.test.js.map +1 -0
- package/dist/ui/testing/screen-recorder.d.ts +29 -0
- package/dist/ui/testing/screen-recorder.d.ts.map +1 -0
- package/dist/ui/testing/screen-recorder.js +179 -0
- package/dist/ui/testing/screen-recorder.js.map +1 -0
- package/dist/ui/thinking-level-cycle.test.d.ts +2 -0
- package/dist/ui/thinking-level-cycle.test.d.ts.map +1 -0
- package/dist/ui/thinking-level-cycle.test.js +45 -0
- package/dist/ui/thinking-level-cycle.test.js.map +1 -0
- package/dist/ui/thinking-level.d.ts +2 -0
- package/dist/ui/thinking-level.d.ts.map +1 -0
- package/dist/ui/thinking-level.js +2 -0
- package/dist/ui/thinking-level.js.map +1 -0
- package/dist/ui/tool-group-summary.d.ts +24 -0
- package/dist/ui/tool-group-summary.d.ts.map +1 -0
- package/dist/ui/tool-group-summary.js +233 -0
- package/dist/ui/tool-group-summary.js.map +1 -0
- package/dist/ui/tool-group-summary.test.d.ts +2 -0
- package/dist/ui/tool-group-summary.test.d.ts.map +1 -0
- package/dist/ui/tool-group-summary.test.js +79 -0
- package/dist/ui/tool-group-summary.test.js.map +1 -0
- package/dist/ui/tool-line-summary.d.ts +29 -0
- package/dist/ui/tool-line-summary.d.ts.map +1 -0
- package/dist/ui/tool-line-summary.js +153 -0
- package/dist/ui/tool-line-summary.js.map +1 -0
- package/dist/ui/transcript/MiscRows.d.ts +26 -0
- package/dist/ui/transcript/MiscRows.d.ts.map +1 -0
- package/dist/ui/transcript/MiscRows.js +68 -0
- package/dist/ui/transcript/MiscRows.js.map +1 -0
- package/dist/ui/transcript/StatusRow.d.ts +14 -0
- package/dist/ui/transcript/StatusRow.d.ts.map +1 -0
- package/dist/ui/transcript/StatusRow.js +14 -0
- package/dist/ui/transcript/StatusRow.js.map +1 -0
- package/dist/ui/transcript/ToolRows.d.ts +20 -0
- package/dist/ui/transcript/ToolRows.d.ts.map +1 -0
- package/dist/ui/transcript/ToolRows.js +25 -0
- package/dist/ui/transcript/ToolRows.js.map +1 -0
- package/dist/ui/transcript/TranscriptItemFrame.d.ts +8 -0
- package/dist/ui/transcript/TranscriptItemFrame.d.ts.map +1 -0
- package/dist/ui/transcript/TranscriptItemFrame.js +9 -0
- package/dist/ui/transcript/TranscriptItemFrame.js.map +1 -0
- package/dist/ui/transcript/TranscriptRenderer.d.ts +22 -0
- package/dist/ui/transcript/TranscriptRenderer.d.ts.map +1 -0
- package/dist/ui/transcript/TranscriptRenderer.js +111 -0
- package/dist/ui/transcript/TranscriptRenderer.js.map +1 -0
- package/dist/ui/transcript/presentation.d.ts +61 -0
- package/dist/ui/transcript/presentation.d.ts.map +1 -0
- package/dist/ui/transcript/presentation.js +86 -0
- package/dist/ui/transcript/presentation.js.map +1 -0
- package/dist/ui/transcript/spacing.d.ts +56 -0
- package/dist/ui/transcript/spacing.d.ts.map +1 -0
- package/dist/ui/transcript/spacing.js +129 -0
- package/dist/ui/transcript/spacing.js.map +1 -0
- package/dist/ui/transcript/spacing.test.d.ts +2 -0
- package/dist/ui/transcript/spacing.test.d.ts.map +1 -0
- package/dist/ui/transcript/spacing.test.js +193 -0
- package/dist/ui/transcript/spacing.test.js.map +1 -0
- package/dist/ui/transcript/tool-presentation.d.ts +12 -0
- package/dist/ui/transcript/tool-presentation.d.ts.map +1 -0
- package/dist/ui/transcript/tool-presentation.js +55 -0
- package/dist/ui/transcript/tool-presentation.js.map +1 -0
- package/dist/ui/transcript/transcript-lines.d.ts +32 -0
- package/dist/ui/transcript/transcript-lines.d.ts.map +1 -0
- package/dist/ui/transcript/transcript-lines.js +86 -0
- package/dist/ui/transcript/transcript-lines.js.map +1 -0
- package/dist/ui/transcript/transcript-lines.test.d.ts +2 -0
- package/dist/ui/transcript/transcript-lines.test.d.ts.map +1 -0
- package/dist/ui/transcript/transcript-lines.test.js +76 -0
- package/dist/ui/transcript/transcript-lines.test.js.map +1 -0
- package/dist/ui/transcript-viewport-pinning.test.d.ts +2 -0
- package/dist/ui/transcript-viewport-pinning.test.d.ts.map +1 -0
- package/dist/ui/transcript-viewport-pinning.test.js +148 -0
- package/dist/ui/transcript-viewport-pinning.test.js.map +1 -0
- package/dist/ui/tui-history-parity.test.d.ts +2 -0
- package/dist/ui/tui-history-parity.test.d.ts.map +1 -0
- package/dist/ui/tui-history-parity.test.js +381 -0
- package/dist/ui/tui-history-parity.test.js.map +1 -0
- package/dist/ui/tui-simulation.test.d.ts +2 -0
- package/dist/ui/tui-simulation.test.d.ts.map +1 -0
- package/dist/ui/tui-simulation.test.js +139 -0
- package/dist/ui/tui-simulation.test.js.map +1 -0
- package/dist/ui/tui-terminal-recorder.test.d.ts +2 -0
- package/dist/ui/tui-terminal-recorder.test.d.ts.map +1 -0
- package/dist/ui/tui-terminal-recorder.test.js +134 -0
- package/dist/ui/tui-terminal-recorder.test.js.map +1 -0
- package/dist/ui/utils/assistant-stream-split.d.ts +23 -0
- package/dist/ui/utils/assistant-stream-split.d.ts.map +1 -0
- package/dist/ui/utils/assistant-stream-split.js +41 -0
- package/dist/ui/utils/assistant-stream-split.js.map +1 -0
- package/dist/ui/utils/assistant-stream-split.test.d.ts +2 -0
- package/dist/ui/utils/assistant-stream-split.test.d.ts.map +1 -0
- package/dist/ui/utils/assistant-stream-split.test.js +40 -0
- package/dist/ui/utils/assistant-stream-split.test.js.map +1 -0
- package/dist/ui/utils/latex-to-unicode.d.ts +22 -0
- package/dist/ui/utils/latex-to-unicode.d.ts.map +1 -0
- package/dist/ui/utils/latex-to-unicode.js +538 -0
- package/dist/ui/utils/latex-to-unicode.js.map +1 -0
- package/dist/ui/utils/markdown-renderer.d.ts +20 -0
- package/dist/ui/utils/markdown-renderer.d.ts.map +1 -0
- package/dist/ui/utils/markdown-renderer.js +327 -0
- package/dist/ui/utils/markdown-renderer.js.map +1 -0
- package/dist/ui/utils/markdown-table.d.ts +9 -0
- package/dist/ui/utils/markdown-table.d.ts.map +1 -0
- package/dist/ui/utils/markdown-table.js +95 -0
- package/dist/ui/utils/markdown-table.js.map +1 -0
- package/dist/ui/utils/terminal-graphics.d.ts +16 -0
- package/dist/ui/utils/terminal-graphics.d.ts.map +1 -0
- package/dist/ui/utils/terminal-graphics.js +68 -0
- package/dist/ui/utils/terminal-graphics.js.map +1 -0
- package/dist/ui/utils/terminal-graphics.test.d.ts +2 -0
- package/dist/ui/utils/terminal-graphics.test.d.ts.map +1 -0
- package/dist/ui/utils/terminal-graphics.test.js +61 -0
- package/dist/ui/utils/terminal-graphics.test.js.map +1 -0
- package/dist/ui/utils/terminal-input.d.ts +3 -0
- package/dist/ui/utils/terminal-input.d.ts.map +1 -0
- package/dist/ui/utils/terminal-input.js +28 -0
- package/dist/ui/utils/terminal-input.js.map +1 -0
- package/dist/ui/utils/terminal-input.test.d.ts +2 -0
- package/dist/ui/utils/terminal-input.test.d.ts.map +1 -0
- package/dist/ui/utils/terminal-input.test.js +15 -0
- package/dist/ui/utils/terminal-input.test.js.map +1 -0
- package/dist/ui/utils/text-utils.d.ts +8 -0
- package/dist/ui/utils/text-utils.d.ts.map +1 -0
- package/dist/ui/utils/text-utils.js +16 -0
- package/dist/ui/utils/text-utils.js.map +1 -0
- package/dist/ui/utils/token-to-ansi.js +19 -9
- package/dist/ui/utils/token-to-ansi.js.map +1 -1
- package/dist/ui/utils/user-message-display.d.ts +7 -0
- package/dist/ui/utils/user-message-display.d.ts.map +1 -0
- package/dist/ui/utils/user-message-display.js +26 -0
- package/dist/ui/utils/user-message-display.js.map +1 -0
- package/dist/utils/format.js +7 -9
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/image.d.ts +9 -0
- package/dist/utils/image.d.ts.map +1 -1
- package/dist/utils/image.js +25 -0
- package/dist/utils/image.js.map +1 -1
- package/dist/utils/plan-steps.d.ts.map +1 -1
- package/dist/utils/plan-steps.js +5 -1
- package/dist/utils/plan-steps.js.map +1 -1
- package/dist/utils/plan-steps.test.d.ts +2 -0
- package/dist/utils/plan-steps.test.d.ts.map +1 -0
- package/dist/utils/plan-steps.test.js +16 -0
- package/dist/utils/plan-steps.test.js.map +1 -0
- package/package.json +50 -10
- package/dist/core/repomap-context.d.ts +0 -11
- package/dist/core/repomap-context.d.ts.map +0 -1
- package/dist/core/repomap-context.js +0 -68
- package/dist/core/repomap-context.js.map +0 -1
- package/dist/core/repomap-context.test.d.ts +0 -2
- package/dist/core/repomap-context.test.d.ts.map +0 -1
- package/dist/core/repomap-context.test.js +0 -47
- package/dist/core/repomap-context.test.js.map +0 -1
- package/dist/core/repomap.d.ts +0 -74
- package/dist/core/repomap.d.ts.map +0 -1
- package/dist/core/repomap.js +0 -906
- package/dist/core/repomap.js.map +0 -1
- package/dist/core/repomap.test.d.ts +0 -2
- package/dist/core/repomap.test.d.ts.map +0 -1
- package/dist/core/repomap.test.js +0 -494
- package/dist/core/repomap.test.js.map +0 -1
- package/dist/ui/components/EyesOverlay.d.ts +0 -10
- package/dist/ui/components/EyesOverlay.d.ts.map +0 -1
- package/dist/ui/components/EyesOverlay.js +0 -220
- package/dist/ui/components/EyesOverlay.js.map +0 -1
|
@@ -0,0 +1,916 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import stringWidth from "string-width";
|
|
3
|
+
import wrapAnsi from "wrap-ansi";
|
|
4
|
+
import { getModel } from "../core/model-registry.js";
|
|
5
|
+
import { HOOK_TONE_COLOR, isPanelReplacedToolItem } from "./app-items.js";
|
|
6
|
+
import { BLACK_CIRCLE, RETURN_SYMBOL } from "./constants/figures.js";
|
|
7
|
+
import { SPINNER_FRAMES } from "./spinner-frames.js";
|
|
8
|
+
import { getUserMessageDisplayParts } from "./utils/user-message-display.js";
|
|
9
|
+
import { buildToolGroupSummary } from "./tool-group-summary.js";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { pathToFileURL } from "node:url";
|
|
12
|
+
import { renderMarkdownToAnsiLines } from "./utils/markdown-renderer.js";
|
|
13
|
+
import { detectGraphicsProtocol, encodeInlineImage } from "./utils/terminal-graphics.js";
|
|
14
|
+
import { createHyperlink } from "./utils/hyperlink.js";
|
|
15
|
+
import { supportsHyperlinks } from "./utils/supports-hyperlinks.js";
|
|
16
|
+
import { shouldSeparateTranscriptItems } from "./transcript/spacing.js";
|
|
17
|
+
import { MAX_OUTPUT_LINES, RESPONSE_LEFT_PADDING, USER_MESSAGE_BACKGROUND, USER_MESSAGE_BOTTOM_FILL, USER_MESSAGE_HORIZONTAL_PADDING, USER_MESSAGE_PREFIX, USER_MESSAGE_TOP_FILL, block, color, dim, formatCompactTokens, formatDuration, formatHistoryWrite, gradientLine, indent, stripAnsi, truncatePlain, userChipSegment, wrapPlain, } from "./terminal-history-format.js";
|
|
18
|
+
import { renderCompacted, renderCompacting, renderError, renderSetupHint, renderStatusLine, renderStepDone, renderStylePack, renderUpdateNotice, } from "./terminal-history-status-renderers.js";
|
|
19
|
+
import { presentDuration, presentGoalAgentTransition, presentInfo, presentModelTransition, presentPlanEvent, presentQueued, presentStopped, presentTask, presentThemeTransition, } from "./transcript/presentation.js";
|
|
20
|
+
import { toolTonePalette } from "./transcript/tool-presentation.js";
|
|
21
|
+
const LOGO_LINES = [" █▀▀▀ ▀▀▀█", " █▀▀ ▄▀", " █▄▄▄ █▄▄▄"];
|
|
22
|
+
const PLAN_MODE_LOGO = [
|
|
23
|
+
"▗▄▄▖ ▗▖ ▗▄▖ ▗▖ ▗▖ ▗▖ ▗▖ ▗▄▖ ▗▄▄▄ ▗▄▄▄▖",
|
|
24
|
+
"▐▌ ▐▌▐▌ ▐▌ ▐▌▐▛▚▖▐▌ ▐▛▚▞▜▌▐▌ ▐▌▐▌ █▐▌",
|
|
25
|
+
"▐▛▀▘ ▐▌ ▐▛▀▜▌▐▌ ▝▜▌ ▐▌ ▐▌▐▌ ▐▌▐▌ █▐▛▀▀▘",
|
|
26
|
+
"▐▌ ▐▙▄▄▖▐▌ ▐▌▐▌ ▐▌ ▐▌ ▐▌▝▚▄▞▘▐▙▄▄▀▐▙▄▄▖",
|
|
27
|
+
];
|
|
28
|
+
const PLAN_MODE_GRADIENT = [
|
|
29
|
+
"#f59e0b",
|
|
30
|
+
"#fbbf24",
|
|
31
|
+
"#f59e0b",
|
|
32
|
+
"#d97706",
|
|
33
|
+
"#f59e0b",
|
|
34
|
+
"#fbbf24",
|
|
35
|
+
"#d97706",
|
|
36
|
+
];
|
|
37
|
+
const GRADIENT = [
|
|
38
|
+
"#60a5fa",
|
|
39
|
+
"#6da1f9",
|
|
40
|
+
"#7a9df7",
|
|
41
|
+
"#8799f5",
|
|
42
|
+
"#9495f3",
|
|
43
|
+
"#a18ff1",
|
|
44
|
+
"#a78bfa",
|
|
45
|
+
"#a18ff1",
|
|
46
|
+
"#9495f3",
|
|
47
|
+
"#8799f5",
|
|
48
|
+
"#7a9df7",
|
|
49
|
+
"#6da1f9",
|
|
50
|
+
];
|
|
51
|
+
const GAP = " ";
|
|
52
|
+
const LOGO_WIDTH = 9;
|
|
53
|
+
const SIDE_BY_SIDE_MIN = LOGO_WIDTH + GAP.length + 62;
|
|
54
|
+
const COMPACT_TOOLS = new Set(["read", "grep", "find", "ls", "source_path"]);
|
|
55
|
+
const STATE_TOOLS = new Set(["tasks"]);
|
|
56
|
+
const SERVER_STYLE_TOOLS = new Set(["web_search"]);
|
|
57
|
+
// How many recent assistant fingerprints to remember for retry de-dup. A
|
|
58
|
+
// stream retry re-emits the SAME leading paragraphs it just flushed, always
|
|
59
|
+
// adjacent in print order — so a small recency window catches retries while
|
|
60
|
+
// still allowing a genuinely repeated short phrase (e.g. "Done.") to reappear
|
|
61
|
+
// many turns later.
|
|
62
|
+
const ASSISTANT_FINGERPRINT_WINDOW = 16;
|
|
63
|
+
export function createTerminalHistoryPrinter({ stream = process.stdout, } = {}) {
|
|
64
|
+
const printed = new Set();
|
|
65
|
+
// Ordered ring of recently printed assistant text fingerprints. The printer
|
|
66
|
+
// dedupes by item id, but progressive mid-stream flushing assigns a FRESH id
|
|
67
|
+
// to each flushed paragraph. On a stream stall/overload the agent loop emits
|
|
68
|
+
// a `retry`, the provider re-streams from scratch, and those same paragraphs
|
|
69
|
+
// get re-flushed under new ids — so id-dedup alone lets the identical text
|
|
70
|
+
// print again (N retries => N+1 stacked copies). Fingerprinting the content
|
|
71
|
+
// suppresses those re-emissions regardless of id.
|
|
72
|
+
const recentAssistantFingerprints = [];
|
|
73
|
+
let previousPrintedKind = null;
|
|
74
|
+
const fingerprintOf = (item) => {
|
|
75
|
+
if (item.kind !== "assistant")
|
|
76
|
+
return null;
|
|
77
|
+
const normalized = item.text.replace(/\s+/g, " ").trim();
|
|
78
|
+
return normalized.length > 0 ? normalized : null;
|
|
79
|
+
};
|
|
80
|
+
return {
|
|
81
|
+
print(items, context, options) {
|
|
82
|
+
const writeOutput = options?.write ?? ((data) => void stream.write(data));
|
|
83
|
+
for (const item of items) {
|
|
84
|
+
if (!options?.force && printed.has(item.id))
|
|
85
|
+
continue;
|
|
86
|
+
// Tool activity is shown live in the pinned LiveToolPanel, not the
|
|
87
|
+
// scrollback transcript. Skip without touching spacing state so the
|
|
88
|
+
// surrounding non-tool rows keep their separators.
|
|
89
|
+
if (isPanelReplacedToolItem(item))
|
|
90
|
+
continue;
|
|
91
|
+
// Retry-driven duplicate: identical assistant text re-flushed under a
|
|
92
|
+
// new id after a stream restart. Mark the id printed so a later flush of
|
|
93
|
+
// the same item is a cheap id hit, then skip without writing.
|
|
94
|
+
const fingerprint = options?.force ? null : fingerprintOf(item);
|
|
95
|
+
if (fingerprint !== null && recentAssistantFingerprints.includes(fingerprint)) {
|
|
96
|
+
printed.add(item.id);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const output = serializeCompletedItemToTerminalHistory(item, context);
|
|
100
|
+
const endsWithBlankLine = item.kind === "banner";
|
|
101
|
+
// A continuation assistant chunk is the next paragraph of a response
|
|
102
|
+
// whose earlier paragraphs were already flushed mid-stream. Re-insert
|
|
103
|
+
// the blank line that separated them so the reassembled scrollback
|
|
104
|
+
// matches the whole response (assistant→assistant is otherwise compact).
|
|
105
|
+
const isContinuationParagraph = item.kind === "assistant" &&
|
|
106
|
+
item.continuation === true &&
|
|
107
|
+
previousPrintedKind === "assistant";
|
|
108
|
+
const formatted = formatHistoryWrite(output, {
|
|
109
|
+
leadingSeparator: item.kind === "plan_transition"
|
|
110
|
+
? false
|
|
111
|
+
: isContinuationParagraph
|
|
112
|
+
? true
|
|
113
|
+
: shouldSeparateTranscriptItems({
|
|
114
|
+
previousKind: previousPrintedKind ?? undefined,
|
|
115
|
+
currentKind: item.kind,
|
|
116
|
+
}),
|
|
117
|
+
trailingBlankLine: endsWithBlankLine,
|
|
118
|
+
trailingNewlines: item.kind === "user" ? 1 : undefined,
|
|
119
|
+
});
|
|
120
|
+
if (formatted.length === 0)
|
|
121
|
+
continue;
|
|
122
|
+
printed.add(item.id);
|
|
123
|
+
if (fingerprint !== null) {
|
|
124
|
+
recentAssistantFingerprints.push(fingerprint);
|
|
125
|
+
if (recentAssistantFingerprints.length > ASSISTANT_FINGERPRINT_WINDOW) {
|
|
126
|
+
recentAssistantFingerprints.shift();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
writeOutput(formatted);
|
|
130
|
+
// Inline image previews render in the Static scrollback region (straight
|
|
131
|
+
// to the stream, above Ink's live frame). Only emit graphics escapes on
|
|
132
|
+
// terminals that support them; everything else keeps the text-only line.
|
|
133
|
+
const previews = (item.kind === "tool_done" || item.kind === "user") && item.imagePreviews
|
|
134
|
+
? item.imagePreviews
|
|
135
|
+
: undefined;
|
|
136
|
+
if (previews && previews.length > 0) {
|
|
137
|
+
const protocol = detectGraphicsProtocol();
|
|
138
|
+
// Indent the image to the message text column (after the `⏺ ` dot),
|
|
139
|
+
// matching assistant/tool label alignment. Graphics protocols anchor
|
|
140
|
+
// the image at the cursor column, so leading spaces shift it right.
|
|
141
|
+
const imageLeftPad = " ";
|
|
142
|
+
const canLink = supportsHyperlinks();
|
|
143
|
+
for (const preview of previews) {
|
|
144
|
+
if (protocol !== "none") {
|
|
145
|
+
writeOutput(`\n${imageLeftPad}${encodeInlineImage(preview.base64, protocol)}\n`);
|
|
146
|
+
}
|
|
147
|
+
// Clickable "open" affordance — Cmd/Ctrl-click opens the file in the
|
|
148
|
+
// OS default viewer. The pixels themselves aren't clickable, so the
|
|
149
|
+
// path is the open handle.
|
|
150
|
+
if (preview.path && canLink) {
|
|
151
|
+
const fileUrl = pathToFileURL(preview.path).href;
|
|
152
|
+
const linkLabel = `↗ ${path.basename(preview.path)}`;
|
|
153
|
+
const lead = protocol === "none" ? "\n" : "";
|
|
154
|
+
writeOutput(`${lead}${imageLeftPad}${createHyperlink(fileUrl, linkLabel)}\n`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
previousPrintedKind = item.kind;
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
clear() {
|
|
162
|
+
printed.clear();
|
|
163
|
+
recentAssistantFingerprints.length = 0;
|
|
164
|
+
previousPrintedKind = null;
|
|
165
|
+
},
|
|
166
|
+
resetPrinted() {
|
|
167
|
+
printed.clear();
|
|
168
|
+
recentAssistantFingerprints.length = 0;
|
|
169
|
+
previousPrintedKind = null;
|
|
170
|
+
},
|
|
171
|
+
get printedIds() {
|
|
172
|
+
return printed;
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
export function serializeCompletedItemToTerminalHistory(item, context) {
|
|
177
|
+
switch (item.kind) {
|
|
178
|
+
case "banner":
|
|
179
|
+
return renderBanner(context);
|
|
180
|
+
case "user":
|
|
181
|
+
return renderUser(item.text, item.imageCount, item.pasteInfo, context);
|
|
182
|
+
case "queued":
|
|
183
|
+
return renderQueued(item.text, item.imageCount, context);
|
|
184
|
+
case "assistant":
|
|
185
|
+
return renderAssistant(item.text, context, item.continuation);
|
|
186
|
+
case "ideal_hook":
|
|
187
|
+
return renderIdealHook(item.text, item.tone ?? "review", context);
|
|
188
|
+
case "tool_start":
|
|
189
|
+
if (item.name === "enter_plan")
|
|
190
|
+
return "";
|
|
191
|
+
return renderToolStart(item.name, item.args, item.progressOutput, context);
|
|
192
|
+
case "tool_done":
|
|
193
|
+
if (item.name === "enter_plan")
|
|
194
|
+
return "";
|
|
195
|
+
return renderToolDone(item.name, item.args, item.result, item.isError, item.durationMs, context);
|
|
196
|
+
case "tool_group":
|
|
197
|
+
return renderToolGroup(item.tools, context);
|
|
198
|
+
case "server_tool_start":
|
|
199
|
+
return renderServerToolStart(item.name, item.input, context);
|
|
200
|
+
case "server_tool_done":
|
|
201
|
+
return renderServerToolDone(item.name, item.input, item.resultType, item.durationMs, context);
|
|
202
|
+
case "subagent_group":
|
|
203
|
+
return renderSubAgentGroup(item.agents, item.aborted, context);
|
|
204
|
+
case "task": {
|
|
205
|
+
const presentation = presentTask(item);
|
|
206
|
+
return renderStatusLine(presentation.glyph.trim(), `${dim(context, presentation.label ?? "")}${color(context.theme.commandColor, presentation.text, true)}`, context, context.theme.commandColor, presentation.bold, true);
|
|
207
|
+
}
|
|
208
|
+
case "goal_agent_transition": {
|
|
209
|
+
const presentation = presentGoalAgentTransition(item);
|
|
210
|
+
return renderStatusLine(presentation.glyph.trim(), presentation.text, context, context.theme.secondary, presentation.bold);
|
|
211
|
+
}
|
|
212
|
+
case "goal_progress":
|
|
213
|
+
return renderGoalProgress(item, context);
|
|
214
|
+
case "error":
|
|
215
|
+
return renderError(item.headline, item.message, item.guidance, context);
|
|
216
|
+
case "info": {
|
|
217
|
+
const presentation = presentInfo(item);
|
|
218
|
+
return renderStatusLine(presentation.glyph.trim(), presentation.text, context, context.theme.commandColor, presentation.bold);
|
|
219
|
+
}
|
|
220
|
+
case "style_pack":
|
|
221
|
+
return renderStylePack(item.added, item.showSetupHint, context);
|
|
222
|
+
case "setup_hint":
|
|
223
|
+
return renderSetupHint(context);
|
|
224
|
+
case "update_notice":
|
|
225
|
+
return renderUpdateNotice(item.text, context);
|
|
226
|
+
case "compacting":
|
|
227
|
+
return renderCompacting(context);
|
|
228
|
+
case "compacted":
|
|
229
|
+
return renderCompacted(item.originalCount, item.newCount, item.tokensBefore, item.tokensAfter, context);
|
|
230
|
+
case "duration": {
|
|
231
|
+
const presentation = presentDuration(item);
|
|
232
|
+
return indent(dim(context, `${presentation.glyph}${presentation.text}`), RESPONSE_LEFT_PADDING);
|
|
233
|
+
}
|
|
234
|
+
case "session_summary":
|
|
235
|
+
return renderSessionSummary(item.summary, context);
|
|
236
|
+
case "plan_transition":
|
|
237
|
+
return renderPlanModeLogo(context);
|
|
238
|
+
case "model_transition": {
|
|
239
|
+
const presentation = presentModelTransition(item);
|
|
240
|
+
return renderStatusLine(presentation.glyph.trim(), `${dim(context, presentation.label ?? "")}${color(context.theme.commandColor, presentation.text, true)}`, context, context.theme.commandColor, presentation.bold, true);
|
|
241
|
+
}
|
|
242
|
+
case "theme_transition": {
|
|
243
|
+
const presentation = presentThemeTransition(item);
|
|
244
|
+
return renderStatusLine(presentation.glyph.trim(), `${dim(context, presentation.label ?? "")}${color(context.theme.commandColor, presentation.text, true)}`, context, context.theme.commandColor, presentation.bold, true);
|
|
245
|
+
}
|
|
246
|
+
case "plan_event": {
|
|
247
|
+
const presentation = presentPlanEvent(item);
|
|
248
|
+
return renderStatusLine(presentation.glyph.trim(), `${color(context.theme.commandColor, presentation.text, true)}${presentation.detail ? dim(context, presentation.detail) : ""}`, context, context.theme.commandColor, presentation.bold, true);
|
|
249
|
+
}
|
|
250
|
+
case "stopped": {
|
|
251
|
+
const presentation = presentStopped(item);
|
|
252
|
+
return renderStatusLine(presentation.glyph.trim(), presentation.text, context, context.theme.commandColor, presentation.bold);
|
|
253
|
+
}
|
|
254
|
+
case "step_done":
|
|
255
|
+
return renderStepDone(item.stepNum, item.description, context);
|
|
256
|
+
case "tombstone":
|
|
257
|
+
return "";
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function renderSessionSummary(summary, context) {
|
|
261
|
+
const cacheTokens = (summary.usage.cacheRead ?? 0) + (summary.usage.cacheWrite ?? 0);
|
|
262
|
+
const successRate = summary.tools.totalCalls > 0
|
|
263
|
+
? (summary.tools.totalSuccess / summary.tools.totalCalls) * 100
|
|
264
|
+
: null;
|
|
265
|
+
const topTools = Object.entries(summary.tools.byName)
|
|
266
|
+
.sort(([, a], [, b]) => b.calls - a.calls || b.durationMs - a.durationMs)
|
|
267
|
+
.slice(0, 5)
|
|
268
|
+
.map(([name, stats]) => `${name} ×${stats.calls}`)
|
|
269
|
+
.join(", ");
|
|
270
|
+
const lines = [
|
|
271
|
+
color(context.theme.secondary, summary.title, true),
|
|
272
|
+
"",
|
|
273
|
+
`${color(context.theme.text, "Session", true)}`,
|
|
274
|
+
summary.sessionId
|
|
275
|
+
? `${color(context.theme.link, "ID:")} ${dim(context, summary.sessionId)}`
|
|
276
|
+
: undefined,
|
|
277
|
+
`${color(context.theme.link, "Model:")} ${summary.provider}:${summary.model}`,
|
|
278
|
+
`${color(context.theme.link, "Directory:")} ${dim(context, summary.cwd)}`,
|
|
279
|
+
"",
|
|
280
|
+
`${color(context.theme.text, "Usage", true)}`,
|
|
281
|
+
`${color(context.theme.link, "Wall time:")} ${formatDuration(summary.wallDurationMs)}`,
|
|
282
|
+
`${color(context.theme.link, "Turns:")} ${summary.turns.toLocaleString()}`,
|
|
283
|
+
`${color(context.theme.link, "Tokens:")} ${summary.usage.inputTokens.toLocaleString()} in / ${summary.usage.outputTokens.toLocaleString()} out${cacheTokens > 0 ? dim(context, ` / ${cacheTokens.toLocaleString()} cache`) : ""}`,
|
|
284
|
+
"",
|
|
285
|
+
`${color(context.theme.text, "Work", true)}`,
|
|
286
|
+
`${color(context.theme.link, "Tool calls:")} ${summary.tools.totalCalls.toLocaleString()} (${color(context.theme.success, `✓ ${summary.tools.totalSuccess.toLocaleString()}`)} ${color(context.theme.error, `× ${summary.tools.totalFail.toLocaleString()}`)}${successRate == null ? "" : dim(context, ` · ${successRate.toFixed(1)}%`)})`,
|
|
287
|
+
`${color(context.theme.link, "Top tools:")} ${dim(context, topTools || "none")}`,
|
|
288
|
+
summary.linesChanged.added > 0 || summary.linesChanged.removed > 0
|
|
289
|
+
? `${color(context.theme.link, "Code changes:")} ${color(context.theme.success, `+${summary.linesChanged.added.toLocaleString()}`)} ${color(context.theme.error, `-${summary.linesChanged.removed.toLocaleString()}`)}`
|
|
290
|
+
: undefined,
|
|
291
|
+
summary.footer ? "" : undefined,
|
|
292
|
+
summary.footer ? dim(context, summary.footer) : undefined,
|
|
293
|
+
].filter((line) => line !== undefined);
|
|
294
|
+
return indent(lines.join("\n"), RESPONSE_LEFT_PADDING);
|
|
295
|
+
}
|
|
296
|
+
function renderBanner(context) {
|
|
297
|
+
const modelInfo = getModel(context.model);
|
|
298
|
+
const modelName = modelInfo?.name ?? context.model;
|
|
299
|
+
const home = process.env.HOME ?? "";
|
|
300
|
+
const displayPath = home && context.cwd.startsWith(home) ? `~${context.cwd.slice(home.length)}` : context.cwd;
|
|
301
|
+
const logo = LOGO_LINES.map((lineText) => gradientLine(lineText, GRADIENT));
|
|
302
|
+
const shortcuts = `${color(context.theme.primary, "Ctrl+T")} ${dim(context, "tasks · ")}${color(context.theme.primary, "Ctrl+S")} ${dim(context, "skills · ")}${color(context.theme.primary, "Shift+Tab")} ${dim(context, "toggle thinking")}`;
|
|
303
|
+
if (context.columns < SIDE_BY_SIDE_MIN) {
|
|
304
|
+
return block([
|
|
305
|
+
"",
|
|
306
|
+
...logo,
|
|
307
|
+
"",
|
|
308
|
+
`${color(context.theme.primary, "EZ Coder", true)}${dim(context, ` v${context.version}`)}`,
|
|
309
|
+
`${color(context.theme.secondary, modelName)} ${dim(context, truncatePlain(displayPath, context.columns))}`,
|
|
310
|
+
shortcuts,
|
|
311
|
+
"",
|
|
312
|
+
]);
|
|
313
|
+
}
|
|
314
|
+
return block([
|
|
315
|
+
"",
|
|
316
|
+
`${logo[0]}${GAP}${color(context.theme.primary, "EZ Coder", true)}${dim(context, ` v${context.version} · By `)}${color(context.theme.text, "Nolan Grout", true)}`,
|
|
317
|
+
`${logo[1]}${GAP}${color(context.theme.secondary, modelName)} ${dim(context, truncatePlain(displayPath, Math.max(10, context.columns - LOGO_WIDTH - GAP.length - stringWidth(modelName) - 2)))}`,
|
|
318
|
+
`${logo[2]}${GAP}${shortcuts}`,
|
|
319
|
+
"",
|
|
320
|
+
]);
|
|
321
|
+
}
|
|
322
|
+
function renderGoalProgress(item, context) {
|
|
323
|
+
const isError = item.status === "failed" || item.status === "fail" || item.status === "blocked";
|
|
324
|
+
const itemColor = isError
|
|
325
|
+
? context.theme.error
|
|
326
|
+
: item.phase === "worker_finished" || item.phase === "terminal"
|
|
327
|
+
? context.theme.success
|
|
328
|
+
: item.phase === "verifier_started" || item.phase === "verifier_finished"
|
|
329
|
+
? context.theme.accent
|
|
330
|
+
: item.phase === "orchestrator_reviewing" || item.phase === "orchestrator_working"
|
|
331
|
+
? context.theme.secondary
|
|
332
|
+
: item.phase === "continuing"
|
|
333
|
+
? context.theme.warning
|
|
334
|
+
: context.theme.primary;
|
|
335
|
+
const glyph = item.phase === "worker_finished" || item.phase === "verifier_finished"
|
|
336
|
+
? "✓"
|
|
337
|
+
: item.phase === "terminal"
|
|
338
|
+
? item.status === "passed"
|
|
339
|
+
? "◆"
|
|
340
|
+
: "!"
|
|
341
|
+
: "↻";
|
|
342
|
+
const lines = [
|
|
343
|
+
`${color(itemColor, `${glyph} ${item.title}`, true)}${item.workerId ? dim(context, ` · worker ${item.workerId}`) : ""}`,
|
|
344
|
+
item.detail ? dim(context, ` ${item.detail}`) : undefined,
|
|
345
|
+
...(item.summaryRows ?? []).map((row) => ` ${dim(context, row.label.padEnd(10))}${color(context.theme.text, row.value)}${row.detail ? dim(context, ` · ${row.detail}`) : ""}`),
|
|
346
|
+
...(item.summarySections ?? []).flatMap((section) => [
|
|
347
|
+
` ${dim(context, section.title)}`,
|
|
348
|
+
...section.lines.map((line) => ` ${color(context.theme.text, `• ${line}`)}`),
|
|
349
|
+
]),
|
|
350
|
+
].filter((line) => line !== undefined);
|
|
351
|
+
return indent(lines.join("\n"), RESPONSE_LEFT_PADDING);
|
|
352
|
+
}
|
|
353
|
+
function renderUser(text, imageCount, pasteInfo, context) {
|
|
354
|
+
const imageBadges = Array.from({ length: imageCount ?? 0 }, (_, index) => userChipSegment(`[Image #${index + 1}]`, context.theme.accent));
|
|
355
|
+
const userMessageText = context.theme.commandColor;
|
|
356
|
+
const separator = userChipSegment(" ", userMessageText);
|
|
357
|
+
const content = [
|
|
358
|
+
...getUserMessageDisplayParts(text, pasteInfo).map((part) => userChipSegment(part.text, part.kind === "paste" ? context.theme.textDim : userMessageText)),
|
|
359
|
+
...imageBadges,
|
|
360
|
+
]
|
|
361
|
+
.filter((part) => part.length > 0)
|
|
362
|
+
.join(separator);
|
|
363
|
+
const messageWidth = Math.max(10, context.columns);
|
|
364
|
+
const contentWidth = Math.max(1, messageWidth - USER_MESSAGE_HORIZONTAL_PADDING - USER_MESSAGE_PREFIX.length);
|
|
365
|
+
const wrapped = wrapAnsi(content || userChipSegment("(empty)", userMessageText), contentWidth, {
|
|
366
|
+
hard: true,
|
|
367
|
+
wordWrap: true,
|
|
368
|
+
});
|
|
369
|
+
const top = chalk.hex(USER_MESSAGE_BACKGROUND)(USER_MESSAGE_TOP_FILL.repeat(messageWidth));
|
|
370
|
+
const bottom = chalk.hex(USER_MESSAGE_BACKGROUND)(USER_MESSAGE_BOTTOM_FILL.repeat(messageWidth));
|
|
371
|
+
const rows = wrapped.split("\n").map((lineText, index) => {
|
|
372
|
+
const prefix = index === 0
|
|
373
|
+
? userChipSegment(USER_MESSAGE_PREFIX, userMessageText, true)
|
|
374
|
+
: userChipSegment(" ".repeat(USER_MESSAGE_PREFIX.length), userMessageText);
|
|
375
|
+
const line = `${userChipSegment(" ", userMessageText)}${prefix}${lineText}`;
|
|
376
|
+
const fillWidth = Math.max(0, messageWidth - stringWidth(stripAnsi(line)));
|
|
377
|
+
return `${line}${userChipSegment(" ".repeat(fillWidth), userMessageText)}`;
|
|
378
|
+
});
|
|
379
|
+
return [top, ...rows, bottom].join("\n");
|
|
380
|
+
}
|
|
381
|
+
function renderQueued(text, imageCount, context) {
|
|
382
|
+
const presentation = presentQueued({ kind: "queued", text, imageCount, id: "history-queued" });
|
|
383
|
+
return prefixFirstLine(wrapPlain(`${dim(context, presentation.label)}${color(context.theme.text, presentation.text)}${color(context.theme.text, presentation.suffix)}`, context.columns - 4), ` ${color(context.theme.warning, presentation.glyph.trim(), true)} `, " ");
|
|
384
|
+
}
|
|
385
|
+
function renderAssistant(text, context, continuation = false) {
|
|
386
|
+
const lines = [];
|
|
387
|
+
const body = renderMarkdownToAnsiLines({
|
|
388
|
+
text,
|
|
389
|
+
theme: context.theme,
|
|
390
|
+
width: Math.max(10, context.columns - 4),
|
|
391
|
+
})
|
|
392
|
+
.join("\n")
|
|
393
|
+
.replace(/^\n+|\n+$/g, "");
|
|
394
|
+
if (body.length > 0) {
|
|
395
|
+
lines.push(continuation
|
|
396
|
+
? indent(body, " ")
|
|
397
|
+
: prefixFirstLine(body, ` ${color(context.theme.primary, BLACK_CIRCLE)} `, " "));
|
|
398
|
+
}
|
|
399
|
+
return lines.join("\n");
|
|
400
|
+
}
|
|
401
|
+
function renderIdealHook(text, tone, context) {
|
|
402
|
+
// Same dot prefix + indent as an assistant row, but in the tone's color
|
|
403
|
+
// (bold) so each agent hook visibly stands apart from normal output and
|
|
404
|
+
// from the other hooks.
|
|
405
|
+
const toneColor = context.theme[HOOK_TONE_COLOR[tone]];
|
|
406
|
+
const body = color(toneColor, text, true);
|
|
407
|
+
return prefixFirstLine(body, ` ${color(toneColor, BLACK_CIRCLE)} `, " ");
|
|
408
|
+
}
|
|
409
|
+
function renderPlanModeLogo(_context) {
|
|
410
|
+
return PLAN_MODE_LOGO.map((line) => ` ${gradientLine(line, PLAN_MODE_GRADIENT)}`).join("\n");
|
|
411
|
+
}
|
|
412
|
+
function renderToolStart(name, args, progressOutput, context) {
|
|
413
|
+
if (SERVER_STYLE_TOOLS.has(name)) {
|
|
414
|
+
const { label, detail } = getToolHeaderParts(name, args);
|
|
415
|
+
return block([
|
|
416
|
+
toolHeader("running", label, detail, context, { quoteDetail: true }),
|
|
417
|
+
...messageResponse([dim(context, "Searching...")], context),
|
|
418
|
+
]);
|
|
419
|
+
}
|
|
420
|
+
if (COMPACT_TOOLS.has(name)) {
|
|
421
|
+
return toolHeader("running", getCompactRunningLabel(name, args), "", context);
|
|
422
|
+
}
|
|
423
|
+
if (STATE_TOOLS.has(name)) {
|
|
424
|
+
const { label, detail } = getToolHeaderParts(name, args);
|
|
425
|
+
return stateToolHeader("running", label, detail, "", context);
|
|
426
|
+
}
|
|
427
|
+
const { label, detail } = getToolHeaderParts(name, args);
|
|
428
|
+
const header = toolHeader("running", label, detail, context);
|
|
429
|
+
if (name !== "bash" || !progressOutput?.trim())
|
|
430
|
+
return header;
|
|
431
|
+
return block([
|
|
432
|
+
header,
|
|
433
|
+
...messageResponse(outputPreview(progressOutput, context, context.theme.textMuted, { tail: true }), context),
|
|
434
|
+
]);
|
|
435
|
+
}
|
|
436
|
+
function renderToolDone(name, args, result, isError, durationMs, context) {
|
|
437
|
+
if (SERVER_STYLE_TOOLS.has(name)) {
|
|
438
|
+
return renderServerStyleToolDone(name, args, result, isError, context);
|
|
439
|
+
}
|
|
440
|
+
if (COMPACT_TOOLS.has(name) && !isError) {
|
|
441
|
+
return toolHeader("done", getCompactDoneLabel(name, args, result), "", context);
|
|
442
|
+
}
|
|
443
|
+
// Screenshot collapses to a single header line, e.g. `Screenshot (image/png)`.
|
|
444
|
+
// The inline image is appended separately by the printer; the multi-line
|
|
445
|
+
// "Captured …" text would be redundant above it.
|
|
446
|
+
if (name === "screenshot" && !isError) {
|
|
447
|
+
const mediaType = result.match(/\[(image\/[a-z0-9.+-]+)\]/i)?.[1] ?? "image";
|
|
448
|
+
return toolHeader("done", "Screenshot", mediaType, context);
|
|
449
|
+
}
|
|
450
|
+
if (STATE_TOOLS.has(name)) {
|
|
451
|
+
const { label, detail } = getToolHeaderParts(name, args);
|
|
452
|
+
return stateToolHeader(isError ? "error" : "done", label, detail, getInlineSummary(name, result, isError), context);
|
|
453
|
+
}
|
|
454
|
+
const { label, detail } = getToolHeaderParts(name, args);
|
|
455
|
+
const inline = getInlineSummary(name, result, isError);
|
|
456
|
+
const suffix = inline.length > 0 && toolResultPreview(name, result, isError, context).length === 0
|
|
457
|
+
? inline
|
|
458
|
+
: "";
|
|
459
|
+
const header = toolHeader(isError ? "error" : "done", label, detail, context, { suffix });
|
|
460
|
+
const preview = toolResultPreview(name, result, isError, context);
|
|
461
|
+
if (name === "edit" && !isError) {
|
|
462
|
+
const diff = extractDiff(result);
|
|
463
|
+
if (diff)
|
|
464
|
+
return block([header, ...messageResponse(renderDiffPreview(diff, args, context), context)]);
|
|
465
|
+
}
|
|
466
|
+
return block(preview.length > 0 ? [header, ...messageResponse(preview, context)] : [header]);
|
|
467
|
+
}
|
|
468
|
+
function renderToolGroup(tools, context) {
|
|
469
|
+
const allDone = tools.every((tool) => tool.status === "done");
|
|
470
|
+
const hasError = tools.some((tool) => tool.isError);
|
|
471
|
+
const status = allDone ? (hasError ? "error" : "done") : "running";
|
|
472
|
+
return toolHeader(status, renderSummarySegments(buildToolGroupSummary(tools, allDone), context), "", context, {
|
|
473
|
+
labelAlreadyStyled: true,
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
function renderServerToolStart(name, input, context) {
|
|
477
|
+
const { label, detail } = getServerToolHeaderParts(name, input);
|
|
478
|
+
return block([
|
|
479
|
+
toolHeader("running", label, detail, context, { quoteDetail: true }),
|
|
480
|
+
...messageResponse([dim(context, "Searching...")], context),
|
|
481
|
+
]);
|
|
482
|
+
}
|
|
483
|
+
function renderServerToolDone(name, input, resultType, durationMs, context) {
|
|
484
|
+
const { label, detail } = getServerToolHeaderParts(name, input);
|
|
485
|
+
const isAborted = resultType === "aborted";
|
|
486
|
+
const summary = isAborted ? "Stopped." : `Did 1 search in ${Math.round(durationMs / 1000)}s`;
|
|
487
|
+
return block([
|
|
488
|
+
toolHeader(isAborted ? "error" : "done", label, detail, context, { quoteDetail: true }),
|
|
489
|
+
...messageResponse([dim(context, summary)], context),
|
|
490
|
+
]);
|
|
491
|
+
}
|
|
492
|
+
function renderSubAgentGroup(agents, aborted, context) {
|
|
493
|
+
if (agents.length === 0)
|
|
494
|
+
return "";
|
|
495
|
+
const runningCount = agents.filter((agent) => agent.status === "running").length;
|
|
496
|
+
const allDone = runningCount === 0;
|
|
497
|
+
const headerText = aborted
|
|
498
|
+
? `${agents.length} agent${agents.length !== 1 ? "s" : ""} interrupted`
|
|
499
|
+
: allDone
|
|
500
|
+
? `${agents.length} agent${agents.length !== 1 ? "s" : ""} completed`
|
|
501
|
+
: `${agents.length} agent${agents.length !== 1 ? "s" : ""} launched`;
|
|
502
|
+
const lines = [
|
|
503
|
+
toolHeader(aborted ? "error" : allDone ? "done" : "running", headerText, "", context),
|
|
504
|
+
];
|
|
505
|
+
agents.forEach((agent, index) => {
|
|
506
|
+
lines.push(...renderSubAgentRows(agent, index === agents.length - 1, aborted === true, context));
|
|
507
|
+
});
|
|
508
|
+
return block(lines);
|
|
509
|
+
}
|
|
510
|
+
function renderServerStyleToolDone(name, args, result, isError, context) {
|
|
511
|
+
const { label, detail } = getToolHeaderParts(name, args);
|
|
512
|
+
const searchCount = (result.match(/^\d+\./gm) ?? []).length;
|
|
513
|
+
const summaryText = isError
|
|
514
|
+
? (result.split("\n")[0] ?? "")
|
|
515
|
+
: `${searchCount} result${searchCount !== 1 ? "s" : ""}`;
|
|
516
|
+
return block([
|
|
517
|
+
toolHeader(isError ? "error" : "done", label, detail, context, { quoteDetail: true }),
|
|
518
|
+
...messageResponse([dim(context, summaryText)], context),
|
|
519
|
+
]);
|
|
520
|
+
}
|
|
521
|
+
function renderSubAgentRows(agent, isLast, aborted, context) {
|
|
522
|
+
const branch = isLast ? "└─" : "├─";
|
|
523
|
+
const continuation = isLast ? " " : "│ ";
|
|
524
|
+
const isRunning = agent.status === "running" && !aborted;
|
|
525
|
+
const firstLine = agent.task.split("\n")[0]?.replace(/\*\*/g, "") ?? "";
|
|
526
|
+
const taskDisplay = firstLine.length > 60 ? `${firstLine.slice(0, 57)}…` : firstLine;
|
|
527
|
+
const taskPrefix = agent.status === "done"
|
|
528
|
+
? color(context.theme.success, "✓ ", true)
|
|
529
|
+
: agent.status === "error"
|
|
530
|
+
? color(context.theme.error, "✗ ", true)
|
|
531
|
+
: "";
|
|
532
|
+
const taskLine = `${dim(context, ` ${branch.padEnd(3)}`)}${taskPrefix}${color(agent.status === "done" ? context.theme.success : context.theme.text, taskDisplay, isRunning)}`;
|
|
533
|
+
const totalTokens = agent.tokenUsage ? agent.tokenUsage.input + agent.tokenUsage.output : 0;
|
|
534
|
+
let detail;
|
|
535
|
+
if (isRunning) {
|
|
536
|
+
detail = `${color(context.theme.primary, "· ")}${dim(context, agent.currentActivity ?? "Starting…")}`;
|
|
537
|
+
}
|
|
538
|
+
else if (agent.status === "done") {
|
|
539
|
+
detail = dim(context, `${formatCompactTokens(totalTokens)} tokens${agent.durationMs != null ? ` · ${formatDuration(agent.durationMs)}` : ""}`);
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
detail = color(context.theme.error, `${agent.status === "aborted" || aborted ? "Interrupted" : "Failed"}${agent.durationMs != null ? ` · ${formatDuration(agent.durationMs)}` : ""}`);
|
|
543
|
+
}
|
|
544
|
+
return [taskLine, `${dim(context, ` ${continuation}${RETURN_SYMBOL} `)}${detail}`];
|
|
545
|
+
}
|
|
546
|
+
function toolResultPreview(name, result, isError, context) {
|
|
547
|
+
if (isError)
|
|
548
|
+
return outputPreview(result, context, context.theme.error);
|
|
549
|
+
if (["read", "write", "skill", "web_fetch", "source_path", "task_stop"].includes(name))
|
|
550
|
+
return [];
|
|
551
|
+
if (name === "edit" && extractDiff(result))
|
|
552
|
+
return [];
|
|
553
|
+
const lines = result.split("\n").filter((lineText) => lineText.length > 0);
|
|
554
|
+
if (name === "bash" && /^Exit code:/.test(lines[0] ?? ""))
|
|
555
|
+
lines.shift();
|
|
556
|
+
if (lines.length === 0 || result === "No matches found.")
|
|
557
|
+
return [];
|
|
558
|
+
return outputPreview(lines.join("\n"), context, name === "bash" && getBashExitCode(result) !== "0"
|
|
559
|
+
? context.theme.warning
|
|
560
|
+
: context.theme.textMuted);
|
|
561
|
+
}
|
|
562
|
+
function outputPreview(text, context, colorHex, options = {}) {
|
|
563
|
+
const lines = text.split("\n").filter((lineText) => lineText.length > 0);
|
|
564
|
+
const selected = options.tail ? lines.slice(-3) : lines.slice(0, MAX_OUTPUT_LINES);
|
|
565
|
+
const display = selected.map((lineText) => {
|
|
566
|
+
const wrapped = wrapPlain(truncatePlain(lineText, context.columns - 8), context.columns - 8);
|
|
567
|
+
return color(colorHex, wrapped);
|
|
568
|
+
});
|
|
569
|
+
if (lines.length > MAX_OUTPUT_LINES) {
|
|
570
|
+
display.push(dim(context, `… +${lines.length - MAX_OUTPUT_LINES} line${lines.length - MAX_OUTPUT_LINES === 1 ? "" : "s"}`));
|
|
571
|
+
}
|
|
572
|
+
return display;
|
|
573
|
+
}
|
|
574
|
+
function toolHeader(status, label, detail, context, options = {}) {
|
|
575
|
+
const dotColor = options.dotColor ??
|
|
576
|
+
(status === "error"
|
|
577
|
+
? context.theme.error
|
|
578
|
+
: status === "done"
|
|
579
|
+
? context.theme.success
|
|
580
|
+
: context.theme.spinnerColor);
|
|
581
|
+
const indicator = options.indicator ?? (status === "running" ? SPINNER_FRAMES[0] : BLACK_CIRCLE);
|
|
582
|
+
const labelColor = status === "error"
|
|
583
|
+
? context.theme.error
|
|
584
|
+
: status === "done"
|
|
585
|
+
? context.theme.success
|
|
586
|
+
: context.theme.toolName;
|
|
587
|
+
const detailText = detail
|
|
588
|
+
? color(context.theme.text, options.quoteDetail ? `(${dim(context, '"')}${detail}${dim(context, '"')})` : `(${detail})`)
|
|
589
|
+
: "";
|
|
590
|
+
const suffixText = options.suffix ? dim(context, ` ${options.suffix}`) : "";
|
|
591
|
+
const labelText = options.labelAlreadyStyled ? label : color(labelColor, label, true);
|
|
592
|
+
return `${RESPONSE_LEFT_PADDING}${color(dotColor, indicator)} ${labelText}${detailText}${suffixText}`;
|
|
593
|
+
}
|
|
594
|
+
function renderSummarySegments(segments, context) {
|
|
595
|
+
return segments
|
|
596
|
+
.map((segment) => segment.tone
|
|
597
|
+
? color(toolTonePalette(context.theme, segment.tone).primary, segment.text, segment.bold)
|
|
598
|
+
: color(context.theme.text, segment.text, segment.bold))
|
|
599
|
+
.join("");
|
|
600
|
+
}
|
|
601
|
+
function stateToolHeader(status, label, detail, inline, context) {
|
|
602
|
+
const suffix = [detail, inline ? `· ${inline}` : ""]
|
|
603
|
+
.filter((value) => value.length > 0)
|
|
604
|
+
.join(" ");
|
|
605
|
+
return `${toolHeader(status, label, "", context)}${suffix ? dim(context, ` ${suffix}`) : ""}`;
|
|
606
|
+
}
|
|
607
|
+
function messageResponse(lines, context) {
|
|
608
|
+
if (lines.length === 0)
|
|
609
|
+
return [];
|
|
610
|
+
const [first, ...rest] = lines;
|
|
611
|
+
return [
|
|
612
|
+
`${RESPONSE_LEFT_PADDING}${dim(context, ` ${RETURN_SYMBOL} `)}${first}`,
|
|
613
|
+
...rest.map((lineText) => `${RESPONSE_LEFT_PADDING}${dim(context, " ")}${lineText}`),
|
|
614
|
+
];
|
|
615
|
+
}
|
|
616
|
+
function prefixFirstLine(text, firstPrefix, nextPrefix) {
|
|
617
|
+
return text
|
|
618
|
+
.split("\n")
|
|
619
|
+
.map((lineText, index) => {
|
|
620
|
+
if (lineText.length === 0)
|
|
621
|
+
return "";
|
|
622
|
+
return `${index === 0 ? firstPrefix : nextPrefix}${lineText}`;
|
|
623
|
+
})
|
|
624
|
+
.join("\n");
|
|
625
|
+
}
|
|
626
|
+
function getToolHeaderParts(name, args) {
|
|
627
|
+
const displayName = toolDisplayName(name);
|
|
628
|
+
switch (name) {
|
|
629
|
+
case "bash": {
|
|
630
|
+
const command = String(args.command ?? "");
|
|
631
|
+
const firstLine = command.split("\n")[0] ?? "";
|
|
632
|
+
const detail = firstLine.length > 60 ? `${firstLine.slice(0, 57)}…` : firstLine;
|
|
633
|
+
return { label: displayName, detail: command.includes("\n") ? `${detail} …` : detail };
|
|
634
|
+
}
|
|
635
|
+
case "edit":
|
|
636
|
+
case "write":
|
|
637
|
+
return { label: displayName, detail: shortenPath(String(args.file_path ?? "")) };
|
|
638
|
+
case "read":
|
|
639
|
+
return { label: "Read", detail: shortenPath(String(args.file_path ?? "")) };
|
|
640
|
+
case "grep":
|
|
641
|
+
case "find": {
|
|
642
|
+
const pattern = String(args.pattern ?? "");
|
|
643
|
+
return {
|
|
644
|
+
label: displayName,
|
|
645
|
+
detail: pattern.length > 40 ? `${pattern.slice(0, 37)}…` : pattern,
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
case "ls":
|
|
649
|
+
return { label: displayName, detail: shortenPath(String(args.path ?? ".")) };
|
|
650
|
+
case "subagent": {
|
|
651
|
+
const task = String(args.task ?? "");
|
|
652
|
+
return { label: displayName, detail: task.length > 50 ? `${task.slice(0, 47)}…` : task };
|
|
653
|
+
}
|
|
654
|
+
case "skill":
|
|
655
|
+
return { label: displayName, detail: String(args.skill ?? "") };
|
|
656
|
+
case "task_output":
|
|
657
|
+
case "task_stop":
|
|
658
|
+
return { label: displayName, detail: String(args.id ?? "") };
|
|
659
|
+
case "web_search": {
|
|
660
|
+
const query = String(args.query ?? "");
|
|
661
|
+
return { label: "Web Search", detail: query.length > 60 ? `${query.slice(0, 57)}…` : query };
|
|
662
|
+
}
|
|
663
|
+
case "source_path": {
|
|
664
|
+
const packageName = String(args.package ?? "");
|
|
665
|
+
return {
|
|
666
|
+
label: displayName,
|
|
667
|
+
detail: packageName.length > 60 ? `${packageName.slice(0, 57)}…` : packageName,
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
case "web_fetch": {
|
|
671
|
+
const url = String(args.url ?? "");
|
|
672
|
+
return { label: displayName, detail: url.length > 60 ? `${url.slice(0, 57)}…` : url };
|
|
673
|
+
}
|
|
674
|
+
case "tasks":
|
|
675
|
+
return { label: displayName, detail: String(args.action ?? "") };
|
|
676
|
+
default:
|
|
677
|
+
return { label: displayName, detail: name.startsWith("mcp__") ? getMCPDetailArg(args) : "" };
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
function toolDisplayName(name) {
|
|
681
|
+
if (name.startsWith("mcp__")) {
|
|
682
|
+
const parts = name.split("__");
|
|
683
|
+
return snakeToTitle(parts[2] ?? parts[1] ?? "mcp");
|
|
684
|
+
}
|
|
685
|
+
switch (name) {
|
|
686
|
+
case "bash":
|
|
687
|
+
return "Bash";
|
|
688
|
+
case "read":
|
|
689
|
+
return "Read";
|
|
690
|
+
case "write":
|
|
691
|
+
return "Write";
|
|
692
|
+
case "edit":
|
|
693
|
+
return "Update";
|
|
694
|
+
case "grep":
|
|
695
|
+
return "Search";
|
|
696
|
+
case "find":
|
|
697
|
+
return "Find";
|
|
698
|
+
case "ls":
|
|
699
|
+
return "List";
|
|
700
|
+
case "subagent":
|
|
701
|
+
return "Agent";
|
|
702
|
+
case "skill":
|
|
703
|
+
return "Skill";
|
|
704
|
+
case "web_fetch":
|
|
705
|
+
return "Fetch";
|
|
706
|
+
case "web_search":
|
|
707
|
+
return "Web Search";
|
|
708
|
+
case "task_output":
|
|
709
|
+
return "Task Output";
|
|
710
|
+
case "task_stop":
|
|
711
|
+
return "Task Stop";
|
|
712
|
+
case "source_path":
|
|
713
|
+
return "Source";
|
|
714
|
+
case "tasks":
|
|
715
|
+
return "Task";
|
|
716
|
+
default:
|
|
717
|
+
return snakeToTitle(name);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
function snakeToTitle(value) {
|
|
721
|
+
return value
|
|
722
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1_$2")
|
|
723
|
+
.split("_")
|
|
724
|
+
.filter((word) => word.length > 0)
|
|
725
|
+
.map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1).toLowerCase()}`)
|
|
726
|
+
.join(" ");
|
|
727
|
+
}
|
|
728
|
+
function getMCPDetailArg(args) {
|
|
729
|
+
const entries = Object.entries(args).filter(([, value]) => value !== undefined && value !== null && value !== "");
|
|
730
|
+
if (entries.length === 0)
|
|
731
|
+
return "";
|
|
732
|
+
const preferred = ["query", "prompt", "url", "path", "pattern", "name", "command", "repo"];
|
|
733
|
+
const preferredEntry = preferred
|
|
734
|
+
.map((key) => entries.find(([entryKey]) => entryKey.toLowerCase() === key))
|
|
735
|
+
.find((entry) => entry !== undefined);
|
|
736
|
+
const best = preferredEntry ??
|
|
737
|
+
entries
|
|
738
|
+
.filter(([, value]) => typeof value === "string")
|
|
739
|
+
.sort((a, b) => String(a[1]).length - String(b[1]).length)[0] ??
|
|
740
|
+
entries[0];
|
|
741
|
+
const value = String(best?.[1] ?? "");
|
|
742
|
+
return value.length > 50 ? `${value.slice(0, 47)}…` : value;
|
|
743
|
+
}
|
|
744
|
+
function getCompactRunningLabel(name, args) {
|
|
745
|
+
switch (name) {
|
|
746
|
+
case "grep":
|
|
747
|
+
return "Searching…";
|
|
748
|
+
case "read":
|
|
749
|
+
return "Reading…";
|
|
750
|
+
case "find":
|
|
751
|
+
return "Finding files…";
|
|
752
|
+
case "ls":
|
|
753
|
+
return "Listing…";
|
|
754
|
+
case "source_path": {
|
|
755
|
+
const packageName = String(args.package ?? "");
|
|
756
|
+
return `Resolving source${packageName ? ` for ${packageName}` : ""}…`;
|
|
757
|
+
}
|
|
758
|
+
default:
|
|
759
|
+
return `${name}…`;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
function getCompactDoneLabel(name, args, result) {
|
|
763
|
+
switch (name) {
|
|
764
|
+
case "grep": {
|
|
765
|
+
const lines = result.split("\n").filter((lineText) => lineText.length > 0);
|
|
766
|
+
const matchCount = lines.filter((lineText) => !/^\d+ match|^\[Truncated/.test(lineText)).length;
|
|
767
|
+
return `Searched for 1 pattern${matchCount > 0 ? ` (${matchCount} match${matchCount !== 1 ? "es" : ""})` : ""}`;
|
|
768
|
+
}
|
|
769
|
+
case "read":
|
|
770
|
+
return `Read ${shortenPath(String(args.file_path ?? ""))}`;
|
|
771
|
+
case "find": {
|
|
772
|
+
const lines = result.split("\n").filter((lineText) => lineText.length > 0);
|
|
773
|
+
return `Found ${lines.length} file${lines.length !== 1 ? "s" : ""}`;
|
|
774
|
+
}
|
|
775
|
+
case "ls": {
|
|
776
|
+
const lines = result.split("\n").filter((lineText) => lineText.length > 0);
|
|
777
|
+
return `Listed ${lines.length} item${lines.length !== 1 ? "s" : ""}`;
|
|
778
|
+
}
|
|
779
|
+
case "source_path": {
|
|
780
|
+
const packageName = String(args.package ?? "source");
|
|
781
|
+
const sourcePath = extractSourcePath(result);
|
|
782
|
+
return `Resolved ${packageName} → ${sourcePath ? shortenPath(sourcePath) : "source path"}`;
|
|
783
|
+
}
|
|
784
|
+
default:
|
|
785
|
+
return name;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
function getInlineSummary(name, result, isError) {
|
|
789
|
+
if (isError) {
|
|
790
|
+
const firstLine = result.split("\n")[0] ?? "";
|
|
791
|
+
return firstLine.length > 60 ? `${firstLine.slice(0, 57)}…` : firstLine;
|
|
792
|
+
}
|
|
793
|
+
switch (name) {
|
|
794
|
+
case "read": {
|
|
795
|
+
const lines = result.split("\n").filter((lineText) => lineText.length > 0);
|
|
796
|
+
return `${lines.length} line${lines.length !== 1 ? "s" : ""}`;
|
|
797
|
+
}
|
|
798
|
+
case "write":
|
|
799
|
+
return result.match(/^Wrote \d+ lines?/)?.[0] ?? result.split("\n")[0] ?? "";
|
|
800
|
+
case "bash": {
|
|
801
|
+
const exitCode = result.match(/^Exit code: (.+)/)?.[1];
|
|
802
|
+
return exitCode ? `exit ${exitCode}` : "done";
|
|
803
|
+
}
|
|
804
|
+
case "subagent":
|
|
805
|
+
return "completed";
|
|
806
|
+
case "skill":
|
|
807
|
+
return result.startsWith("Error") ? (result.split("\n")[0] ?? "") : "loaded";
|
|
808
|
+
case "web_fetch": {
|
|
809
|
+
if (result.startsWith("Error"))
|
|
810
|
+
return result.split("\n")[0] ?? "";
|
|
811
|
+
const lines = result.split("\n").filter((lineText) => lineText.length > 0);
|
|
812
|
+
return `${lines.length} line${lines.length !== 1 ? "s" : ""}`;
|
|
813
|
+
}
|
|
814
|
+
case "source_path":
|
|
815
|
+
return extractSourcePath(result) ? shortenPath(extractSourcePath(result) ?? "") : "resolved";
|
|
816
|
+
case "task_stop":
|
|
817
|
+
return result.split("\n")[0] ?? "stopped";
|
|
818
|
+
case "tasks": {
|
|
819
|
+
const quoted = result.match(/"([^"]+)"/)?.[1];
|
|
820
|
+
if (quoted)
|
|
821
|
+
return quoted.length > 50 ? `${quoted.slice(0, 47)}…` : quoted;
|
|
822
|
+
const firstLine = result.split("\n")[0] ?? "";
|
|
823
|
+
return firstLine.length > 60 ? `${firstLine.slice(0, 57)}…` : firstLine;
|
|
824
|
+
}
|
|
825
|
+
default: {
|
|
826
|
+
if (!name.startsWith("mcp__"))
|
|
827
|
+
return "";
|
|
828
|
+
const lines = result.split("\n").filter((lineText) => lineText.length > 0);
|
|
829
|
+
if (lines.length === 0)
|
|
830
|
+
return "no results";
|
|
831
|
+
const first = lines[0] ?? "";
|
|
832
|
+
return lines.length === 1
|
|
833
|
+
? first.length > 50
|
|
834
|
+
? `${first.slice(0, 47)}…`
|
|
835
|
+
: first
|
|
836
|
+
: `${lines.length} lines`;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
function shortenPath(filePath) {
|
|
841
|
+
const parts = filePath.split("/");
|
|
842
|
+
if (parts.length <= 3)
|
|
843
|
+
return filePath;
|
|
844
|
+
return `…/${parts.slice(-2).join("/")}`;
|
|
845
|
+
}
|
|
846
|
+
function extractSourcePath(result) {
|
|
847
|
+
return result.match(/^Source path:\s*(.+)$/m)?.[1]?.trim();
|
|
848
|
+
}
|
|
849
|
+
function getServerToolHeaderParts(name, input) {
|
|
850
|
+
const values = input && typeof input === "object" ? input : {};
|
|
851
|
+
if (name === "web_search") {
|
|
852
|
+
const query = String(values.query ?? "");
|
|
853
|
+
return { label: "Web Search", detail: query.length > 60 ? `${query.slice(0, 57)}…` : query };
|
|
854
|
+
}
|
|
855
|
+
return { label: name, detail: "" };
|
|
856
|
+
}
|
|
857
|
+
function getBashExitCode(result) {
|
|
858
|
+
return result.match(/^Exit code: (.+)/)?.[1]?.trim() ?? "0";
|
|
859
|
+
}
|
|
860
|
+
function extractDiff(result) {
|
|
861
|
+
return result.includes("---") && result.includes("+++") ? result : undefined;
|
|
862
|
+
}
|
|
863
|
+
function renderDiffPreview(diff, args, context) {
|
|
864
|
+
const added = (diff.match(/^\+[^+]/gm) ?? []).length;
|
|
865
|
+
const removed = (diff.match(/^-[^-]/gm) ?? []).length;
|
|
866
|
+
const lines = [
|
|
867
|
+
dim(context, `Added ${added} line${added !== 1 ? "s" : ""}, removed ${removed} line${removed !== 1 ? "s" : ""}`),
|
|
868
|
+
];
|
|
869
|
+
const diffLines = buildDiffLines(diff, String(args.file_path ?? ""), context);
|
|
870
|
+
if (diffLines.length > 0) {
|
|
871
|
+
lines.push(dim(context, "────────────────────────────────────────────────────────────────"));
|
|
872
|
+
lines.push(...diffLines);
|
|
873
|
+
lines.push(dim(context, "────────────────────────────────────────────────────────────────"));
|
|
874
|
+
}
|
|
875
|
+
const hiddenCount = Math.max(0, countDisplayDiffLines(diff) + 1 - (diffLines.length + 1));
|
|
876
|
+
if (hiddenCount > 0)
|
|
877
|
+
lines.push(dim(context, `… +${hiddenCount} lines`));
|
|
878
|
+
return lines;
|
|
879
|
+
}
|
|
880
|
+
function countDisplayDiffLines(diff) {
|
|
881
|
+
return diff
|
|
882
|
+
.split("\n")
|
|
883
|
+
.filter((lineText) => !lineText.startsWith("---") && !lineText.startsWith("+++") && !lineText.startsWith("@@")).length;
|
|
884
|
+
}
|
|
885
|
+
function buildDiffLines(diff, filePath, context) {
|
|
886
|
+
const lang = langFromFilePath(filePath);
|
|
887
|
+
const displayLines = diff
|
|
888
|
+
.split("\n")
|
|
889
|
+
.filter((lineText) => !lineText.startsWith("---") && !lineText.startsWith("+++") && !lineText.startsWith("@@"))
|
|
890
|
+
.slice(0, MAX_OUTPUT_LINES);
|
|
891
|
+
return displayLines.map((lineText, index) => {
|
|
892
|
+
const marker = lineText[0] === "+" || lineText[0] === "-" ? lineText[0] : " ";
|
|
893
|
+
const content = truncatePlain(lineText.slice(marker === " " ? 0 : 1), Math.max(10, context.columns - 12));
|
|
894
|
+
const lineNo = String(index + 1).padStart(2, " ");
|
|
895
|
+
if (marker === "+")
|
|
896
|
+
return chalk.bgHex("#16a34a").hex("#ffffff")(`${lineNo} + ${content}`);
|
|
897
|
+
if (marker === "-")
|
|
898
|
+
return chalk.bgHex("#dc2626").hex("#ffffff")(`${lineNo} - ${content}`);
|
|
899
|
+
return `${color(context.theme.textDim, `${lineNo} `)}${colorCode(content, lang, context)}`;
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
function langFromFilePath(filePath) {
|
|
903
|
+
if (/\.tsx?$/.test(filePath))
|
|
904
|
+
return "ts";
|
|
905
|
+
if (/\.jsx?$/.test(filePath))
|
|
906
|
+
return "js";
|
|
907
|
+
if (/\.json$/.test(filePath))
|
|
908
|
+
return "json";
|
|
909
|
+
return "text";
|
|
910
|
+
}
|
|
911
|
+
function colorCode(text, lang, context) {
|
|
912
|
+
if (lang === "text")
|
|
913
|
+
return color(context.theme.text, text);
|
|
914
|
+
return color(context.theme.text, text);
|
|
915
|
+
}
|
|
916
|
+
//# sourceMappingURL=terminal-history.js.map
|