@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,536 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cognitive Security Middleware
|
|
3
|
+
*
|
|
4
|
+
* Automatically integrates flow control into the agent loop.
|
|
5
|
+
* All tool inputs/outputs are classified, tracked, and validated.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
classifyData,
|
|
10
|
+
createFlowPolicyEngine,
|
|
11
|
+
createFlowTracker,
|
|
12
|
+
createLeakPrevention,
|
|
13
|
+
createTaintTracker,
|
|
14
|
+
type ClassifiedData,
|
|
15
|
+
type FlowPolicyEngineHandle,
|
|
16
|
+
type FlowTrackerHandle,
|
|
17
|
+
type LeakPreventionHandle,
|
|
18
|
+
type TaintTrackerHandle,
|
|
19
|
+
type FlowValidationResult,
|
|
20
|
+
type LeakCheckResult,
|
|
21
|
+
} from "./index.js";
|
|
22
|
+
|
|
23
|
+
export interface SecurityConfig {
|
|
24
|
+
/** Enable automatic data classification */
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
/** Enable flow policy enforcement */
|
|
27
|
+
enforcePolicies: boolean;
|
|
28
|
+
/** Enable taint tracking */
|
|
29
|
+
trackTaints: boolean;
|
|
30
|
+
/** Enable leak prevention on outputs */
|
|
31
|
+
preventLeaks: boolean;
|
|
32
|
+
/** Log security events */
|
|
33
|
+
logEvents: boolean;
|
|
34
|
+
/** Block on policy violations */
|
|
35
|
+
blockOnViolation: boolean;
|
|
36
|
+
/** Domains considered external (require stricter checks) */
|
|
37
|
+
externalDomains: string[];
|
|
38
|
+
/** Tools that transmit data externally */
|
|
39
|
+
externalTools: string[];
|
|
40
|
+
/** Tools that read from sensitive sources */
|
|
41
|
+
sensitiveSourceTools: string[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const DEFAULT_SECURITY_CONFIG: SecurityConfig = {
|
|
45
|
+
enabled: true,
|
|
46
|
+
enforcePolicies: true,
|
|
47
|
+
trackTaints: true,
|
|
48
|
+
preventLeaks: true,
|
|
49
|
+
logEvents: true,
|
|
50
|
+
blockOnViolation: true,
|
|
51
|
+
externalDomains: ["external", "network", "api", "web"],
|
|
52
|
+
externalTools: ["Bash", "Write", "Edit", "MultiEdit", "NotebookEdit"],
|
|
53
|
+
sensitiveSourceTools: ["Read", "Bash"],
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export interface SecurityEvent {
|
|
57
|
+
type: "classify" | "flow_check" | "leak_check" | "taint" | "block" | "allow";
|
|
58
|
+
timestamp: number;
|
|
59
|
+
toolName: string;
|
|
60
|
+
dataId?: string;
|
|
61
|
+
sensitivity?: string;
|
|
62
|
+
category?: string;
|
|
63
|
+
sourceDomain?: string;
|
|
64
|
+
targetDomain?: string;
|
|
65
|
+
allowed?: boolean;
|
|
66
|
+
reason?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface ToolSecurityContext {
|
|
70
|
+
toolName: string;
|
|
71
|
+
input: Record<string, unknown>;
|
|
72
|
+
output?: unknown;
|
|
73
|
+
sourceDomain: string;
|
|
74
|
+
targetDomain: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface SecurityMiddlewareResult {
|
|
78
|
+
allowed: boolean;
|
|
79
|
+
reason: string;
|
|
80
|
+
classifiedInput?: ClassifiedData;
|
|
81
|
+
classifiedOutput?: ClassifiedData;
|
|
82
|
+
flowResult?: FlowValidationResult;
|
|
83
|
+
leakResult?: LeakCheckResult;
|
|
84
|
+
sanitizedOutput?: string;
|
|
85
|
+
events: SecurityEvent[];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Cognitive Security Middleware
|
|
90
|
+
*
|
|
91
|
+
* Wraps tool execution with automatic security checks.
|
|
92
|
+
*/
|
|
93
|
+
export class CognitiveSecurityMiddleware {
|
|
94
|
+
private config: SecurityConfig;
|
|
95
|
+
private policyEngine: FlowPolicyEngineHandle | null = null;
|
|
96
|
+
private flowTracker: FlowTrackerHandle | null = null;
|
|
97
|
+
private leakPrevention: LeakPreventionHandle | null = null;
|
|
98
|
+
private taintTracker: TaintTrackerHandle | null = null;
|
|
99
|
+
private events: SecurityEvent[] = [];
|
|
100
|
+
private initialized = false;
|
|
101
|
+
|
|
102
|
+
constructor(config: Partial<SecurityConfig> = {}) {
|
|
103
|
+
this.config = { ...DEFAULT_SECURITY_CONFIG, ...config };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Initialize security components (lazy loading)
|
|
108
|
+
*/
|
|
109
|
+
async initialize(): Promise<void> {
|
|
110
|
+
if (this.initialized) return;
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
if (this.config.enforcePolicies) {
|
|
114
|
+
this.policyEngine = await createFlowPolicyEngine();
|
|
115
|
+
}
|
|
116
|
+
if (this.config.trackTaints) {
|
|
117
|
+
this.flowTracker = await createFlowTracker();
|
|
118
|
+
this.taintTracker = await createTaintTracker();
|
|
119
|
+
}
|
|
120
|
+
if (this.config.preventLeaks) {
|
|
121
|
+
this.leakPrevention = await createLeakPrevention();
|
|
122
|
+
}
|
|
123
|
+
this.initialized = true;
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.warn("[Security] Failed to initialize:", error);
|
|
126
|
+
// Continue without security if init fails
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Check tool input before execution
|
|
132
|
+
*/
|
|
133
|
+
async checkInput(
|
|
134
|
+
toolName: string,
|
|
135
|
+
input: Record<string, unknown>
|
|
136
|
+
): Promise<SecurityMiddlewareResult> {
|
|
137
|
+
await this.initialize();
|
|
138
|
+
|
|
139
|
+
const events: SecurityEvent[] = [];
|
|
140
|
+
const sourceDomain = this.getToolDomain(toolName);
|
|
141
|
+
const targetDomain = "agent";
|
|
142
|
+
|
|
143
|
+
// Extract input content for classification
|
|
144
|
+
const inputContent = this.extractContent(input);
|
|
145
|
+
|
|
146
|
+
// Classify input data
|
|
147
|
+
const classifiedInput = await classifyData(
|
|
148
|
+
inputContent,
|
|
149
|
+
sourceDomain,
|
|
150
|
+
[toolName]
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
events.push({
|
|
154
|
+
type: "classify",
|
|
155
|
+
timestamp: Date.now(),
|
|
156
|
+
toolName,
|
|
157
|
+
dataId: classifiedInput.id,
|
|
158
|
+
sensitivity: classifiedInput.sensitivity,
|
|
159
|
+
category: classifiedInput.category,
|
|
160
|
+
sourceDomain,
|
|
161
|
+
targetDomain,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// Check flow policy
|
|
165
|
+
let flowResult: FlowValidationResult | undefined;
|
|
166
|
+
if (this.policyEngine && this.config.enforcePolicies) {
|
|
167
|
+
flowResult = this.policyEngine.evaluate(
|
|
168
|
+
classifiedInput,
|
|
169
|
+
sourceDomain,
|
|
170
|
+
targetDomain
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
events.push({
|
|
174
|
+
type: "flow_check",
|
|
175
|
+
timestamp: Date.now(),
|
|
176
|
+
toolName,
|
|
177
|
+
dataId: classifiedInput.id,
|
|
178
|
+
sourceDomain,
|
|
179
|
+
targetDomain,
|
|
180
|
+
allowed: flowResult.allowed,
|
|
181
|
+
reason: flowResult.reason,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
if (!flowResult.allowed && this.config.blockOnViolation) {
|
|
185
|
+
events.push({
|
|
186
|
+
type: "block",
|
|
187
|
+
timestamp: Date.now(),
|
|
188
|
+
toolName,
|
|
189
|
+
reason: flowResult.reason,
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
this.logEvent(events);
|
|
193
|
+
return {
|
|
194
|
+
allowed: false,
|
|
195
|
+
reason: `Security policy blocked: ${flowResult.reason}`,
|
|
196
|
+
classifiedInput,
|
|
197
|
+
flowResult,
|
|
198
|
+
events,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Register taint for sensitive data
|
|
204
|
+
if (this.taintTracker && this.config.trackTaints) {
|
|
205
|
+
if (classifiedInput.sensitivity !== "public") {
|
|
206
|
+
const sourceId = this.taintTracker.registerSource(
|
|
207
|
+
sourceDomain,
|
|
208
|
+
classifiedInput.sensitivity,
|
|
209
|
+
[classifiedInput.category]
|
|
210
|
+
);
|
|
211
|
+
this.taintTracker.taint(sourceId, inputContent, "tool_input", toolName);
|
|
212
|
+
|
|
213
|
+
events.push({
|
|
214
|
+
type: "taint",
|
|
215
|
+
timestamp: Date.now(),
|
|
216
|
+
toolName,
|
|
217
|
+
sensitivity: classifiedInput.sensitivity,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
events.push({
|
|
223
|
+
type: "allow",
|
|
224
|
+
timestamp: Date.now(),
|
|
225
|
+
toolName,
|
|
226
|
+
reason: "Input check passed",
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
this.logEvent(events);
|
|
230
|
+
return {
|
|
231
|
+
allowed: true,
|
|
232
|
+
reason: "Input check passed",
|
|
233
|
+
classifiedInput,
|
|
234
|
+
flowResult,
|
|
235
|
+
events,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Check tool output after execution
|
|
241
|
+
*/
|
|
242
|
+
async checkOutput(
|
|
243
|
+
toolName: string,
|
|
244
|
+
input: Record<string, unknown>,
|
|
245
|
+
output: string
|
|
246
|
+
): Promise<SecurityMiddlewareResult> {
|
|
247
|
+
await this.initialize();
|
|
248
|
+
|
|
249
|
+
const events: SecurityEvent[] = [];
|
|
250
|
+
const sourceDomain = "agent";
|
|
251
|
+
const targetDomain = this.isExternalTool(toolName)
|
|
252
|
+
? "external"
|
|
253
|
+
: "internal";
|
|
254
|
+
|
|
255
|
+
// Classify output data
|
|
256
|
+
const classifiedOutput = await classifyData(
|
|
257
|
+
output,
|
|
258
|
+
sourceDomain,
|
|
259
|
+
[toolName, "output"]
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
events.push({
|
|
263
|
+
type: "classify",
|
|
264
|
+
timestamp: Date.now(),
|
|
265
|
+
toolName,
|
|
266
|
+
dataId: classifiedOutput.id,
|
|
267
|
+
sensitivity: classifiedOutput.sensitivity,
|
|
268
|
+
category: classifiedOutput.category,
|
|
269
|
+
sourceDomain,
|
|
270
|
+
targetDomain,
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
// Check flow policy for output
|
|
274
|
+
let flowResult: FlowValidationResult | undefined;
|
|
275
|
+
if (this.policyEngine && this.config.enforcePolicies && this.isExternalTool(toolName)) {
|
|
276
|
+
flowResult = this.policyEngine.evaluate(
|
|
277
|
+
classifiedOutput,
|
|
278
|
+
sourceDomain,
|
|
279
|
+
targetDomain
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
events.push({
|
|
283
|
+
type: "flow_check",
|
|
284
|
+
timestamp: Date.now(),
|
|
285
|
+
toolName,
|
|
286
|
+
dataId: classifiedOutput.id,
|
|
287
|
+
sourceDomain,
|
|
288
|
+
targetDomain,
|
|
289
|
+
allowed: flowResult.allowed,
|
|
290
|
+
reason: flowResult.reason,
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
if (!flowResult.allowed && this.config.blockOnViolation) {
|
|
294
|
+
events.push({
|
|
295
|
+
type: "block",
|
|
296
|
+
timestamp: Date.now(),
|
|
297
|
+
toolName,
|
|
298
|
+
reason: flowResult.reason,
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
this.logEvent(events);
|
|
302
|
+
return {
|
|
303
|
+
allowed: false,
|
|
304
|
+
reason: `Security policy blocked output: ${flowResult.reason}`,
|
|
305
|
+
classifiedOutput,
|
|
306
|
+
flowResult,
|
|
307
|
+
events,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Check for leaks
|
|
313
|
+
let leakResult: LeakCheckResult | undefined;
|
|
314
|
+
let sanitizedOutput = output;
|
|
315
|
+
if (this.leakPrevention && this.config.preventLeaks) {
|
|
316
|
+
leakResult = this.leakPrevention.check(output, targetDomain);
|
|
317
|
+
|
|
318
|
+
events.push({
|
|
319
|
+
type: "leak_check",
|
|
320
|
+
timestamp: Date.now(),
|
|
321
|
+
toolName,
|
|
322
|
+
allowed: leakResult.action !== "block",
|
|
323
|
+
reason: leakResult.action,
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
if (leakResult.action === "block") {
|
|
327
|
+
// Sanitize instead of blocking
|
|
328
|
+
sanitizedOutput = this.leakPrevention.sanitize(output);
|
|
329
|
+
|
|
330
|
+
if (this.config.blockOnViolation) {
|
|
331
|
+
events.push({
|
|
332
|
+
type: "block",
|
|
333
|
+
timestamp: Date.now(),
|
|
334
|
+
toolName,
|
|
335
|
+
reason: `Leak detected: ${leakResult.detections.map(d => d.pattern_name).join(", ")}`,
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
this.logEvent(events);
|
|
339
|
+
return {
|
|
340
|
+
allowed: false,
|
|
341
|
+
reason: `Potential data leak detected and blocked`,
|
|
342
|
+
classifiedOutput,
|
|
343
|
+
leakResult,
|
|
344
|
+
sanitizedOutput,
|
|
345
|
+
events,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Track flow
|
|
352
|
+
if (this.flowTracker && this.config.trackTaints && flowResult) {
|
|
353
|
+
this.flowTracker.record(
|
|
354
|
+
classifiedOutput,
|
|
355
|
+
sourceDomain,
|
|
356
|
+
targetDomain,
|
|
357
|
+
this.isExternalTool(toolName) ? "outbound" : "internal",
|
|
358
|
+
flowResult,
|
|
359
|
+
null,
|
|
360
|
+
null
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
events.push({
|
|
365
|
+
type: "allow",
|
|
366
|
+
timestamp: Date.now(),
|
|
367
|
+
toolName,
|
|
368
|
+
reason: "Output check passed",
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
this.logEvent(events);
|
|
372
|
+
return {
|
|
373
|
+
allowed: true,
|
|
374
|
+
reason: "Output check passed",
|
|
375
|
+
classifiedOutput,
|
|
376
|
+
flowResult,
|
|
377
|
+
leakResult,
|
|
378
|
+
sanitizedOutput,
|
|
379
|
+
events,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Wrap tool handler with security checks
|
|
385
|
+
*/
|
|
386
|
+
wrapToolHandler<TInput extends Record<string, unknown>, TResult>(
|
|
387
|
+
toolName: string,
|
|
388
|
+
handler: (input: TInput, context: unknown) => Promise<{ content: string; is_error?: boolean }>
|
|
389
|
+
): (input: TInput, context: unknown) => Promise<{ content: string; is_error?: boolean }> {
|
|
390
|
+
return async (input: TInput, context: unknown) => {
|
|
391
|
+
if (!this.config.enabled) {
|
|
392
|
+
return handler(input, context);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// Check input
|
|
396
|
+
const inputCheck = await this.checkInput(toolName, input as Record<string, unknown>);
|
|
397
|
+
if (!inputCheck.allowed) {
|
|
398
|
+
return {
|
|
399
|
+
content: `[Security] ${inputCheck.reason}`,
|
|
400
|
+
is_error: true,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// Execute tool
|
|
405
|
+
const result = await handler(input, context);
|
|
406
|
+
|
|
407
|
+
// Check output
|
|
408
|
+
const outputCheck = await this.checkOutput(toolName, input as Record<string, unknown>, result.content);
|
|
409
|
+
if (!outputCheck.allowed) {
|
|
410
|
+
return {
|
|
411
|
+
content: outputCheck.sanitizedOutput || `[Security] ${outputCheck.reason}`,
|
|
412
|
+
is_error: true,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// Return sanitized output if needed
|
|
417
|
+
return {
|
|
418
|
+
content: outputCheck.sanitizedOutput || result.content,
|
|
419
|
+
is_error: result.is_error,
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Get domain for a tool
|
|
426
|
+
*/
|
|
427
|
+
private getToolDomain(toolName: string): string {
|
|
428
|
+
if (this.isExternalTool(toolName)) return "external";
|
|
429
|
+
if (this.config.sensitiveSourceTools.includes(toolName)) return "filesystem";
|
|
430
|
+
return "internal";
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Check if tool transmits externally
|
|
435
|
+
*/
|
|
436
|
+
private isExternalTool(toolName: string): boolean {
|
|
437
|
+
return this.config.externalTools.includes(toolName);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Extract content from tool input for classification
|
|
442
|
+
*/
|
|
443
|
+
private extractContent(input: Record<string, unknown>): string {
|
|
444
|
+
const parts: string[] = [];
|
|
445
|
+
|
|
446
|
+
for (const [key, value] of Object.entries(input)) {
|
|
447
|
+
if (typeof value === "string") {
|
|
448
|
+
parts.push(`${key}=${value}`);
|
|
449
|
+
} else if (typeof value === "object" && value !== null) {
|
|
450
|
+
parts.push(`${key}=${JSON.stringify(value)}`);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
return parts.join(" ");
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Log security events
|
|
459
|
+
*/
|
|
460
|
+
private logEvent(events: SecurityEvent[]): void {
|
|
461
|
+
this.events.push(...events);
|
|
462
|
+
|
|
463
|
+
if (this.config.logEvents) {
|
|
464
|
+
for (const event of events) {
|
|
465
|
+
if (event.type === "block") {
|
|
466
|
+
console.warn(`[Security] BLOCK: ${event.toolName} - ${event.reason}`);
|
|
467
|
+
} else if (event.type === "allow" && event.sensitivity && event.sensitivity !== "public") {
|
|
468
|
+
console.log(`[Security] ALLOW: ${event.toolName} (${event.sensitivity})`);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Get all security events
|
|
476
|
+
*/
|
|
477
|
+
getEvents(): SecurityEvent[] {
|
|
478
|
+
return [...this.events];
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Clear event history
|
|
483
|
+
*/
|
|
484
|
+
clearEvents(): void {
|
|
485
|
+
this.events = [];
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Get security statistics
|
|
490
|
+
*/
|
|
491
|
+
getStats(): {
|
|
492
|
+
totalEvents: number;
|
|
493
|
+
blockedCount: number;
|
|
494
|
+
allowedCount: number;
|
|
495
|
+
bySensitivity: Record<string, number>;
|
|
496
|
+
} {
|
|
497
|
+
const blockedCount = this.events.filter(e => e.type === "block").length;
|
|
498
|
+
const allowedCount = this.events.filter(e => e.type === "allow").length;
|
|
499
|
+
|
|
500
|
+
const bySensitivity: Record<string, number> = {};
|
|
501
|
+
for (const event of this.events) {
|
|
502
|
+
if (event.sensitivity) {
|
|
503
|
+
bySensitivity[event.sensitivity] = (bySensitivity[event.sensitivity] || 0) + 1;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
return {
|
|
508
|
+
totalEvents: this.events.length,
|
|
509
|
+
blockedCount,
|
|
510
|
+
allowedCount,
|
|
511
|
+
bySensitivity,
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// Singleton instance for global use
|
|
517
|
+
let globalMiddleware: CognitiveSecurityMiddleware | null = null;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Get or create global security middleware
|
|
521
|
+
*/
|
|
522
|
+
export function getSecurityMiddleware(
|
|
523
|
+
config?: Partial<SecurityConfig>
|
|
524
|
+
): CognitiveSecurityMiddleware {
|
|
525
|
+
if (!globalMiddleware) {
|
|
526
|
+
globalMiddleware = new CognitiveSecurityMiddleware(config);
|
|
527
|
+
}
|
|
528
|
+
return globalMiddleware;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Reset global middleware (for testing)
|
|
533
|
+
*/
|
|
534
|
+
export function resetSecurityMiddleware(): void {
|
|
535
|
+
globalMiddleware = null;
|
|
536
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
mv
|
|
2
|
+
- /Users/ebowwa/Desktop/codespaces/packages/src/coder/packages/src/core/claude-md.ts
|
|
3
|
+
- /Users/ebowwa/Desktop/codespaces/packages/src/coder/packages/src/core/config-loader.ts
|
|
4
|
+
- /Users/ebowwa/Desktop/codespaces/packages/src/coder/packages/src/core/models.ts
|
|
5
|
+
- /Users/ebowwa/Desktop/codespaces/packages/src/coder/packages/src/core/permissions.ts
|
|
6
|
+
|
|
7
|
+
here aqi
|