@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,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single Query Execution
|
|
3
|
+
* Shared query runner for CLI -q mode
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Message, ToolDefinition, ExtendedThinkingConfig, GitStatus } from "../../../../types/index.js";
|
|
7
|
+
import { agentLoop, formatCost, formatCostBrief } from "../../../../core/agent-loop.js";
|
|
8
|
+
import { HookManager } from "../../../../ecosystem/hooks/index.js";
|
|
9
|
+
import { SessionStore } from "../../../../core/session-store.js";
|
|
10
|
+
import { createStreamHighlighter } from "../../../../core/stream-highlighter.js";
|
|
11
|
+
import {
|
|
12
|
+
renderStatusLine,
|
|
13
|
+
getContextWindow,
|
|
14
|
+
type StatusLineOptions,
|
|
15
|
+
} from "./status-line.js";
|
|
16
|
+
import type { CLIArgs } from "./args.js";
|
|
17
|
+
|
|
18
|
+
// ============================================
|
|
19
|
+
// TYPES
|
|
20
|
+
// ============================================
|
|
21
|
+
|
|
22
|
+
export interface QueryOptions {
|
|
23
|
+
apiKey: string;
|
|
24
|
+
args: CLIArgs;
|
|
25
|
+
systemPrompt: string;
|
|
26
|
+
tools: ToolDefinition[];
|
|
27
|
+
query: string;
|
|
28
|
+
sessionStore: SessionStore;
|
|
29
|
+
sessionId: string;
|
|
30
|
+
hookManager: HookManager;
|
|
31
|
+
workingDirectory: string;
|
|
32
|
+
gitStatus?: GitStatus | null;
|
|
33
|
+
/** Resolved permission mode (from config, may differ from args.permissionMode) */
|
|
34
|
+
permissionMode?: import("../../../../types/index.js").PermissionMode;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// ============================================
|
|
38
|
+
// SINGLE QUERY RUNNER
|
|
39
|
+
// ============================================
|
|
40
|
+
|
|
41
|
+
export async function runSingleQuery(options: QueryOptions): Promise<void> {
|
|
42
|
+
const {
|
|
43
|
+
apiKey,
|
|
44
|
+
args,
|
|
45
|
+
systemPrompt,
|
|
46
|
+
tools,
|
|
47
|
+
query,
|
|
48
|
+
sessionStore,
|
|
49
|
+
sessionId,
|
|
50
|
+
hookManager,
|
|
51
|
+
workingDirectory,
|
|
52
|
+
gitStatus,
|
|
53
|
+
permissionMode: resolvedPermissionMode,
|
|
54
|
+
} = options;
|
|
55
|
+
|
|
56
|
+
// Use resolved permission mode from config if provided, otherwise fall back to args
|
|
57
|
+
const permissionMode = resolvedPermissionMode ?? args.permissionMode;
|
|
58
|
+
|
|
59
|
+
// Show initial status line
|
|
60
|
+
const initialStatusOptions: StatusLineOptions = {
|
|
61
|
+
permissionMode,
|
|
62
|
+
tokensUsed: 0,
|
|
63
|
+
maxTokens: getContextWindow(args.model),
|
|
64
|
+
model: args.model,
|
|
65
|
+
isLoading: true,
|
|
66
|
+
};
|
|
67
|
+
console.log(`\x1b[90m${renderStatusLine(initialStatusOptions)}\x1b[0m\n`);
|
|
68
|
+
|
|
69
|
+
// Track tokens for final status
|
|
70
|
+
let totalTokens = 0;
|
|
71
|
+
|
|
72
|
+
const messages: Message[] = [
|
|
73
|
+
{
|
|
74
|
+
role: "user",
|
|
75
|
+
content: [{ type: "text", text: query }],
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
// Save user message to session
|
|
80
|
+
await sessionStore.saveMessage(messages[0]!);
|
|
81
|
+
|
|
82
|
+
// Create stream highlighter for code blocks
|
|
83
|
+
const highlighter = createStreamHighlighter();
|
|
84
|
+
|
|
85
|
+
// Build extended thinking config
|
|
86
|
+
const extendedThinkingConfig: ExtendedThinkingConfig | undefined = args.extendedThinking
|
|
87
|
+
? {
|
|
88
|
+
enabled: true,
|
|
89
|
+
effort: args.effort ?? "medium",
|
|
90
|
+
interleaved: args.interleaved ?? true,
|
|
91
|
+
}
|
|
92
|
+
: undefined;
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
const result = await agentLoop(messages, {
|
|
96
|
+
apiKey,
|
|
97
|
+
model: args.model,
|
|
98
|
+
maxTokens: args.maxTokens,
|
|
99
|
+
systemPrompt,
|
|
100
|
+
tools,
|
|
101
|
+
permissionMode, // Use resolved permission mode
|
|
102
|
+
workingDirectory,
|
|
103
|
+
gitStatus: gitStatus ?? undefined,
|
|
104
|
+
extendedThinking: extendedThinkingConfig,
|
|
105
|
+
hookManager,
|
|
106
|
+
sessionId,
|
|
107
|
+
onText: (text) => {
|
|
108
|
+
const highlighted = highlighter.process(text);
|
|
109
|
+
if (highlighted) {
|
|
110
|
+
process.stdout.write(highlighted);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
onThinking: (thinking) => {
|
|
114
|
+
process.stdout.write(`\x1b[90m${thinking}\x1b[0m`);
|
|
115
|
+
},
|
|
116
|
+
onMetrics: async (metrics) => {
|
|
117
|
+
// Track tokens for final status
|
|
118
|
+
totalTokens = metrics.usage.input_tokens + metrics.usage.output_tokens;
|
|
119
|
+
console.log(`\n\x1b[90m${formatCostBrief(metrics)}\x1b[0m`);
|
|
120
|
+
await sessionStore.saveMetrics(metrics);
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Flush any remaining highlighted content
|
|
125
|
+
const remaining = highlighter.flush();
|
|
126
|
+
if (remaining) {
|
|
127
|
+
process.stdout.write(remaining);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Save assistant message to session
|
|
131
|
+
const lastMessage = result.messages[result.messages.length - 1];
|
|
132
|
+
if (lastMessage && lastMessage.role === "assistant") {
|
|
133
|
+
await sessionStore.saveMessage(lastMessage);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Show final status line
|
|
137
|
+
const finalStatusOptions: StatusLineOptions = {
|
|
138
|
+
permissionMode,
|
|
139
|
+
tokensUsed: totalTokens,
|
|
140
|
+
maxTokens: getContextWindow(args.model),
|
|
141
|
+
model: args.model,
|
|
142
|
+
isLoading: false,
|
|
143
|
+
};
|
|
144
|
+
console.log(`\n\x1b[90m${renderStatusLine(finalStatusOptions)}\x1b[0m`);
|
|
145
|
+
console.log(`\x1b[90mSession: ${sessionId}\x1b[0m`);
|
|
146
|
+
console.log(`\x1b[90mTotal cost: ${formatCost(result.totalCost)}\x1b[0m`);
|
|
147
|
+
} catch (error) {
|
|
148
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
149
|
+
console.error(`Error: ${errorMessage}`);
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Setup
|
|
3
|
+
* Shared initialization logic for CLI and TUI modes
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { MCPServerConfig, ToolDefinition, PermissionMode } from "../../../../types/index.js";
|
|
7
|
+
import { MCPClientImpl, createMCPClients } from "../../../mcp/client.js";
|
|
8
|
+
import { HookManager } from "../../../../ecosystem/hooks/index.js";
|
|
9
|
+
import { createPromptEvaluator } from "../../../../ecosystem/hooks/prompt-evaluator.js";
|
|
10
|
+
import { SkillManager } from "../../../../ecosystem/skills/index.js";
|
|
11
|
+
import { TeammateManager } from "../../../../teammates/index.js";
|
|
12
|
+
import {
|
|
13
|
+
loadAllConfigs,
|
|
14
|
+
getMergedSettings,
|
|
15
|
+
getPermissionMode,
|
|
16
|
+
getAllowedTools,
|
|
17
|
+
getDisallowedTools,
|
|
18
|
+
getAllMCPServers,
|
|
19
|
+
settingsToHookDefinitions,
|
|
20
|
+
type LoadedConfig,
|
|
21
|
+
type SettingsConfig,
|
|
22
|
+
} from "../../../../core/config-loader.js";
|
|
23
|
+
import { createSecurityHookHandlers } from "../../../../core/cognitive-security/hooks.js";
|
|
24
|
+
import type { CLIArgs } from "./args.js";
|
|
25
|
+
|
|
26
|
+
// ============================================
|
|
27
|
+
// TYPES
|
|
28
|
+
// ============================================
|
|
29
|
+
|
|
30
|
+
export interface SessionSetup {
|
|
31
|
+
loadedConfig: LoadedConfig;
|
|
32
|
+
mergedSettings: SettingsConfig;
|
|
33
|
+
hookManager: HookManager;
|
|
34
|
+
skillManager: SkillManager;
|
|
35
|
+
teammateManager: TeammateManager;
|
|
36
|
+
mcpClients: Map<string, MCPClientImpl>;
|
|
37
|
+
tools: ToolDefinition[];
|
|
38
|
+
permissionMode: PermissionMode;
|
|
39
|
+
allowedTools: Set<string>;
|
|
40
|
+
disallowedTools: Set<string>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface SetupOptions {
|
|
44
|
+
args: CLIArgs;
|
|
45
|
+
apiKey: string;
|
|
46
|
+
workingDirectory: string;
|
|
47
|
+
onProgress?: (message: string) => void;
|
|
48
|
+
/** When true, disable console logging for security hooks (prevents TUI corruption) */
|
|
49
|
+
isTuiMode?: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ============================================
|
|
53
|
+
// MCP CONFIG LOADER
|
|
54
|
+
// ============================================
|
|
55
|
+
|
|
56
|
+
export async function loadMCPConfig(configPath: string): Promise<Record<string, MCPServerConfig>> {
|
|
57
|
+
try {
|
|
58
|
+
const file = Bun.file(configPath);
|
|
59
|
+
const content = await file.text();
|
|
60
|
+
const config = JSON.parse(content) as Record<string, unknown>;
|
|
61
|
+
|
|
62
|
+
// Support both formats:
|
|
63
|
+
// 1. { "servers": { "name": {...} } }
|
|
64
|
+
// 2. { "name": {...} } (direct server config)
|
|
65
|
+
if ("servers" in config && typeof config.servers === "object" && config.servers !== null) {
|
|
66
|
+
return config.servers as Record<string, MCPServerConfig>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Check if it looks like direct server config (has "type" at top level)
|
|
70
|
+
if ("type" in config) {
|
|
71
|
+
// Single server config without "servers" wrapper
|
|
72
|
+
const servers: Record<string, MCPServerConfig> = {};
|
|
73
|
+
servers["default"] = config as unknown as MCPServerConfig;
|
|
74
|
+
return servers;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return config as Record<string, MCPServerConfig>;
|
|
78
|
+
} catch (error) {
|
|
79
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
80
|
+
throw new Error(`Failed to load MCP config from ${configPath}: ${errorMessage}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ============================================
|
|
85
|
+
// MCP TOOLS CONVERTER
|
|
86
|
+
// ============================================
|
|
87
|
+
|
|
88
|
+
export function mcpToolsToToolDefinitions(mcpClients: Map<string, MCPClientImpl>): ToolDefinition[] {
|
|
89
|
+
const tools: ToolDefinition[] = [];
|
|
90
|
+
|
|
91
|
+
for (const [serverName, client] of mcpClients) {
|
|
92
|
+
for (const mcpTool of client.tools) {
|
|
93
|
+
tools.push({
|
|
94
|
+
name: `mcp__${serverName}__${mcpTool.name}`,
|
|
95
|
+
description: mcpTool.description,
|
|
96
|
+
input_schema: mcpTool.inputSchema,
|
|
97
|
+
handler: async (args, context) => {
|
|
98
|
+
if (!client.connected) {
|
|
99
|
+
return {
|
|
100
|
+
content: `Error: MCP server "${serverName}" is not connected`,
|
|
101
|
+
is_error: true,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return client.callTool(mcpTool.name, args);
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return tools;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ============================================
|
|
114
|
+
// SESSION SETUP
|
|
115
|
+
// ============================================
|
|
116
|
+
|
|
117
|
+
export async function setupSession(options: SetupOptions): Promise<SessionSetup> {
|
|
118
|
+
const { args, apiKey, workingDirectory, onProgress } = options;
|
|
119
|
+
|
|
120
|
+
const log = (msg: string) => {
|
|
121
|
+
if (onProgress) onProgress(msg);
|
|
122
|
+
else console.log(`\x1b[90m${msg}\x1b[0m`);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// ============================================
|
|
126
|
+
// LOAD CONFIGURATION
|
|
127
|
+
// ============================================
|
|
128
|
+
log("Loading configuration...");
|
|
129
|
+
|
|
130
|
+
let loadedConfig: LoadedConfig;
|
|
131
|
+
try {
|
|
132
|
+
loadedConfig = await loadAllConfigs(workingDirectory);
|
|
133
|
+
} catch (error) {
|
|
134
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
135
|
+
log(`Warning: Failed to load config: ${errorMessage}`);
|
|
136
|
+
// Use empty defaults
|
|
137
|
+
loadedConfig = {
|
|
138
|
+
main: {},
|
|
139
|
+
settings: {},
|
|
140
|
+
keybindings: { bindings: [] },
|
|
141
|
+
projectSettings: {},
|
|
142
|
+
sources: [],
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Get merged settings (project overrides global)
|
|
147
|
+
const mergedSettings = getMergedSettings(loadedConfig.settings, loadedConfig.projectSettings);
|
|
148
|
+
|
|
149
|
+
// Log loaded config sources
|
|
150
|
+
if (loadedConfig.sources.length > 0) {
|
|
151
|
+
log(` Config sources: ${loadedConfig.sources.length} files`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Determine permission mode
|
|
155
|
+
let permissionMode = args.permissionMode;
|
|
156
|
+
if (permissionMode === "default") {
|
|
157
|
+
const configMode = getPermissionMode(mergedSettings);
|
|
158
|
+
if (configMode !== "default") {
|
|
159
|
+
permissionMode = configMode;
|
|
160
|
+
log(` Permission mode: ${configMode} (from config)`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Get allowed/disallowed tools from config
|
|
165
|
+
const allowedTools = getAllowedTools(mergedSettings);
|
|
166
|
+
const disallowedTools = getDisallowedTools(mergedSettings);
|
|
167
|
+
|
|
168
|
+
// ============================================
|
|
169
|
+
// INITIALIZE MANAGERS
|
|
170
|
+
// ============================================
|
|
171
|
+
|
|
172
|
+
// Create prompt evaluator for LLM-based hooks
|
|
173
|
+
const promptEvaluator = createPromptEvaluator({
|
|
174
|
+
apiKey,
|
|
175
|
+
model: "claude-haiku-4-5", // Fast model for hook evaluation
|
|
176
|
+
maxTokens: 256,
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// Initialize components
|
|
180
|
+
const hookManager = new HookManager(60000, promptEvaluator);
|
|
181
|
+
const skillManager = new SkillManager();
|
|
182
|
+
const teammateManager = new TeammateManager();
|
|
183
|
+
|
|
184
|
+
// ============================================
|
|
185
|
+
// REGISTER HOOKS
|
|
186
|
+
// ============================================
|
|
187
|
+
|
|
188
|
+
// Register hooks from config
|
|
189
|
+
const hookDefinitions = settingsToHookDefinitions(mergedSettings);
|
|
190
|
+
for (const [event, definitions] of Object.entries(hookDefinitions)) {
|
|
191
|
+
for (const def of definitions) {
|
|
192
|
+
hookManager.register(event as import("../../../../types/index.js").HookEvent, def);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (Object.keys(hookDefinitions).length > 0) {
|
|
196
|
+
log(` Hooks registered: ${Object.keys(hookDefinitions).length} events`);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Register cognitive security hooks (in-process handlers)
|
|
200
|
+
// When bypassPermissions is set, disable all security checks
|
|
201
|
+
// In TUI mode, disable console logging to prevent corrupting the display
|
|
202
|
+
const isBypassMode = permissionMode === "bypassPermissions";
|
|
203
|
+
const isTuiMode = options.isTuiMode ?? false;
|
|
204
|
+
const securityHandlers = createSecurityHookHandlers({
|
|
205
|
+
enabled: !isBypassMode, // Disable entirely in bypass mode
|
|
206
|
+
checkIntentAlignment: !isBypassMode,
|
|
207
|
+
enforceFlowPolicies: !isBypassMode,
|
|
208
|
+
preventLeaks: !isBypassMode,
|
|
209
|
+
trackTaints: !isBypassMode,
|
|
210
|
+
logEvents: !isTuiMode, // Disable console logging in TUI mode to prevent display corruption
|
|
211
|
+
blockOnViolation: false, // Never block - log only
|
|
212
|
+
minAlignmentScore: 0.3,
|
|
213
|
+
approvalRequiredSensitivities: ["secret", "top_secret"],
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
hookManager.registerHandler("SessionStart", securityHandlers.SessionStart);
|
|
217
|
+
hookManager.registerHandler("PreToolUse", securityHandlers.PreToolUse);
|
|
218
|
+
hookManager.registerHandler("PostToolUse", securityHandlers.PostToolUse);
|
|
219
|
+
hookManager.registerHandler("UserPromptSubmit", securityHandlers.UserPromptSubmit);
|
|
220
|
+
hookManager.registerHandler("SessionEnd", securityHandlers.SessionEnd);
|
|
221
|
+
|
|
222
|
+
// Load skills from project
|
|
223
|
+
const skillsDir = workingDirectory + "/.claude/skills";
|
|
224
|
+
skillManager.loadFromDirectory(skillsDir, "project");
|
|
225
|
+
|
|
226
|
+
// ============================================
|
|
227
|
+
// MCP SETUP
|
|
228
|
+
// ============================================
|
|
229
|
+
|
|
230
|
+
const mcpClients = new Map<string, MCPClientImpl>();
|
|
231
|
+
|
|
232
|
+
// Get MCP servers from loaded config
|
|
233
|
+
const configServers = getAllMCPServers(loadedConfig.main, workingDirectory);
|
|
234
|
+
|
|
235
|
+
// If --mcp-config is specified, it overrides config file servers
|
|
236
|
+
let servers = configServers;
|
|
237
|
+
if (args.mcpConfig) {
|
|
238
|
+
try {
|
|
239
|
+
log(`Loading MCP config from ${args.mcpConfig}...`);
|
|
240
|
+
const fileServers = await loadMCPConfig(args.mcpConfig);
|
|
241
|
+
servers = fileServers;
|
|
242
|
+
} catch (error) {
|
|
243
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
244
|
+
log(`Warning: Failed to load MCP config file: ${errorMessage}`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Connect to MCP servers
|
|
249
|
+
if (Object.keys(servers).length > 0) {
|
|
250
|
+
// Only count enabled servers
|
|
251
|
+
const enabledServers = Object.entries(servers).filter(([_, config]) => !config.disabled);
|
|
252
|
+
const serverCount = enabledServers.length;
|
|
253
|
+
|
|
254
|
+
if (serverCount > 0) {
|
|
255
|
+
log(` Connecting to ${serverCount} MCP server(s)...`);
|
|
256
|
+
|
|
257
|
+
const connectedClients = await createMCPClients(servers, (message) => {
|
|
258
|
+
log(` ${message}`);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
for (const [name, client] of connectedClients) {
|
|
262
|
+
mcpClients.set(name, client);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (mcpClients.size > 0) {
|
|
266
|
+
log(` Connected to ${mcpClients.size} MCP server(s)`);
|
|
267
|
+
} else {
|
|
268
|
+
log(` Warning: No MCP servers connected successfully`);
|
|
269
|
+
}
|
|
270
|
+
} else if (Object.keys(servers).length > 0) {
|
|
271
|
+
log(` MCP config loaded but all ${Object.keys(servers).length} server(s) are disabled`);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// ============================================
|
|
276
|
+
// BUILD TOOLS
|
|
277
|
+
// ============================================
|
|
278
|
+
|
|
279
|
+
// Import built-in tools dynamically to avoid circular deps
|
|
280
|
+
const { builtInTools } = await import("../../../../ecosystem/tools/index.js");
|
|
281
|
+
|
|
282
|
+
const tools: ToolDefinition[] = [
|
|
283
|
+
...builtInTools,
|
|
284
|
+
...mcpToolsToToolDefinitions(mcpClients),
|
|
285
|
+
];
|
|
286
|
+
|
|
287
|
+
return {
|
|
288
|
+
loadedConfig,
|
|
289
|
+
mergedSettings,
|
|
290
|
+
hookManager,
|
|
291
|
+
skillManager,
|
|
292
|
+
teammateManager,
|
|
293
|
+
mcpClients,
|
|
294
|
+
tools,
|
|
295
|
+
permissionMode,
|
|
296
|
+
allowedTools,
|
|
297
|
+
disallowedTools,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spinner Frames
|
|
3
|
+
* Single source of truth for spinner animation frames
|
|
4
|
+
*
|
|
5
|
+
* These are pure data arrays with no dependencies, suitable for any UI context.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Default braille spinner frames
|
|
10
|
+
*/
|
|
11
|
+
export const spinnerFrames: string[] = [
|
|
12
|
+
"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏",
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Dot-based spinner frames (works in more terminals)
|
|
17
|
+
*/
|
|
18
|
+
export const dotSpinnerFrames: string[] = [
|
|
19
|
+
"⠁", "⠈", "⠐", "⠠", "⢀", "⣀", "⣄", "⣤", "⣦", "⣶", "⣷", "⣸", "⣼", "⣾", "⣽", "⣻",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* ASCII-only spinner frames (maximum compatibility)
|
|
24
|
+
*/
|
|
25
|
+
export const asciiSpinnerFrames: string[] = [
|
|
26
|
+
"|", "/", "-", "\\",
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Arrow spinner frames
|
|
31
|
+
*/
|
|
32
|
+
export const arrowSpinnerFrames: string[] = [
|
|
33
|
+
"→", "↘", "↓", "↙", "←", "↖", "↑", "↗",
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Simple dot progress frames
|
|
38
|
+
*/
|
|
39
|
+
export const simpleDotFrames: string[] = [
|
|
40
|
+
". ", ".. ", "...", " ..", " .", " ",
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Tool activity spinner frames
|
|
45
|
+
*/
|
|
46
|
+
export const toolSpinnerFrames: string[] = [
|
|
47
|
+
"⚙ ", "⚙⚙", " ⚙",
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get next frame in sequence
|
|
52
|
+
*/
|
|
53
|
+
export function nextFrame(frames: string[], index: number): string {
|
|
54
|
+
return frames[index % frames.length] ?? frames[0] ?? "";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Create a spinner iterator
|
|
59
|
+
*/
|
|
60
|
+
export function* createSpinnerIterator(frames: string[]): Generator<string, never, never> {
|
|
61
|
+
let index = 0;
|
|
62
|
+
while (true) {
|
|
63
|
+
yield frames[index % frames.length] ?? frames[0] ?? "";
|
|
64
|
+
index++;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Get frame at specific index
|
|
70
|
+
*/
|
|
71
|
+
export function getFrame(frames: string[], index: number): string {
|
|
72
|
+
return frames[index % frames.length] ?? frames[0] ?? "";
|
|
73
|
+
}
|