@prestyj/cli 4.3.209 → 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 -724
- 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 -1
- package/dist/tools/enter-plan.d.ts.map +1 -1
- package/dist/tools/enter-plan.js +8 -11
- 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 +16 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +11 -7
- 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 -221
- 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 +32 -11
- 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 -272
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +1606 -2199
- 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 -34
- package/dist/ui/render.d.ts.map +1 -1
- package/dist/ui/render.js +128 -41
- 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
package/dist/cli.js
CHANGED
|
@@ -41,18 +41,17 @@ import { PerformanceObserver, performance } from "node:perf_hooks";
|
|
|
41
41
|
}
|
|
42
42
|
}).observe({ entryTypes: allTypes });
|
|
43
43
|
}
|
|
44
|
+
import { fileURLToPath } from "node:url";
|
|
44
45
|
import { parseArgs } from "node:util";
|
|
45
46
|
import fs from "node:fs";
|
|
46
47
|
import readline from "node:readline/promises";
|
|
47
|
-
import { execFile, spawnSync } from "node:child_process";
|
|
48
|
-
import { createRequire } from "node:module";
|
|
49
48
|
import { renderApp } from "./ui/render.js";
|
|
50
49
|
import { runJsonMode } from "./modes/json-mode.js";
|
|
51
50
|
import { runRpcMode } from "./modes/rpc-mode.js";
|
|
52
51
|
import { runServeMode } from "./modes/serve-mode.js";
|
|
53
52
|
import { runAgentHomeMode } from "./modes/agent-home-mode.js";
|
|
54
|
-
import { renderLoginSelector } from "./ui/login.js";
|
|
55
53
|
import { renderSessionSelector } from "./ui/sessions.js";
|
|
54
|
+
import { segmentDisplayText, stripDoneMarkers } from "./utils/plan-steps.js";
|
|
56
55
|
import { formatUserError } from "./utils/error-handler.js";
|
|
57
56
|
import { AuthStorage } from "./core/auth-storage.js";
|
|
58
57
|
import { SessionManager } from "./core/session-manager.js";
|
|
@@ -61,59 +60,31 @@ import { initLogger, log, closeLogger } from "./core/logger.js";
|
|
|
61
60
|
import { setStreamDiagnostic } from "@prestyj/agent";
|
|
62
61
|
import { setProviderDiagnostic } from "@prestyj/ai";
|
|
63
62
|
import { buildSystemPrompt } from "./system-prompt.js";
|
|
64
|
-
import {
|
|
63
|
+
import { PROMPT_COMMANDS } from "./core/prompt-commands.js";
|
|
65
64
|
import { createTools } from "./tools/index.js";
|
|
65
|
+
import { CheckpointStore } from "./core/checkpoint-store.js";
|
|
66
66
|
import { shouldCompact, compact } from "./core/compaction/compactor.js";
|
|
67
67
|
import { createCompactedSessionCheckpoint, formatRestoreInfoText, getRestoredMessagesForDisplay, } from "./core/session-compaction.js";
|
|
68
68
|
import { setEstimatorModel } from "./core/compaction/token-estimator.js";
|
|
69
69
|
import { getContextWindow, getDefaultModel, getMaxThinkingLevel, getModel, } from "./core/model-registry.js";
|
|
70
|
-
import { MCPClientManager,
|
|
70
|
+
import { MCPClientManager, getAllMcpServers } from "./core/mcp/index.js";
|
|
71
|
+
import { runPixel } from "./cli/pixel.js";
|
|
72
|
+
import { runLogin, runLogout, runDoctor } from "./cli/auth.js";
|
|
73
|
+
import { runMcp } from "./cli/mcp.js";
|
|
74
|
+
import { CLI_VERSION, LOGO_LINES, clearVisibleScreen, displayName, gradientLine, requireInteractiveTTY, } from "./cli/shared.js";
|
|
71
75
|
import { discoverAgents } from "./core/agents.js";
|
|
72
76
|
import { discoverSkills } from "./core/skills.js";
|
|
73
77
|
import path from "node:path";
|
|
74
|
-
import { loginAnthropic } from "./core/oauth/anthropic.js";
|
|
75
|
-
import { loginOpenAI } from "./core/oauth/openai.js";
|
|
76
|
-
import { loginGemini } from "./core/oauth/gemini.js";
|
|
77
78
|
import chalk from "chalk";
|
|
78
79
|
import { checkAndAutoUpdate } from "./core/auto-update.js";
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const GRADIENT = [
|
|
88
|
-
"#60a5fa",
|
|
89
|
-
"#6da1f9",
|
|
90
|
-
"#7a9df7",
|
|
91
|
-
"#8799f5",
|
|
92
|
-
"#9495f3",
|
|
93
|
-
"#a18ff1",
|
|
94
|
-
"#a78bfa",
|
|
95
|
-
"#a18ff1",
|
|
96
|
-
"#9495f3",
|
|
97
|
-
"#8799f5",
|
|
98
|
-
"#7a9df7",
|
|
99
|
-
"#6da1f9",
|
|
100
|
-
];
|
|
101
|
-
function gradientLine(text) {
|
|
102
|
-
let result = "";
|
|
103
|
-
let colorIdx = 0;
|
|
104
|
-
for (const ch of text) {
|
|
105
|
-
if (ch === " ") {
|
|
106
|
-
result += ch;
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
result += chalk.hex(GRADIENT[colorIdx % GRADIENT.length])(ch);
|
|
110
|
-
colorIdx++;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
115
|
-
function clearVisibleScreen() {
|
|
116
|
-
process.stdout.write("\x1b[2J\x1b[H");
|
|
80
|
+
import { routeCliCommandInput } from "./cli/command-routing.js";
|
|
81
|
+
const THINKING_LEVELS = new Set(["low", "medium", "high", "xhigh", "max"]);
|
|
82
|
+
export function parseThinkingLevel(value) {
|
|
83
|
+
if (value === undefined)
|
|
84
|
+
return undefined;
|
|
85
|
+
if (THINKING_LEVELS.has(value))
|
|
86
|
+
return value;
|
|
87
|
+
throw new Error(`Invalid --thinking value "${value}". Expected low, medium, high, xhigh, or max.`);
|
|
117
88
|
}
|
|
118
89
|
function printHelp() {
|
|
119
90
|
// Clear the visible viewport for a clean look without erasing scrollback.
|
|
@@ -149,6 +120,7 @@ function printHelp() {
|
|
|
149
120
|
["telegram", "Configure Telegram bot integration"],
|
|
150
121
|
["agent-home-login", "Configure Agent Home relay connection"],
|
|
151
122
|
["agent-home", "Connect to Agent Home as a remote agent"],
|
|
123
|
+
["mcp", "Add and manage MCP servers"],
|
|
152
124
|
];
|
|
153
125
|
for (const [name, desc] of cmds) {
|
|
154
126
|
console.log(` ${accent(name.padEnd(20))} ${dim(desc)}`);
|
|
@@ -166,6 +138,8 @@ function printHelp() {
|
|
|
166
138
|
["--model <name>", "Model to use (e.g. claude-sonnet-4-6, gpt-5.5)"],
|
|
167
139
|
["--max-turns <n>", "Maximum agent turns per prompt"],
|
|
168
140
|
["--system-prompt <text>", "Override the system prompt"],
|
|
141
|
+
["--thinking <level>", "Enable thinking level (low, medium, high, xhigh, max)"],
|
|
142
|
+
["--resume <id>", "Resume a session by id"],
|
|
169
143
|
["--json", "JSON output mode (for sub-agents)"],
|
|
170
144
|
["--rpc", "JSON-RPC mode (for IDE integrations)"],
|
|
171
145
|
];
|
|
@@ -178,8 +152,6 @@ function printHelp() {
|
|
|
178
152
|
const slashCmds = [
|
|
179
153
|
["/help", "Show available slash commands"],
|
|
180
154
|
["/model", "Switch AI model"],
|
|
181
|
-
["/goal", "Create a programmatic goal loop"],
|
|
182
|
-
["/goals", "Open the goal pane"],
|
|
183
155
|
["/compact", "Compact conversation context"],
|
|
184
156
|
["/session", "Switch or create sessions"],
|
|
185
157
|
["/new", "Start a new session"],
|
|
@@ -193,10 +165,7 @@ function printHelp() {
|
|
|
193
165
|
// Keyboard shortcuts
|
|
194
166
|
console.log(primary("Keyboard shortcuts:"));
|
|
195
167
|
const shortcuts = [
|
|
196
|
-
["Ctrl+T", "Toggle task overlay"],
|
|
197
|
-
["Ctrl+G", "Toggle goal overlay"],
|
|
198
168
|
["Ctrl+S", "Toggle skills overlay"],
|
|
199
|
-
["Ctrl+P", "Toggle plan mode"],
|
|
200
169
|
["Shift+Tab", "Toggle thinking"],
|
|
201
170
|
["Shift+Enter", "New line in input"],
|
|
202
171
|
];
|
|
@@ -205,126 +174,49 @@ function printHelp() {
|
|
|
205
174
|
}
|
|
206
175
|
console.log();
|
|
207
176
|
}
|
|
177
|
+
function createCliSubcommandHandlers() {
|
|
178
|
+
const runWithStandardErrorHandling = (operation, logStack = false) => {
|
|
179
|
+
operation().catch((err) => {
|
|
180
|
+
log("ERROR", "fatal", err instanceof Error ? (logStack ? (err.stack ?? err.message) : err.message) : String(err));
|
|
181
|
+
closeLogger();
|
|
182
|
+
process.stderr.write(formatUserError(err) + "\n");
|
|
183
|
+
process.exit(1);
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
return {
|
|
187
|
+
pixel: () => runWithStandardErrorHandling(() => runPixel({ runInkTUI }), true),
|
|
188
|
+
mcp: () => runWithStandardErrorHandling(runMcp),
|
|
189
|
+
login: () => runWithStandardErrorHandling(runLogin),
|
|
190
|
+
logout: () => runWithStandardErrorHandling(runLogout),
|
|
191
|
+
sessions: () => runWithStandardErrorHandling(runSessions),
|
|
192
|
+
telegram: () => runWithStandardErrorHandling(runTelegramSetup),
|
|
193
|
+
serve: () => runWithStandardErrorHandling(runServe),
|
|
194
|
+
doctor: () => {
|
|
195
|
+
runDoctor().catch((err) => {
|
|
196
|
+
process.stderr.write(formatUserError(err) + "\n");
|
|
197
|
+
process.exit(1);
|
|
198
|
+
});
|
|
199
|
+
},
|
|
200
|
+
"agent-home-login": () => runWithStandardErrorHandling(runAgentHomeLogin),
|
|
201
|
+
"agent-home": () => runWithStandardErrorHandling(runAgentHome),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
208
204
|
function main() {
|
|
209
205
|
// Silent auto-update check (throttled, non-blocking on failure)
|
|
210
206
|
const updateMessage = checkAndAutoUpdate(CLI_VERSION);
|
|
211
207
|
if (updateMessage) {
|
|
212
208
|
console.error(chalk.bold.hex("#4ade80")(`✨ ${updateMessage}`));
|
|
213
209
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
const subcommand = process.argv[2];
|
|
222
|
-
// Passthrough to @prestyj/eyes CLI. Agents call this from bash as
|
|
223
|
-
// `ezcoder eyes log rough "..."` etc. — `ezcoder` is guaranteed on PATH
|
|
224
|
-
// (user launched it), so this avoids depending on nested bin visibility in
|
|
225
|
-
// global npm/pnpm installs.
|
|
226
|
-
if (subcommand === "eyes") {
|
|
227
|
-
let cliPath;
|
|
228
|
-
try {
|
|
229
|
-
cliPath = _require.resolve("@prestyj/eyes/cli");
|
|
230
|
-
}
|
|
231
|
-
catch {
|
|
232
|
-
process.stderr.write("ezcoder-eyes package not installed\n");
|
|
233
|
-
process.exit(1);
|
|
234
|
-
}
|
|
235
|
-
const r = spawnSync(process.execPath, [cliPath, ...process.argv.slice(3)], {
|
|
236
|
-
stdio: "inherit",
|
|
237
|
-
});
|
|
238
|
-
process.exit(r.status ?? 0);
|
|
239
|
-
}
|
|
240
|
-
if (subcommand === "pixel") {
|
|
241
|
-
runPixel().catch((err) => {
|
|
242
|
-
// Log the full stack — `pixel install` failures are usually bugs in our
|
|
243
|
-
// own AST/wiring code, and the stack is the only useful diagnostic.
|
|
244
|
-
log("ERROR", "fatal", err instanceof Error ? (err.stack ?? err.message) : String(err));
|
|
245
|
-
closeLogger();
|
|
246
|
-
process.stderr.write(formatUserError(err) + "\n");
|
|
247
|
-
process.exit(1);
|
|
248
|
-
});
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
if (subcommand === "login") {
|
|
252
|
-
runLogin().catch((err) => {
|
|
253
|
-
log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
|
|
254
|
-
closeLogger();
|
|
255
|
-
process.stderr.write(formatUserError(err) + "\n");
|
|
256
|
-
process.exit(1);
|
|
257
|
-
});
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
if (subcommand === "logout") {
|
|
261
|
-
runLogout().catch((err) => {
|
|
262
|
-
log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
|
|
263
|
-
closeLogger();
|
|
264
|
-
process.stderr.write(formatUserError(err) + "\n");
|
|
265
|
-
process.exit(1);
|
|
266
|
-
});
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
if (subcommand === "sessions") {
|
|
270
|
-
process.argv.splice(2, 1);
|
|
271
|
-
runSessions().catch((err) => {
|
|
272
|
-
log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
|
|
273
|
-
closeLogger();
|
|
274
|
-
process.stderr.write(formatUserError(err) + "\n");
|
|
275
|
-
process.exit(1);
|
|
276
|
-
});
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
if (subcommand === "telegram") {
|
|
280
|
-
runTelegramSetup().catch((err) => {
|
|
281
|
-
log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
|
|
282
|
-
closeLogger();
|
|
283
|
-
process.stderr.write(formatUserError(err) + "\n");
|
|
284
|
-
process.exit(1);
|
|
285
|
-
});
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
if (subcommand === "serve") {
|
|
289
|
-
process.argv.splice(2, 1);
|
|
290
|
-
runServe().catch((err) => {
|
|
291
|
-
log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
|
|
292
|
-
closeLogger();
|
|
293
|
-
process.stderr.write(formatUserError(err) + "\n");
|
|
294
|
-
process.exit(1);
|
|
295
|
-
});
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
if (subcommand === "doctor") {
|
|
299
|
-
runDoctor().catch((err) => {
|
|
300
|
-
process.stderr.write(formatUserError(err) + "\n");
|
|
301
|
-
process.exit(1);
|
|
302
|
-
});
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
if (subcommand === "agent-home-login") {
|
|
306
|
-
runAgentHomeLogin().catch((err) => {
|
|
307
|
-
log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
|
|
308
|
-
closeLogger();
|
|
309
|
-
process.stderr.write(formatUserError(err) + "\n");
|
|
310
|
-
process.exit(1);
|
|
311
|
-
});
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
if (subcommand === "agent-home") {
|
|
315
|
-
process.argv.splice(2, 1);
|
|
316
|
-
runAgentHome().catch((err) => {
|
|
317
|
-
log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
|
|
318
|
-
closeLogger();
|
|
319
|
-
process.stderr.write(formatUserError(err) + "\n");
|
|
320
|
-
process.exit(1);
|
|
321
|
-
});
|
|
210
|
+
const commandRoute = routeCliCommandInput({
|
|
211
|
+
argv: process.argv,
|
|
212
|
+
printHelp,
|
|
213
|
+
exit: process.exit,
|
|
214
|
+
handlers: createCliSubcommandHandlers(),
|
|
215
|
+
});
|
|
216
|
+
if (commandRoute.kind === "handled") {
|
|
322
217
|
return;
|
|
323
218
|
}
|
|
324
|
-
|
|
325
|
-
// Remove "continue" so parseArgs handles remaining flags
|
|
326
|
-
process.argv.splice(2, 1);
|
|
327
|
-
}
|
|
219
|
+
const subcommand = commandRoute.kind === "continue" ? "continue" : commandRoute.subcommand;
|
|
328
220
|
const { values, positionals } = parseArgs({
|
|
329
221
|
options: {
|
|
330
222
|
help: { type: "boolean", short: "h" },
|
|
@@ -336,6 +228,8 @@ function main() {
|
|
|
336
228
|
"max-turns": { type: "string" },
|
|
337
229
|
"system-prompt": { type: "string" },
|
|
338
230
|
"prompt-cache-key": { type: "string" },
|
|
231
|
+
thinking: { type: "string" },
|
|
232
|
+
resume: { type: "string" },
|
|
339
233
|
},
|
|
340
234
|
allowPositionals: true,
|
|
341
235
|
strict: true,
|
|
@@ -352,10 +246,11 @@ function main() {
|
|
|
352
246
|
if (values.json) {
|
|
353
247
|
const message = positionals[0] ?? "";
|
|
354
248
|
const jsonProvider = (values.provider ?? "anthropic");
|
|
355
|
-
const jsonModel = values.model ?? "claude-opus-4-
|
|
249
|
+
const jsonModel = values.model ?? "claude-opus-4-8";
|
|
356
250
|
const maxTurns = values["max-turns"] ? parseInt(values["max-turns"], 10) : undefined;
|
|
357
251
|
const systemPrompt = values["system-prompt"];
|
|
358
252
|
const promptCacheKey = values["prompt-cache-key"];
|
|
253
|
+
const thinkingLevel = parseThinkingLevel(values.thinking);
|
|
359
254
|
const cwd = process.cwd();
|
|
360
255
|
runJsonMode({
|
|
361
256
|
message,
|
|
@@ -365,6 +260,7 @@ function main() {
|
|
|
365
260
|
systemPrompt,
|
|
366
261
|
maxTurns,
|
|
367
262
|
promptCacheKey,
|
|
263
|
+
thinkingLevel,
|
|
368
264
|
}).catch((err) => {
|
|
369
265
|
process.stderr.write(formatUserError(err) + "\n");
|
|
370
266
|
process.exit(1);
|
|
@@ -374,7 +270,7 @@ function main() {
|
|
|
374
270
|
// RPC mode — headless JSON-over-stdio for IDE integrations
|
|
375
271
|
if (values.rpc) {
|
|
376
272
|
const rpcProvider = (values.provider ?? "anthropic");
|
|
377
|
-
const rpcModel = values.model ?? "claude-opus-4-
|
|
273
|
+
const rpcModel = values.model ?? "claude-opus-4-8";
|
|
378
274
|
const systemPrompt = values["system-prompt"];
|
|
379
275
|
const cwd = process.cwd();
|
|
380
276
|
runRpcMode({
|
|
@@ -407,11 +303,11 @@ function main() {
|
|
|
407
303
|
return "deepseek-v4-pro";
|
|
408
304
|
if (p === "openrouter")
|
|
409
305
|
return "qwen/qwen3.6-plus";
|
|
410
|
-
return "claude-opus-4-
|
|
306
|
+
return "claude-opus-4-8";
|
|
411
307
|
}
|
|
412
308
|
const model = saved.model ?? getHardcodedDefault(provider);
|
|
413
309
|
const thinkingLevel = saved.thinkingEnabled
|
|
414
|
-
? getMaxThinkingLevel(model)
|
|
310
|
+
? (saved.thinkingLevel ?? getMaxThinkingLevel(model))
|
|
415
311
|
: undefined;
|
|
416
312
|
// Interactive mode (Ink TUI)
|
|
417
313
|
const cwd = process.cwd();
|
|
@@ -421,7 +317,9 @@ function main() {
|
|
|
421
317
|
model,
|
|
422
318
|
cwd,
|
|
423
319
|
thinkingLevel,
|
|
320
|
+
idealReviewEnabled: saved.idealReviewEnabled,
|
|
424
321
|
continueRecent,
|
|
322
|
+
resumeSessionPath: values.resume,
|
|
425
323
|
theme: savedTheme,
|
|
426
324
|
}).catch((err) => {
|
|
427
325
|
log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
|
|
@@ -431,18 +329,6 @@ function main() {
|
|
|
431
329
|
});
|
|
432
330
|
}
|
|
433
331
|
// ── Ink TUI ───────────────────────────────────────────────
|
|
434
|
-
/**
|
|
435
|
-
* Bail with a friendly message if stdin isn't a TTY. Ink's raw-mode crash is
|
|
436
|
-
* cryptic; this catches the common case (piped stdin, API shells, CI).
|
|
437
|
-
*/
|
|
438
|
-
function requireInteractiveTTY() {
|
|
439
|
-
if (process.stdin.isTTY)
|
|
440
|
-
return;
|
|
441
|
-
process.stderr.write(chalk.red("ezcoder needs an interactive terminal — your stdin isn't a TTY.\n") +
|
|
442
|
-
chalk.hex("#6b7280")("Run ezcoder directly in your terminal (not piped or through an API shell). " +
|
|
443
|
-
'For headless use try "ezcoder --json \'<prompt>\'" or "ezcoder --rpc".\n'));
|
|
444
|
-
process.exit(1);
|
|
445
|
-
}
|
|
446
332
|
async function runInkTUI(opts) {
|
|
447
333
|
requireInteractiveTTY();
|
|
448
334
|
const { cwd } = opts;
|
|
@@ -534,35 +420,24 @@ async function runInkTUI(opts) {
|
|
|
534
420
|
globalSkillsDir: paths.skillsDir,
|
|
535
421
|
projectDir: cwd,
|
|
536
422
|
});
|
|
537
|
-
//
|
|
423
|
+
// Runtime mode refs — shared between tools and UI
|
|
538
424
|
const planModeRef = { current: false };
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
const repoMapChangedFilesRef = { current: new Set() };
|
|
546
|
-
const repoMapReadFilesRef = { current: new Set() };
|
|
547
|
-
const toRepoMapPath = (root, filePath) => path.relative(root, filePath).split(path.sep).join("/");
|
|
548
|
-
const markRepoMapRead = (root, filePath) => {
|
|
549
|
-
repoMapReadFilesRef.current.add(toRepoMapPath(root, filePath));
|
|
550
|
-
};
|
|
551
|
-
const markRepoMapDirty = (root, filePath) => {
|
|
552
|
-
const relativePath = toRepoMapPath(root, filePath);
|
|
553
|
-
repoMapChangedFilesRef.current.add(relativePath);
|
|
554
|
-
repoMapReadFilesRef.current.add(relativePath);
|
|
555
|
-
};
|
|
425
|
+
const goalModeRef = { current: "off" };
|
|
426
|
+
const planToolCallbacks = {};
|
|
427
|
+
// Holder so the (cwd-bound) tools can snapshot pre-mutation file state for
|
|
428
|
+
// /rewind. The store is created once the session id is known (below).
|
|
429
|
+
const checkpointRef = { current: null };
|
|
430
|
+
const onPreFileMutation = (filePath) => checkpointRef.current?.recordPreMutation(filePath) ?? Promise.resolve();
|
|
556
431
|
const { tools, processManager } = createTools(cwd, {
|
|
557
432
|
agents,
|
|
558
433
|
skills,
|
|
559
434
|
provider,
|
|
560
435
|
model,
|
|
561
436
|
planModeRef,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
437
|
+
goalModeRef,
|
|
438
|
+
onPreFileMutation,
|
|
439
|
+
onEnterPlan: (reason) => planToolCallbacks.onEnterPlan?.(reason),
|
|
440
|
+
onExitPlan: (planPath) => planToolCallbacks.onExitPlan?.(planPath) ?? Promise.resolve("Plan review is unavailable."),
|
|
566
441
|
});
|
|
567
442
|
// Rebuilds the cwd-bound tools for a different project root. Used by the
|
|
568
443
|
// pixel-fix flow so the agent operates in the error's project, not in
|
|
@@ -574,24 +449,26 @@ async function runInkTUI(opts) {
|
|
|
574
449
|
provider,
|
|
575
450
|
model,
|
|
576
451
|
planModeRef,
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
452
|
+
goalModeRef,
|
|
453
|
+
onPreFileMutation,
|
|
454
|
+
onEnterPlan: (reason) => planToolCallbacks.onEnterPlan?.(reason),
|
|
455
|
+
onExitPlan: (planPath) => planToolCallbacks.onExitPlan?.(planPath) ?? Promise.resolve("Plan review is unavailable."),
|
|
581
456
|
});
|
|
582
457
|
return rebuilt;
|
|
583
458
|
};
|
|
584
|
-
//
|
|
459
|
+
// MCP startup can involve `npx` installing/booting servers. Do it after the
|
|
460
|
+
// TUI paints so a slow network or npm cache never looks like "nothing happens".
|
|
585
461
|
const mcpManager = new MCPClientManager();
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
462
|
+
let initialMcpConnectPromise;
|
|
463
|
+
const connectInitialMcpTools = async () => {
|
|
464
|
+
initialMcpConnectPromise ??= (async () => {
|
|
465
|
+
const providerApiKey = provider === "glm" ? credentialsByProvider["glm"]?.accessToken : undefined;
|
|
466
|
+
const servers = await getAllMcpServers(provider, providerApiKey, cwd);
|
|
467
|
+
return mcpManager.connectAll(servers);
|
|
468
|
+
})();
|
|
469
|
+
return initialMcpConnectPromise;
|
|
470
|
+
};
|
|
471
|
+
const systemPrompt = await buildSystemPrompt(cwd, skills, planModeRef.current, undefined, tools.map((tool) => tool.name), undefined, provider, goalModeRef.current);
|
|
595
472
|
// Kill all background processes on exit (synchronous — catches all exit paths)
|
|
596
473
|
process.on("exit", () => {
|
|
597
474
|
processManager.shutdownAll();
|
|
@@ -602,10 +479,15 @@ async function runInkTUI(opts) {
|
|
|
602
479
|
// Session management — create or reuse session file
|
|
603
480
|
const sessionManager = new SessionManager(paths.sessionsDir);
|
|
604
481
|
let sessionPath;
|
|
482
|
+
let sessionId;
|
|
605
483
|
let initialHistory;
|
|
606
484
|
// Determine which session to resume (explicit path or most recent)
|
|
607
|
-
const
|
|
608
|
-
|
|
485
|
+
const explicitResumePath = opts.resumeSessionPath
|
|
486
|
+
? opts.resumeSessionPath.includes("/")
|
|
487
|
+
? opts.resumeSessionPath
|
|
488
|
+
: await sessionManager.findById(cwd, opts.resumeSessionPath)
|
|
489
|
+
: null;
|
|
490
|
+
const resumePath = explicitResumePath ?? (opts.continueRecent ? await sessionManager.getMostRecent(cwd) : null);
|
|
609
491
|
if (resumePath) {
|
|
610
492
|
try {
|
|
611
493
|
const loaded = await sessionManager.load(resumePath);
|
|
@@ -613,6 +495,7 @@ async function runInkTUI(opts) {
|
|
|
613
495
|
if (loadedMessages.length > 0) {
|
|
614
496
|
messages.push(...loadedMessages);
|
|
615
497
|
sessionPath = resumePath;
|
|
498
|
+
sessionId = loaded.header.id;
|
|
616
499
|
log("INFO", "session", `Restored session`, {
|
|
617
500
|
path: resumePath,
|
|
618
501
|
messageCount: String(loadedMessages.length),
|
|
@@ -646,6 +529,7 @@ async function runInkTUI(opts) {
|
|
|
646
529
|
messages: compacted.messages,
|
|
647
530
|
});
|
|
648
531
|
sessionPath = compactedSession.path;
|
|
532
|
+
sessionId = compactedSession.id;
|
|
649
533
|
messages.length = 0;
|
|
650
534
|
messages.push(...compacted.messages);
|
|
651
535
|
log("INFO", "session", `Auto-compaction complete`, {
|
|
@@ -659,7 +543,11 @@ async function runInkTUI(opts) {
|
|
|
659
543
|
}
|
|
660
544
|
}
|
|
661
545
|
const restoredMessages = getRestoredMessagesForDisplay(messages);
|
|
662
|
-
|
|
546
|
+
const restoredDisplayItems = sessionManager.getDisplayItems(loaded.entries, loaded.header.leafId);
|
|
547
|
+
initialHistory =
|
|
548
|
+
restoredDisplayItems.length > 0
|
|
549
|
+
? restoredDisplayItems
|
|
550
|
+
: messagesToHistoryItems(restoredMessages);
|
|
663
551
|
initialHistory.push({
|
|
664
552
|
kind: "info",
|
|
665
553
|
text: formatRestoreInfoText(loadedMessages.length, restoredMessages.length),
|
|
@@ -675,22 +563,12 @@ async function runInkTUI(opts) {
|
|
|
675
563
|
if (!sessionPath) {
|
|
676
564
|
const session = await sessionManager.create(cwd, provider, model);
|
|
677
565
|
sessionPath = session.path;
|
|
566
|
+
sessionId = session.id;
|
|
678
567
|
log("INFO", "session", `New session created`, { path: sessionPath });
|
|
679
568
|
}
|
|
680
|
-
//
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
const openCount = journalCount({ status: "open" }, cwd);
|
|
684
|
-
if (openCount > 0) {
|
|
685
|
-
const s = openCount === 1 ? "" : "s";
|
|
686
|
-
if (!initialHistory)
|
|
687
|
-
initialHistory = [];
|
|
688
|
-
initialHistory.push({
|
|
689
|
-
kind: "info",
|
|
690
|
-
text: `👁 Eyes: ${openCount} open improvement signal${s} from recent sessions. Run /eyes-improve to triage.`,
|
|
691
|
-
id: "eyes-banner",
|
|
692
|
-
});
|
|
693
|
-
}
|
|
569
|
+
// Now that the session id is finalized, back /rewind with a checkpoint store.
|
|
570
|
+
if (sessionId) {
|
|
571
|
+
checkpointRef.current = new CheckpointStore({ sessionId, cwd });
|
|
694
572
|
}
|
|
695
573
|
await renderApp({
|
|
696
574
|
provider,
|
|
@@ -711,356 +589,23 @@ async function runInkTUI(opts) {
|
|
|
711
589
|
initialHistory,
|
|
712
590
|
sessionsDir: paths.sessionsDir,
|
|
713
591
|
sessionPath,
|
|
592
|
+
sessionId,
|
|
714
593
|
processManager,
|
|
715
594
|
settingsFile: paths.settingsFile,
|
|
716
595
|
mcpManager,
|
|
717
596
|
authStorage,
|
|
718
597
|
planModeRef,
|
|
719
|
-
|
|
720
|
-
onExitPlanRef,
|
|
598
|
+
goalModeRef,
|
|
721
599
|
skills,
|
|
600
|
+
checkpointStore: checkpointRef.current ?? undefined,
|
|
722
601
|
initialOverlay: opts.initialOverlay,
|
|
602
|
+
idealReviewEnabled: opts.idealReviewEnabled,
|
|
723
603
|
rebuildToolsForCwd,
|
|
724
|
-
|
|
725
|
-
|
|
604
|
+
connectInitialMcpTools,
|
|
605
|
+
planCallbacks: planToolCallbacks,
|
|
726
606
|
});
|
|
727
607
|
closeLogger();
|
|
728
608
|
}
|
|
729
|
-
// ── Login ──────────────────────────────────────────────────
|
|
730
|
-
async function runLogin() {
|
|
731
|
-
requireInteractiveTTY();
|
|
732
|
-
clearVisibleScreen();
|
|
733
|
-
const paths = await ensureAppDirs();
|
|
734
|
-
initLogger(paths.logFile, { version: CLI_VERSION });
|
|
735
|
-
log("INFO", "auth", "Login flow started");
|
|
736
|
-
const authStorage = new AuthStorage();
|
|
737
|
-
await authStorage.load();
|
|
738
|
-
// Phase 1: Ink-based provider selector
|
|
739
|
-
const provider = await renderLoginSelector(CLI_VERSION);
|
|
740
|
-
if (!provider) {
|
|
741
|
-
console.log(chalk.hex("#6b7280")("Login cancelled."));
|
|
742
|
-
return;
|
|
743
|
-
}
|
|
744
|
-
console.log(chalk.hex("#60a5fa").bold("\nLogging in to ") +
|
|
745
|
-
chalk.hex("#a78bfa")(displayName(provider)) +
|
|
746
|
-
chalk.hex("#60a5fa").bold("...\n"));
|
|
747
|
-
// Phase 2: OAuth flow (readline needed for Anthropic code paste)
|
|
748
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
749
|
-
try {
|
|
750
|
-
const callbacks = {
|
|
751
|
-
onOpenUrl: (url) => {
|
|
752
|
-
console.log(chalk.hex("#60a5fa").bold("Opening browser..."));
|
|
753
|
-
openBrowser(url);
|
|
754
|
-
console.log(chalk.hex("#6b7280")("\nIf the browser didn't open, visit:\n") +
|
|
755
|
-
chalk.hex("#6b7280")(url) +
|
|
756
|
-
"\n");
|
|
757
|
-
},
|
|
758
|
-
onPromptCode: async (message) => {
|
|
759
|
-
return rl.question(message + " ");
|
|
760
|
-
},
|
|
761
|
-
onStatus: (message) => {
|
|
762
|
-
console.log(chalk.hex("#6b7280")(message));
|
|
763
|
-
},
|
|
764
|
-
};
|
|
765
|
-
let creds;
|
|
766
|
-
if (provider === "glm" ||
|
|
767
|
-
provider === "moonshot" ||
|
|
768
|
-
provider === "xiaomi" ||
|
|
769
|
-
provider === "minimax" ||
|
|
770
|
-
provider === "deepseek" ||
|
|
771
|
-
provider === "openrouter") {
|
|
772
|
-
const keyLabel = provider === "glm"
|
|
773
|
-
? "Z.AI"
|
|
774
|
-
: provider === "xiaomi"
|
|
775
|
-
? "Xiaomi MiMo"
|
|
776
|
-
: provider === "minimax"
|
|
777
|
-
? "MiniMax"
|
|
778
|
-
: provider === "deepseek"
|
|
779
|
-
? "DeepSeek"
|
|
780
|
-
: provider === "openrouter"
|
|
781
|
-
? "OpenRouter"
|
|
782
|
-
: "Moonshot";
|
|
783
|
-
const apiKey = await rl.question(chalk.hex("#60a5fa")(`Paste your ${keyLabel} API key: `));
|
|
784
|
-
if (!apiKey.trim()) {
|
|
785
|
-
console.log(chalk.hex("#ef4444")("No API key provided. Login cancelled."));
|
|
786
|
-
return;
|
|
787
|
-
}
|
|
788
|
-
creds = {
|
|
789
|
-
accessToken: apiKey.trim(),
|
|
790
|
-
refreshToken: "",
|
|
791
|
-
expiresAt: Date.now() + 365 * 24 * 60 * 60 * 1000 * 100, // ~100 years
|
|
792
|
-
...(provider === "xiaomi" ? { baseUrl: "https://token-plan-sgp.xiaomimimo.com/v1" } : {}),
|
|
793
|
-
};
|
|
794
|
-
}
|
|
795
|
-
else {
|
|
796
|
-
creds =
|
|
797
|
-
provider === "anthropic"
|
|
798
|
-
? await loginAnthropic(callbacks)
|
|
799
|
-
: provider === "gemini"
|
|
800
|
-
? await loginGemini(callbacks)
|
|
801
|
-
: await loginOpenAI(callbacks);
|
|
802
|
-
}
|
|
803
|
-
await authStorage.setCredentials(provider, creds);
|
|
804
|
-
log("INFO", "auth", `Login succeeded for ${displayName(provider)}`);
|
|
805
|
-
console.log(chalk.hex("#4ade80")(`\n✓ Logged in to ${displayName(provider)} successfully!`));
|
|
806
|
-
}
|
|
807
|
-
finally {
|
|
808
|
-
rl.close();
|
|
809
|
-
closeLogger();
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
// ── Doctor ─────────────────────────────────────────────────
|
|
813
|
-
async function runDoctor() {
|
|
814
|
-
clearVisibleScreen();
|
|
815
|
-
const os = await import("node:os");
|
|
816
|
-
const fsP = await import("node:fs/promises");
|
|
817
|
-
const dim = chalk.hex("#6b7280");
|
|
818
|
-
const primary = chalk.hex("#60a5fa");
|
|
819
|
-
const accent = chalk.hex("#a78bfa");
|
|
820
|
-
const good = chalk.hex("#4ade80");
|
|
821
|
-
const warn = chalk.hex("#fbbf24");
|
|
822
|
-
const bad = chalk.hex("#ef4444");
|
|
823
|
-
// ── Banner ──────────────────────────────────────────────────
|
|
824
|
-
const LOGO = LOGO_LINES;
|
|
825
|
-
const GAP = " ";
|
|
826
|
-
console.log();
|
|
827
|
-
console.log(` ${gradientLine(LOGO[0])}${GAP}` +
|
|
828
|
-
primary.bold("EZ Coder") +
|
|
829
|
-
dim(` v${CLI_VERSION}`) +
|
|
830
|
-
dim(" · By ") +
|
|
831
|
-
chalk.white.bold("Nolan Grout"));
|
|
832
|
-
console.log(` ${gradientLine(LOGO[1])}${GAP}` + accent("Doctor"));
|
|
833
|
-
console.log(` ${gradientLine(LOGO[2])}${GAP}` + dim("Diagnose & Fix"));
|
|
834
|
-
console.log();
|
|
835
|
-
const home = os.homedir();
|
|
836
|
-
const ggDir = path.join(home, ".ezcoder");
|
|
837
|
-
const authFile = path.join(ggDir, "auth.json");
|
|
838
|
-
const lockFile = authFile + ".lock";
|
|
839
|
-
const myUid = process.getuid();
|
|
840
|
-
let fixed = 0;
|
|
841
|
-
// ── Environment ─────────────────────────────────────────────
|
|
842
|
-
console.log(accent(" Environment\n"));
|
|
843
|
-
console.log(dim(` Home: ${home}`));
|
|
844
|
-
console.log(dim(` $HOME: ${process.env.HOME ?? "(not set)"}`));
|
|
845
|
-
console.log(dim(` Node.js: ${process.version}`));
|
|
846
|
-
console.log(dim(` Platform: ${process.platform} ${process.arch}`));
|
|
847
|
-
console.log(dim(` UID: ${myUid} EUID: ${process.geteuid()}`));
|
|
848
|
-
if (process.env.HOME && process.env.HOME !== home) {
|
|
849
|
-
console.log(warn("\n ⚠ $HOME differs from os.homedir() — this can cause auth mismatches"));
|
|
850
|
-
}
|
|
851
|
-
if (myUid !== process.geteuid()) {
|
|
852
|
-
console.log(warn(" ⚠ uid ≠ euid — running with elevated privileges (sudo?)"));
|
|
853
|
-
console.log(dim(" Running ezcoder with sudo can cause ownership issues."));
|
|
854
|
-
console.log(dim(" Use without sudo, or fix after: sudo chown -R $(whoami) ~/.gg"));
|
|
855
|
-
}
|
|
856
|
-
console.log();
|
|
857
|
-
// ── Config Directory ────────────────────────────────────────
|
|
858
|
-
console.log(accent(" Config Directory\n"));
|
|
859
|
-
try {
|
|
860
|
-
const stat = await fsP.stat(ggDir);
|
|
861
|
-
const mode = stat.mode & 0o777;
|
|
862
|
-
console.log(dim(` Path: ${ggDir}`));
|
|
863
|
-
console.log(dim(` Mode: 0o${mode.toString(8)} UID: ${stat.uid}`));
|
|
864
|
-
// Fix ownership
|
|
865
|
-
if (stat.uid !== myUid) {
|
|
866
|
-
console.log(warn(` ⚠ Owned by uid ${stat.uid}, expected ${myUid}`));
|
|
867
|
-
try {
|
|
868
|
-
await fsP.chown(ggDir, myUid, process.getgid());
|
|
869
|
-
console.log(good(" ✓ Fixed directory ownership"));
|
|
870
|
-
fixed++;
|
|
871
|
-
}
|
|
872
|
-
catch {
|
|
873
|
-
console.log(bad(` ✗ Cannot fix — try: sudo chown -R $(whoami) ${ggDir}`));
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
// Fix permissions (should be 0o700)
|
|
877
|
-
if (mode !== 0o700) {
|
|
878
|
-
try {
|
|
879
|
-
await fsP.chmod(ggDir, 0o700);
|
|
880
|
-
console.log(good(" ✓ Fixed directory permissions → 0o700"));
|
|
881
|
-
fixed++;
|
|
882
|
-
}
|
|
883
|
-
catch {
|
|
884
|
-
console.log(bad(` ✗ Cannot fix — try: chmod 700 ${ggDir}`));
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
catch {
|
|
889
|
-
console.log(warn(` ${ggDir} missing — creating...`));
|
|
890
|
-
try {
|
|
891
|
-
await fsP.mkdir(ggDir, { recursive: true, mode: 0o700 });
|
|
892
|
-
console.log(good(` ✓ Created ${ggDir}`));
|
|
893
|
-
fixed++;
|
|
894
|
-
}
|
|
895
|
-
catch (mkErr) {
|
|
896
|
-
console.log(bad(` ✗ Cannot create: ${mkErr instanceof Error ? mkErr.message : String(mkErr)}`));
|
|
897
|
-
console.log();
|
|
898
|
-
return;
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
console.log();
|
|
902
|
-
// ── Lock File ───────────────────────────────────────────────
|
|
903
|
-
try {
|
|
904
|
-
const lockStat = await fsP.stat(lockFile);
|
|
905
|
-
const ageMs = Date.now() - lockStat.mtimeMs;
|
|
906
|
-
console.log(accent(" Lock File\n"));
|
|
907
|
-
console.log(warn(` ⚠ Stale lock found (age: ${Math.round(ageMs / 1000)}s)`));
|
|
908
|
-
await fsP.unlink(lockFile);
|
|
909
|
-
console.log(good(" ✓ Removed"));
|
|
910
|
-
fixed++;
|
|
911
|
-
console.log();
|
|
912
|
-
}
|
|
913
|
-
catch {
|
|
914
|
-
// No lock file — good, skip section entirely
|
|
915
|
-
}
|
|
916
|
-
// ── Auth File ───────────────────────────────────────────────
|
|
917
|
-
console.log(accent(" Auth File\n"));
|
|
918
|
-
let authData = null;
|
|
919
|
-
let authNeedsRewrite = false;
|
|
920
|
-
try {
|
|
921
|
-
const stat = await fsP.stat(authFile);
|
|
922
|
-
const mode = stat.mode & 0o777;
|
|
923
|
-
console.log(dim(` Path: ${authFile}`));
|
|
924
|
-
console.log(dim(` Size: ${stat.size} bytes Mode: 0o${mode.toString(8)} UID: ${stat.uid}`));
|
|
925
|
-
// Fix ownership
|
|
926
|
-
if (stat.uid !== myUid) {
|
|
927
|
-
console.log(warn(` ⚠ Owned by uid ${stat.uid}, expected ${myUid}`));
|
|
928
|
-
try {
|
|
929
|
-
await fsP.chown(authFile, myUid, process.getgid());
|
|
930
|
-
console.log(good(" ✓ Fixed file ownership"));
|
|
931
|
-
fixed++;
|
|
932
|
-
}
|
|
933
|
-
catch {
|
|
934
|
-
console.log(bad(` ✗ Cannot fix — try: sudo chown $(whoami) ${authFile}`));
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
// Fix permissions (should be 0o600)
|
|
938
|
-
if (mode !== 0o600) {
|
|
939
|
-
try {
|
|
940
|
-
await fsP.chmod(authFile, 0o600);
|
|
941
|
-
console.log(good(" ✓ Fixed file permissions → 0o600"));
|
|
942
|
-
fixed++;
|
|
943
|
-
}
|
|
944
|
-
catch {
|
|
945
|
-
console.log(bad(` ✗ Cannot fix — try: chmod 600 ${authFile}`));
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
// Try to read and parse
|
|
949
|
-
try {
|
|
950
|
-
const content = await fsP.readFile(authFile, "utf-8");
|
|
951
|
-
try {
|
|
952
|
-
authData = JSON.parse(content);
|
|
953
|
-
}
|
|
954
|
-
catch {
|
|
955
|
-
console.log(bad(" ✗ Invalid JSON — backing up and resetting"));
|
|
956
|
-
const backupName = `auth.json.corrupt.${Date.now()}`;
|
|
957
|
-
await fsP.copyFile(authFile, path.join(ggDir, backupName));
|
|
958
|
-
await fsP.writeFile(authFile, "{}", { encoding: "utf-8", mode: 0o600 });
|
|
959
|
-
console.log(good(` ✓ Corrupt file backed up as ${backupName}`));
|
|
960
|
-
console.log(dim(' Run "ezcoder login" to re-authenticate'));
|
|
961
|
-
authData = {};
|
|
962
|
-
fixed++;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
catch (readErr) {
|
|
966
|
-
const code = readErr.code;
|
|
967
|
-
if (code === "EACCES") {
|
|
968
|
-
console.log(bad(" ✗ Permission denied reading auth.json"));
|
|
969
|
-
console.log(dim(` Try: sudo chown $(whoami) ${authFile} && chmod 600 ${authFile}`));
|
|
970
|
-
}
|
|
971
|
-
else {
|
|
972
|
-
console.log(bad(` ✗ Read error: ${readErr instanceof Error ? readErr.message : String(readErr)}`));
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
catch {
|
|
977
|
-
console.log(dim(` Path: ${authFile}`));
|
|
978
|
-
console.log(warn(' Not found — run "ezcoder login" to authenticate'));
|
|
979
|
-
}
|
|
980
|
-
console.log();
|
|
981
|
-
// ── Credentials ─────────────────────────────────────────────
|
|
982
|
-
if (authData && Object.keys(authData).length > 0) {
|
|
983
|
-
console.log(accent(" Credentials\n"));
|
|
984
|
-
for (const p of Object.keys(authData)) {
|
|
985
|
-
const cred = authData[p];
|
|
986
|
-
if (!cred || typeof cred !== "object") {
|
|
987
|
-
console.log(bad(` ✗ ${p}: invalid entry — removing`));
|
|
988
|
-
delete authData[p];
|
|
989
|
-
authNeedsRewrite = true;
|
|
990
|
-
fixed++;
|
|
991
|
-
continue;
|
|
992
|
-
}
|
|
993
|
-
if (!cred.accessToken || typeof cred.accessToken !== "string") {
|
|
994
|
-
console.log(bad(` ✗ ${p}: missing accessToken — removing`));
|
|
995
|
-
delete authData[p];
|
|
996
|
-
authNeedsRewrite = true;
|
|
997
|
-
fixed++;
|
|
998
|
-
continue;
|
|
999
|
-
}
|
|
1000
|
-
const token = String(cred.accessToken);
|
|
1001
|
-
const masked = token.slice(0, 8) + "..." + token.slice(-4);
|
|
1002
|
-
const expires = typeof cred.expiresAt === "number" ? new Date(cred.expiresAt).toISOString() : "unknown";
|
|
1003
|
-
const expired = typeof cred.expiresAt === "number" && Date.now() > cred.expiresAt;
|
|
1004
|
-
if (expired) {
|
|
1005
|
-
console.log(warn(` ⚠ ${p}: ${masked} expired ${expires}`));
|
|
1006
|
-
}
|
|
1007
|
-
else {
|
|
1008
|
-
console.log(good(` ✓ ${p}: ${masked} expires ${expires}`));
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
if (authNeedsRewrite) {
|
|
1012
|
-
try {
|
|
1013
|
-
await fsP.writeFile(authFile, JSON.stringify(authData, null, 2), {
|
|
1014
|
-
encoding: "utf-8",
|
|
1015
|
-
mode: 0o600,
|
|
1016
|
-
});
|
|
1017
|
-
console.log(good(" ✓ Cleaned up auth.json"));
|
|
1018
|
-
}
|
|
1019
|
-
catch {
|
|
1020
|
-
console.log(bad(" ✗ Failed to write cleaned auth.json"));
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
console.log();
|
|
1024
|
-
}
|
|
1025
|
-
// ── Temp Files ──────────────────────────────────────────────
|
|
1026
|
-
try {
|
|
1027
|
-
const entries = await fsP.readdir(ggDir);
|
|
1028
|
-
const tmpFiles = entries.filter((e) => e.startsWith("auth.json.") && e.endsWith(".tmp"));
|
|
1029
|
-
if (tmpFiles.length > 0) {
|
|
1030
|
-
console.log(accent(" Temp Files\n"));
|
|
1031
|
-
console.log(warn(` ⚠ ${tmpFiles.length} orphaned temp file(s) from interrupted writes`));
|
|
1032
|
-
for (const tmp of tmpFiles) {
|
|
1033
|
-
await fsP.unlink(path.join(ggDir, tmp)).catch(() => { });
|
|
1034
|
-
}
|
|
1035
|
-
console.log(good(` ✓ Removed ${tmpFiles.length} file(s)`));
|
|
1036
|
-
fixed++;
|
|
1037
|
-
console.log();
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
catch {
|
|
1041
|
-
// Can't read directory — already flagged above
|
|
1042
|
-
}
|
|
1043
|
-
// ── Summary ─────────────────────────────────────────────────
|
|
1044
|
-
if (fixed > 0) {
|
|
1045
|
-
console.log(good(` ✓ Fixed ${fixed} issue${fixed > 1 ? "s" : ""}.`));
|
|
1046
|
-
}
|
|
1047
|
-
else {
|
|
1048
|
-
console.log(good(" ✓ Everything looks good."));
|
|
1049
|
-
}
|
|
1050
|
-
console.log();
|
|
1051
|
-
}
|
|
1052
|
-
// ── Logout ─────────────────────────────────────────────────
|
|
1053
|
-
async function runLogout() {
|
|
1054
|
-
const paths = await ensureAppDirs();
|
|
1055
|
-
initLogger(paths.logFile, { version: CLI_VERSION });
|
|
1056
|
-
log("INFO", "auth", "Logout requested");
|
|
1057
|
-
const authStorage = new AuthStorage();
|
|
1058
|
-
await authStorage.load();
|
|
1059
|
-
await authStorage.clearAll();
|
|
1060
|
-
log("INFO", "auth", "Logout succeeded");
|
|
1061
|
-
closeLogger();
|
|
1062
|
-
console.log(chalk.green("Logged out successfully."));
|
|
1063
|
-
}
|
|
1064
609
|
// ── Sessions ──────────────────────────────────────────────
|
|
1065
610
|
async function runSessions() {
|
|
1066
611
|
requireInteractiveTTY();
|
|
@@ -1090,11 +635,11 @@ async function runSessions() {
|
|
|
1090
635
|
return "MiniMax-M2.7";
|
|
1091
636
|
if (p === "deepseek")
|
|
1092
637
|
return "deepseek-v4-pro";
|
|
1093
|
-
return "claude-opus-4-
|
|
638
|
+
return "claude-opus-4-8";
|
|
1094
639
|
}
|
|
1095
640
|
const model = saved2.model ?? getDefault(provider);
|
|
1096
641
|
const thinkingLevel = saved2.thinkingEnabled
|
|
1097
|
-
? getMaxThinkingLevel(model)
|
|
642
|
+
? (saved2.thinkingLevel ?? getMaxThinkingLevel(model))
|
|
1098
643
|
: undefined;
|
|
1099
644
|
closeLogger();
|
|
1100
645
|
await runInkTUI({
|
|
@@ -1102,6 +647,7 @@ async function runSessions() {
|
|
|
1102
647
|
model,
|
|
1103
648
|
cwd,
|
|
1104
649
|
thinkingLevel,
|
|
650
|
+
idealReviewEnabled: saved2.idealReviewEnabled,
|
|
1105
651
|
resumeSessionPath: selectedPath,
|
|
1106
652
|
theme: saved2.theme,
|
|
1107
653
|
});
|
|
@@ -1279,7 +825,7 @@ async function runServe() {
|
|
|
1279
825
|
const preferredProvider = serveValues.provider ?? saved3.provider ?? "anthropic";
|
|
1280
826
|
const { provider, model } = await resolveActiveProvider(authStorage, preferredProvider, serveValues.model ?? saved3.model);
|
|
1281
827
|
const thinkingLevel = saved3.thinkingEnabled
|
|
1282
|
-
? getMaxThinkingLevel(model)
|
|
828
|
+
? (saved3.thinkingLevel ?? getMaxThinkingLevel(model))
|
|
1283
829
|
: undefined;
|
|
1284
830
|
initLogger(paths.logFile, {
|
|
1285
831
|
version: CLI_VERSION,
|
|
@@ -1322,32 +868,16 @@ async function runAgentHomeLogin() {
|
|
|
1322
868
|
log("INFO", "agent-home", "Agent Home login started");
|
|
1323
869
|
const existing = await loadAgentHomeConfig();
|
|
1324
870
|
// Banner
|
|
1325
|
-
const LOGO =
|
|
1326
|
-
" \u2584\u2580\u2580\u2580 \u2584\u2580\u2580\u2580",
|
|
1327
|
-
" \u2588 \u2580\u2588 \u2588 \u2580\u2588",
|
|
1328
|
-
" \u2580\u2584\u2584\u2580 \u2580\u2584\u2584\u2580",
|
|
1329
|
-
];
|
|
1330
|
-
function gradientTextLocal(text) {
|
|
1331
|
-
let colorIdx = 0;
|
|
1332
|
-
return text
|
|
1333
|
-
.split("")
|
|
1334
|
-
.map((ch) => {
|
|
1335
|
-
if (ch === " ")
|
|
1336
|
-
return ch;
|
|
1337
|
-
const color = GRADIENT[colorIdx++ % GRADIENT.length];
|
|
1338
|
-
return chalk.hex(color)(ch);
|
|
1339
|
-
})
|
|
1340
|
-
.join("");
|
|
1341
|
-
}
|
|
871
|
+
const LOGO = LOGO_LINES;
|
|
1342
872
|
const GAP = " ";
|
|
1343
873
|
console.log();
|
|
1344
|
-
console.log(` ${
|
|
874
|
+
console.log(` ${gradientLine(LOGO[0])}${GAP}` +
|
|
1345
875
|
chalk.hex("#60a5fa").bold("EZ Coder") +
|
|
1346
876
|
chalk.hex("#6b7280")(` v${CLI_VERSION}`) +
|
|
1347
877
|
chalk.hex("#6b7280")(" \u00b7 By ") +
|
|
1348
878
|
chalk.white.bold("Nolan Grout"));
|
|
1349
|
-
console.log(` ${
|
|
1350
|
-
console.log(` ${
|
|
879
|
+
console.log(` ${gradientLine(LOGO[1])}${GAP}` + chalk.hex("#a78bfa")("Agent Home Setup"));
|
|
880
|
+
console.log(` ${gradientLine(LOGO[2])}${GAP}` + chalk.hex("#6b7280")("Remote Control via iOS"));
|
|
1351
881
|
console.log();
|
|
1352
882
|
if (existing) {
|
|
1353
883
|
console.log(chalk.hex("#6b7280")(" Current config:\n") +
|
|
@@ -1411,7 +941,7 @@ async function runAgentHome() {
|
|
|
1411
941
|
const preferredProvider = ahValues.provider ?? saved4.provider ?? "anthropic";
|
|
1412
942
|
const { provider, model } = await resolveActiveProvider(authStorage, preferredProvider, ahValues.model ?? saved4.model);
|
|
1413
943
|
const thinkingLevel = saved4.thinkingEnabled
|
|
1414
|
-
? getMaxThinkingLevel(model)
|
|
944
|
+
? (saved4.thinkingLevel ?? getMaxThinkingLevel(model))
|
|
1415
945
|
: undefined;
|
|
1416
946
|
initLogger(paths.logFile, {
|
|
1417
947
|
version: CLI_VERSION,
|
|
@@ -1429,105 +959,6 @@ async function runAgentHome() {
|
|
|
1429
959
|
});
|
|
1430
960
|
}
|
|
1431
961
|
// ── Pixel ──────────────────────────────────────────────────
|
|
1432
|
-
async function runPixel() {
|
|
1433
|
-
const sub = process.argv[3];
|
|
1434
|
-
const rest = process.argv.slice(4);
|
|
1435
|
-
if (sub === "install") {
|
|
1436
|
-
const { runPixelInstall } = await import("./core/pixel.js");
|
|
1437
|
-
const opts = parsePixelInstallArgs(rest);
|
|
1438
|
-
await runPixelInstall(opts);
|
|
1439
|
-
return;
|
|
1440
|
-
}
|
|
1441
|
-
if (sub === "fix") {
|
|
1442
|
-
const errorId = rest[0];
|
|
1443
|
-
if (!errorId) {
|
|
1444
|
-
process.stderr.write("Usage: ezcoder pixel fix <error_id>\n");
|
|
1445
|
-
process.exit(1);
|
|
1446
|
-
}
|
|
1447
|
-
const { fixError } = await import("./core/pixel-fix.js");
|
|
1448
|
-
const result = await fixError(errorId);
|
|
1449
|
-
if (result.outcome === "awaiting_review") {
|
|
1450
|
-
console.log(chalk.hex("#4ade80")(`✓ ${result.reason}`));
|
|
1451
|
-
}
|
|
1452
|
-
else {
|
|
1453
|
-
console.log(chalk.hex("#ef4444")(`✗ ${result.reason}`));
|
|
1454
|
-
process.exit(1);
|
|
1455
|
-
}
|
|
1456
|
-
return;
|
|
1457
|
-
}
|
|
1458
|
-
if (sub === "run") {
|
|
1459
|
-
const { runQueue } = await import("./core/pixel-fix.js");
|
|
1460
|
-
const result = await runQueue();
|
|
1461
|
-
console.log(chalk.bold(`${result.fixed} fixed · ${result.failed} failed · ${result.total} total`));
|
|
1462
|
-
if (result.failed > 0)
|
|
1463
|
-
process.exit(1);
|
|
1464
|
-
return;
|
|
1465
|
-
}
|
|
1466
|
-
if (sub === "--help" || sub === "-h") {
|
|
1467
|
-
printPixelHelp();
|
|
1468
|
-
return;
|
|
1469
|
-
}
|
|
1470
|
-
if (sub === "list") {
|
|
1471
|
-
const { listAllErrors } = await import("./core/pixel.js");
|
|
1472
|
-
await listAllErrors();
|
|
1473
|
-
return;
|
|
1474
|
-
}
|
|
1475
|
-
if (sub) {
|
|
1476
|
-
process.stderr.write(`Unknown pixel subcommand: ${sub}\n`);
|
|
1477
|
-
printPixelHelp();
|
|
1478
|
-
process.exit(1);
|
|
1479
|
-
}
|
|
1480
|
-
// No subcommand → launch the Ink TUI with the pixel overlay open. The fix
|
|
1481
|
-
// flow runs through the same agent loop as a Task, streaming live in the
|
|
1482
|
-
// chat instead of spawning a subprocess.
|
|
1483
|
-
// Non-TTY (CI, piped) → fall back to text list.
|
|
1484
|
-
if (!process.stdin.isTTY) {
|
|
1485
|
-
const { listAllErrors } = await import("./core/pixel.js");
|
|
1486
|
-
await listAllErrors();
|
|
1487
|
-
return;
|
|
1488
|
-
}
|
|
1489
|
-
const saved = loadSavedSettings();
|
|
1490
|
-
const provider = saved.provider ?? "anthropic";
|
|
1491
|
-
const model = saved.model ?? defaultModelFor(provider);
|
|
1492
|
-
await runInkTUI({
|
|
1493
|
-
provider,
|
|
1494
|
-
model,
|
|
1495
|
-
cwd: process.cwd(),
|
|
1496
|
-
thinkingLevel: saved.thinkingEnabled ? "medium" : undefined,
|
|
1497
|
-
theme: saved.theme,
|
|
1498
|
-
initialOverlay: "pixel",
|
|
1499
|
-
});
|
|
1500
|
-
}
|
|
1501
|
-
function defaultModelFor(p) {
|
|
1502
|
-
return getDefaultModel(p).id;
|
|
1503
|
-
}
|
|
1504
|
-
function parsePixelInstallArgs(args) {
|
|
1505
|
-
const out = { skipPackageInstall: false };
|
|
1506
|
-
for (let i = 0; i < args.length; i++) {
|
|
1507
|
-
const a = args[i];
|
|
1508
|
-
if (a === "--ingest-url")
|
|
1509
|
-
out.ingestUrl = args[++i];
|
|
1510
|
-
else if (a === "--name")
|
|
1511
|
-
out.name = args[++i];
|
|
1512
|
-
else if (a === "--skip-install")
|
|
1513
|
-
out.skipPackageInstall = true;
|
|
1514
|
-
}
|
|
1515
|
-
return out;
|
|
1516
|
-
}
|
|
1517
|
-
function printPixelHelp() {
|
|
1518
|
-
console.log(`ezcoder pixel — error tracking + auto-fix queue
|
|
1519
|
-
|
|
1520
|
-
Usage:
|
|
1521
|
-
ezcoder pixel List open errors across every registered project
|
|
1522
|
-
ezcoder pixel install Register the current project and wire up the SDK
|
|
1523
|
-
ezcoder pixel fix <error_id> Fix one specific error end-to-end
|
|
1524
|
-
ezcoder pixel run Auto-fix every open error across all projects
|
|
1525
|
-
|
|
1526
|
-
ezcoder pixel install --name <name> Override the project name
|
|
1527
|
-
ezcoder pixel install --ingest-url <url> Use a custom backend URL
|
|
1528
|
-
ezcoder pixel install --skip-install Don't run the package manager
|
|
1529
|
-
`);
|
|
1530
|
-
}
|
|
1531
962
|
// ── Helpers ────────────────────────────────────────────────
|
|
1532
963
|
/**
|
|
1533
964
|
* Pick the provider/model to start with. If the preferred provider isn't
|
|
@@ -1571,25 +1002,6 @@ async function resolveActiveProvider(authStorage, preferred, savedModel) {
|
|
|
1571
1002
|
const provider = loggedInProviders[0];
|
|
1572
1003
|
return { provider, model: getDefaultModel(provider).id, loggedInProviders };
|
|
1573
1004
|
}
|
|
1574
|
-
function displayName(provider) {
|
|
1575
|
-
if (provider === "anthropic")
|
|
1576
|
-
return "Anthropic";
|
|
1577
|
-
if (provider === "xiaomi")
|
|
1578
|
-
return "Xiaomi (MiMo)";
|
|
1579
|
-
if (provider === "gemini")
|
|
1580
|
-
return "Gemini";
|
|
1581
|
-
if (provider === "glm")
|
|
1582
|
-
return "Z.AI (GLM)";
|
|
1583
|
-
if (provider === "moonshot")
|
|
1584
|
-
return "Moonshot";
|
|
1585
|
-
if (provider === "minimax")
|
|
1586
|
-
return "MiniMax";
|
|
1587
|
-
if (provider === "deepseek")
|
|
1588
|
-
return "DeepSeek";
|
|
1589
|
-
if (provider === "openrouter")
|
|
1590
|
-
return "OpenRouter";
|
|
1591
|
-
return "OpenAI";
|
|
1592
|
-
}
|
|
1593
1005
|
function extractText(content) {
|
|
1594
1006
|
if (typeof content === "string")
|
|
1595
1007
|
return content;
|
|
@@ -1598,9 +1010,45 @@ function extractText(content) {
|
|
|
1598
1010
|
.map((b) => b.text)
|
|
1599
1011
|
.join("\n");
|
|
1600
1012
|
}
|
|
1601
|
-
function
|
|
1013
|
+
function restoredPromptCommandDisplayText(text) {
|
|
1014
|
+
for (const command of PROMPT_COMMANDS) {
|
|
1015
|
+
if (text === command.prompt)
|
|
1016
|
+
return `/${command.name}`;
|
|
1017
|
+
const prefix = `${command.prompt}\n\n## User Instructions\n\n`;
|
|
1018
|
+
if (text.startsWith(prefix)) {
|
|
1019
|
+
const args = text.slice(prefix.length).trim();
|
|
1020
|
+
return args ? `/${command.name} ${args}` : `/${command.name}`;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
return null;
|
|
1024
|
+
}
|
|
1025
|
+
export function messagesToHistoryItems(msgs) {
|
|
1602
1026
|
const items = [];
|
|
1603
1027
|
let id = 0;
|
|
1028
|
+
const pushRestoredAssistantText = (text) => {
|
|
1029
|
+
const segments = segmentDisplayText(text, []);
|
|
1030
|
+
if (segments.length === 0) {
|
|
1031
|
+
const stripped = stripDoneMarkers(text);
|
|
1032
|
+
if (stripped)
|
|
1033
|
+
items.push({ kind: "assistant", text: stripped, id: `restore-${id++}` });
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
for (const segment of segments) {
|
|
1037
|
+
if (segment.kind === "text") {
|
|
1038
|
+
const stripped = stripDoneMarkers(segment.text).trimStart();
|
|
1039
|
+
if (stripped)
|
|
1040
|
+
items.push({ kind: "assistant", text: stripped, id: `restore-${id++}` });
|
|
1041
|
+
}
|
|
1042
|
+
else {
|
|
1043
|
+
items.push({
|
|
1044
|
+
kind: "step_done",
|
|
1045
|
+
stepNum: segment.stepNum,
|
|
1046
|
+
description: segment.description,
|
|
1047
|
+
id: `restore-${id++}`,
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
};
|
|
1604
1052
|
// Index tool results by toolCallId for pairing with tool calls
|
|
1605
1053
|
const toolResults = new Map();
|
|
1606
1054
|
for (const msg of msgs) {
|
|
@@ -1624,14 +1072,19 @@ function messagesToHistoryItems(msgs) {
|
|
|
1624
1072
|
roleCounts[msg.role] = (roleCounts[msg.role] ?? 0) + 1;
|
|
1625
1073
|
if (msg.role === "user") {
|
|
1626
1074
|
const text = extractText(msg.content);
|
|
1627
|
-
if (text)
|
|
1628
|
-
|
|
1075
|
+
if (!text)
|
|
1076
|
+
continue;
|
|
1077
|
+
items.push({
|
|
1078
|
+
kind: "user",
|
|
1079
|
+
text: restoredPromptCommandDisplayText(text) ?? text,
|
|
1080
|
+
id: `restore-${id++}`,
|
|
1081
|
+
});
|
|
1629
1082
|
}
|
|
1630
1083
|
else if (msg.role === "assistant") {
|
|
1631
1084
|
const content = msg.content;
|
|
1632
1085
|
if (typeof content === "string") {
|
|
1633
1086
|
if (content)
|
|
1634
|
-
|
|
1087
|
+
pushRestoredAssistantText(content);
|
|
1635
1088
|
continue;
|
|
1636
1089
|
}
|
|
1637
1090
|
for (const block of content) {
|
|
@@ -1654,7 +1107,7 @@ function messagesToHistoryItems(msgs) {
|
|
|
1654
1107
|
let textBuf = "";
|
|
1655
1108
|
const flushText = () => {
|
|
1656
1109
|
if (textBuf) {
|
|
1657
|
-
|
|
1110
|
+
pushRestoredAssistantText(textBuf);
|
|
1658
1111
|
textBuf = "";
|
|
1659
1112
|
}
|
|
1660
1113
|
};
|
|
@@ -1708,11 +1161,8 @@ function messagesToHistoryItems(msgs) {
|
|
|
1708
1161
|
});
|
|
1709
1162
|
return items;
|
|
1710
1163
|
}
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
// Ignore errors — user can copy URL manually
|
|
1715
|
-
});
|
|
1164
|
+
if (process.argv[1] &&
|
|
1165
|
+
fileURLToPath(import.meta.url) === fs.realpathSync(path.resolve(process.argv[1]))) {
|
|
1166
|
+
main();
|
|
1716
1167
|
}
|
|
1717
|
-
main();
|
|
1718
1168
|
//# sourceMappingURL=cli.js.map
|