@prestyj/cli 4.3.210 → 4.3.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -9
- package/dist/cli/auth.d.ts +4 -0
- package/dist/cli/auth.d.ts.map +1 -0
- package/dist/cli/auth.js +344 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/command-routing.d.ts +28 -0
- package/dist/cli/command-routing.d.ts.map +1 -0
- package/dist/cli/command-routing.js +53 -0
- package/dist/cli/command-routing.js.map +1 -0
- package/dist/cli/command-routing.test.d.ts +2 -0
- package/dist/cli/command-routing.test.d.ts.map +1 -0
- package/dist/cli/command-routing.test.js +60 -0
- package/dist/cli/command-routing.test.js.map +1 -0
- package/dist/cli/mcp.d.ts +2 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/cli/mcp.js +309 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/pixel.d.ts +27 -0
- package/dist/cli/pixel.d.ts.map +1 -0
- package/dist/cli/pixel.js +103 -0
- package/dist/cli/pixel.js.map +1 -0
- package/dist/cli/shared.d.ts +13 -0
- package/dist/cli/shared.d.ts.map +1 -0
- package/dist/cli/shared.js +82 -0
- package/dist/cli/shared.js.map +1 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +174 -732
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +4 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -1
- package/dist/config.js.map +1 -1
- package/dist/config.test.d.ts +2 -0
- package/dist/config.test.d.ts.map +1 -0
- package/dist/config.test.js +29 -0
- package/dist/config.test.js.map +1 -0
- package/dist/core/agent-session-compaction.test.d.ts +2 -0
- package/dist/core/agent-session-compaction.test.d.ts.map +1 -0
- package/dist/core/agent-session-compaction.test.js +114 -0
- package/dist/core/agent-session-compaction.test.js.map +1 -0
- package/dist/core/agent-session.d.ts +0 -23
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +6 -101
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/checkpoint-store.d.ts +93 -0
- package/dist/core/checkpoint-store.d.ts.map +1 -0
- package/dist/core/checkpoint-store.js +188 -0
- package/dist/core/checkpoint-store.js.map +1 -0
- package/dist/core/checkpoint-store.test.d.ts +2 -0
- package/dist/core/checkpoint-store.test.d.ts.map +1 -0
- package/dist/core/checkpoint-store.test.js +111 -0
- package/dist/core/checkpoint-store.test.js.map +1 -0
- package/dist/core/compaction/compactor.d.ts +4 -0
- package/dist/core/compaction/compactor.d.ts.map +1 -1
- package/dist/core/compaction/compactor.js +81 -28
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/compactor.test.js +33 -9
- package/dist/core/compaction/compactor.test.js.map +1 -1
- package/dist/core/compaction/token-estimator.test.js +1 -1
- package/dist/core/continue-replay-inventory.test.d.ts +2 -0
- package/dist/core/continue-replay-inventory.test.d.ts.map +1 -0
- package/dist/core/continue-replay-inventory.test.js +42 -0
- package/dist/core/continue-replay-inventory.test.js.map +1 -0
- package/dist/core/goal-controller.d.ts +4 -0
- package/dist/core/goal-controller.d.ts.map +1 -1
- package/dist/core/goal-controller.js +223 -32
- package/dist/core/goal-controller.js.map +1 -1
- package/dist/core/goal-controller.test.js +387 -22
- package/dist/core/goal-controller.test.js.map +1 -1
- package/dist/core/goal-lifecycle-smoke.test.js +49 -8
- package/dist/core/goal-lifecycle-smoke.test.js.map +1 -1
- package/dist/core/goal-prerequisites.d.ts +23 -0
- package/dist/core/goal-prerequisites.d.ts.map +1 -0
- package/dist/core/goal-prerequisites.js +114 -0
- package/dist/core/goal-prerequisites.js.map +1 -0
- package/dist/core/goal-prerequisites.test.d.ts +2 -0
- package/dist/core/goal-prerequisites.test.d.ts.map +1 -0
- package/dist/core/goal-prerequisites.test.js +118 -0
- package/dist/core/goal-prerequisites.test.js.map +1 -0
- package/dist/core/goal-store.d.ts +12 -1
- package/dist/core/goal-store.d.ts.map +1 -1
- package/dist/core/goal-store.js +146 -40
- package/dist/core/goal-store.js.map +1 -1
- package/dist/core/goal-store.test.js +65 -8
- package/dist/core/goal-store.test.js.map +1 -1
- package/dist/core/goal-verifier.d.ts.map +1 -1
- package/dist/core/goal-verifier.js +4 -1
- package/dist/core/goal-verifier.js.map +1 -1
- package/dist/core/goal-verifier.test.js +43 -0
- package/dist/core/goal-verifier.test.js.map +1 -1
- package/dist/core/goal-worker.d.ts +2 -0
- package/dist/core/goal-worker.d.ts.map +1 -1
- package/dist/core/goal-worker.js +31 -7
- package/dist/core/goal-worker.js.map +1 -1
- package/dist/core/goal-worker.test.js +44 -0
- package/dist/core/goal-worker.test.js.map +1 -1
- package/dist/core/ideal-review.d.ts +20 -0
- package/dist/core/ideal-review.d.ts.map +1 -0
- package/dist/core/ideal-review.js +55 -0
- package/dist/core/ideal-review.js.map +1 -0
- package/dist/core/ideal-review.test.d.ts +2 -0
- package/dist/core/ideal-review.test.d.ts.map +1 -0
- package/dist/core/ideal-review.test.js +59 -0
- package/dist/core/ideal-review.test.js.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/loop-breaker.d.ts +46 -0
- package/dist/core/loop-breaker.d.ts.map +1 -0
- package/dist/core/loop-breaker.js +79 -0
- package/dist/core/loop-breaker.js.map +1 -0
- package/dist/core/loop-breaker.test.d.ts +2 -0
- package/dist/core/loop-breaker.test.d.ts.map +1 -0
- package/dist/core/loop-breaker.test.js +110 -0
- package/dist/core/loop-breaker.test.js.map +1 -0
- package/dist/core/mcp/client.d.ts +20 -0
- package/dist/core/mcp/client.d.ts.map +1 -1
- package/dist/core/mcp/client.js +55 -11
- package/dist/core/mcp/client.js.map +1 -1
- package/dist/core/mcp/defaults.d.ts +7 -0
- package/dist/core/mcp/defaults.d.ts.map +1 -1
- package/dist/core/mcp/defaults.js +14 -0
- package/dist/core/mcp/defaults.js.map +1 -1
- package/dist/core/mcp/index.d.ts +6 -1
- package/dist/core/mcp/index.d.ts.map +1 -1
- package/dist/core/mcp/index.js +3 -1
- package/dist/core/mcp/index.js.map +1 -1
- package/dist/core/mcp/parse-add-command.d.ts +25 -0
- package/dist/core/mcp/parse-add-command.d.ts.map +1 -0
- package/dist/core/mcp/parse-add-command.js +220 -0
- package/dist/core/mcp/parse-add-command.js.map +1 -0
- package/dist/core/mcp/parse-add-command.test.d.ts +2 -0
- package/dist/core/mcp/parse-add-command.test.d.ts.map +1 -0
- package/dist/core/mcp/parse-add-command.test.js +75 -0
- package/dist/core/mcp/parse-add-command.test.js.map +1 -0
- package/dist/core/mcp/store.d.ts +80 -0
- package/dist/core/mcp/store.d.ts.map +1 -0
- package/dist/core/mcp/store.js +157 -0
- package/dist/core/mcp/store.js.map +1 -0
- package/dist/core/mcp/store.test.d.ts +2 -0
- package/dist/core/mcp/store.test.d.ts.map +1 -0
- package/dist/core/mcp/store.test.js +101 -0
- package/dist/core/mcp/store.test.js.map +1 -0
- package/dist/core/model-registry.d.ts +2 -2
- package/dist/core/model-registry.js +4 -4
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-registry.test.js +1 -1
- package/dist/core/model-registry.test.js.map +1 -1
- package/dist/core/prompt-commands.d.ts.map +1 -1
- package/dist/core/prompt-commands.js +64 -894
- package/dist/core/prompt-commands.js.map +1 -1
- package/dist/core/prompt-commands.test.js +49 -41
- package/dist/core/prompt-commands.test.js.map +1 -1
- package/dist/core/regrounding.d.ts +23 -0
- package/dist/core/regrounding.d.ts.map +1 -0
- package/dist/core/regrounding.js +21 -0
- package/dist/core/regrounding.js.map +1 -0
- package/dist/core/regrounding.test.d.ts +2 -0
- package/dist/core/regrounding.test.d.ts.map +1 -0
- package/dist/core/regrounding.test.js +38 -0
- package/dist/core/regrounding.test.js.map +1 -0
- package/dist/core/runtime-mode.d.ts +23 -0
- package/dist/core/runtime-mode.d.ts.map +1 -0
- package/dist/core/runtime-mode.js +30 -0
- package/dist/core/runtime-mode.js.map +1 -0
- package/dist/core/session-manager.d.ts +4 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +20 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-restore-display.test.d.ts +2 -0
- package/dist/core/session-restore-display.test.d.ts.map +1 -0
- package/dist/core/session-restore-display.test.js +78 -0
- package/dist/core/session-restore-display.test.js.map +1 -0
- package/dist/core/settings-manager.d.ts +4 -2
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +3 -6
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts +0 -2
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +10 -15
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/style-packs/index.js +1 -1
- package/dist/core/style-packs/index.js.map +1 -1
- package/dist/core/task-store.d.ts +26 -0
- package/dist/core/task-store.d.ts.map +1 -0
- package/dist/core/task-store.js +147 -0
- package/dist/core/task-store.js.map +1 -0
- package/dist/core/tasks-store.d.ts +24 -0
- package/dist/core/tasks-store.d.ts.map +1 -0
- package/dist/core/tasks-store.js +81 -0
- package/dist/core/tasks-store.js.map +1 -0
- package/dist/core/thinking-level.d.ts +5 -0
- package/dist/core/thinking-level.d.ts.map +1 -0
- package/dist/core/thinking-level.js +59 -0
- package/dist/core/thinking-level.js.map +1 -0
- package/dist/core/thinking-level.test.d.ts +2 -0
- package/dist/core/thinking-level.test.d.ts.map +1 -0
- package/dist/core/thinking-level.test.js +38 -0
- package/dist/core/thinking-level.test.js.map +1 -0
- package/dist/core/verify-commands.js +4 -4
- package/dist/core/verify-commands.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactive.d.ts.map +1 -1
- package/dist/interactive.js +3 -1
- package/dist/interactive.js.map +1 -1
- package/dist/system-prompt.d.ts +5 -1
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +76 -48
- package/dist/system-prompt.js.map +1 -1
- package/dist/system-prompt.test.js +98 -46
- package/dist/system-prompt.test.js.map +1 -1
- package/dist/tools/bash.d.ts +6 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +21 -3
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/checkpoint-hook.test.d.ts +2 -0
- package/dist/tools/checkpoint-hook.test.d.ts.map +1 -0
- package/dist/tools/checkpoint-hook.test.js +65 -0
- package/dist/tools/checkpoint-hook.test.js.map +1 -0
- package/dist/tools/edit-diff.d.ts +17 -4
- package/dist/tools/edit-diff.d.ts.map +1 -1
- package/dist/tools/edit-diff.js +78 -16
- package/dist/tools/edit-diff.js.map +1 -1
- package/dist/tools/edit-diff.test.js +31 -1
- package/dist/tools/edit-diff.test.js.map +1 -1
- package/dist/tools/edit-robustness.test.d.ts +2 -0
- package/dist/tools/edit-robustness.test.d.ts.map +1 -0
- package/dist/tools/edit-robustness.test.js +415 -0
- package/dist/tools/edit-robustness.test.js.map +1 -0
- package/dist/tools/edit.d.ts +8 -2
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +48 -20
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/edit.test.js +23 -22
- package/dist/tools/edit.test.js.map +1 -1
- package/dist/tools/enter-plan.d.ts +1 -3
- package/dist/tools/enter-plan.d.ts.map +1 -1
- package/dist/tools/enter-plan.js +9 -21
- package/dist/tools/enter-plan.js.map +1 -1
- package/dist/tools/exit-plan.d.ts.map +1 -1
- package/dist/tools/exit-plan.js +8 -9
- package/dist/tools/exit-plan.js.map +1 -1
- package/dist/tools/goal-mode.test.d.ts +2 -0
- package/dist/tools/goal-mode.test.d.ts.map +1 -0
- package/dist/tools/goal-mode.test.js +121 -0
- package/dist/tools/goal-mode.test.js.map +1 -0
- package/dist/tools/goals.d.ts +14 -2
- package/dist/tools/goals.d.ts.map +1 -1
- package/dist/tools/goals.js +257 -26
- package/dist/tools/goals.js.map +1 -1
- package/dist/tools/goals.test.js +365 -1
- package/dist/tools/goals.test.js.map +1 -1
- package/dist/tools/html-extract.d.ts +58 -0
- package/dist/tools/html-extract.d.ts.map +1 -0
- package/dist/tools/html-extract.js +130 -0
- package/dist/tools/html-extract.js.map +1 -0
- package/dist/tools/html-extract.test.d.ts +2 -0
- package/dist/tools/html-extract.test.d.ts.map +1 -0
- package/dist/tools/html-extract.test.js +60 -0
- package/dist/tools/html-extract.test.js.map +1 -0
- package/dist/tools/index.d.ts +15 -12
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +12 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/pdf-extract.d.ts +18 -0
- package/dist/tools/pdf-extract.d.ts.map +1 -0
- package/dist/tools/pdf-extract.js +43 -0
- package/dist/tools/pdf-extract.js.map +1 -0
- package/dist/tools/pdf-extract.test.d.ts +2 -0
- package/dist/tools/pdf-extract.test.d.ts.map +1 -0
- package/dist/tools/pdf-extract.test.js +15 -0
- package/dist/tools/pdf-extract.test.js.map +1 -0
- package/dist/tools/plan-mode.test.js +82 -243
- package/dist/tools/plan-mode.test.js.map +1 -1
- package/dist/tools/prompt-hints.d.ts.map +1 -1
- package/dist/tools/prompt-hints.js +6 -9
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/tools/read-only-bash.d.ts +13 -0
- package/dist/tools/read-only-bash.d.ts.map +1 -0
- package/dist/tools/read-only-bash.js +155 -0
- package/dist/tools/read-only-bash.js.map +1 -0
- package/dist/tools/read-only-bash.test.d.ts +2 -0
- package/dist/tools/read-only-bash.test.d.ts.map +1 -0
- package/dist/tools/read-only-bash.test.js +47 -0
- package/dist/tools/read-only-bash.test.js.map +1 -0
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +14 -1
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/read.test.js +4 -0
- package/dist/tools/read.test.js.map +1 -1
- package/dist/tools/screenshot.d.ts +25 -0
- package/dist/tools/screenshot.d.ts.map +1 -0
- package/dist/tools/screenshot.js +165 -0
- package/dist/tools/screenshot.js.map +1 -0
- package/dist/tools/screenshot.test.d.ts +2 -0
- package/dist/tools/screenshot.test.d.ts.map +1 -0
- package/dist/tools/screenshot.test.js +145 -0
- package/dist/tools/screenshot.test.js.map +1 -0
- package/dist/tools/subagent.d.ts +7 -2
- package/dist/tools/subagent.d.ts.map +1 -1
- package/dist/tools/subagent.js +31 -9
- package/dist/tools/subagent.js.map +1 -1
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +22 -58
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/web-fetch.d.ts +16 -1
- package/dist/tools/web-fetch.d.ts.map +1 -1
- package/dist/tools/web-fetch.js +357 -45
- package/dist/tools/web-fetch.js.map +1 -1
- package/dist/tools/web-fetch.test.js +263 -2
- package/dist/tools/web-fetch.test.js.map +1 -1
- package/dist/tools/web-search.d.ts +14 -0
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +321 -35
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools/web-search.test.js +144 -1
- package/dist/tools/web-search.test.js.map +1 -1
- package/dist/tools/write.d.ts +8 -2
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +36 -9
- package/dist/tools/write.js.map +1 -1
- package/dist/tools/write.test.js +0 -16
- package/dist/tools/write.test.js.map +1 -1
- package/dist/ui/App.d.ts +52 -280
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +1608 -2235
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/activity-phrases.d.ts.map +1 -1
- package/dist/ui/activity-phrases.js +0 -2
- package/dist/ui/activity-phrases.js.map +1 -1
- package/dist/ui/app-items.d.ts +276 -0
- package/dist/ui/app-items.d.ts.map +1 -0
- package/dist/ui/app-items.js +52 -0
- package/dist/ui/app-items.js.map +1 -0
- package/dist/ui/app-items.test.d.ts +2 -0
- package/dist/ui/app-items.test.d.ts.map +1 -0
- package/dist/ui/app-items.test.js +38 -0
- package/dist/ui/app-items.test.js.map +1 -0
- package/dist/ui/app-state-persistence.test.js +45 -160
- package/dist/ui/app-state-persistence.test.js.map +1 -1
- package/dist/ui/assistant-stream-flush-parity.test.d.ts +2 -0
- package/dist/ui/assistant-stream-flush-parity.test.d.ts.map +1 -0
- package/dist/ui/assistant-stream-flush-parity.test.js +85 -0
- package/dist/ui/assistant-stream-flush-parity.test.js.map +1 -0
- package/dist/ui/chat-layout-pinning.test.d.ts +2 -0
- package/dist/ui/chat-layout-pinning.test.d.ts.map +1 -0
- package/dist/ui/chat-layout-pinning.test.js +525 -0
- package/dist/ui/chat-layout-pinning.test.js.map +1 -0
- package/dist/ui/components/ActivityIndicator.d.ts +1 -2
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/ui/components/ActivityIndicator.js +63 -94
- package/dist/ui/components/ActivityIndicator.js.map +1 -1
- package/dist/ui/components/AnimationContext.d.ts.map +1 -1
- package/dist/ui/components/AnimationContext.js +3 -5
- package/dist/ui/components/AnimationContext.js.map +1 -1
- package/dist/ui/components/AssistantMessage.d.ts +6 -2
- package/dist/ui/components/AssistantMessage.d.ts.map +1 -1
- package/dist/ui/components/AssistantMessage.js +9 -4
- package/dist/ui/components/AssistantMessage.js.map +1 -1
- package/dist/ui/components/AssistantMessage.test.d.ts +2 -0
- package/dist/ui/components/AssistantMessage.test.d.ts.map +1 -0
- package/dist/ui/components/AssistantMessage.test.js +387 -0
- package/dist/ui/components/AssistantMessage.test.js.map +1 -0
- package/dist/ui/components/BackgroundTasksBar.d.ts +1 -3
- package/dist/ui/components/BackgroundTasksBar.d.ts.map +1 -1
- package/dist/ui/components/BackgroundTasksBar.js +8 -10
- package/dist/ui/components/BackgroundTasksBar.js.map +1 -1
- package/dist/ui/components/Banner.d.ts +1 -2
- package/dist/ui/components/Banner.d.ts.map +1 -1
- package/dist/ui/components/Banner.js +9 -4
- package/dist/ui/components/Banner.js.map +1 -1
- package/dist/ui/components/ChatFooterPane.d.ts +25 -0
- package/dist/ui/components/ChatFooterPane.d.ts.map +1 -0
- package/dist/ui/components/ChatFooterPane.js +15 -0
- package/dist/ui/components/ChatFooterPane.js.map +1 -0
- package/dist/ui/components/ChatInputStack.d.ts +36 -0
- package/dist/ui/components/ChatInputStack.d.ts.map +1 -0
- package/dist/ui/components/ChatInputStack.js +10 -0
- package/dist/ui/components/ChatInputStack.js.map +1 -0
- package/dist/ui/components/ChatLayout.d.ts +37 -0
- package/dist/ui/components/ChatLayout.d.ts.map +1 -0
- package/dist/ui/components/ChatLayout.js +21 -0
- package/dist/ui/components/ChatLayout.js.map +1 -0
- package/dist/ui/components/ChatLivePane.d.ts +18 -0
- package/dist/ui/components/ChatLivePane.d.ts.map +1 -0
- package/dist/ui/components/ChatLivePane.js +22 -0
- package/dist/ui/components/ChatLivePane.js.map +1 -0
- package/dist/ui/components/ChatScreen.d.ts +136 -0
- package/dist/ui/components/ChatScreen.d.ts.map +1 -0
- package/dist/ui/components/ChatScreen.js +16 -0
- package/dist/ui/components/ChatScreen.js.map +1 -0
- package/dist/ui/components/ChatStatusRow.d.ts +34 -0
- package/dist/ui/components/ChatStatusRow.d.ts.map +1 -0
- package/dist/ui/components/ChatStatusRow.js +11 -0
- package/dist/ui/components/ChatStatusRow.js.map +1 -0
- package/dist/ui/components/CompactionNotice.d.ts +4 -2
- package/dist/ui/components/CompactionNotice.d.ts.map +1 -1
- package/dist/ui/components/CompactionNotice.js +4 -4
- package/dist/ui/components/CompactionNotice.js.map +1 -1
- package/dist/ui/components/Footer.d.ts +27 -6
- package/dist/ui/components/Footer.d.ts.map +1 -1
- package/dist/ui/components/Footer.js +75 -30
- package/dist/ui/components/Footer.js.map +1 -1
- package/dist/ui/components/FooterStatusRow.d.ts +20 -0
- package/dist/ui/components/FooterStatusRow.d.ts.map +1 -0
- package/dist/ui/components/FooterStatusRow.js +10 -0
- package/dist/ui/components/FooterStatusRow.js.map +1 -0
- package/dist/ui/components/FullScreenOverlayRouter.d.ts +19 -0
- package/dist/ui/components/FullScreenOverlayRouter.d.ts.map +1 -0
- package/dist/ui/components/FullScreenOverlayRouter.js +18 -0
- package/dist/ui/components/FullScreenOverlayRouter.js.map +1 -0
- package/dist/ui/components/GoalOverlay.d.ts +28 -20
- package/dist/ui/components/GoalOverlay.d.ts.map +1 -1
- package/dist/ui/components/GoalOverlay.js +283 -253
- package/dist/ui/components/GoalOverlay.js.map +1 -1
- package/dist/ui/components/GoalStatusBar.d.ts.map +1 -1
- package/dist/ui/components/GoalStatusBar.js +2 -1
- package/dist/ui/components/GoalStatusBar.js.map +1 -1
- package/dist/ui/components/IdealHookMessage.d.ts +14 -0
- package/dist/ui/components/IdealHookMessage.d.ts.map +1 -0
- package/dist/ui/components/IdealHookMessage.js +26 -0
- package/dist/ui/components/IdealHookMessage.js.map +1 -0
- package/dist/ui/components/InputArea.d.ts +31 -6
- package/dist/ui/components/InputArea.d.ts.map +1 -1
- package/dist/ui/components/InputArea.js +208 -50
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/components/InputArea.test.js +11 -1
- package/dist/ui/components/InputArea.test.js.map +1 -1
- package/dist/ui/components/LiveToolPanel.d.ts +30 -0
- package/dist/ui/components/LiveToolPanel.d.ts.map +1 -0
- package/dist/ui/components/LiveToolPanel.js +66 -0
- package/dist/ui/components/LiveToolPanel.js.map +1 -0
- package/dist/ui/components/Markdown.d.ts +11 -11
- package/dist/ui/components/Markdown.d.ts.map +1 -1
- package/dist/ui/components/Markdown.js +28 -198
- package/dist/ui/components/Markdown.js.map +1 -1
- package/dist/ui/components/ModelSelector.d.ts.map +1 -1
- package/dist/ui/components/ModelSelector.js +18 -18
- package/dist/ui/components/ModelSelector.js.map +1 -1
- package/dist/ui/components/PlanModeLogo.d.ts +3 -0
- package/dist/ui/components/PlanModeLogo.d.ts.map +1 -0
- package/dist/ui/components/PlanModeLogo.js +49 -0
- package/dist/ui/components/PlanModeLogo.js.map +1 -0
- package/dist/ui/components/PlanOverlay.d.ts +7 -0
- package/dist/ui/components/PlanOverlay.d.ts.map +1 -1
- package/dist/ui/components/PlanOverlay.js +17 -3
- package/dist/ui/components/PlanOverlay.js.map +1 -1
- package/dist/ui/components/PlanOverlay.test.d.ts +2 -0
- package/dist/ui/components/PlanOverlay.test.d.ts.map +1 -0
- package/dist/ui/components/PlanOverlay.test.js +24 -0
- package/dist/ui/components/PlanOverlay.test.js.map +1 -0
- package/dist/ui/components/QueueIndicator.d.ts +9 -0
- package/dist/ui/components/QueueIndicator.d.ts.map +1 -0
- package/dist/ui/components/QueueIndicator.js +9 -0
- package/dist/ui/components/QueueIndicator.js.map +1 -0
- package/dist/ui/components/RewindOverlay.d.ts +18 -0
- package/dist/ui/components/RewindOverlay.d.ts.map +1 -0
- package/dist/ui/components/RewindOverlay.js +52 -0
- package/dist/ui/components/RewindOverlay.js.map +1 -0
- package/dist/ui/components/SelectList.d.ts.map +1 -1
- package/dist/ui/components/SelectList.js +5 -0
- package/dist/ui/components/SelectList.js.map +1 -1
- package/dist/ui/components/ServerToolExecution.d.ts +2 -0
- package/dist/ui/components/ServerToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ServerToolExecution.js +7 -23
- package/dist/ui/components/ServerToolExecution.js.map +1 -1
- package/dist/ui/components/SessionSummary.d.ts +5 -0
- package/dist/ui/components/SessionSummary.d.ts.map +1 -0
- package/dist/ui/components/SessionSummary.js +32 -0
- package/dist/ui/components/SessionSummary.js.map +1 -0
- package/dist/ui/components/SlashCommandMenu.d.ts +4 -3
- package/dist/ui/components/SlashCommandMenu.d.ts.map +1 -1
- package/dist/ui/components/SlashCommandMenu.js +38 -26
- package/dist/ui/components/SlashCommandMenu.js.map +1 -1
- package/dist/ui/components/SlashStyledSelectList.d.ts +21 -0
- package/dist/ui/components/SlashStyledSelectList.d.ts.map +1 -0
- package/dist/ui/components/SlashStyledSelectList.js +71 -0
- package/dist/ui/components/SlashStyledSelectList.js.map +1 -0
- package/dist/ui/components/StreamingArea.d.ts +11 -2
- package/dist/ui/components/StreamingArea.d.ts.map +1 -1
- package/dist/ui/components/StreamingArea.js +20 -23
- package/dist/ui/components/StreamingArea.js.map +1 -1
- package/dist/ui/components/StreamingArea.test.d.ts +2 -0
- package/dist/ui/components/StreamingArea.test.d.ts.map +1 -0
- package/dist/ui/components/StreamingArea.test.js +18 -0
- package/dist/ui/components/StreamingArea.test.js.map +1 -0
- package/dist/ui/components/SubAgentPanel.d.ts +2 -1
- package/dist/ui/components/SubAgentPanel.d.ts.map +1 -1
- package/dist/ui/components/SubAgentPanel.js +4 -3
- package/dist/ui/components/SubAgentPanel.js.map +1 -1
- package/dist/ui/components/TaskOverlay.d.ts.map +1 -1
- package/dist/ui/components/TaskOverlay.js +53 -82
- package/dist/ui/components/TaskOverlay.js.map +1 -1
- package/dist/ui/components/TaskPickerMenu.d.ts +9 -0
- package/dist/ui/components/TaskPickerMenu.d.ts.map +1 -0
- package/dist/ui/components/TaskPickerMenu.js +33 -0
- package/dist/ui/components/TaskPickerMenu.js.map +1 -0
- package/dist/ui/components/ThemeSelector.js +2 -2
- package/dist/ui/components/ThemeSelector.js.map +1 -1
- package/dist/ui/components/ToolExecution.d.ts +2 -0
- package/dist/ui/components/ToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolExecution.js +18 -52
- package/dist/ui/components/ToolExecution.js.map +1 -1
- package/dist/ui/components/ToolGroupExecution.d.ts +6 -2
- package/dist/ui/components/ToolGroupExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolGroupExecution.js +15 -147
- package/dist/ui/components/ToolGroupExecution.js.map +1 -1
- package/dist/ui/components/ToolUseLoader.d.ts +3 -1
- package/dist/ui/components/ToolUseLoader.d.ts.map +1 -1
- package/dist/ui/components/ToolUseLoader.js +2 -2
- package/dist/ui/components/ToolUseLoader.js.map +1 -1
- package/dist/ui/components/TranscriptViewport.d.ts +34 -0
- package/dist/ui/components/TranscriptViewport.d.ts.map +1 -0
- package/dist/ui/components/TranscriptViewport.js +45 -0
- package/dist/ui/components/TranscriptViewport.js.map +1 -0
- package/dist/ui/components/UserMessage.d.ts.map +1 -1
- package/dist/ui/components/UserMessage.js +15 -10
- package/dist/ui/components/UserMessage.js.map +1 -1
- package/dist/ui/components/UserMessage.test.d.ts +2 -0
- package/dist/ui/components/UserMessage.test.d.ts.map +1 -0
- package/dist/ui/components/UserMessage.test.js +39 -0
- package/dist/ui/components/UserMessage.test.js.map +1 -0
- package/dist/ui/components/index.d.ts +5 -0
- package/dist/ui/components/index.d.ts.map +1 -1
- package/dist/ui/components/index.js +5 -0
- package/dist/ui/components/index.js.map +1 -1
- package/dist/ui/duration-format.d.ts +2 -0
- package/dist/ui/duration-format.d.ts.map +1 -0
- package/dist/ui/duration-format.js +9 -0
- package/dist/ui/duration-format.js.map +1 -0
- package/dist/ui/duration-summary.d.ts +2 -0
- package/dist/ui/duration-summary.d.ts.map +1 -0
- package/dist/ui/duration-summary.js +66 -0
- package/dist/ui/duration-summary.js.map +1 -0
- package/dist/ui/error-item.d.ts +8 -0
- package/dist/ui/error-item.d.ts.map +1 -0
- package/dist/ui/error-item.js +32 -0
- package/dist/ui/error-item.js.map +1 -0
- package/dist/ui/footer-jump-regression.test.d.ts +2 -0
- package/dist/ui/footer-jump-regression.test.d.ts.map +1 -0
- package/dist/ui/footer-jump-regression.test.js +177 -0
- package/dist/ui/footer-jump-regression.test.js.map +1 -0
- package/dist/ui/footer-status-layout.test.js +22 -7
- package/dist/ui/footer-status-layout.test.js.map +1 -1
- package/dist/ui/goal-events.d.ts.map +1 -1
- package/dist/ui/goal-events.js +14 -6
- package/dist/ui/goal-events.js.map +1 -1
- package/dist/ui/goal-events.test.js +40 -2
- package/dist/ui/goal-events.test.js.map +1 -1
- package/dist/ui/goal-lifecycle-orchestration.test.d.ts +2 -0
- package/dist/ui/goal-lifecycle-orchestration.test.d.ts.map +1 -0
- package/dist/ui/goal-lifecycle-orchestration.test.js +512 -0
- package/dist/ui/goal-lifecycle-orchestration.test.js.map +1 -0
- package/dist/ui/goal-overlay.test.js +122 -44
- package/dist/ui/goal-overlay.test.js.map +1 -1
- package/dist/ui/goal-status-bar.test.js +29 -0
- package/dist/ui/goal-status-bar.test.js.map +1 -1
- package/dist/ui/goal-summary.d.ts +14 -0
- package/dist/ui/goal-summary.d.ts.map +1 -0
- package/dist/ui/goal-summary.js +194 -0
- package/dist/ui/goal-summary.js.map +1 -0
- package/dist/ui/hooks/useAgentLoop.d.ts +25 -4
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +197 -22
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.test.d.ts +2 -0
- package/dist/ui/hooks/useAgentLoop.test.d.ts.map +1 -0
- package/dist/ui/hooks/useAgentLoop.test.js +8 -0
- package/dist/ui/hooks/useAgentLoop.test.js.map +1 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.d.ts +45 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.d.ts.map +1 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.js +97 -0
- package/dist/ui/hooks/useChatLayoutMeasurements.js.map +1 -0
- package/dist/ui/hooks/useContextCompaction.d.ts +41 -0
- package/dist/ui/hooks/useContextCompaction.d.ts.map +1 -0
- package/dist/ui/hooks/useContextCompaction.js +149 -0
- package/dist/ui/hooks/useContextCompaction.js.map +1 -0
- package/dist/ui/hooks/useModeState.d.ts +56 -0
- package/dist/ui/hooks/useModeState.d.ts.map +1 -0
- package/dist/ui/hooks/useModeState.js +65 -0
- package/dist/ui/hooks/useModeState.js.map +1 -0
- package/dist/ui/hooks/usePixelFixFlow.d.ts +57 -0
- package/dist/ui/hooks/usePixelFixFlow.d.ts.map +1 -0
- package/dist/ui/hooks/usePixelFixFlow.js +102 -0
- package/dist/ui/hooks/usePixelFixFlow.js.map +1 -0
- package/dist/ui/hooks/useSessionPersistence.d.ts +34 -0
- package/dist/ui/hooks/useSessionPersistence.d.ts.map +1 -0
- package/dist/ui/hooks/useSessionPersistence.js +67 -0
- package/dist/ui/hooks/useSessionPersistence.js.map +1 -0
- package/dist/ui/hooks/useTaskPickerController.d.ts +19 -0
- package/dist/ui/hooks/useTaskPickerController.d.ts.map +1 -0
- package/dist/ui/hooks/useTaskPickerController.js +41 -0
- package/dist/ui/hooks/useTaskPickerController.js.map +1 -0
- package/dist/ui/hooks/useTerminalSize.d.ts +13 -10
- package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -1
- package/dist/ui/hooks/useTerminalSize.js +21 -16
- package/dist/ui/hooks/useTerminalSize.js.map +1 -1
- package/dist/ui/hooks/useTranscriptHistory.d.ts +48 -0
- package/dist/ui/hooks/useTranscriptHistory.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptHistory.js +113 -0
- package/dist/ui/hooks/useTranscriptHistory.js.map +1 -0
- package/dist/ui/hooks/useTranscriptHistory.test.d.ts +2 -0
- package/dist/ui/hooks/useTranscriptHistory.test.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptHistory.test.js +61 -0
- package/dist/ui/hooks/useTranscriptHistory.test.js.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.d.ts +30 -0
- package/dist/ui/hooks/useTranscriptScroll.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.js +44 -0
- package/dist/ui/hooks/useTranscriptScroll.js.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.test.d.ts +2 -0
- package/dist/ui/hooks/useTranscriptScroll.test.d.ts.map +1 -0
- package/dist/ui/hooks/useTranscriptScroll.test.js +119 -0
- package/dist/ui/hooks/useTranscriptScroll.test.js.map +1 -0
- package/dist/ui/item-helpers.d.ts +26 -0
- package/dist/ui/item-helpers.d.ts.map +1 -0
- package/dist/ui/item-helpers.js +114 -0
- package/dist/ui/item-helpers.js.map +1 -0
- package/dist/ui/layout-decisions.d.ts +81 -0
- package/dist/ui/layout-decisions.d.ts.map +1 -0
- package/dist/ui/layout-decisions.js +89 -0
- package/dist/ui/layout-decisions.js.map +1 -0
- package/dist/ui/live-area-clamp.test.d.ts +2 -0
- package/dist/ui/live-area-clamp.test.d.ts.map +1 -0
- package/dist/ui/live-area-clamp.test.js +88 -0
- package/dist/ui/live-area-clamp.test.js.map +1 -0
- package/dist/ui/live-area-height.d.ts +35 -0
- package/dist/ui/live-area-height.d.ts.map +1 -0
- package/dist/ui/live-area-height.js +80 -0
- package/dist/ui/live-area-height.js.map +1 -0
- package/dist/ui/live-area-height.test.d.ts +2 -0
- package/dist/ui/live-area-height.test.d.ts.map +1 -0
- package/dist/ui/live-area-height.test.js +67 -0
- package/dist/ui/live-area-height.test.js.map +1 -0
- package/dist/ui/live-frame-height.test.d.ts +2 -0
- package/dist/ui/live-frame-height.test.d.ts.map +1 -0
- package/dist/ui/live-frame-height.test.js +116 -0
- package/dist/ui/live-frame-height.test.js.map +1 -0
- package/dist/ui/live-item-flush.d.ts +2 -2
- package/dist/ui/live-item-flush.d.ts.map +1 -1
- package/dist/ui/live-item-flush.js +8 -4
- package/dist/ui/live-item-flush.js.map +1 -1
- package/dist/ui/login.js +1 -1
- package/dist/ui/long-prompt-regression-harness.test.d.ts +2 -0
- package/dist/ui/long-prompt-regression-harness.test.d.ts.map +1 -0
- package/dist/ui/long-prompt-regression-harness.test.js +195 -0
- package/dist/ui/long-prompt-regression-harness.test.js.map +1 -0
- package/dist/ui/mcp.d.ts +62 -0
- package/dist/ui/mcp.d.ts.map +1 -0
- package/dist/ui/mcp.js +306 -0
- package/dist/ui/mcp.js.map +1 -0
- package/dist/ui/plan-overlay.test.js +7 -29
- package/dist/ui/plan-overlay.test.js.map +1 -1
- package/dist/ui/prompt-routing.d.ts +11 -0
- package/dist/ui/prompt-routing.d.ts.map +1 -0
- package/dist/ui/prompt-routing.js +61 -0
- package/dist/ui/prompt-routing.js.map +1 -0
- package/dist/ui/queued-message.test.d.ts +2 -0
- package/dist/ui/queued-message.test.d.ts.map +1 -0
- package/dist/ui/queued-message.test.js +162 -0
- package/dist/ui/queued-message.test.js.map +1 -0
- package/dist/ui/render.d.ts +38 -42
- package/dist/ui/render.d.ts.map +1 -1
- package/dist/ui/render.js +128 -42
- package/dist/ui/render.js.map +1 -1
- package/dist/ui/render.test.d.ts +2 -0
- package/dist/ui/render.test.d.ts.map +1 -0
- package/dist/ui/render.test.js +16 -0
- package/dist/ui/render.test.js.map +1 -0
- package/dist/ui/scroll-stabilization.test.js +1 -7
- package/dist/ui/scroll-stabilization.test.js.map +1 -1
- package/dist/ui/session-summary.d.ts +63 -0
- package/dist/ui/session-summary.d.ts.map +1 -0
- package/dist/ui/session-summary.js +81 -0
- package/dist/ui/session-summary.js.map +1 -0
- package/dist/ui/slash-command-images.test.js +12 -11
- package/dist/ui/slash-command-images.test.js.map +1 -1
- package/dist/ui/stores/transcript-scroll-store.d.ts +27 -0
- package/dist/ui/stores/transcript-scroll-store.d.ts.map +1 -0
- package/dist/ui/stores/transcript-scroll-store.js +73 -0
- package/dist/ui/stores/transcript-scroll-store.js.map +1 -0
- package/dist/ui/stores/transcript-scroll-store.test.d.ts +2 -0
- package/dist/ui/stores/transcript-scroll-store.test.d.ts.map +1 -0
- package/dist/ui/stores/transcript-scroll-store.test.js +73 -0
- package/dist/ui/stores/transcript-scroll-store.test.js.map +1 -0
- package/dist/ui/streaming-flush-bounce.test.d.ts +2 -0
- package/dist/ui/streaming-flush-bounce.test.d.ts.map +1 -0
- package/dist/ui/streaming-flush-bounce.test.js +156 -0
- package/dist/ui/streaming-flush-bounce.test.js.map +1 -0
- package/dist/ui/submit-prompt-command.d.ts +49 -0
- package/dist/ui/submit-prompt-command.d.ts.map +1 -0
- package/dist/ui/submit-prompt-command.js +107 -0
- package/dist/ui/submit-prompt-command.js.map +1 -0
- package/dist/ui/submit-slash-commands.d.ts +12 -0
- package/dist/ui/submit-slash-commands.d.ts.map +1 -0
- package/dist/ui/submit-slash-commands.js +32 -0
- package/dist/ui/submit-slash-commands.js.map +1 -0
- package/dist/ui/terminal-history-format.d.ts +43 -0
- package/dist/ui/terminal-history-format.d.ts.map +1 -0
- package/dist/ui/terminal-history-format.js +133 -0
- package/dist/ui/terminal-history-format.js.map +1 -0
- package/dist/ui/terminal-history-retry-dedup.test.d.ts +2 -0
- package/dist/ui/terminal-history-retry-dedup.test.d.ts.map +1 -0
- package/dist/ui/terminal-history-retry-dedup.test.js +61 -0
- package/dist/ui/terminal-history-retry-dedup.test.js.map +1 -0
- package/dist/ui/terminal-history-spacing.d.ts +2 -0
- package/dist/ui/terminal-history-spacing.d.ts.map +1 -0
- package/dist/ui/terminal-history-spacing.js +2 -0
- package/dist/ui/terminal-history-spacing.js.map +1 -0
- package/dist/ui/terminal-history-status-renderers.d.ts +15 -0
- package/dist/ui/terminal-history-status-renderers.d.ts.map +1 -0
- package/dist/ui/terminal-history-status-renderers.js +99 -0
- package/dist/ui/terminal-history-status-renderers.js.map +1 -0
- package/dist/ui/terminal-history.d.ts +26 -0
- package/dist/ui/terminal-history.d.ts.map +1 -0
- package/dist/ui/terminal-history.js +916 -0
- package/dist/ui/terminal-history.js.map +1 -0
- package/dist/ui/terminal-history.test.d.ts +2 -0
- package/dist/ui/terminal-history.test.d.ts.map +1 -0
- package/dist/ui/terminal-history.test.js +550 -0
- package/dist/ui/terminal-history.test.js.map +1 -0
- package/dist/ui/testing/screen-recorder.d.ts +29 -0
- package/dist/ui/testing/screen-recorder.d.ts.map +1 -0
- package/dist/ui/testing/screen-recorder.js +179 -0
- package/dist/ui/testing/screen-recorder.js.map +1 -0
- package/dist/ui/thinking-level-cycle.test.d.ts +2 -0
- package/dist/ui/thinking-level-cycle.test.d.ts.map +1 -0
- package/dist/ui/thinking-level-cycle.test.js +45 -0
- package/dist/ui/thinking-level-cycle.test.js.map +1 -0
- package/dist/ui/thinking-level.d.ts +2 -0
- package/dist/ui/thinking-level.d.ts.map +1 -0
- package/dist/ui/thinking-level.js +2 -0
- package/dist/ui/thinking-level.js.map +1 -0
- package/dist/ui/tool-group-summary.d.ts +24 -0
- package/dist/ui/tool-group-summary.d.ts.map +1 -0
- package/dist/ui/tool-group-summary.js +233 -0
- package/dist/ui/tool-group-summary.js.map +1 -0
- package/dist/ui/tool-group-summary.test.d.ts +2 -0
- package/dist/ui/tool-group-summary.test.d.ts.map +1 -0
- package/dist/ui/tool-group-summary.test.js +79 -0
- package/dist/ui/tool-group-summary.test.js.map +1 -0
- package/dist/ui/tool-line-summary.d.ts +29 -0
- package/dist/ui/tool-line-summary.d.ts.map +1 -0
- package/dist/ui/tool-line-summary.js +153 -0
- package/dist/ui/tool-line-summary.js.map +1 -0
- package/dist/ui/transcript/MiscRows.d.ts +26 -0
- package/dist/ui/transcript/MiscRows.d.ts.map +1 -0
- package/dist/ui/transcript/MiscRows.js +68 -0
- package/dist/ui/transcript/MiscRows.js.map +1 -0
- package/dist/ui/transcript/StatusRow.d.ts +14 -0
- package/dist/ui/transcript/StatusRow.d.ts.map +1 -0
- package/dist/ui/transcript/StatusRow.js +14 -0
- package/dist/ui/transcript/StatusRow.js.map +1 -0
- package/dist/ui/transcript/ToolRows.d.ts +20 -0
- package/dist/ui/transcript/ToolRows.d.ts.map +1 -0
- package/dist/ui/transcript/ToolRows.js +25 -0
- package/dist/ui/transcript/ToolRows.js.map +1 -0
- package/dist/ui/transcript/TranscriptItemFrame.d.ts +8 -0
- package/dist/ui/transcript/TranscriptItemFrame.d.ts.map +1 -0
- package/dist/ui/transcript/TranscriptItemFrame.js +9 -0
- package/dist/ui/transcript/TranscriptItemFrame.js.map +1 -0
- package/dist/ui/transcript/TranscriptRenderer.d.ts +22 -0
- package/dist/ui/transcript/TranscriptRenderer.d.ts.map +1 -0
- package/dist/ui/transcript/TranscriptRenderer.js +111 -0
- package/dist/ui/transcript/TranscriptRenderer.js.map +1 -0
- package/dist/ui/transcript/presentation.d.ts +61 -0
- package/dist/ui/transcript/presentation.d.ts.map +1 -0
- package/dist/ui/transcript/presentation.js +86 -0
- package/dist/ui/transcript/presentation.js.map +1 -0
- package/dist/ui/transcript/spacing.d.ts +56 -0
- package/dist/ui/transcript/spacing.d.ts.map +1 -0
- package/dist/ui/transcript/spacing.js +129 -0
- package/dist/ui/transcript/spacing.js.map +1 -0
- package/dist/ui/transcript/spacing.test.d.ts +2 -0
- package/dist/ui/transcript/spacing.test.d.ts.map +1 -0
- package/dist/ui/transcript/spacing.test.js +193 -0
- package/dist/ui/transcript/spacing.test.js.map +1 -0
- package/dist/ui/transcript/tool-presentation.d.ts +12 -0
- package/dist/ui/transcript/tool-presentation.d.ts.map +1 -0
- package/dist/ui/transcript/tool-presentation.js +55 -0
- package/dist/ui/transcript/tool-presentation.js.map +1 -0
- package/dist/ui/transcript/transcript-lines.d.ts +32 -0
- package/dist/ui/transcript/transcript-lines.d.ts.map +1 -0
- package/dist/ui/transcript/transcript-lines.js +86 -0
- package/dist/ui/transcript/transcript-lines.js.map +1 -0
- package/dist/ui/transcript/transcript-lines.test.d.ts +2 -0
- package/dist/ui/transcript/transcript-lines.test.d.ts.map +1 -0
- package/dist/ui/transcript/transcript-lines.test.js +76 -0
- package/dist/ui/transcript/transcript-lines.test.js.map +1 -0
- package/dist/ui/transcript-viewport-pinning.test.d.ts +2 -0
- package/dist/ui/transcript-viewport-pinning.test.d.ts.map +1 -0
- package/dist/ui/transcript-viewport-pinning.test.js +148 -0
- package/dist/ui/transcript-viewport-pinning.test.js.map +1 -0
- package/dist/ui/tui-history-parity.test.d.ts +2 -0
- package/dist/ui/tui-history-parity.test.d.ts.map +1 -0
- package/dist/ui/tui-history-parity.test.js +381 -0
- package/dist/ui/tui-history-parity.test.js.map +1 -0
- package/dist/ui/tui-simulation.test.d.ts +2 -0
- package/dist/ui/tui-simulation.test.d.ts.map +1 -0
- package/dist/ui/tui-simulation.test.js +139 -0
- package/dist/ui/tui-simulation.test.js.map +1 -0
- package/dist/ui/tui-terminal-recorder.test.d.ts +2 -0
- package/dist/ui/tui-terminal-recorder.test.d.ts.map +1 -0
- package/dist/ui/tui-terminal-recorder.test.js +134 -0
- package/dist/ui/tui-terminal-recorder.test.js.map +1 -0
- package/dist/ui/utils/assistant-stream-split.d.ts +23 -0
- package/dist/ui/utils/assistant-stream-split.d.ts.map +1 -0
- package/dist/ui/utils/assistant-stream-split.js +41 -0
- package/dist/ui/utils/assistant-stream-split.js.map +1 -0
- package/dist/ui/utils/assistant-stream-split.test.d.ts +2 -0
- package/dist/ui/utils/assistant-stream-split.test.d.ts.map +1 -0
- package/dist/ui/utils/assistant-stream-split.test.js +40 -0
- package/dist/ui/utils/assistant-stream-split.test.js.map +1 -0
- package/dist/ui/utils/latex-to-unicode.d.ts +22 -0
- package/dist/ui/utils/latex-to-unicode.d.ts.map +1 -0
- package/dist/ui/utils/latex-to-unicode.js +538 -0
- package/dist/ui/utils/latex-to-unicode.js.map +1 -0
- package/dist/ui/utils/markdown-renderer.d.ts +20 -0
- package/dist/ui/utils/markdown-renderer.d.ts.map +1 -0
- package/dist/ui/utils/markdown-renderer.js +327 -0
- package/dist/ui/utils/markdown-renderer.js.map +1 -0
- package/dist/ui/utils/markdown-table.d.ts +9 -0
- package/dist/ui/utils/markdown-table.d.ts.map +1 -0
- package/dist/ui/utils/markdown-table.js +95 -0
- package/dist/ui/utils/markdown-table.js.map +1 -0
- package/dist/ui/utils/terminal-graphics.d.ts +16 -0
- package/dist/ui/utils/terminal-graphics.d.ts.map +1 -0
- package/dist/ui/utils/terminal-graphics.js +68 -0
- package/dist/ui/utils/terminal-graphics.js.map +1 -0
- package/dist/ui/utils/terminal-graphics.test.d.ts +2 -0
- package/dist/ui/utils/terminal-graphics.test.d.ts.map +1 -0
- package/dist/ui/utils/terminal-graphics.test.js +61 -0
- package/dist/ui/utils/terminal-graphics.test.js.map +1 -0
- package/dist/ui/utils/terminal-input.d.ts +3 -0
- package/dist/ui/utils/terminal-input.d.ts.map +1 -0
- package/dist/ui/utils/terminal-input.js +28 -0
- package/dist/ui/utils/terminal-input.js.map +1 -0
- package/dist/ui/utils/terminal-input.test.d.ts +2 -0
- package/dist/ui/utils/terminal-input.test.d.ts.map +1 -0
- package/dist/ui/utils/terminal-input.test.js +15 -0
- package/dist/ui/utils/terminal-input.test.js.map +1 -0
- package/dist/ui/utils/text-utils.d.ts +8 -0
- package/dist/ui/utils/text-utils.d.ts.map +1 -0
- package/dist/ui/utils/text-utils.js +16 -0
- package/dist/ui/utils/text-utils.js.map +1 -0
- package/dist/ui/utils/token-to-ansi.js +19 -9
- package/dist/ui/utils/token-to-ansi.js.map +1 -1
- package/dist/ui/utils/user-message-display.d.ts +7 -0
- package/dist/ui/utils/user-message-display.d.ts.map +1 -0
- package/dist/ui/utils/user-message-display.js +26 -0
- package/dist/ui/utils/user-message-display.js.map +1 -0
- package/dist/utils/format.js +7 -9
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/image.d.ts +9 -0
- package/dist/utils/image.d.ts.map +1 -1
- package/dist/utils/image.js +25 -0
- package/dist/utils/image.js.map +1 -1
- package/dist/utils/plan-steps.d.ts.map +1 -1
- package/dist/utils/plan-steps.js +5 -1
- package/dist/utils/plan-steps.js.map +1 -1
- package/dist/utils/plan-steps.test.d.ts +2 -0
- package/dist/utils/plan-steps.test.d.ts.map +1 -0
- package/dist/utils/plan-steps.test.js +16 -0
- package/dist/utils/plan-steps.test.js.map +1 -0
- package/package.json +50 -10
- package/dist/core/repomap-context.d.ts +0 -11
- package/dist/core/repomap-context.d.ts.map +0 -1
- package/dist/core/repomap-context.js +0 -68
- package/dist/core/repomap-context.js.map +0 -1
- package/dist/core/repomap-context.test.d.ts +0 -2
- package/dist/core/repomap-context.test.d.ts.map +0 -1
- package/dist/core/repomap-context.test.js +0 -47
- package/dist/core/repomap-context.test.js.map +0 -1
- package/dist/core/repomap.d.ts +0 -74
- package/dist/core/repomap.d.ts.map +0 -1
- package/dist/core/repomap.js +0 -906
- package/dist/core/repomap.js.map +0 -1
- package/dist/core/repomap.test.d.ts +0 -2
- package/dist/core/repomap.test.d.ts.map +0 -1
- package/dist/core/repomap.test.js +0 -494
- package/dist/core/repomap.test.js.map +0 -1
- package/dist/ui/components/EyesOverlay.d.ts +0 -10
- package/dist/ui/components/EyesOverlay.d.ts.map +0 -1
- package/dist/ui/components/EyesOverlay.js +0 -220
- package/dist/ui/components/EyesOverlay.js.map +0 -1
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,41 +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
|
-
|
|
540
|
-
|
|
541
|
-
//
|
|
542
|
-
//
|
|
543
|
-
const
|
|
544
|
-
const
|
|
545
|
-
current: () => { },
|
|
546
|
-
};
|
|
547
|
-
const onExitPlanRef = {
|
|
548
|
-
current: () => Promise.resolve("cancelled"),
|
|
549
|
-
};
|
|
550
|
-
const repoMapChangedFilesRef = { current: new Set() };
|
|
551
|
-
const repoMapReadFilesRef = { current: new Set() };
|
|
552
|
-
const toRepoMapPath = (root, filePath) => path.relative(root, filePath).split(path.sep).join("/");
|
|
553
|
-
const markRepoMapRead = (root, filePath) => {
|
|
554
|
-
repoMapReadFilesRef.current.add(toRepoMapPath(root, filePath));
|
|
555
|
-
};
|
|
556
|
-
const markRepoMapDirty = (root, filePath) => {
|
|
557
|
-
const relativePath = toRepoMapPath(root, filePath);
|
|
558
|
-
repoMapChangedFilesRef.current.add(relativePath);
|
|
559
|
-
repoMapReadFilesRef.current.add(relativePath);
|
|
560
|
-
};
|
|
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();
|
|
561
431
|
const { tools, processManager } = createTools(cwd, {
|
|
562
432
|
agents,
|
|
563
433
|
skills,
|
|
564
434
|
provider,
|
|
565
435
|
model,
|
|
566
436
|
planModeRef,
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
onFileMutated: (filePath) => markRepoMapDirty(cwd, filePath),
|
|
437
|
+
goalModeRef,
|
|
438
|
+
onPreFileMutation,
|
|
439
|
+
onEnterPlan: (reason) => planToolCallbacks.onEnterPlan?.(reason),
|
|
440
|
+
onExitPlan: (planPath) => planToolCallbacks.onExitPlan?.(planPath) ?? Promise.resolve("Plan review is unavailable."),
|
|
572
441
|
});
|
|
573
442
|
// Rebuilds the cwd-bound tools for a different project root. Used by the
|
|
574
443
|
// pixel-fix flow so the agent operates in the error's project, not in
|
|
@@ -580,25 +449,26 @@ async function runInkTUI(opts) {
|
|
|
580
449
|
provider,
|
|
581
450
|
model,
|
|
582
451
|
planModeRef,
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
onFileMutated: (filePath) => markRepoMapDirty(newCwd, filePath),
|
|
452
|
+
goalModeRef,
|
|
453
|
+
onPreFileMutation,
|
|
454
|
+
onEnterPlan: (reason) => planToolCallbacks.onEnterPlan?.(reason),
|
|
455
|
+
onExitPlan: (planPath) => planToolCallbacks.onExitPlan?.(planPath) ?? Promise.resolve("Plan review is unavailable."),
|
|
588
456
|
});
|
|
589
457
|
return rebuilt;
|
|
590
458
|
};
|
|
591
|
-
//
|
|
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".
|
|
592
461
|
const mcpManager = new MCPClientManager();
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
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);
|
|
602
472
|
// Kill all background processes on exit (synchronous — catches all exit paths)
|
|
603
473
|
process.on("exit", () => {
|
|
604
474
|
processManager.shutdownAll();
|
|
@@ -609,10 +479,15 @@ async function runInkTUI(opts) {
|
|
|
609
479
|
// Session management — create or reuse session file
|
|
610
480
|
const sessionManager = new SessionManager(paths.sessionsDir);
|
|
611
481
|
let sessionPath;
|
|
482
|
+
let sessionId;
|
|
612
483
|
let initialHistory;
|
|
613
484
|
// Determine which session to resume (explicit path or most recent)
|
|
614
|
-
const
|
|
615
|
-
|
|
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);
|
|
616
491
|
if (resumePath) {
|
|
617
492
|
try {
|
|
618
493
|
const loaded = await sessionManager.load(resumePath);
|
|
@@ -620,6 +495,7 @@ async function runInkTUI(opts) {
|
|
|
620
495
|
if (loadedMessages.length > 0) {
|
|
621
496
|
messages.push(...loadedMessages);
|
|
622
497
|
sessionPath = resumePath;
|
|
498
|
+
sessionId = loaded.header.id;
|
|
623
499
|
log("INFO", "session", `Restored session`, {
|
|
624
500
|
path: resumePath,
|
|
625
501
|
messageCount: String(loadedMessages.length),
|
|
@@ -653,6 +529,7 @@ async function runInkTUI(opts) {
|
|
|
653
529
|
messages: compacted.messages,
|
|
654
530
|
});
|
|
655
531
|
sessionPath = compactedSession.path;
|
|
532
|
+
sessionId = compactedSession.id;
|
|
656
533
|
messages.length = 0;
|
|
657
534
|
messages.push(...compacted.messages);
|
|
658
535
|
log("INFO", "session", `Auto-compaction complete`, {
|
|
@@ -666,7 +543,11 @@ async function runInkTUI(opts) {
|
|
|
666
543
|
}
|
|
667
544
|
}
|
|
668
545
|
const restoredMessages = getRestoredMessagesForDisplay(messages);
|
|
669
|
-
|
|
546
|
+
const restoredDisplayItems = sessionManager.getDisplayItems(loaded.entries, loaded.header.leafId);
|
|
547
|
+
initialHistory =
|
|
548
|
+
restoredDisplayItems.length > 0
|
|
549
|
+
? restoredDisplayItems
|
|
550
|
+
: messagesToHistoryItems(restoredMessages);
|
|
670
551
|
initialHistory.push({
|
|
671
552
|
kind: "info",
|
|
672
553
|
text: formatRestoreInfoText(loadedMessages.length, restoredMessages.length),
|
|
@@ -682,22 +563,12 @@ async function runInkTUI(opts) {
|
|
|
682
563
|
if (!sessionPath) {
|
|
683
564
|
const session = await sessionManager.create(cwd, provider, model);
|
|
684
565
|
sessionPath = session.path;
|
|
566
|
+
sessionId = session.id;
|
|
685
567
|
log("INFO", "session", `New session created`, { path: sessionPath });
|
|
686
568
|
}
|
|
687
|
-
//
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
const openCount = journalCount({ status: "open" }, cwd);
|
|
691
|
-
if (openCount > 0) {
|
|
692
|
-
const s = openCount === 1 ? "" : "s";
|
|
693
|
-
if (!initialHistory)
|
|
694
|
-
initialHistory = [];
|
|
695
|
-
initialHistory.push({
|
|
696
|
-
kind: "info",
|
|
697
|
-
text: `👁 Eyes: ${openCount} open improvement signal${s} from recent sessions. Run /eyes-improve to triage.`,
|
|
698
|
-
id: "eyes-banner",
|
|
699
|
-
});
|
|
700
|
-
}
|
|
569
|
+
// Now that the session id is finalized, back /rewind with a checkpoint store.
|
|
570
|
+
if (sessionId) {
|
|
571
|
+
checkpointRef.current = new CheckpointStore({ sessionId, cwd });
|
|
701
572
|
}
|
|
702
573
|
await renderApp({
|
|
703
574
|
provider,
|
|
@@ -718,357 +589,23 @@ async function runInkTUI(opts) {
|
|
|
718
589
|
initialHistory,
|
|
719
590
|
sessionsDir: paths.sessionsDir,
|
|
720
591
|
sessionPath,
|
|
592
|
+
sessionId,
|
|
721
593
|
processManager,
|
|
722
594
|
settingsFile: paths.settingsFile,
|
|
723
595
|
mcpManager,
|
|
724
596
|
authStorage,
|
|
725
597
|
planModeRef,
|
|
726
|
-
|
|
727
|
-
onEnterPlanRef,
|
|
728
|
-
onExitPlanRef,
|
|
598
|
+
goalModeRef,
|
|
729
599
|
skills,
|
|
600
|
+
checkpointStore: checkpointRef.current ?? undefined,
|
|
730
601
|
initialOverlay: opts.initialOverlay,
|
|
602
|
+
idealReviewEnabled: opts.idealReviewEnabled,
|
|
731
603
|
rebuildToolsForCwd,
|
|
732
|
-
|
|
733
|
-
|
|
604
|
+
connectInitialMcpTools,
|
|
605
|
+
planCallbacks: planToolCallbacks,
|
|
734
606
|
});
|
|
735
607
|
closeLogger();
|
|
736
608
|
}
|
|
737
|
-
// ── Login ──────────────────────────────────────────────────
|
|
738
|
-
async function runLogin() {
|
|
739
|
-
requireInteractiveTTY();
|
|
740
|
-
clearVisibleScreen();
|
|
741
|
-
const paths = await ensureAppDirs();
|
|
742
|
-
initLogger(paths.logFile, { version: CLI_VERSION });
|
|
743
|
-
log("INFO", "auth", "Login flow started");
|
|
744
|
-
const authStorage = new AuthStorage();
|
|
745
|
-
await authStorage.load();
|
|
746
|
-
// Phase 1: Ink-based provider selector
|
|
747
|
-
const provider = await renderLoginSelector(CLI_VERSION);
|
|
748
|
-
if (!provider) {
|
|
749
|
-
console.log(chalk.hex("#6b7280")("Login cancelled."));
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
|
-
console.log(chalk.hex("#60a5fa").bold("\nLogging in to ") +
|
|
753
|
-
chalk.hex("#a78bfa")(displayName(provider)) +
|
|
754
|
-
chalk.hex("#60a5fa").bold("...\n"));
|
|
755
|
-
// Phase 2: OAuth flow (readline needed for Anthropic code paste)
|
|
756
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
757
|
-
try {
|
|
758
|
-
const callbacks = {
|
|
759
|
-
onOpenUrl: (url) => {
|
|
760
|
-
console.log(chalk.hex("#60a5fa").bold("Opening browser..."));
|
|
761
|
-
openBrowser(url);
|
|
762
|
-
console.log(chalk.hex("#6b7280")("\nIf the browser didn't open, visit:\n") +
|
|
763
|
-
chalk.hex("#6b7280")(url) +
|
|
764
|
-
"\n");
|
|
765
|
-
},
|
|
766
|
-
onPromptCode: async (message) => {
|
|
767
|
-
return rl.question(message + " ");
|
|
768
|
-
},
|
|
769
|
-
onStatus: (message) => {
|
|
770
|
-
console.log(chalk.hex("#6b7280")(message));
|
|
771
|
-
},
|
|
772
|
-
};
|
|
773
|
-
let creds;
|
|
774
|
-
if (provider === "glm" ||
|
|
775
|
-
provider === "moonshot" ||
|
|
776
|
-
provider === "xiaomi" ||
|
|
777
|
-
provider === "minimax" ||
|
|
778
|
-
provider === "deepseek" ||
|
|
779
|
-
provider === "openrouter") {
|
|
780
|
-
const keyLabel = provider === "glm"
|
|
781
|
-
? "Z.AI"
|
|
782
|
-
: provider === "xiaomi"
|
|
783
|
-
? "Xiaomi MiMo"
|
|
784
|
-
: provider === "minimax"
|
|
785
|
-
? "MiniMax"
|
|
786
|
-
: provider === "deepseek"
|
|
787
|
-
? "DeepSeek"
|
|
788
|
-
: provider === "openrouter"
|
|
789
|
-
? "OpenRouter"
|
|
790
|
-
: "Moonshot";
|
|
791
|
-
const apiKey = await rl.question(chalk.hex("#60a5fa")(`Paste your ${keyLabel} API key: `));
|
|
792
|
-
if (!apiKey.trim()) {
|
|
793
|
-
console.log(chalk.hex("#ef4444")("No API key provided. Login cancelled."));
|
|
794
|
-
return;
|
|
795
|
-
}
|
|
796
|
-
creds = {
|
|
797
|
-
accessToken: apiKey.trim(),
|
|
798
|
-
refreshToken: "",
|
|
799
|
-
expiresAt: Date.now() + 365 * 24 * 60 * 60 * 1000 * 100, // ~100 years
|
|
800
|
-
...(provider === "xiaomi" ? { baseUrl: "https://token-plan-sgp.xiaomimimo.com/v1" } : {}),
|
|
801
|
-
};
|
|
802
|
-
}
|
|
803
|
-
else {
|
|
804
|
-
creds =
|
|
805
|
-
provider === "anthropic"
|
|
806
|
-
? await loginAnthropic(callbacks)
|
|
807
|
-
: provider === "gemini"
|
|
808
|
-
? await loginGemini(callbacks)
|
|
809
|
-
: await loginOpenAI(callbacks);
|
|
810
|
-
}
|
|
811
|
-
await authStorage.setCredentials(provider, creds);
|
|
812
|
-
log("INFO", "auth", `Login succeeded for ${displayName(provider)}`);
|
|
813
|
-
console.log(chalk.hex("#4ade80")(`\n✓ Logged in to ${displayName(provider)} successfully!`));
|
|
814
|
-
}
|
|
815
|
-
finally {
|
|
816
|
-
rl.close();
|
|
817
|
-
closeLogger();
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
// ── Doctor ─────────────────────────────────────────────────
|
|
821
|
-
async function runDoctor() {
|
|
822
|
-
clearVisibleScreen();
|
|
823
|
-
const os = await import("node:os");
|
|
824
|
-
const fsP = await import("node:fs/promises");
|
|
825
|
-
const dim = chalk.hex("#6b7280");
|
|
826
|
-
const primary = chalk.hex("#60a5fa");
|
|
827
|
-
const accent = chalk.hex("#a78bfa");
|
|
828
|
-
const good = chalk.hex("#4ade80");
|
|
829
|
-
const warn = chalk.hex("#fbbf24");
|
|
830
|
-
const bad = chalk.hex("#ef4444");
|
|
831
|
-
// ── Banner ──────────────────────────────────────────────────
|
|
832
|
-
const LOGO = LOGO_LINES;
|
|
833
|
-
const GAP = " ";
|
|
834
|
-
console.log();
|
|
835
|
-
console.log(` ${gradientLine(LOGO[0])}${GAP}` +
|
|
836
|
-
primary.bold("EZ Coder") +
|
|
837
|
-
dim(` v${CLI_VERSION}`) +
|
|
838
|
-
dim(" · By ") +
|
|
839
|
-
chalk.white.bold("Nolan Grout"));
|
|
840
|
-
console.log(` ${gradientLine(LOGO[1])}${GAP}` + accent("Doctor"));
|
|
841
|
-
console.log(` ${gradientLine(LOGO[2])}${GAP}` + dim("Diagnose & Fix"));
|
|
842
|
-
console.log();
|
|
843
|
-
const home = os.homedir();
|
|
844
|
-
const ggDir = path.join(home, ".ezcoder");
|
|
845
|
-
const authFile = path.join(ggDir, "auth.json");
|
|
846
|
-
const lockFile = authFile + ".lock";
|
|
847
|
-
const myUid = process.getuid();
|
|
848
|
-
let fixed = 0;
|
|
849
|
-
// ── Environment ─────────────────────────────────────────────
|
|
850
|
-
console.log(accent(" Environment\n"));
|
|
851
|
-
console.log(dim(` Home: ${home}`));
|
|
852
|
-
console.log(dim(` $HOME: ${process.env.HOME ?? "(not set)"}`));
|
|
853
|
-
console.log(dim(` Node.js: ${process.version}`));
|
|
854
|
-
console.log(dim(` Platform: ${process.platform} ${process.arch}`));
|
|
855
|
-
console.log(dim(` UID: ${myUid} EUID: ${process.geteuid()}`));
|
|
856
|
-
if (process.env.HOME && process.env.HOME !== home) {
|
|
857
|
-
console.log(warn("\n ⚠ $HOME differs from os.homedir() — this can cause auth mismatches"));
|
|
858
|
-
}
|
|
859
|
-
if (myUid !== process.geteuid()) {
|
|
860
|
-
console.log(warn(" ⚠ uid ≠ euid — running with elevated privileges (sudo?)"));
|
|
861
|
-
console.log(dim(" Running ezcoder with sudo can cause ownership issues."));
|
|
862
|
-
console.log(dim(" Use without sudo, or fix after: sudo chown -R $(whoami) ~/.gg"));
|
|
863
|
-
}
|
|
864
|
-
console.log();
|
|
865
|
-
// ── Config Directory ────────────────────────────────────────
|
|
866
|
-
console.log(accent(" Config Directory\n"));
|
|
867
|
-
try {
|
|
868
|
-
const stat = await fsP.stat(ggDir);
|
|
869
|
-
const mode = stat.mode & 0o777;
|
|
870
|
-
console.log(dim(` Path: ${ggDir}`));
|
|
871
|
-
console.log(dim(` Mode: 0o${mode.toString(8)} UID: ${stat.uid}`));
|
|
872
|
-
// Fix ownership
|
|
873
|
-
if (stat.uid !== myUid) {
|
|
874
|
-
console.log(warn(` ⚠ Owned by uid ${stat.uid}, expected ${myUid}`));
|
|
875
|
-
try {
|
|
876
|
-
await fsP.chown(ggDir, myUid, process.getgid());
|
|
877
|
-
console.log(good(" ✓ Fixed directory ownership"));
|
|
878
|
-
fixed++;
|
|
879
|
-
}
|
|
880
|
-
catch {
|
|
881
|
-
console.log(bad(` ✗ Cannot fix — try: sudo chown -R $(whoami) ${ggDir}`));
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
// Fix permissions (should be 0o700)
|
|
885
|
-
if (mode !== 0o700) {
|
|
886
|
-
try {
|
|
887
|
-
await fsP.chmod(ggDir, 0o700);
|
|
888
|
-
console.log(good(" ✓ Fixed directory permissions → 0o700"));
|
|
889
|
-
fixed++;
|
|
890
|
-
}
|
|
891
|
-
catch {
|
|
892
|
-
console.log(bad(` ✗ Cannot fix — try: chmod 700 ${ggDir}`));
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
catch {
|
|
897
|
-
console.log(warn(` ${ggDir} missing — creating...`));
|
|
898
|
-
try {
|
|
899
|
-
await fsP.mkdir(ggDir, { recursive: true, mode: 0o700 });
|
|
900
|
-
console.log(good(` ✓ Created ${ggDir}`));
|
|
901
|
-
fixed++;
|
|
902
|
-
}
|
|
903
|
-
catch (mkErr) {
|
|
904
|
-
console.log(bad(` ✗ Cannot create: ${mkErr instanceof Error ? mkErr.message : String(mkErr)}`));
|
|
905
|
-
console.log();
|
|
906
|
-
return;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
console.log();
|
|
910
|
-
// ── Lock File ───────────────────────────────────────────────
|
|
911
|
-
try {
|
|
912
|
-
const lockStat = await fsP.stat(lockFile);
|
|
913
|
-
const ageMs = Date.now() - lockStat.mtimeMs;
|
|
914
|
-
console.log(accent(" Lock File\n"));
|
|
915
|
-
console.log(warn(` ⚠ Stale lock found (age: ${Math.round(ageMs / 1000)}s)`));
|
|
916
|
-
await fsP.unlink(lockFile);
|
|
917
|
-
console.log(good(" ✓ Removed"));
|
|
918
|
-
fixed++;
|
|
919
|
-
console.log();
|
|
920
|
-
}
|
|
921
|
-
catch {
|
|
922
|
-
// No lock file — good, skip section entirely
|
|
923
|
-
}
|
|
924
|
-
// ── Auth File ───────────────────────────────────────────────
|
|
925
|
-
console.log(accent(" Auth File\n"));
|
|
926
|
-
let authData = null;
|
|
927
|
-
let authNeedsRewrite = false;
|
|
928
|
-
try {
|
|
929
|
-
const stat = await fsP.stat(authFile);
|
|
930
|
-
const mode = stat.mode & 0o777;
|
|
931
|
-
console.log(dim(` Path: ${authFile}`));
|
|
932
|
-
console.log(dim(` Size: ${stat.size} bytes Mode: 0o${mode.toString(8)} UID: ${stat.uid}`));
|
|
933
|
-
// Fix ownership
|
|
934
|
-
if (stat.uid !== myUid) {
|
|
935
|
-
console.log(warn(` ⚠ Owned by uid ${stat.uid}, expected ${myUid}`));
|
|
936
|
-
try {
|
|
937
|
-
await fsP.chown(authFile, myUid, process.getgid());
|
|
938
|
-
console.log(good(" ✓ Fixed file ownership"));
|
|
939
|
-
fixed++;
|
|
940
|
-
}
|
|
941
|
-
catch {
|
|
942
|
-
console.log(bad(` ✗ Cannot fix — try: sudo chown $(whoami) ${authFile}`));
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
// Fix permissions (should be 0o600)
|
|
946
|
-
if (mode !== 0o600) {
|
|
947
|
-
try {
|
|
948
|
-
await fsP.chmod(authFile, 0o600);
|
|
949
|
-
console.log(good(" ✓ Fixed file permissions → 0o600"));
|
|
950
|
-
fixed++;
|
|
951
|
-
}
|
|
952
|
-
catch {
|
|
953
|
-
console.log(bad(` ✗ Cannot fix — try: chmod 600 ${authFile}`));
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
// Try to read and parse
|
|
957
|
-
try {
|
|
958
|
-
const content = await fsP.readFile(authFile, "utf-8");
|
|
959
|
-
try {
|
|
960
|
-
authData = JSON.parse(content);
|
|
961
|
-
}
|
|
962
|
-
catch {
|
|
963
|
-
console.log(bad(" ✗ Invalid JSON — backing up and resetting"));
|
|
964
|
-
const backupName = `auth.json.corrupt.${Date.now()}`;
|
|
965
|
-
await fsP.copyFile(authFile, path.join(ggDir, backupName));
|
|
966
|
-
await fsP.writeFile(authFile, "{}", { encoding: "utf-8", mode: 0o600 });
|
|
967
|
-
console.log(good(` ✓ Corrupt file backed up as ${backupName}`));
|
|
968
|
-
console.log(dim(' Run "ezcoder login" to re-authenticate'));
|
|
969
|
-
authData = {};
|
|
970
|
-
fixed++;
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
catch (readErr) {
|
|
974
|
-
const code = readErr.code;
|
|
975
|
-
if (code === "EACCES") {
|
|
976
|
-
console.log(bad(" ✗ Permission denied reading auth.json"));
|
|
977
|
-
console.log(dim(` Try: sudo chown $(whoami) ${authFile} && chmod 600 ${authFile}`));
|
|
978
|
-
}
|
|
979
|
-
else {
|
|
980
|
-
console.log(bad(` ✗ Read error: ${readErr instanceof Error ? readErr.message : String(readErr)}`));
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
catch {
|
|
985
|
-
console.log(dim(` Path: ${authFile}`));
|
|
986
|
-
console.log(warn(' Not found — run "ezcoder login" to authenticate'));
|
|
987
|
-
}
|
|
988
|
-
console.log();
|
|
989
|
-
// ── Credentials ─────────────────────────────────────────────
|
|
990
|
-
if (authData && Object.keys(authData).length > 0) {
|
|
991
|
-
console.log(accent(" Credentials\n"));
|
|
992
|
-
for (const p of Object.keys(authData)) {
|
|
993
|
-
const cred = authData[p];
|
|
994
|
-
if (!cred || typeof cred !== "object") {
|
|
995
|
-
console.log(bad(` ✗ ${p}: invalid entry — removing`));
|
|
996
|
-
delete authData[p];
|
|
997
|
-
authNeedsRewrite = true;
|
|
998
|
-
fixed++;
|
|
999
|
-
continue;
|
|
1000
|
-
}
|
|
1001
|
-
if (!cred.accessToken || typeof cred.accessToken !== "string") {
|
|
1002
|
-
console.log(bad(` ✗ ${p}: missing accessToken — removing`));
|
|
1003
|
-
delete authData[p];
|
|
1004
|
-
authNeedsRewrite = true;
|
|
1005
|
-
fixed++;
|
|
1006
|
-
continue;
|
|
1007
|
-
}
|
|
1008
|
-
const token = String(cred.accessToken);
|
|
1009
|
-
const masked = token.slice(0, 8) + "..." + token.slice(-4);
|
|
1010
|
-
const expires = typeof cred.expiresAt === "number" ? new Date(cred.expiresAt).toISOString() : "unknown";
|
|
1011
|
-
const expired = typeof cred.expiresAt === "number" && Date.now() > cred.expiresAt;
|
|
1012
|
-
if (expired) {
|
|
1013
|
-
console.log(warn(` ⚠ ${p}: ${masked} expired ${expires}`));
|
|
1014
|
-
}
|
|
1015
|
-
else {
|
|
1016
|
-
console.log(good(` ✓ ${p}: ${masked} expires ${expires}`));
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
if (authNeedsRewrite) {
|
|
1020
|
-
try {
|
|
1021
|
-
await fsP.writeFile(authFile, JSON.stringify(authData, null, 2), {
|
|
1022
|
-
encoding: "utf-8",
|
|
1023
|
-
mode: 0o600,
|
|
1024
|
-
});
|
|
1025
|
-
console.log(good(" ✓ Cleaned up auth.json"));
|
|
1026
|
-
}
|
|
1027
|
-
catch {
|
|
1028
|
-
console.log(bad(" ✗ Failed to write cleaned auth.json"));
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
console.log();
|
|
1032
|
-
}
|
|
1033
|
-
// ── Temp Files ──────────────────────────────────────────────
|
|
1034
|
-
try {
|
|
1035
|
-
const entries = await fsP.readdir(ggDir);
|
|
1036
|
-
const tmpFiles = entries.filter((e) => e.startsWith("auth.json.") && e.endsWith(".tmp"));
|
|
1037
|
-
if (tmpFiles.length > 0) {
|
|
1038
|
-
console.log(accent(" Temp Files\n"));
|
|
1039
|
-
console.log(warn(` ⚠ ${tmpFiles.length} orphaned temp file(s) from interrupted writes`));
|
|
1040
|
-
for (const tmp of tmpFiles) {
|
|
1041
|
-
await fsP.unlink(path.join(ggDir, tmp)).catch(() => { });
|
|
1042
|
-
}
|
|
1043
|
-
console.log(good(` ✓ Removed ${tmpFiles.length} file(s)`));
|
|
1044
|
-
fixed++;
|
|
1045
|
-
console.log();
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
catch {
|
|
1049
|
-
// Can't read directory — already flagged above
|
|
1050
|
-
}
|
|
1051
|
-
// ── Summary ─────────────────────────────────────────────────
|
|
1052
|
-
if (fixed > 0) {
|
|
1053
|
-
console.log(good(` ✓ Fixed ${fixed} issue${fixed > 1 ? "s" : ""}.`));
|
|
1054
|
-
}
|
|
1055
|
-
else {
|
|
1056
|
-
console.log(good(" ✓ Everything looks good."));
|
|
1057
|
-
}
|
|
1058
|
-
console.log();
|
|
1059
|
-
}
|
|
1060
|
-
// ── Logout ─────────────────────────────────────────────────
|
|
1061
|
-
async function runLogout() {
|
|
1062
|
-
const paths = await ensureAppDirs();
|
|
1063
|
-
initLogger(paths.logFile, { version: CLI_VERSION });
|
|
1064
|
-
log("INFO", "auth", "Logout requested");
|
|
1065
|
-
const authStorage = new AuthStorage();
|
|
1066
|
-
await authStorage.load();
|
|
1067
|
-
await authStorage.clearAll();
|
|
1068
|
-
log("INFO", "auth", "Logout succeeded");
|
|
1069
|
-
closeLogger();
|
|
1070
|
-
console.log(chalk.green("Logged out successfully."));
|
|
1071
|
-
}
|
|
1072
609
|
// ── Sessions ──────────────────────────────────────────────
|
|
1073
610
|
async function runSessions() {
|
|
1074
611
|
requireInteractiveTTY();
|
|
@@ -1098,11 +635,11 @@ async function runSessions() {
|
|
|
1098
635
|
return "MiniMax-M2.7";
|
|
1099
636
|
if (p === "deepseek")
|
|
1100
637
|
return "deepseek-v4-pro";
|
|
1101
|
-
return "claude-opus-4-
|
|
638
|
+
return "claude-opus-4-8";
|
|
1102
639
|
}
|
|
1103
640
|
const model = saved2.model ?? getDefault(provider);
|
|
1104
641
|
const thinkingLevel = saved2.thinkingEnabled
|
|
1105
|
-
? getMaxThinkingLevel(model)
|
|
642
|
+
? (saved2.thinkingLevel ?? getMaxThinkingLevel(model))
|
|
1106
643
|
: undefined;
|
|
1107
644
|
closeLogger();
|
|
1108
645
|
await runInkTUI({
|
|
@@ -1110,6 +647,7 @@ async function runSessions() {
|
|
|
1110
647
|
model,
|
|
1111
648
|
cwd,
|
|
1112
649
|
thinkingLevel,
|
|
650
|
+
idealReviewEnabled: saved2.idealReviewEnabled,
|
|
1113
651
|
resumeSessionPath: selectedPath,
|
|
1114
652
|
theme: saved2.theme,
|
|
1115
653
|
});
|
|
@@ -1287,7 +825,7 @@ async function runServe() {
|
|
|
1287
825
|
const preferredProvider = serveValues.provider ?? saved3.provider ?? "anthropic";
|
|
1288
826
|
const { provider, model } = await resolveActiveProvider(authStorage, preferredProvider, serveValues.model ?? saved3.model);
|
|
1289
827
|
const thinkingLevel = saved3.thinkingEnabled
|
|
1290
|
-
? getMaxThinkingLevel(model)
|
|
828
|
+
? (saved3.thinkingLevel ?? getMaxThinkingLevel(model))
|
|
1291
829
|
: undefined;
|
|
1292
830
|
initLogger(paths.logFile, {
|
|
1293
831
|
version: CLI_VERSION,
|
|
@@ -1330,32 +868,16 @@ async function runAgentHomeLogin() {
|
|
|
1330
868
|
log("INFO", "agent-home", "Agent Home login started");
|
|
1331
869
|
const existing = await loadAgentHomeConfig();
|
|
1332
870
|
// Banner
|
|
1333
|
-
const LOGO =
|
|
1334
|
-
" \u2584\u2580\u2580\u2580 \u2584\u2580\u2580\u2580",
|
|
1335
|
-
" \u2588 \u2580\u2588 \u2588 \u2580\u2588",
|
|
1336
|
-
" \u2580\u2584\u2584\u2580 \u2580\u2584\u2584\u2580",
|
|
1337
|
-
];
|
|
1338
|
-
function gradientTextLocal(text) {
|
|
1339
|
-
let colorIdx = 0;
|
|
1340
|
-
return text
|
|
1341
|
-
.split("")
|
|
1342
|
-
.map((ch) => {
|
|
1343
|
-
if (ch === " ")
|
|
1344
|
-
return ch;
|
|
1345
|
-
const color = GRADIENT[colorIdx++ % GRADIENT.length];
|
|
1346
|
-
return chalk.hex(color)(ch);
|
|
1347
|
-
})
|
|
1348
|
-
.join("");
|
|
1349
|
-
}
|
|
871
|
+
const LOGO = LOGO_LINES;
|
|
1350
872
|
const GAP = " ";
|
|
1351
873
|
console.log();
|
|
1352
|
-
console.log(` ${
|
|
874
|
+
console.log(` ${gradientLine(LOGO[0])}${GAP}` +
|
|
1353
875
|
chalk.hex("#60a5fa").bold("EZ Coder") +
|
|
1354
876
|
chalk.hex("#6b7280")(` v${CLI_VERSION}`) +
|
|
1355
877
|
chalk.hex("#6b7280")(" \u00b7 By ") +
|
|
1356
878
|
chalk.white.bold("Nolan Grout"));
|
|
1357
|
-
console.log(` ${
|
|
1358
|
-
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"));
|
|
1359
881
|
console.log();
|
|
1360
882
|
if (existing) {
|
|
1361
883
|
console.log(chalk.hex("#6b7280")(" Current config:\n") +
|
|
@@ -1419,7 +941,7 @@ async function runAgentHome() {
|
|
|
1419
941
|
const preferredProvider = ahValues.provider ?? saved4.provider ?? "anthropic";
|
|
1420
942
|
const { provider, model } = await resolveActiveProvider(authStorage, preferredProvider, ahValues.model ?? saved4.model);
|
|
1421
943
|
const thinkingLevel = saved4.thinkingEnabled
|
|
1422
|
-
? getMaxThinkingLevel(model)
|
|
944
|
+
? (saved4.thinkingLevel ?? getMaxThinkingLevel(model))
|
|
1423
945
|
: undefined;
|
|
1424
946
|
initLogger(paths.logFile, {
|
|
1425
947
|
version: CLI_VERSION,
|
|
@@ -1437,105 +959,6 @@ async function runAgentHome() {
|
|
|
1437
959
|
});
|
|
1438
960
|
}
|
|
1439
961
|
// ── Pixel ──────────────────────────────────────────────────
|
|
1440
|
-
async function runPixel() {
|
|
1441
|
-
const sub = process.argv[3];
|
|
1442
|
-
const rest = process.argv.slice(4);
|
|
1443
|
-
if (sub === "install") {
|
|
1444
|
-
const { runPixelInstall } = await import("./core/pixel.js");
|
|
1445
|
-
const opts = parsePixelInstallArgs(rest);
|
|
1446
|
-
await runPixelInstall(opts);
|
|
1447
|
-
return;
|
|
1448
|
-
}
|
|
1449
|
-
if (sub === "fix") {
|
|
1450
|
-
const errorId = rest[0];
|
|
1451
|
-
if (!errorId) {
|
|
1452
|
-
process.stderr.write("Usage: ezcoder pixel fix <error_id>\n");
|
|
1453
|
-
process.exit(1);
|
|
1454
|
-
}
|
|
1455
|
-
const { fixError } = await import("./core/pixel-fix.js");
|
|
1456
|
-
const result = await fixError(errorId);
|
|
1457
|
-
if (result.outcome === "awaiting_review") {
|
|
1458
|
-
console.log(chalk.hex("#4ade80")(`✓ ${result.reason}`));
|
|
1459
|
-
}
|
|
1460
|
-
else {
|
|
1461
|
-
console.log(chalk.hex("#ef4444")(`✗ ${result.reason}`));
|
|
1462
|
-
process.exit(1);
|
|
1463
|
-
}
|
|
1464
|
-
return;
|
|
1465
|
-
}
|
|
1466
|
-
if (sub === "run") {
|
|
1467
|
-
const { runQueue } = await import("./core/pixel-fix.js");
|
|
1468
|
-
const result = await runQueue();
|
|
1469
|
-
console.log(chalk.bold(`${result.fixed} fixed · ${result.failed} failed · ${result.total} total`));
|
|
1470
|
-
if (result.failed > 0)
|
|
1471
|
-
process.exit(1);
|
|
1472
|
-
return;
|
|
1473
|
-
}
|
|
1474
|
-
if (sub === "--help" || sub === "-h") {
|
|
1475
|
-
printPixelHelp();
|
|
1476
|
-
return;
|
|
1477
|
-
}
|
|
1478
|
-
if (sub === "list") {
|
|
1479
|
-
const { listAllErrors } = await import("./core/pixel.js");
|
|
1480
|
-
await listAllErrors();
|
|
1481
|
-
return;
|
|
1482
|
-
}
|
|
1483
|
-
if (sub) {
|
|
1484
|
-
process.stderr.write(`Unknown pixel subcommand: ${sub}\n`);
|
|
1485
|
-
printPixelHelp();
|
|
1486
|
-
process.exit(1);
|
|
1487
|
-
}
|
|
1488
|
-
// No subcommand → launch the Ink TUI with the pixel overlay open. The fix
|
|
1489
|
-
// flow runs through the same agent loop as a Task, streaming live in the
|
|
1490
|
-
// chat instead of spawning a subprocess.
|
|
1491
|
-
// Non-TTY (CI, piped) → fall back to text list.
|
|
1492
|
-
if (!process.stdin.isTTY) {
|
|
1493
|
-
const { listAllErrors } = await import("./core/pixel.js");
|
|
1494
|
-
await listAllErrors();
|
|
1495
|
-
return;
|
|
1496
|
-
}
|
|
1497
|
-
const saved = loadSavedSettings();
|
|
1498
|
-
const provider = saved.provider ?? "anthropic";
|
|
1499
|
-
const model = saved.model ?? defaultModelFor(provider);
|
|
1500
|
-
await runInkTUI({
|
|
1501
|
-
provider,
|
|
1502
|
-
model,
|
|
1503
|
-
cwd: process.cwd(),
|
|
1504
|
-
thinkingLevel: saved.thinkingEnabled ? "medium" : undefined,
|
|
1505
|
-
theme: saved.theme,
|
|
1506
|
-
initialOverlay: "pixel",
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
function defaultModelFor(p) {
|
|
1510
|
-
return getDefaultModel(p).id;
|
|
1511
|
-
}
|
|
1512
|
-
function parsePixelInstallArgs(args) {
|
|
1513
|
-
const out = { skipPackageInstall: false };
|
|
1514
|
-
for (let i = 0; i < args.length; i++) {
|
|
1515
|
-
const a = args[i];
|
|
1516
|
-
if (a === "--ingest-url")
|
|
1517
|
-
out.ingestUrl = args[++i];
|
|
1518
|
-
else if (a === "--name")
|
|
1519
|
-
out.name = args[++i];
|
|
1520
|
-
else if (a === "--skip-install")
|
|
1521
|
-
out.skipPackageInstall = true;
|
|
1522
|
-
}
|
|
1523
|
-
return out;
|
|
1524
|
-
}
|
|
1525
|
-
function printPixelHelp() {
|
|
1526
|
-
console.log(`ezcoder pixel — error tracking + auto-fix queue
|
|
1527
|
-
|
|
1528
|
-
Usage:
|
|
1529
|
-
ezcoder pixel List open errors across every registered project
|
|
1530
|
-
ezcoder pixel install Register the current project and wire up the SDK
|
|
1531
|
-
ezcoder pixel fix <error_id> Fix one specific error end-to-end
|
|
1532
|
-
ezcoder pixel run Auto-fix every open error across all projects
|
|
1533
|
-
|
|
1534
|
-
ezcoder pixel install --name <name> Override the project name
|
|
1535
|
-
ezcoder pixel install --ingest-url <url> Use a custom backend URL
|
|
1536
|
-
ezcoder pixel install --skip-install Don't run the package manager
|
|
1537
|
-
`);
|
|
1538
|
-
}
|
|
1539
962
|
// ── Helpers ────────────────────────────────────────────────
|
|
1540
963
|
/**
|
|
1541
964
|
* Pick the provider/model to start with. If the preferred provider isn't
|
|
@@ -1579,25 +1002,6 @@ async function resolveActiveProvider(authStorage, preferred, savedModel) {
|
|
|
1579
1002
|
const provider = loggedInProviders[0];
|
|
1580
1003
|
return { provider, model: getDefaultModel(provider).id, loggedInProviders };
|
|
1581
1004
|
}
|
|
1582
|
-
function displayName(provider) {
|
|
1583
|
-
if (provider === "anthropic")
|
|
1584
|
-
return "Anthropic";
|
|
1585
|
-
if (provider === "xiaomi")
|
|
1586
|
-
return "Xiaomi (MiMo)";
|
|
1587
|
-
if (provider === "gemini")
|
|
1588
|
-
return "Gemini";
|
|
1589
|
-
if (provider === "glm")
|
|
1590
|
-
return "Z.AI (GLM)";
|
|
1591
|
-
if (provider === "moonshot")
|
|
1592
|
-
return "Moonshot";
|
|
1593
|
-
if (provider === "minimax")
|
|
1594
|
-
return "MiniMax";
|
|
1595
|
-
if (provider === "deepseek")
|
|
1596
|
-
return "DeepSeek";
|
|
1597
|
-
if (provider === "openrouter")
|
|
1598
|
-
return "OpenRouter";
|
|
1599
|
-
return "OpenAI";
|
|
1600
|
-
}
|
|
1601
1005
|
function extractText(content) {
|
|
1602
1006
|
if (typeof content === "string")
|
|
1603
1007
|
return content;
|
|
@@ -1606,9 +1010,45 @@ function extractText(content) {
|
|
|
1606
1010
|
.map((b) => b.text)
|
|
1607
1011
|
.join("\n");
|
|
1608
1012
|
}
|
|
1609
|
-
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) {
|
|
1610
1026
|
const items = [];
|
|
1611
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
|
+
};
|
|
1612
1052
|
// Index tool results by toolCallId for pairing with tool calls
|
|
1613
1053
|
const toolResults = new Map();
|
|
1614
1054
|
for (const msg of msgs) {
|
|
@@ -1632,14 +1072,19 @@ function messagesToHistoryItems(msgs) {
|
|
|
1632
1072
|
roleCounts[msg.role] = (roleCounts[msg.role] ?? 0) + 1;
|
|
1633
1073
|
if (msg.role === "user") {
|
|
1634
1074
|
const text = extractText(msg.content);
|
|
1635
|
-
if (text)
|
|
1636
|
-
|
|
1075
|
+
if (!text)
|
|
1076
|
+
continue;
|
|
1077
|
+
items.push({
|
|
1078
|
+
kind: "user",
|
|
1079
|
+
text: restoredPromptCommandDisplayText(text) ?? text,
|
|
1080
|
+
id: `restore-${id++}`,
|
|
1081
|
+
});
|
|
1637
1082
|
}
|
|
1638
1083
|
else if (msg.role === "assistant") {
|
|
1639
1084
|
const content = msg.content;
|
|
1640
1085
|
if (typeof content === "string") {
|
|
1641
1086
|
if (content)
|
|
1642
|
-
|
|
1087
|
+
pushRestoredAssistantText(content);
|
|
1643
1088
|
continue;
|
|
1644
1089
|
}
|
|
1645
1090
|
for (const block of content) {
|
|
@@ -1662,7 +1107,7 @@ function messagesToHistoryItems(msgs) {
|
|
|
1662
1107
|
let textBuf = "";
|
|
1663
1108
|
const flushText = () => {
|
|
1664
1109
|
if (textBuf) {
|
|
1665
|
-
|
|
1110
|
+
pushRestoredAssistantText(textBuf);
|
|
1666
1111
|
textBuf = "";
|
|
1667
1112
|
}
|
|
1668
1113
|
};
|
|
@@ -1716,11 +1161,8 @@ function messagesToHistoryItems(msgs) {
|
|
|
1716
1161
|
});
|
|
1717
1162
|
return items;
|
|
1718
1163
|
}
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
// Ignore errors — user can copy URL manually
|
|
1723
|
-
});
|
|
1164
|
+
if (process.argv[1] &&
|
|
1165
|
+
fileURLToPath(import.meta.url) === fs.realpathSync(path.resolve(process.argv[1]))) {
|
|
1166
|
+
main();
|
|
1724
1167
|
}
|
|
1725
|
-
main();
|
|
1726
1168
|
//# sourceMappingURL=cli.js.map
|