@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,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI v2 Type definitions
|
|
3
|
+
* Re-exported from the native module for TypeScript consumption
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface RenderMessage {
|
|
7
|
+
role: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RenderState {
|
|
12
|
+
messages: RenderMessage[];
|
|
13
|
+
input_value: string;
|
|
14
|
+
cursor_pos: number;
|
|
15
|
+
status_text: string;
|
|
16
|
+
is_loading: boolean;
|
|
17
|
+
streaming_text: string;
|
|
18
|
+
model: string;
|
|
19
|
+
show_help: boolean;
|
|
20
|
+
help_text: string;
|
|
21
|
+
search_mode: boolean;
|
|
22
|
+
search_query: string;
|
|
23
|
+
search_results: SearchResult[];
|
|
24
|
+
search_selected: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface InputEvent {
|
|
28
|
+
event_type: "key" | "resize" | "none";
|
|
29
|
+
key?: string;
|
|
30
|
+
modifiers?: string;
|
|
31
|
+
new_width?: number;
|
|
32
|
+
new_height?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface SearchResult {
|
|
36
|
+
file_path: string;
|
|
37
|
+
line_number: number;
|
|
38
|
+
content: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for Coordination Callbacks
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { describe, it, expect, beforeEach, afterEach } from "bun:test";
|
|
6
|
+
import { existsSync, rmSync, mkdirSync } from "fs";
|
|
7
|
+
import { join } from "path";
|
|
8
|
+
import { TeammateManager } from "./index.js";
|
|
9
|
+
import {
|
|
10
|
+
CoordinationManager,
|
|
11
|
+
createCoordinationMessage,
|
|
12
|
+
parseCoordinationMessage,
|
|
13
|
+
type CoordinationEvent,
|
|
14
|
+
type ProgressReport,
|
|
15
|
+
type FileClaim,
|
|
16
|
+
} from "./coordination.js";
|
|
17
|
+
|
|
18
|
+
// Helper to clean up claims directory
|
|
19
|
+
const CLAIMS_PATH = join(process.env.HOME || "", ".claude", "teams", "_coordination", "claims");
|
|
20
|
+
|
|
21
|
+
function cleanupClaims(): void {
|
|
22
|
+
if (existsSync(CLAIMS_PATH)) {
|
|
23
|
+
try {
|
|
24
|
+
rmSync(CLAIMS_PATH, { recursive: true, force: true });
|
|
25
|
+
} catch {
|
|
26
|
+
// Ignore errors
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe("Coordination Callbacks", () => {
|
|
32
|
+
let manager: TeammateManager;
|
|
33
|
+
let coordination: CoordinationManager;
|
|
34
|
+
const events: CoordinationEvent[] = [];
|
|
35
|
+
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
// Clean up any stale claims before each test
|
|
38
|
+
cleanupClaims();
|
|
39
|
+
|
|
40
|
+
manager = new TeammateManager();
|
|
41
|
+
coordination = new CoordinationManager(manager, {
|
|
42
|
+
enableFileLocking: true,
|
|
43
|
+
enableHeartbeat: false,
|
|
44
|
+
onCoordinationEvent: (event) => {
|
|
45
|
+
events.push(event);
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
events.length = 0;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
afterEach(() => {
|
|
52
|
+
coordination.shutdown();
|
|
53
|
+
// Clean up claims after each test
|
|
54
|
+
cleanupClaims();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe("Progress Reporting", () => {
|
|
58
|
+
it("should report progress to team", () => {
|
|
59
|
+
coordination.initialize("teammate-1", "test-team");
|
|
60
|
+
|
|
61
|
+
const progress: ProgressReport = {
|
|
62
|
+
step: "Building CSS styles",
|
|
63
|
+
stepNumber: 2,
|
|
64
|
+
totalSteps: 5,
|
|
65
|
+
percentage: 40,
|
|
66
|
+
files: ["styles.css"],
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
coordination.reportProgress(progress);
|
|
70
|
+
|
|
71
|
+
expect(events.length).toBe(1);
|
|
72
|
+
expect(events[0]!.type).toBe("task_progress");
|
|
73
|
+
expect(events[0]!.payload.progress).toEqual(progress);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("should track current progress", () => {
|
|
77
|
+
coordination.initialize("teammate-1", "test-team");
|
|
78
|
+
|
|
79
|
+
const progress: ProgressReport = {
|
|
80
|
+
step: "Writing tests",
|
|
81
|
+
stepNumber: 3,
|
|
82
|
+
totalSteps: 4,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
coordination.reportProgress(progress);
|
|
86
|
+
|
|
87
|
+
// Progress should be emitted
|
|
88
|
+
const progressEvents = events.filter((e) => e.type === "task_progress");
|
|
89
|
+
expect(progressEvents.length).toBe(1);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe("Blocked/Unblocked", () => {
|
|
94
|
+
it("should report blocked status", () => {
|
|
95
|
+
coordination.initialize("teammate-1", "test-team");
|
|
96
|
+
|
|
97
|
+
coordination.reportBlocked("Waiting for CSS file", "css-builder");
|
|
98
|
+
|
|
99
|
+
expect(events.length).toBe(1);
|
|
100
|
+
expect(events[0]!.type).toBe("blocked");
|
|
101
|
+
expect(events[0]!.payload.reason).toBe("Waiting for CSS file");
|
|
102
|
+
expect(events[0]!.payload.blockedBy).toBe("css-builder");
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it("should report unblocked status", () => {
|
|
106
|
+
coordination.initialize("teammate-1", "test-team");
|
|
107
|
+
|
|
108
|
+
coordination.reportBlocked("Waiting for CSS file");
|
|
109
|
+
coordination.reportUnblocked();
|
|
110
|
+
|
|
111
|
+
const blockedEvents = events.filter((e) => e.type === "blocked");
|
|
112
|
+
const unblockedEvents = events.filter((e) => e.type === "unblocked");
|
|
113
|
+
|
|
114
|
+
expect(blockedEvents.length).toBe(1);
|
|
115
|
+
expect(unblockedEvents.length).toBe(1);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe("File Locking", () => {
|
|
120
|
+
it("should claim a file", () => {
|
|
121
|
+
coordination.initialize("teammate-1", "test-team");
|
|
122
|
+
|
|
123
|
+
const claimed = coordination.claimFile("/path/to/file.ts", "Writing code");
|
|
124
|
+
|
|
125
|
+
expect(claimed).toBe(true);
|
|
126
|
+
expect(coordination.isFileClaimed("/path/to/file.ts")).toBe(false); // We own it
|
|
127
|
+
expect(coordination.getFileClaim("/path/to/file.ts")?.reason).toBe("Writing code");
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("should prevent other teammates from claiming", () => {
|
|
131
|
+
coordination.initialize("teammate-1", "test-team");
|
|
132
|
+
|
|
133
|
+
coordination.claimFile("/path/to/file.ts", "Writing code");
|
|
134
|
+
|
|
135
|
+
// Simulate another teammate trying to claim
|
|
136
|
+
const coordination2 = new CoordinationManager(manager, {
|
|
137
|
+
enableFileLocking: true,
|
|
138
|
+
});
|
|
139
|
+
coordination2.initialize("teammate-2", "test-team");
|
|
140
|
+
|
|
141
|
+
const claimed = coordination2.claimFile("/path/to/file.ts", "Also writing");
|
|
142
|
+
|
|
143
|
+
expect(claimed).toBe(false);
|
|
144
|
+
expect(coordination2.isFileClaimed("/path/to/file.ts")).toBe(true);
|
|
145
|
+
|
|
146
|
+
coordination2.shutdown();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("should release a file claim", () => {
|
|
150
|
+
coordination.initialize("teammate-1", "test-team");
|
|
151
|
+
|
|
152
|
+
coordination.claimFile("/path/to/file.ts");
|
|
153
|
+
coordination.releaseFile("/path/to/file.ts");
|
|
154
|
+
|
|
155
|
+
// Create another coordination and try to claim
|
|
156
|
+
const coordination2 = new CoordinationManager(manager, {
|
|
157
|
+
enableFileLocking: true,
|
|
158
|
+
});
|
|
159
|
+
coordination2.initialize("teammate-2", "test-team");
|
|
160
|
+
|
|
161
|
+
const claimed = coordination2.claimFile("/path/to/file.ts");
|
|
162
|
+
expect(claimed).toBe(true);
|
|
163
|
+
|
|
164
|
+
coordination2.shutdown();
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it("should release all claims on shutdown", () => {
|
|
168
|
+
coordination.initialize("teammate-1", "test-team");
|
|
169
|
+
|
|
170
|
+
coordination.claimFile("/file1.ts");
|
|
171
|
+
coordination.claimFile("/file2.ts");
|
|
172
|
+
|
|
173
|
+
coordination.shutdown();
|
|
174
|
+
|
|
175
|
+
// Re-create and check if files are available
|
|
176
|
+
const coordination2 = new CoordinationManager(manager, {
|
|
177
|
+
enableFileLocking: true,
|
|
178
|
+
});
|
|
179
|
+
coordination2.initialize("teammate-2", "test-team");
|
|
180
|
+
|
|
181
|
+
expect(coordination2.isFileClaimed("/file1.ts")).toBe(false);
|
|
182
|
+
expect(coordination2.isFileClaimed("/file2.ts")).toBe(false);
|
|
183
|
+
|
|
184
|
+
coordination2.shutdown();
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it("should list all claims", () => {
|
|
188
|
+
coordination.initialize("teammate-1", "test-team");
|
|
189
|
+
|
|
190
|
+
coordination.claimFile("/file1.ts", "Working on file 1");
|
|
191
|
+
coordination.claimFile("/file2.ts", "Working on file 2");
|
|
192
|
+
|
|
193
|
+
const claims = coordination.getAllClaims();
|
|
194
|
+
|
|
195
|
+
expect(claims.length).toBe(2);
|
|
196
|
+
expect(claims.some((c) => c.filePath === "/file1.ts")).toBe(true);
|
|
197
|
+
expect(claims.some((c) => c.filePath === "/file2.ts")).toBe(true);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it("should support expiring claims", () => {
|
|
201
|
+
coordination.initialize("teammate-1", "test-team");
|
|
202
|
+
|
|
203
|
+
// Claim with 100ms expiration
|
|
204
|
+
coordination.claimFile("/file.ts", "Quick edit", 100);
|
|
205
|
+
|
|
206
|
+
// Should be claimed initially
|
|
207
|
+
expect(coordination.getFileClaim("/file.ts")).toBeDefined();
|
|
208
|
+
|
|
209
|
+
// Wait for expiration
|
|
210
|
+
// Note: In real tests, we'd use fake timers
|
|
211
|
+
// For now, just test the claim exists
|
|
212
|
+
const claim = coordination.getFileClaim("/file.ts");
|
|
213
|
+
expect(claim?.expiresAt).toBeDefined();
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
describe("Coordination Messages", () => {
|
|
218
|
+
it("should create coordination messages", () => {
|
|
219
|
+
const msg = createCoordinationMessage("task_progress", "50% complete");
|
|
220
|
+
expect(msg).toBe("[COORD:TASK_PROGRESS] 50% complete");
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it("should parse coordination messages", () => {
|
|
224
|
+
const result = parseCoordinationMessage("[COORD:FILE_CLAIM] /path/to/file.ts");
|
|
225
|
+
expect(result.isCoordination).toBe(true);
|
|
226
|
+
expect(result.type).toBe("file_claim");
|
|
227
|
+
expect(result.content).toBe("/path/to/file.ts");
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
it("should return false for non-coordination messages", () => {
|
|
231
|
+
const result = parseCoordinationMessage("Hello teammates!");
|
|
232
|
+
expect(result.isCoordination).toBe(false);
|
|
233
|
+
expect(result.type).toBeUndefined();
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
describe("Event Callbacks", () => {
|
|
238
|
+
it("should call onProgress callback", () => {
|
|
239
|
+
const progressReports: Array<{ id: string; progress: ProgressReport }> = [];
|
|
240
|
+
|
|
241
|
+
const coordWithCallbacks = new CoordinationManager(manager, {
|
|
242
|
+
enableProgressReporting: true,
|
|
243
|
+
onProgress: (teammateId, progress) => {
|
|
244
|
+
progressReports.push({ id: teammateId, progress });
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
coordWithCallbacks.initialize("teammate-1", "test-team");
|
|
249
|
+
coordWithCallbacks.reportProgress({
|
|
250
|
+
step: "Test",
|
|
251
|
+
stepNumber: 1,
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
expect(progressReports.length).toBe(1);
|
|
255
|
+
expect(progressReports[0]!.progress.step).toBe("Test");
|
|
256
|
+
|
|
257
|
+
coordWithCallbacks.shutdown();
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
it("should call onFileClaimed callback", () => {
|
|
261
|
+
const claims: FileClaim[] = [];
|
|
262
|
+
|
|
263
|
+
const coordWithCallbacks = new CoordinationManager(manager, {
|
|
264
|
+
enableFileLocking: true,
|
|
265
|
+
onFileClaimed: (claim) => {
|
|
266
|
+
claims.push(claim);
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
coordWithCallbacks.initialize("teammate-1", "test-team");
|
|
271
|
+
coordWithCallbacks.claimFile("/test.ts", "Testing");
|
|
272
|
+
|
|
273
|
+
expect(claims.length).toBe(1);
|
|
274
|
+
expect(claims[0]!.filePath).toBe("/test.ts");
|
|
275
|
+
|
|
276
|
+
coordWithCallbacks.shutdown();
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
});
|