@ebowwa/coder 0.7.63 → 0.7.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/__tests__/permissions.test.d.ts +12 -0
- package/dist/core/__tests__/permissions.test.d.ts.map +1 -0
- package/dist/core/__tests__/permissions.test.js +851 -0
- package/dist/core/agent-loop/__tests__/compaction.test.d.ts +5 -0
- package/dist/core/agent-loop/__tests__/compaction.test.d.ts.map +1 -0
- package/dist/core/agent-loop/__tests__/compaction.test.js +209 -0
- package/dist/core/agent-loop/__tests__/formatters.test.d.ts +5 -0
- package/dist/core/agent-loop/__tests__/formatters.test.d.ts.map +1 -0
- package/dist/core/agent-loop/__tests__/formatters.test.js +195 -0
- package/dist/core/agent-loop/__tests__/index.test.d.ts +5 -0
- package/dist/core/agent-loop/__tests__/index.test.d.ts.map +1 -0
- package/dist/core/agent-loop/__tests__/index.test.js +121 -0
- package/dist/core/agent-loop/__tests__/loop-state.test.d.ts +5 -0
- package/dist/core/agent-loop/__tests__/loop-state.test.d.ts.map +1 -0
- package/dist/core/agent-loop/__tests__/loop-state.test.js +340 -0
- package/dist/core/agent-loop/__tests__/message-builder.test.d.ts +5 -0
- package/dist/core/agent-loop/__tests__/message-builder.test.d.ts.map +1 -0
- package/dist/core/agent-loop/__tests__/message-builder.test.js +178 -0
- package/dist/core/agent-loop/__tests__/tool-executor.test.d.ts +5 -0
- package/dist/core/agent-loop/__tests__/tool-executor.test.d.ts.map +1 -0
- package/dist/core/agent-loop/__tests__/tool-executor.test.js +331 -0
- package/dist/core/agent-loop/compaction.d.ts +39 -0
- package/dist/core/agent-loop/compaction.d.ts.map +1 -0
- package/dist/core/agent-loop/compaction.js +51 -0
- package/dist/core/agent-loop/formatters.d.ts +21 -0
- package/dist/core/agent-loop/formatters.d.ts.map +1 -0
- package/dist/core/agent-loop/formatters.js +42 -0
- package/dist/core/agent-loop/index.d.ts +25 -0
- package/dist/core/agent-loop/index.d.ts.map +1 -0
- package/dist/core/agent-loop/index.js +83 -0
- package/dist/core/agent-loop/loop-state.d.ts +74 -0
- package/dist/core/agent-loop/loop-state.d.ts.map +1 -0
- package/dist/core/agent-loop/loop-state.js +147 -0
- package/dist/core/agent-loop/message-builder.d.ts +13 -0
- package/dist/core/agent-loop/message-builder.d.ts.map +1 -0
- package/dist/core/agent-loop/message-builder.js +49 -0
- package/dist/core/agent-loop/tool-executor.d.ts +23 -0
- package/dist/core/agent-loop/tool-executor.d.ts.map +1 -0
- package/dist/core/agent-loop/tool-executor.js +152 -0
- package/dist/core/agent-loop/turn-executor.d.ts +57 -0
- package/dist/core/agent-loop/turn-executor.d.ts.map +1 -0
- package/dist/core/agent-loop/turn-executor.js +124 -0
- package/dist/core/agent-loop/types.d.ts +141 -0
- package/dist/core/agent-loop/types.d.ts.map +1 -0
- package/dist/core/agent-loop/types.js +4 -0
- package/dist/core/agent-loop.d.ts +17 -0
- package/dist/core/agent-loop.d.ts.map +1 -0
- package/dist/core/agent-loop.js +16 -0
- package/dist/core/api-client-impl.d.ts +62 -0
- package/dist/core/api-client-impl.d.ts.map +1 -0
- package/dist/core/api-client-impl.js +479 -0
- package/dist/core/api-client.d.ts +6 -0
- package/dist/core/api-client.d.ts.map +1 -0
- package/dist/core/api-client.js +5 -0
- package/dist/core/checkpoints.d.ts +128 -0
- package/dist/core/checkpoints.d.ts.map +1 -0
- package/dist/core/checkpoints.js +438 -0
- package/dist/core/claude-md.d.ts +71 -0
- package/dist/core/claude-md.d.ts.map +1 -0
- package/dist/core/claude-md.js +198 -0
- package/dist/core/cognitive-security/hooks.d.ts +138 -0
- package/dist/core/cognitive-security/hooks.d.ts.map +1 -0
- package/dist/core/cognitive-security/hooks.js +389 -0
- package/dist/core/cognitive-security/index.d.ts +751 -0
- package/dist/core/cognitive-security/index.d.ts.map +1 -0
- package/dist/core/cognitive-security/index.js +1123 -0
- package/dist/core/cognitive-security/middleware.d.ts +136 -0
- package/dist/core/cognitive-security/middleware.d.ts.map +1 -0
- package/dist/core/cognitive-security/middleware.js +376 -0
- package/dist/core/config-loader.d.ts +127 -0
- package/dist/core/config-loader.d.ts.map +1 -0
- package/dist/core/config-loader.js +219 -0
- package/dist/core/context-compaction.d.ts +87 -0
- package/dist/core/context-compaction.d.ts.map +1 -0
- package/dist/core/context-compaction.js +428 -0
- package/dist/core/git-status.d.ts +25 -0
- package/dist/core/git-status.d.ts.map +1 -0
- package/dist/core/git-status.js +204 -0
- package/dist/core/image.d.ts +69 -0
- package/dist/core/image.d.ts.map +1 -0
- package/dist/core/image.js +290 -0
- package/dist/core/image.test.d.ts +2 -0
- package/dist/core/image.test.d.ts.map +1 -0
- package/dist/core/image.test.js +149 -0
- package/dist/core/models.d.ts +123 -0
- package/dist/core/models.d.ts.map +1 -0
- package/dist/core/models.js +325 -0
- package/dist/core/permissions.d.ts +81 -0
- package/dist/core/permissions.d.ts.map +1 -0
- package/dist/core/permissions.js +327 -0
- package/dist/core/retry.d.ts +25 -0
- package/dist/core/retry.d.ts.map +1 -0
- package/dist/core/retry.js +121 -0
- package/dist/core/session-store.d.ts +9 -0
- package/dist/core/session-store.d.ts.map +1 -0
- package/dist/core/session-store.js +10 -0
- package/dist/core/sessions/export.d.ts +47 -0
- package/dist/core/sessions/export.d.ts.map +1 -0
- package/dist/core/sessions/export.js +256 -0
- package/dist/core/sessions/index.d.ts +132 -0
- package/dist/core/sessions/index.d.ts.map +1 -0
- package/dist/core/sessions/index.js +442 -0
- package/dist/core/sessions/metadata.d.ts +77 -0
- package/dist/core/sessions/metadata.d.ts.map +1 -0
- package/dist/core/sessions/metadata.js +233 -0
- package/dist/core/sessions/persistence.d.ts +72 -0
- package/dist/core/sessions/persistence.d.ts.map +1 -0
- package/dist/core/sessions/persistence.js +201 -0
- package/dist/core/sessions/types.d.ts +110 -0
- package/dist/core/sessions/types.d.ts.map +1 -0
- package/dist/core/sessions/types.js +4 -0
- package/dist/core/stream-highlighter.d.ts +18 -0
- package/dist/core/stream-highlighter.d.ts.map +1 -0
- package/dist/core/stream-highlighter.js +916 -0
- package/dist/core/system-reminders.d.ts +89 -0
- package/dist/core/system-reminders.d.ts.map +1 -0
- package/dist/core/system-reminders.js +285 -0
- package/dist/ecosystem/hooks/__tests__/index.test.d.ts +5 -0
- package/dist/ecosystem/hooks/__tests__/index.test.d.ts.map +1 -0
- package/dist/ecosystem/hooks/__tests__/index.test.js +458 -0
- package/dist/ecosystem/hooks/index.d.ts +59 -0
- package/dist/ecosystem/hooks/index.d.ts.map +1 -0
- package/dist/ecosystem/hooks/index.js +294 -0
- package/dist/ecosystem/hooks/prompt-evaluator.d.ts +32 -0
- package/dist/ecosystem/hooks/prompt-evaluator.d.ts.map +1 -0
- package/dist/ecosystem/hooks/prompt-evaluator.js +229 -0
- package/dist/ecosystem/skills/index.d.ts +55 -0
- package/dist/ecosystem/skills/index.d.ts.map +1 -0
- package/dist/ecosystem/skills/index.js +258 -0
- package/dist/ecosystem/tools/__tests__/index.test.d.ts +7 -0
- package/dist/ecosystem/tools/__tests__/index.test.d.ts.map +1 -0
- package/dist/ecosystem/tools/__tests__/index.test.js +856 -0
- package/dist/ecosystem/tools/index.d.ts +24 -0
- package/dist/ecosystem/tools/index.d.ts.map +1 -0
- package/dist/ecosystem/tools/index.js +1709 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33688 -49712
- package/dist/interfaces/mcp/client.d.ts +40 -0
- package/dist/interfaces/mcp/client.d.ts.map +1 -0
- package/dist/interfaces/mcp/client.js +309 -0
- package/dist/interfaces/ui/index.d.ts +36 -0
- package/dist/interfaces/ui/index.d.ts.map +1 -0
- package/dist/interfaces/ui/index.js +61 -0
- package/dist/interfaces/ui/spinner.d.ts +140 -0
- package/dist/interfaces/ui/spinner.d.ts.map +1 -0
- package/dist/interfaces/ui/spinner.js +342 -0
- package/dist/interfaces/ui/terminal/cli/index.d.ts +12 -0
- package/dist/interfaces/ui/terminal/cli/index.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/cli/index.js +32012 -50526
- package/dist/interfaces/ui/terminal/native/README.md +53 -0
- package/dist/interfaces/ui/terminal/native/claude_code_native.darwin-x64.node +0 -0
- package/dist/interfaces/ui/terminal/native/claude_code_native.dylib +0 -0
- package/dist/interfaces/ui/terminal/native/index.d.ts +0 -0
- package/dist/interfaces/ui/terminal/native/index.darwin-arm64.node +0 -0
- package/dist/interfaces/ui/terminal/native/index.js +43 -0
- package/dist/interfaces/ui/terminal/native/index.node +0 -0
- package/dist/interfaces/ui/terminal/native/package.json +34 -0
- package/dist/interfaces/ui/terminal/shared/args.d.ts +39 -0
- package/dist/interfaces/ui/terminal/shared/args.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/shared/args.js +176 -0
- package/dist/interfaces/ui/terminal/shared/index.d.ts +11 -0
- package/dist/interfaces/ui/terminal/shared/index.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/shared/index.js +16 -0
- package/dist/interfaces/ui/terminal/shared/loading-state.d.ts +124 -0
- package/dist/interfaces/ui/terminal/shared/loading-state.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/shared/loading-state.js +246 -0
- package/dist/interfaces/ui/terminal/shared/query.d.ts +22 -0
- package/dist/interfaces/ui/terminal/shared/query.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/shared/query.js +100 -0
- package/dist/interfaces/ui/terminal/shared/setup.d.ts +33 -0
- package/dist/interfaces/ui/terminal/shared/setup.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/shared/setup.js +226 -0
- package/dist/interfaces/ui/terminal/shared/status-line.d.ts +117 -0
- package/dist/interfaces/ui/terminal/shared/status-line.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/shared/status-line.js +267 -0
- package/dist/interfaces/ui/terminal/shared/system-prompt.d.ts +38 -0
- package/dist/interfaces/ui/terminal/shared/system-prompt.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/shared/system-prompt.js +102 -0
- package/dist/interfaces/ui/terminal/tui/HelpPanel.d.ts +39 -0
- package/dist/interfaces/ui/terminal/tui/HelpPanel.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/HelpPanel.js +215 -0
- package/dist/interfaces/ui/terminal/tui/InputContext.d.ts +91 -0
- package/dist/interfaces/ui/terminal/tui/InputContext.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/InputContext.js +154 -0
- package/dist/interfaces/ui/terminal/tui/InputField.d.ts +18 -0
- package/dist/interfaces/ui/terminal/tui/InputField.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/InputField.js +41 -0
- package/dist/interfaces/ui/terminal/tui/InteractiveTUI.d.ts +16 -0
- package/dist/interfaces/ui/terminal/tui/InteractiveTUI.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/InteractiveTUI.js +451 -0
- package/dist/interfaces/ui/terminal/tui/MessageArea.d.ts +10 -0
- package/dist/interfaces/ui/terminal/tui/MessageArea.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/MessageArea.js +91 -0
- package/dist/interfaces/ui/terminal/tui/MessageStore.d.ts +48 -0
- package/dist/interfaces/ui/terminal/tui/MessageStore.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/MessageStore.js +151 -0
- package/dist/interfaces/ui/terminal/tui/StatusBar.d.ts +9 -0
- package/dist/interfaces/ui/terminal/tui/StatusBar.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/StatusBar.js +36 -0
- package/dist/interfaces/ui/terminal/tui/commands.d.ts +21 -0
- package/dist/interfaces/ui/terminal/tui/commands.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/commands.js +359 -0
- package/dist/interfaces/ui/terminal/tui/components/InteractiveElements.d.ts +115 -0
- package/dist/interfaces/ui/terminal/tui/components/InteractiveElements.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/components/InteractiveElements.js +306 -0
- package/dist/interfaces/ui/terminal/tui/components/MultilineInput.d.ts +92 -0
- package/dist/interfaces/ui/terminal/tui/components/MultilineInput.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/components/MultilineInput.js +399 -0
- package/dist/interfaces/ui/terminal/tui/components/PaneManager.d.ts +59 -0
- package/dist/interfaces/ui/terminal/tui/components/PaneManager.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/components/PaneManager.js +139 -0
- package/dist/interfaces/ui/terminal/tui/components/Sidebar.d.ts +68 -0
- package/dist/interfaces/ui/terminal/tui/components/Sidebar.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/components/Sidebar.js +340 -0
- package/dist/interfaces/ui/terminal/tui/components/index.d.ts +23 -0
- package/dist/interfaces/ui/terminal/tui/components/index.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/components/index.js +51 -0
- package/dist/interfaces/ui/terminal/tui/console.d.ts +20 -0
- package/dist/interfaces/ui/terminal/tui/console.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/console.js +46 -0
- package/dist/interfaces/ui/terminal/tui/index.d.ts +20 -0
- package/dist/interfaces/ui/terminal/tui/index.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/index.js +28 -0
- package/dist/interfaces/ui/terminal/tui/run.d.ts +13 -0
- package/dist/interfaces/ui/terminal/tui/run.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/run.js +31 -0
- package/dist/interfaces/ui/terminal/tui/spinner.d.ts +44 -0
- package/dist/interfaces/ui/terminal/tui/spinner.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/spinner.js +59 -0
- package/dist/interfaces/ui/terminal/tui/tui-app.d.ts +39 -0
- package/dist/interfaces/ui/terminal/tui/tui-app.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/tui-app.js +198 -0
- package/dist/interfaces/ui/terminal/tui/tui-footer.d.ts +167 -0
- package/dist/interfaces/ui/terminal/tui/tui-footer.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/tui-footer.js +330 -0
- package/dist/interfaces/ui/terminal/tui/types.d.ts +165 -0
- package/dist/interfaces/ui/terminal/tui/types.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/types.js +5 -0
- package/dist/interfaces/ui/terminal/tui/useInputHandler.d.ts +23 -0
- package/dist/interfaces/ui/terminal/tui/useInputHandler.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/useInputHandler.js +72 -0
- package/dist/interfaces/ui/terminal/tui/useNativeInput.d.ts +90 -0
- package/dist/interfaces/ui/terminal/tui/useNativeInput.d.ts.map +1 -0
- package/dist/interfaces/ui/terminal/tui/useNativeInput.js +188 -0
- package/dist/native/README.md +53 -0
- package/dist/native/claude_code_native.darwin-x64.node +0 -0
- package/dist/native/claude_code_native.dylib +0 -0
- package/dist/native/index.d.ts +0 -0
- package/dist/native/index.d.ts.map +1 -0
- package/dist/native/index.darwin-arm64.node +0 -0
- package/dist/native/index.js +43 -0
- package/dist/native/index.node +0 -0
- package/dist/native/package.json +34 -0
- package/dist/teammates/index.d.ts +161 -0
- package/dist/teammates/index.d.ts.map +1 -0
- package/dist/teammates/index.js +827 -0
- package/dist/types/index.d.ts +482 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +52 -0
- package/native/index.darwin-arm64.node +0 -0
- package/native/index.js +33 -19
- package/package.json +6 -3
- package/packages/src/core/__tests__/permissions.test.ts +1091 -0
- package/packages/src/core/agent-loop/__tests__/compaction.test.ts +283 -0
- package/packages/src/core/agent-loop/__tests__/formatters.test.ts +234 -0
- package/packages/src/core/agent-loop/__tests__/index.test.ts +162 -0
- package/packages/src/core/agent-loop/__tests__/loop-state.test.ts +413 -0
- package/packages/src/core/agent-loop/__tests__/message-builder.test.ts +229 -0
- package/packages/src/core/agent-loop/__tests__/tool-executor.test.ts +457 -0
- package/packages/src/core/agent-loop/compaction.ts +92 -0
- package/packages/src/core/agent-loop/formatters.ts +50 -0
- package/packages/src/core/agent-loop/index.ts +137 -0
- package/packages/src/core/agent-loop/loop-state.ts +187 -0
- package/packages/src/core/agent-loop/message-builder.ts +62 -0
- package/packages/src/core/agent-loop/tool-executor.ts +211 -0
- package/packages/src/core/agent-loop/turn-executor.ts +226 -0
- package/packages/src/core/agent-loop/types.ts +152 -0
- package/packages/src/core/agent-loop.ts +18 -0
- package/packages/src/core/api-client-impl.ts +729 -0
- package/packages/src/core/api-client.ts +6 -0
- package/packages/src/core/checkpoints.ts +606 -0
- package/packages/src/core/claude-md.ts +272 -0
- package/packages/src/core/cognitive-security/hooks.ts +591 -0
- package/packages/src/core/cognitive-security/index.ts +2041 -0
- package/packages/src/core/cognitive-security/middleware.ts +536 -0
- package/packages/src/core/config/todo +7 -0
- package/packages/src/core/config-loader.ts +324 -0
- package/packages/src/core/context/__tests__/integration.test.ts +334 -0
- package/packages/src/core/context/compaction.ts +170 -0
- package/packages/src/core/context/constants.ts +58 -0
- package/packages/src/core/context/extraction.ts +85 -0
- package/packages/src/core/context/index.ts +66 -0
- package/packages/src/core/context/summarization.ts +251 -0
- package/packages/src/core/context/token-estimation.ts +98 -0
- package/packages/src/core/context/types.ts +59 -0
- package/packages/src/core/git-status.ts +262 -0
- package/packages/src/core/image.test.ts +180 -0
- package/packages/src/core/image.ts +350 -0
- package/packages/src/core/lmdb.db +0 -0
- package/packages/src/core/lmdb.db-lock +0 -0
- package/packages/src/core/models.ts +507 -0
- package/packages/src/core/normalizers/todo +8 -0
- package/packages/src/core/permissions.ts +431 -0
- package/packages/src/core/providers/README.md +230 -0
- package/packages/src/core/providers/__tests__/providers.test.ts +135 -0
- package/packages/src/core/providers/index.ts +419 -0
- package/packages/src/core/providers/types.ts +132 -0
- package/packages/src/core/retry.ts +180 -0
- package/packages/src/core/session-store.ts +36 -0
- package/packages/src/core/sessions/export.ts +329 -0
- package/packages/src/core/sessions/index.ts +587 -0
- package/packages/src/core/sessions/metadata.ts +309 -0
- package/packages/src/core/sessions/persistence.ts +244 -0
- package/packages/src/core/sessions/types.ts +169 -0
- package/packages/src/core/stream-highlighter.ts +1123 -0
- package/packages/src/core/system-reminders.ts +402 -0
- package/packages/src/core/todo +8 -0
- package/packages/src/ecosystem/hooks/__tests__/index.test.ts +561 -0
- package/packages/src/ecosystem/hooks/index.ts +341 -0
- package/packages/src/ecosystem/hooks/prompt-evaluator.ts +300 -0
- package/packages/src/ecosystem/skills/index.ts +295 -0
- package/packages/src/ecosystem/tools/__tests__/index.test.ts +1335 -0
- package/packages/src/ecosystem/tools/index.ts +2051 -0
- package/packages/src/index.ts +141 -0
- package/packages/src/interfaces/mcp/client.ts +389 -0
- package/packages/src/interfaces/ui/index.ts +158 -0
- package/packages/src/interfaces/ui/lmdb.db +0 -0
- package/packages/src/interfaces/ui/lmdb.db-lock +0 -0
- package/packages/src/interfaces/ui/spinner.ts +451 -0
- package/packages/src/interfaces/ui/terminal/bridge/index.ts +370 -0
- package/packages/src/interfaces/ui/terminal/bridge/ipc.ts +829 -0
- package/packages/src/interfaces/ui/terminal/bridge/screen-export.ts +968 -0
- package/packages/src/interfaces/ui/terminal/bridge/types.ts +226 -0
- package/packages/src/interfaces/ui/terminal/bridge/useBridge.ts +210 -0
- package/packages/src/interfaces/ui/terminal/cli/bootstrap.ts +132 -0
- package/packages/src/interfaces/ui/terminal/cli/index.ts +415 -0
- package/packages/src/interfaces/ui/terminal/cli/interactive/index.ts +110 -0
- package/packages/src/interfaces/ui/terminal/cli/interactive/input-handler.ts +393 -0
- package/packages/src/interfaces/ui/terminal/cli/interactive/interactive-runner.ts +820 -0
- package/packages/src/interfaces/ui/terminal/cli/interactive/message-store.ts +299 -0
- package/packages/src/interfaces/ui/terminal/cli/interactive/types.ts +274 -0
- package/packages/src/interfaces/ui/terminal/lmdb.db +0 -0
- package/packages/src/interfaces/ui/terminal/lmdb.db-lock +0 -0
- package/packages/src/interfaces/ui/terminal/shared/args.ts +222 -0
- package/packages/src/interfaces/ui/terminal/shared/index.ts +84 -0
- package/packages/src/interfaces/ui/terminal/shared/loading-state.ts +322 -0
- package/packages/src/interfaces/ui/terminal/shared/query.ts +152 -0
- package/packages/src/interfaces/ui/terminal/shared/setup.ts +299 -0
- package/packages/src/interfaces/ui/terminal/shared/spinner-frames.ts +73 -0
- package/packages/src/interfaces/ui/terminal/shared/status-line.ts +366 -0
- package/packages/src/interfaces/ui/terminal/shared/system-prompt.ts +146 -0
- package/packages/src/lmdb.db +0 -0
- package/packages/src/lmdb.db-lock +0 -0
- package/packages/src/native/index.ts +2722 -0
- package/packages/src/native/tui_v2_types.ts +39 -0
- package/packages/src/teammates/coordination.test.ts +279 -0
- package/packages/src/teammates/coordination.ts +646 -0
- package/packages/src/teammates/index.ts +1052 -0
- package/packages/src/teammates/integration.test.ts +272 -0
- package/packages/src/teammates/runner.test.ts +235 -0
- package/packages/src/teammates/runner.ts +750 -0
- package/packages/src/teammates/schemas.ts +673 -0
- package/packages/src/types/index.ts +723 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* Coder - CLI Entry Point
|
|
4
|
+
* AI-powered terminal coding assistant
|
|
5
|
+
*
|
|
6
|
+
* This is a thin orchestrator that:
|
|
7
|
+
* 1. Parses arguments
|
|
8
|
+
* 2. Sets up session (config, MCP, hooks)
|
|
9
|
+
* 3. Initializes teammate mode if enabled
|
|
10
|
+
* 4. Dispatches to TUI or single-query mode
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// ============================================
|
|
14
|
+
// PTY WRAPPER DETECTION (must run before any other code)
|
|
15
|
+
// ============================================
|
|
16
|
+
|
|
17
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
18
|
+
import process from "node:process";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Check if we're running under doppler without a TTY and need a PTY wrapper
|
|
22
|
+
* This must run before any other code to properly handle the TTY requirement
|
|
23
|
+
*
|
|
24
|
+
* When successful wrapping occurs, this function NEVER returns - it exits the process
|
|
25
|
+
* when the wrapped child exits.
|
|
26
|
+
*/
|
|
27
|
+
function checkPtyWrapper(): void {
|
|
28
|
+
const isTTY = process.stdin.isTTY;
|
|
29
|
+
const isDoppler = !!process.env.DOPPLER_TOKEN;
|
|
30
|
+
const forceInteractive = process.env.CLAUDE_FORCE_INTERACTIVE === "true";
|
|
31
|
+
const hasQuery = process.argv.includes("-q") || process.argv.includes("--query");
|
|
32
|
+
const hasVersion = process.argv.includes("--version") || process.argv.includes("-v");
|
|
33
|
+
const hasHelp = process.argv.includes("--help") || process.argv.includes("-h");
|
|
34
|
+
const alreadyWrapped = process.env.CODER_PTY_WRAPPED === "1";
|
|
35
|
+
|
|
36
|
+
// Skip if we have a TTY, force interactive, have a query, version, help, or already wrapped
|
|
37
|
+
if (isTTY || forceInteractive || hasQuery || hasVersion || hasHelp || alreadyWrapped) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// If under doppler without TTY, try to wrap with unbuffer
|
|
42
|
+
if (isDoppler) {
|
|
43
|
+
const result = tryWrapWithUnbuffer();
|
|
44
|
+
if (result.wrapped && result.child) {
|
|
45
|
+
// Successfully wrapped - child is running
|
|
46
|
+
// Wait for child to exit, then exit parent with same code
|
|
47
|
+
result.child.on("exit", (code: number | null) => {
|
|
48
|
+
process.exit(code ?? 1);
|
|
49
|
+
});
|
|
50
|
+
// Prevent further execution by keeping parent alive
|
|
51
|
+
// The exit handler above will terminate this process
|
|
52
|
+
setInterval(() => {
|
|
53
|
+
/* keep alive */
|
|
54
|
+
}, 10000);
|
|
55
|
+
return; // TypeScript needs this
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Failed to wrap - show helpful error
|
|
59
|
+
console.error("Error: Interactive mode requires a TTY.");
|
|
60
|
+
console.error("");
|
|
61
|
+
console.error("When using 'doppler run', TTY is not passed through.");
|
|
62
|
+
console.error("");
|
|
63
|
+
console.error("Install 'expect' package for automatic PTY support:");
|
|
64
|
+
console.error(" macOS: brew install expect");
|
|
65
|
+
console.error(" Ubuntu: sudo apt install expect");
|
|
66
|
+
console.error(" Fedora: sudo dnf install expect");
|
|
67
|
+
console.error("");
|
|
68
|
+
console.error("Or use one of these alternatives:");
|
|
69
|
+
console.error(" 1. Single query: doppler run -- coder -q \"your question\"");
|
|
70
|
+
console.error(" 2. Export secrets: doppler secrets download --no-file && coder");
|
|
71
|
+
console.error(" 3. Force simple: CLAUDE_FORCE_INTERACTIVE=true doppler run -- coder");
|
|
72
|
+
console.error(" 4. With unbuffer: unbuffer doppler run -- coder");
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Try to wrap execution with unbuffer to provide a PTY
|
|
79
|
+
* @returns Object with wrapped status and child process if successful
|
|
80
|
+
*/
|
|
81
|
+
function tryWrapWithUnbuffer(): { wrapped: boolean; child?: ReturnType<typeof spawn> } {
|
|
82
|
+
try {
|
|
83
|
+
// Check if unbuffer is available
|
|
84
|
+
const checkResult = spawnSync("which", ["unbuffer"], {
|
|
85
|
+
stdio: "ignore",
|
|
86
|
+
timeout: 1000,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
if (checkResult.status !== 0) {
|
|
90
|
+
return { wrapped: false };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Re-exec ourselves with unbuffer
|
|
94
|
+
const args = [process.execPath, ...process.argv.slice(1)];
|
|
95
|
+
const child = spawn("unbuffer", args, {
|
|
96
|
+
stdio: "inherit",
|
|
97
|
+
env: {
|
|
98
|
+
...process.env,
|
|
99
|
+
CODER_PTY_WRAPPED: "1",
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return { wrapped: true, child };
|
|
104
|
+
} catch {
|
|
105
|
+
return { wrapped: false };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Run PTY check before any other code
|
|
110
|
+
checkPtyWrapper();
|
|
111
|
+
|
|
112
|
+
// ============================================
|
|
113
|
+
// MAIN IMPORTS
|
|
114
|
+
// ============================================
|
|
115
|
+
|
|
116
|
+
import type { Message } from "../../../../types/index.js";
|
|
117
|
+
import type { ToolDefinition, PermissionMode } from "../../../../types/index.js";
|
|
118
|
+
import type { builtInTools } from "../../../../ecosystem/tools/index.js";
|
|
119
|
+
import type { HookManager } from "../../../../ecosystem/hooks/index.js";
|
|
120
|
+
import type { SkillManager } from "../../../../ecosystem/skills/index.js";
|
|
121
|
+
import type { MCPClientImpl } from "../../../mcp/client.js";
|
|
122
|
+
import type { TeammateMessage } from "../../../../types/index.js";
|
|
123
|
+
import { SessionStore, printSessionsList } from "../../../../core/session-store.js";
|
|
124
|
+
import { getGitStatus } from "../../../../core/git-status.js";
|
|
125
|
+
import { renderStatusLine, getContextWindow, VERSION, type StatusLineOptions } from "../shared/status-line.js";
|
|
126
|
+
import { InteractiveRunner } from "./interactive/index.js";
|
|
127
|
+
import type { InteractiveRunnerProps } from "./interactive/types.js";
|
|
128
|
+
import {
|
|
129
|
+
TeammateModeRunner,
|
|
130
|
+
setTeammateRunner,
|
|
131
|
+
isTeammateModeActive,
|
|
132
|
+
} from "../../../../teammates/runner.js";
|
|
133
|
+
|
|
134
|
+
// Shared modules
|
|
135
|
+
import {
|
|
136
|
+
parseArgs,
|
|
137
|
+
requireApiKey,
|
|
138
|
+
setupSession,
|
|
139
|
+
buildCompleteSystemPrompt,
|
|
140
|
+
runSingleQuery,
|
|
141
|
+
} from "../shared/index.js";
|
|
142
|
+
|
|
143
|
+
// ============================================
|
|
144
|
+
// MAIN ENTRY POINT
|
|
145
|
+
// ============================================
|
|
146
|
+
|
|
147
|
+
async function main(): Promise<void> {
|
|
148
|
+
const args = parseArgs();
|
|
149
|
+
|
|
150
|
+
// Handle --version flag
|
|
151
|
+
if (args.showVersion) {
|
|
152
|
+
console.log(`Coder v${VERSION}`);
|
|
153
|
+
console.log(`Model: ${args.model}`);
|
|
154
|
+
console.log(`Node: ${process.version}`);
|
|
155
|
+
console.log(`Platform: ${process.platform} ${process.arch}`);
|
|
156
|
+
process.exit(0);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Initialize session store
|
|
160
|
+
const sessionStore = new SessionStore();
|
|
161
|
+
await sessionStore.init();
|
|
162
|
+
|
|
163
|
+
// Handle --sessions flag
|
|
164
|
+
if (args.listSessions) {
|
|
165
|
+
const sessions = await sessionStore.listSessions(20);
|
|
166
|
+
printSessionsList(sessions);
|
|
167
|
+
process.exit(0);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Get API key
|
|
171
|
+
const apiKey = requireApiKey();
|
|
172
|
+
|
|
173
|
+
// Determine if we'll be in interactive TUI mode (no query = interactive)
|
|
174
|
+
const isInteractiveMode = !args.query;
|
|
175
|
+
|
|
176
|
+
// Setup session (config, MCP, hooks, skills)
|
|
177
|
+
const setup = await setupSession({
|
|
178
|
+
args,
|
|
179
|
+
apiKey,
|
|
180
|
+
workingDirectory: process.cwd(),
|
|
181
|
+
isTuiMode: isInteractiveMode, // Disable console logging in TUI mode
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// Get git status for system prompt
|
|
185
|
+
const gitStatus = await getGitStatus(process.cwd());
|
|
186
|
+
|
|
187
|
+
// Build system prompt
|
|
188
|
+
const systemPrompt = await buildCompleteSystemPrompt(process.cwd(), {
|
|
189
|
+
systemPrompt: args.systemPrompt,
|
|
190
|
+
appendSystemPrompt: args.appendSystemPrompt,
|
|
191
|
+
teammateMode: args.teammateMode,
|
|
192
|
+
agentId: args.agentId,
|
|
193
|
+
agentName: args.agentName,
|
|
194
|
+
teamName: args.teamName,
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// Handle session resume
|
|
198
|
+
let messages: Message[] = [];
|
|
199
|
+
let sessionId: string;
|
|
200
|
+
|
|
201
|
+
if (args.resumeSession) {
|
|
202
|
+
const loadedSession = await sessionStore.resumeSession(args.resumeSession);
|
|
203
|
+
if (!loadedSession) {
|
|
204
|
+
console.error(`Error: Session not found: ${args.resumeSession}`);
|
|
205
|
+
process.exit(1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
messages = loadedSession.messages;
|
|
209
|
+
sessionId = args.resumeSession;
|
|
210
|
+
|
|
211
|
+
// Update args from session metadata
|
|
212
|
+
args.model = loadedSession.metadata.model as typeof args.model;
|
|
213
|
+
args.agentName = loadedSession.metadata.agentName;
|
|
214
|
+
args.agentColor = loadedSession.metadata.agentColor;
|
|
215
|
+
args.teamName = loadedSession.metadata.teamName;
|
|
216
|
+
|
|
217
|
+
console.log(`\x1b[90mResumed session: ${args.resumeSession}\x1b[0m`);
|
|
218
|
+
console.log(`\x1b[90mModel: ${args.model} | Messages: ${messages.length}\x1b[0m\n`);
|
|
219
|
+
} else {
|
|
220
|
+
// Create new session
|
|
221
|
+
sessionId = await sessionStore.createSession({
|
|
222
|
+
model: args.model,
|
|
223
|
+
workingDirectory: process.cwd(),
|
|
224
|
+
agentName: args.agentName,
|
|
225
|
+
agentColor: args.agentColor,
|
|
226
|
+
teamName: args.teamName,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Get initial query
|
|
231
|
+
let query = args.query;
|
|
232
|
+
const firstArg = process.argv[2];
|
|
233
|
+
if (!query && process.argv.length > 2 && firstArg && !firstArg.startsWith("-")) {
|
|
234
|
+
query = process.argv.slice(2).join(" ");
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ============================================
|
|
238
|
+
// TEAMMATE MODE INITIALIZATION
|
|
239
|
+
// ============================================
|
|
240
|
+
|
|
241
|
+
let teammateRunner: TeammateModeRunner | null = null;
|
|
242
|
+
let pendingTeammateMessages: TeammateMessage[] = [];
|
|
243
|
+
|
|
244
|
+
if (args.teammateMode && args.teamName) {
|
|
245
|
+
try {
|
|
246
|
+
teammateRunner = new TeammateModeRunner({
|
|
247
|
+
teamName: args.teamName,
|
|
248
|
+
agentId: args.agentId,
|
|
249
|
+
agentName: args.agentName,
|
|
250
|
+
agentColor: args.agentColor,
|
|
251
|
+
prompt: args.systemPrompt,
|
|
252
|
+
workingDirectory: process.cwd(),
|
|
253
|
+
onMessage: (message: TeammateMessage) => {
|
|
254
|
+
// Queue message for injection into conversation
|
|
255
|
+
pendingTeammateMessages.push(message);
|
|
256
|
+
console.log(`\x1b[90m[Teammate] Message from ${message.from}: ${message.content.slice(0, 50)}...\x1b[0m`);
|
|
257
|
+
},
|
|
258
|
+
onIdle: () => {
|
|
259
|
+
console.log(`\x1b[90m[Teammate] Now idle, waiting for tasks...\x1b[0m`);
|
|
260
|
+
},
|
|
261
|
+
pollInterval: 2000,
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
const teammate = await teammateRunner.start();
|
|
265
|
+
|
|
266
|
+
// Set global reference for tools to access
|
|
267
|
+
setTeammateRunner(teammateRunner);
|
|
268
|
+
|
|
269
|
+
console.log(`\x1b[90m[Teammate] Joined team "${args.teamName}" as ${teammate.name} (${teammate.teammateId})\x1b[0m`);
|
|
270
|
+
} catch (error) {
|
|
271
|
+
console.error(`\x1b[31mError starting teammate mode: ${error}\x1b[0m`);
|
|
272
|
+
teammateRunner = null;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Cleanup handler
|
|
277
|
+
const cleanup = async () => {
|
|
278
|
+
if (teammateRunner) {
|
|
279
|
+
console.log(`\x1b[90m[Teammate] Stopping teammate mode...\x1b[0m`);
|
|
280
|
+
await teammateRunner.stop();
|
|
281
|
+
setTeammateRunner(null);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
process.on("SIGINT", async () => {
|
|
286
|
+
await cleanup();
|
|
287
|
+
process.exit(0);
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
process.on("SIGTERM", async () => {
|
|
291
|
+
await cleanup();
|
|
292
|
+
process.exit(0);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
if (!query) {
|
|
296
|
+
// Show initial status line
|
|
297
|
+
const initialStatusOptions: StatusLineOptions = {
|
|
298
|
+
permissionMode: setup.permissionMode,
|
|
299
|
+
tokensUsed: 0,
|
|
300
|
+
maxTokens: getContextWindow(args.model),
|
|
301
|
+
model: args.model,
|
|
302
|
+
isLoading: false,
|
|
303
|
+
};
|
|
304
|
+
console.log(`\x1b[90m${renderStatusLine(initialStatusOptions)}\x1b[0m`);
|
|
305
|
+
console.log(`\x1b[90mSession: ${sessionId}\x1b[0m`);
|
|
306
|
+
if (teammateRunner) {
|
|
307
|
+
console.log(`\x1b[90mTeammate Mode: Active | Team: ${args.teamName}\x1b[0m`);
|
|
308
|
+
}
|
|
309
|
+
console.log("\x1b[90mType your message, ? for help, or /help for commands.\x1b[0m\n");
|
|
310
|
+
|
|
311
|
+
// Interactive mode
|
|
312
|
+
await runInteractiveMode(
|
|
313
|
+
apiKey,
|
|
314
|
+
args,
|
|
315
|
+
systemPrompt,
|
|
316
|
+
setup.tools,
|
|
317
|
+
setup.hookManager,
|
|
318
|
+
setup.skillManager,
|
|
319
|
+
sessionStore,
|
|
320
|
+
messages,
|
|
321
|
+
sessionId,
|
|
322
|
+
setup.mcpClients,
|
|
323
|
+
setup.permissionMode,
|
|
324
|
+
teammateRunner
|
|
325
|
+
);
|
|
326
|
+
} else {
|
|
327
|
+
// Single query mode
|
|
328
|
+
await runSingleQuery({
|
|
329
|
+
apiKey,
|
|
330
|
+
args,
|
|
331
|
+
systemPrompt,
|
|
332
|
+
tools: setup.tools,
|
|
333
|
+
query,
|
|
334
|
+
sessionStore,
|
|
335
|
+
sessionId,
|
|
336
|
+
hookManager: setup.hookManager,
|
|
337
|
+
workingDirectory: process.cwd(),
|
|
338
|
+
gitStatus,
|
|
339
|
+
permissionMode: setup.permissionMode,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// ============================================
|
|
345
|
+
// INTERACTIVE MODE
|
|
346
|
+
// ============================================
|
|
347
|
+
|
|
348
|
+
async function runInteractiveMode(
|
|
349
|
+
apiKey: string,
|
|
350
|
+
args: Awaited<ReturnType<typeof parseArgs>>,
|
|
351
|
+
systemPrompt: string,
|
|
352
|
+
tools: ToolDefinition[],
|
|
353
|
+
hookManager: HookManager,
|
|
354
|
+
skillManager: SkillManager,
|
|
355
|
+
sessionStore: SessionStore,
|
|
356
|
+
messages: Message[],
|
|
357
|
+
sessionId: string,
|
|
358
|
+
mcpClients: Map<string, MCPClientImpl>,
|
|
359
|
+
permissionMode: PermissionMode,
|
|
360
|
+
teammateRunner: TeammateModeRunner | null = null
|
|
361
|
+
): Promise<void> {
|
|
362
|
+
// Note: PTY wrapper check already ran at module load time
|
|
363
|
+
// This check is for non-doppler environments without TTY
|
|
364
|
+
const isInteractive = process.stdin.isTTY;
|
|
365
|
+
const forceInteractive = process.env.CLAUDE_FORCE_INTERACTIVE === "true";
|
|
366
|
+
|
|
367
|
+
if (!isInteractive && !forceInteractive) {
|
|
368
|
+
console.error("Error: Interactive mode requires a TTY.");
|
|
369
|
+
console.error("");
|
|
370
|
+
console.error("Use -q for single query mode, or set CLAUDE_FORCE_INTERACTIVE=true.");
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// Create a mutable session ID holder for the interactive runner
|
|
375
|
+
let currentSessionId = sessionId;
|
|
376
|
+
const setSessionId = (newId: string) => {
|
|
377
|
+
currentSessionId = newId;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
// Run the non-React interactive CLI
|
|
381
|
+
const runner = new InteractiveRunner({
|
|
382
|
+
apiKey,
|
|
383
|
+
model: args.model,
|
|
384
|
+
permissionMode,
|
|
385
|
+
maxTokens: args.maxTokens,
|
|
386
|
+
systemPrompt,
|
|
387
|
+
tools,
|
|
388
|
+
hookManager,
|
|
389
|
+
sessionStore,
|
|
390
|
+
sessionId: currentSessionId,
|
|
391
|
+
setSessionId,
|
|
392
|
+
initialMessages: messages,
|
|
393
|
+
workingDirectory: process.cwd(),
|
|
394
|
+
teammateRunner,
|
|
395
|
+
onExit: async () => {
|
|
396
|
+
// Cleanup teammate mode
|
|
397
|
+
if (teammateRunner) {
|
|
398
|
+
await teammateRunner.stop();
|
|
399
|
+
setTeammateRunner(null);
|
|
400
|
+
}
|
|
401
|
+
console.log("\n\x1b[90mGoodbye!\x1b[0m");
|
|
402
|
+
},
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
await runner.start();
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// ============================================
|
|
409
|
+
// RUN MAIN
|
|
410
|
+
// ============================================
|
|
411
|
+
|
|
412
|
+
main().catch((error) => {
|
|
413
|
+
console.error("Fatal error:", error);
|
|
414
|
+
process.exit(1);
|
|
415
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Interactive Module
|
|
3
|
+
*
|
|
4
|
+
* Non-React implementation of the interactive CLI mode.
|
|
5
|
+
* Extracts core patterns from v1 TUI without the Ink dependency.
|
|
6
|
+
*
|
|
7
|
+
* This module provides:
|
|
8
|
+
* - MessageStore: Centralized message state management
|
|
9
|
+
* - InputManager: Priority-based keyboard input handling
|
|
10
|
+
* - InteractiveRunner: Main interactive loop with agent integration
|
|
11
|
+
* - Type definitions for all components
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { InteractiveRunner, MessageStoreImpl, InputManagerImpl } from "./interactive/index.js";
|
|
16
|
+
*
|
|
17
|
+
* // Create and run interactive mode
|
|
18
|
+
* const runner = new InteractiveRunner({
|
|
19
|
+
* apiKey: process.env.API_KEY!,
|
|
20
|
+
* model: "claude-sonnet-4-6",
|
|
21
|
+
* // ... other props
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* await runner.start();
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Architecture:
|
|
28
|
+
* - MessageStore: Single source of truth for messages (non-React)
|
|
29
|
+
* - InputManager: Centralized keyboard input with priority system
|
|
30
|
+
* - InteractiveRunner: Main loop that orchestrates everything
|
|
31
|
+
*
|
|
32
|
+
* Patterns from v1 TUI:
|
|
33
|
+
* - MessageStore pattern: addMessage, addApiMessages, addSystem, clear, replace
|
|
34
|
+
* - InputContext pattern: register, focus, dispatch, blocked state
|
|
35
|
+
* - Clean separation of concerns
|
|
36
|
+
* - Well-defined TypeScript interfaces
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
// ============================================
|
|
40
|
+
// TYPES
|
|
41
|
+
// ============================================
|
|
42
|
+
|
|
43
|
+
export type {
|
|
44
|
+
// Message types
|
|
45
|
+
UIMessage,
|
|
46
|
+
MessageSubType,
|
|
47
|
+
MessageStore,
|
|
48
|
+
|
|
49
|
+
// Input types
|
|
50
|
+
InputManager,
|
|
51
|
+
InputHandler,
|
|
52
|
+
InputHandlerOptions,
|
|
53
|
+
NativeKeyEvent,
|
|
54
|
+
|
|
55
|
+
// Runner types
|
|
56
|
+
InteractiveRunnerProps,
|
|
57
|
+
InteractiveState,
|
|
58
|
+
SessionStore,
|
|
59
|
+
SessionInfo,
|
|
60
|
+
CommandContext,
|
|
61
|
+
|
|
62
|
+
// Context types
|
|
63
|
+
ContextInfo,
|
|
64
|
+
} from "./types.js";
|
|
65
|
+
|
|
66
|
+
export { InputPriority } from "./types.js";
|
|
67
|
+
|
|
68
|
+
// ============================================
|
|
69
|
+
// MESSAGE STORE
|
|
70
|
+
// ============================================
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
MessageStoreImpl,
|
|
74
|
+
getMessageStore,
|
|
75
|
+
resetMessageStore,
|
|
76
|
+
} from "./message-store.js";
|
|
77
|
+
|
|
78
|
+
// ============================================
|
|
79
|
+
// INPUT HANDLER
|
|
80
|
+
// ============================================
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
InputManagerImpl,
|
|
84
|
+
getInputManager,
|
|
85
|
+
resetInputManager,
|
|
86
|
+
KeyEvents,
|
|
87
|
+
} from "./input-handler.js";
|
|
88
|
+
|
|
89
|
+
// ============================================
|
|
90
|
+
// INTERACTIVE RUNNER
|
|
91
|
+
// ============================================
|
|
92
|
+
|
|
93
|
+
import { InteractiveRunner as _InteractiveRunner } from "./interactive-runner.js";
|
|
94
|
+
|
|
95
|
+
export { _InteractiveRunner as InteractiveRunner };
|
|
96
|
+
|
|
97
|
+
// ============================================
|
|
98
|
+
// CONVENIENCE FUNCTIONS
|
|
99
|
+
// ============================================
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Run interactive mode with the given props
|
|
103
|
+
* Convenience function that creates and starts an InteractiveRunner
|
|
104
|
+
*/
|
|
105
|
+
export async function runInteractiveMode(
|
|
106
|
+
props: import("./types.js").InteractiveRunnerProps
|
|
107
|
+
): Promise<void> {
|
|
108
|
+
const runner = new _InteractiveRunner(props);
|
|
109
|
+
await runner.start();
|
|
110
|
+
}
|