@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,751 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cognitive Security - Intent Module
|
|
3
|
+
*
|
|
4
|
+
* TypeScript bindings for the Rust cognitive security module.
|
|
5
|
+
* Provides intent preservation, alignment scoring, and corruption detection.
|
|
6
|
+
*/
|
|
7
|
+
export interface AgentIntent {
|
|
8
|
+
id: string;
|
|
9
|
+
version: number;
|
|
10
|
+
identity: AgentIdentity;
|
|
11
|
+
purpose: AgentPurpose;
|
|
12
|
+
principles: AgentPrinciples;
|
|
13
|
+
signature?: string;
|
|
14
|
+
createdAt: number;
|
|
15
|
+
signedBy?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AgentIdentity {
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
capabilities: string[];
|
|
21
|
+
constraints: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface AgentPurpose {
|
|
24
|
+
goals: Goal[];
|
|
25
|
+
nonGoals: string[];
|
|
26
|
+
boundaries: Boundary[];
|
|
27
|
+
}
|
|
28
|
+
export interface AgentPrinciples {
|
|
29
|
+
values: string[];
|
|
30
|
+
priorities: string[];
|
|
31
|
+
forbidden: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface Goal {
|
|
34
|
+
id: string;
|
|
35
|
+
description: string;
|
|
36
|
+
priority: "critical" | "high" | "medium" | "low";
|
|
37
|
+
measurable: boolean;
|
|
38
|
+
successCriteria?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface Boundary {
|
|
41
|
+
id: string;
|
|
42
|
+
description: string;
|
|
43
|
+
enforcement: "never" | "require_approval" | "log_only";
|
|
44
|
+
domain: string;
|
|
45
|
+
pattern?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ActionContext {
|
|
48
|
+
actionType: string;
|
|
49
|
+
domain: string;
|
|
50
|
+
operation: string;
|
|
51
|
+
target?: string;
|
|
52
|
+
params?: Record<string, unknown>;
|
|
53
|
+
reasoning?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface AlignmentResult {
|
|
56
|
+
score: number;
|
|
57
|
+
reasoning: string;
|
|
58
|
+
servesGoals: string[];
|
|
59
|
+
hindersGoals: string[];
|
|
60
|
+
boundaryConcerns: string[];
|
|
61
|
+
confidence: number;
|
|
62
|
+
shouldBlock: boolean;
|
|
63
|
+
requiresReview: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface IntegrityResult {
|
|
66
|
+
valid: boolean;
|
|
67
|
+
error?: string;
|
|
68
|
+
signatureValid: boolean;
|
|
69
|
+
contentIntact: boolean;
|
|
70
|
+
expired: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface IntentKeypair {
|
|
73
|
+
privateKey: string;
|
|
74
|
+
publicKey: string;
|
|
75
|
+
}
|
|
76
|
+
export interface ValidationResult {
|
|
77
|
+
valid: boolean;
|
|
78
|
+
errors: string[];
|
|
79
|
+
warnings: string[];
|
|
80
|
+
}
|
|
81
|
+
export interface BehaviorSnapshot {
|
|
82
|
+
timestamp: number;
|
|
83
|
+
actionCount: number;
|
|
84
|
+
alignmentDistribution: AlignmentDistribution;
|
|
85
|
+
actionsByDomain: DomainCount[];
|
|
86
|
+
actionsByType: TypeCount[];
|
|
87
|
+
boundaryViolations: number;
|
|
88
|
+
actionsBlocked: number;
|
|
89
|
+
}
|
|
90
|
+
export interface AlignmentDistribution {
|
|
91
|
+
mean: number;
|
|
92
|
+
variance: number;
|
|
93
|
+
min: number;
|
|
94
|
+
max: number;
|
|
95
|
+
belowThresholdCount: number;
|
|
96
|
+
}
|
|
97
|
+
export interface DomainCount {
|
|
98
|
+
domain: string;
|
|
99
|
+
count: number;
|
|
100
|
+
}
|
|
101
|
+
export interface TypeCount {
|
|
102
|
+
actionType: string;
|
|
103
|
+
count: number;
|
|
104
|
+
}
|
|
105
|
+
export interface CorruptionAnalysis {
|
|
106
|
+
riskScore: number;
|
|
107
|
+
indicators: CorruptionIndicator[];
|
|
108
|
+
recommendation: "continue" | "monitor" | "alert" | "pause" | "reset" | "investigate";
|
|
109
|
+
explanation: string;
|
|
110
|
+
}
|
|
111
|
+
export interface CorruptionIndicator {
|
|
112
|
+
indicatorType: string;
|
|
113
|
+
severity: string;
|
|
114
|
+
description: string;
|
|
115
|
+
evidence: string;
|
|
116
|
+
}
|
|
117
|
+
export interface DriftResult {
|
|
118
|
+
overallDrift: number;
|
|
119
|
+
driftFactors: DriftFactor[];
|
|
120
|
+
concernLevel: "none" | "low" | "medium" | "high" | "critical";
|
|
121
|
+
}
|
|
122
|
+
export interface DriftFactor {
|
|
123
|
+
factorType: string;
|
|
124
|
+
drift: number;
|
|
125
|
+
description: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Generate a new Ed25519 keypair for signing intents
|
|
129
|
+
*/
|
|
130
|
+
export declare function generateKeypair(): Promise<IntentKeypair>;
|
|
131
|
+
/**
|
|
132
|
+
* Sign an agent intent with a private key
|
|
133
|
+
*/
|
|
134
|
+
export declare function signIntent(intent: AgentIntent, privateKey: string): Promise<AgentIntent>;
|
|
135
|
+
/**
|
|
136
|
+
* Verify an intent's signature
|
|
137
|
+
*/
|
|
138
|
+
export declare function verifyIntent(intent: AgentIntent): Promise<IntegrityResult>;
|
|
139
|
+
/**
|
|
140
|
+
* Hash an intent for comparison
|
|
141
|
+
*/
|
|
142
|
+
export declare function hashIntent(intent: AgentIntent): Promise<string>;
|
|
143
|
+
/**
|
|
144
|
+
* Check if two intents are equivalent (ignoring signatures)
|
|
145
|
+
*/
|
|
146
|
+
export declare function intentsEquivalent(intent1: AgentIntent, intent2: AgentIntent): Promise<boolean>;
|
|
147
|
+
/**
|
|
148
|
+
* Score how well an action aligns with an intent
|
|
149
|
+
*/
|
|
150
|
+
export declare function scoreAlignment(action: ActionContext, intent: AgentIntent): Promise<AlignmentResult>;
|
|
151
|
+
/**
|
|
152
|
+
* Batch score multiple actions against an intent
|
|
153
|
+
*/
|
|
154
|
+
export declare function batchScoreAlignment(actions: ActionContext[], intent: AgentIntent): Promise<AlignmentResult[]>;
|
|
155
|
+
/**
|
|
156
|
+
* Check if any action in a sequence would violate intent
|
|
157
|
+
*/
|
|
158
|
+
export declare function checkSequenceViolations(actions: ActionContext[], intent: AgentIntent): Promise<number[]>;
|
|
159
|
+
/**
|
|
160
|
+
* Load intent from a JSON file
|
|
161
|
+
*/
|
|
162
|
+
export declare function loadIntent(path: string): Promise<AgentIntent>;
|
|
163
|
+
/**
|
|
164
|
+
* Save intent to a JSON file
|
|
165
|
+
*/
|
|
166
|
+
export declare function saveIntent(intent: AgentIntent, path: string): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Parse intent from JSON string
|
|
169
|
+
*/
|
|
170
|
+
export declare function parseIntent(json: string): Promise<AgentIntent>;
|
|
171
|
+
/**
|
|
172
|
+
* Serialize intent to JSON string
|
|
173
|
+
*/
|
|
174
|
+
export declare function serializeIntent(intent: AgentIntent): Promise<string>;
|
|
175
|
+
/**
|
|
176
|
+
* Validate intent structure
|
|
177
|
+
*/
|
|
178
|
+
export declare function validateIntent(intent: AgentIntent): Promise<ValidationResult>;
|
|
179
|
+
/**
|
|
180
|
+
* Create a default data collector intent
|
|
181
|
+
*/
|
|
182
|
+
export declare function createDataCollectorIntent(name: string, description: string): Promise<AgentIntent>;
|
|
183
|
+
/**
|
|
184
|
+
* Merge two intents (child overrides parent)
|
|
185
|
+
*/
|
|
186
|
+
export declare function mergeIntents(base: AgentIntent, override: AgentIntent): Promise<AgentIntent>;
|
|
187
|
+
/**
|
|
188
|
+
* Analyze behavior for signs of intent corruption
|
|
189
|
+
*/
|
|
190
|
+
export declare function analyzeCorruption(snapshot: BehaviorSnapshot, intent: AgentIntent): Promise<CorruptionAnalysis>;
|
|
191
|
+
/**
|
|
192
|
+
* Detect behavioral drift between two snapshots
|
|
193
|
+
*/
|
|
194
|
+
export declare function detectDrift(baseline: BehaviorSnapshot, current: BehaviorSnapshot): Promise<DriftResult>;
|
|
195
|
+
/**
|
|
196
|
+
* Create an empty behavior snapshot
|
|
197
|
+
*/
|
|
198
|
+
export declare function createEmptySnapshot(): Promise<BehaviorSnapshot>;
|
|
199
|
+
/**
|
|
200
|
+
* Update a snapshot with a new action result
|
|
201
|
+
*/
|
|
202
|
+
export declare function updateSnapshot(snapshot: BehaviorSnapshot, action: ActionContext, alignment: AlignmentResult): Promise<BehaviorSnapshot>;
|
|
203
|
+
export type ActionType = "modify" | "execute" | "communicate" | "transfer" | "observe" | "create" | "delete";
|
|
204
|
+
export type FlowDirection = "inbound" | "outbound" | "bidirectional";
|
|
205
|
+
export interface ClassifiedAction {
|
|
206
|
+
id: string;
|
|
207
|
+
actionType: string;
|
|
208
|
+
domain: string;
|
|
209
|
+
operation: string;
|
|
210
|
+
target?: string;
|
|
211
|
+
flowDirection: string;
|
|
212
|
+
riskLevel: number;
|
|
213
|
+
hasSideEffects: boolean;
|
|
214
|
+
requiresApproval: boolean;
|
|
215
|
+
reasoning?: string;
|
|
216
|
+
timestamp: number;
|
|
217
|
+
metadata?: string;
|
|
218
|
+
}
|
|
219
|
+
export interface ActionValidationResult {
|
|
220
|
+
allowed: boolean;
|
|
221
|
+
classification?: ClassifiedAction;
|
|
222
|
+
reason: string;
|
|
223
|
+
violatedPolicy?: string;
|
|
224
|
+
approvalRequired: boolean;
|
|
225
|
+
approvalToken?: string;
|
|
226
|
+
alternatives: string[];
|
|
227
|
+
confidence: number;
|
|
228
|
+
}
|
|
229
|
+
export interface ActionPolicy {
|
|
230
|
+
id: string;
|
|
231
|
+
description: string;
|
|
232
|
+
actionTypes: string[];
|
|
233
|
+
domains: string[];
|
|
234
|
+
operations: string[];
|
|
235
|
+
effect: "allow" | "deny" | "require_approval";
|
|
236
|
+
priority: number;
|
|
237
|
+
conditions?: string;
|
|
238
|
+
enabled: boolean;
|
|
239
|
+
}
|
|
240
|
+
export interface ActionContextForValidation {
|
|
241
|
+
actionType: string;
|
|
242
|
+
domain: string;
|
|
243
|
+
operation: string;
|
|
244
|
+
target?: string;
|
|
245
|
+
params?: string;
|
|
246
|
+
reasoning?: string;
|
|
247
|
+
sessionId?: string;
|
|
248
|
+
parentActionId?: string;
|
|
249
|
+
}
|
|
250
|
+
export interface ApprovalRequest {
|
|
251
|
+
id: string;
|
|
252
|
+
actionId: string;
|
|
253
|
+
classification: ClassifiedAction;
|
|
254
|
+
context: ActionContextForValidation;
|
|
255
|
+
createdAt: number;
|
|
256
|
+
expiresAt: number;
|
|
257
|
+
status: "pending" | "approved" | "denied" | "cancelled";
|
|
258
|
+
decidedBy?: string;
|
|
259
|
+
decidedAt?: number;
|
|
260
|
+
reason?: string;
|
|
261
|
+
priority: number;
|
|
262
|
+
escalationLevel: number;
|
|
263
|
+
}
|
|
264
|
+
export interface ApprovalStats {
|
|
265
|
+
pendingCount: number;
|
|
266
|
+
approvedCount: number;
|
|
267
|
+
deniedCount: number;
|
|
268
|
+
cancelledCount: number;
|
|
269
|
+
totalProcessed: number;
|
|
270
|
+
}
|
|
271
|
+
export interface AuditEntry {
|
|
272
|
+
id: string;
|
|
273
|
+
sequence: number;
|
|
274
|
+
timestamp: number;
|
|
275
|
+
action: ClassifiedAction;
|
|
276
|
+
validation: ActionValidationResult;
|
|
277
|
+
executed: boolean;
|
|
278
|
+
executionResult?: string;
|
|
279
|
+
sessionId?: string;
|
|
280
|
+
agentId?: string;
|
|
281
|
+
correlationId?: string;
|
|
282
|
+
metadata?: string;
|
|
283
|
+
}
|
|
284
|
+
export interface AuditStats {
|
|
285
|
+
totalEntries: number;
|
|
286
|
+
blockedCount: number;
|
|
287
|
+
executedCount: number;
|
|
288
|
+
byActionType: {
|
|
289
|
+
actionType: string;
|
|
290
|
+
count: number;
|
|
291
|
+
}[];
|
|
292
|
+
byDomain: {
|
|
293
|
+
domain: string;
|
|
294
|
+
count: number;
|
|
295
|
+
}[];
|
|
296
|
+
firstTimestamp: number;
|
|
297
|
+
lastTimestamp: number;
|
|
298
|
+
}
|
|
299
|
+
export interface ActionRiskInfo {
|
|
300
|
+
actionType: string;
|
|
301
|
+
riskLevel: number;
|
|
302
|
+
}
|
|
303
|
+
export interface FileDomainConfig {
|
|
304
|
+
protectedPaths: string[];
|
|
305
|
+
readOnlyPaths: string[];
|
|
306
|
+
largeFileThreshold: number;
|
|
307
|
+
}
|
|
308
|
+
export interface NetworkDomainConfig {
|
|
309
|
+
allowedHosts: string[];
|
|
310
|
+
blockedHosts: string[];
|
|
311
|
+
requireApprovalExternal: boolean;
|
|
312
|
+
}
|
|
313
|
+
export interface ShellDomainConfig {
|
|
314
|
+
allowedCommands: string[];
|
|
315
|
+
blockedCommands: string[];
|
|
316
|
+
requireApproval: boolean;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Classify an operation into an action type
|
|
320
|
+
*/
|
|
321
|
+
export declare function classifyOperation(operation: string, domain: string, target?: string, reasoning?: string): Promise<ClassifiedAction>;
|
|
322
|
+
/**
|
|
323
|
+
* Get all supported action types
|
|
324
|
+
*/
|
|
325
|
+
export declare function getActionTypes(): Promise<string[]>;
|
|
326
|
+
/**
|
|
327
|
+
* Get risk levels for all action types
|
|
328
|
+
*/
|
|
329
|
+
export declare function getActionRiskLevels(): Promise<ActionRiskInfo[]>;
|
|
330
|
+
/**
|
|
331
|
+
* Create a deny-all policy
|
|
332
|
+
*/
|
|
333
|
+
export declare function createDenyAllPolicy(): Promise<ActionPolicy>;
|
|
334
|
+
/**
|
|
335
|
+
* Create an observe-only policy
|
|
336
|
+
*/
|
|
337
|
+
export declare function createObserveOnlyPolicy(): Promise<ActionPolicy>;
|
|
338
|
+
/**
|
|
339
|
+
* Create a transfer approval policy
|
|
340
|
+
*/
|
|
341
|
+
export declare function createTransferApprovalPolicy(): Promise<ActionPolicy>;
|
|
342
|
+
/**
|
|
343
|
+
* Create file domain configuration
|
|
344
|
+
*/
|
|
345
|
+
export declare function createFileDomainConfig(): Promise<FileDomainConfig>;
|
|
346
|
+
/**
|
|
347
|
+
* Create network domain configuration
|
|
348
|
+
*/
|
|
349
|
+
export declare function createNetworkDomainConfig(): Promise<NetworkDomainConfig>;
|
|
350
|
+
/**
|
|
351
|
+
* Create shell domain configuration
|
|
352
|
+
*/
|
|
353
|
+
export declare function createShellDomainConfig(): Promise<ShellDomainConfig>;
|
|
354
|
+
export type SensitivityLevelType = "public" | "internal" | "confidential" | "secret" | "top_secret";
|
|
355
|
+
export type DataCategoryType = "pii" | "financial" | "credentials" | "secrets" | "source_code" | "configuration" | "logs" | "user_content" | "system_data" | "network_data" | "generic";
|
|
356
|
+
export interface ClassifiedData {
|
|
357
|
+
id: string;
|
|
358
|
+
sensitivity: string;
|
|
359
|
+
category: string;
|
|
360
|
+
source: string;
|
|
361
|
+
tags: string[];
|
|
362
|
+
can_log: boolean;
|
|
363
|
+
can_transmit: boolean;
|
|
364
|
+
can_store: boolean;
|
|
365
|
+
expires_at: number | null;
|
|
366
|
+
created_at: number;
|
|
367
|
+
}
|
|
368
|
+
export interface FlowRecord {
|
|
369
|
+
id: string;
|
|
370
|
+
data_id: string;
|
|
371
|
+
source_domain: string;
|
|
372
|
+
target_domain: string;
|
|
373
|
+
direction: string;
|
|
374
|
+
allowed: boolean;
|
|
375
|
+
reason: string;
|
|
376
|
+
policy_id: string | null;
|
|
377
|
+
session_id: string | null;
|
|
378
|
+
action_id: string | null;
|
|
379
|
+
timestamp: number;
|
|
380
|
+
data_hash: string;
|
|
381
|
+
}
|
|
382
|
+
export interface FlowValidationResult {
|
|
383
|
+
allowed: boolean;
|
|
384
|
+
reason: string;
|
|
385
|
+
applied_policy: string | null;
|
|
386
|
+
can_log: boolean;
|
|
387
|
+
can_transmit: boolean;
|
|
388
|
+
can_store: boolean;
|
|
389
|
+
transformations: string[];
|
|
390
|
+
confidence: number;
|
|
391
|
+
warnings: string[];
|
|
392
|
+
requireApproval?: boolean;
|
|
393
|
+
}
|
|
394
|
+
export interface FlowPolicy {
|
|
395
|
+
id: string;
|
|
396
|
+
description: string;
|
|
397
|
+
source_pattern: string;
|
|
398
|
+
target_pattern: string;
|
|
399
|
+
min_source_sensitivity: string | null;
|
|
400
|
+
max_target_sensitivity: string | null;
|
|
401
|
+
categories: string[];
|
|
402
|
+
effect: "allow" | "deny" | "transform" | "audit_only";
|
|
403
|
+
priority: number;
|
|
404
|
+
required_transforms: string[];
|
|
405
|
+
log_flow: boolean;
|
|
406
|
+
require_approval: boolean;
|
|
407
|
+
conditions: string | null;
|
|
408
|
+
enabled: boolean;
|
|
409
|
+
}
|
|
410
|
+
export interface FlowTrackerStats {
|
|
411
|
+
total_flows: number;
|
|
412
|
+
allowed_count: number;
|
|
413
|
+
blocked_count: number;
|
|
414
|
+
by_direction: {
|
|
415
|
+
direction: string;
|
|
416
|
+
count: number;
|
|
417
|
+
}[];
|
|
418
|
+
by_source_domain: {
|
|
419
|
+
domain: string;
|
|
420
|
+
count: number;
|
|
421
|
+
}[];
|
|
422
|
+
by_target_domain: {
|
|
423
|
+
domain: string;
|
|
424
|
+
count: number;
|
|
425
|
+
}[];
|
|
426
|
+
first_timestamp: number;
|
|
427
|
+
last_timestamp: number;
|
|
428
|
+
}
|
|
429
|
+
export interface DomainStats {
|
|
430
|
+
domain: string;
|
|
431
|
+
inbound_count: number;
|
|
432
|
+
outbound_count: number;
|
|
433
|
+
blocked_count: number;
|
|
434
|
+
by_sensitivity: Record<string, number>;
|
|
435
|
+
}
|
|
436
|
+
export type LeakType = "credential_exposure" | "pii_exposure" | "secret_key_exposure" | "internal_url_exposure" | "debug_info_leak" | "stack_trace_exposure" | "config_exposure" | "source_code_leak" | "encoded_smuggling" | "timing_channel" | "covert_channel";
|
|
437
|
+
export type PreventionActionType = "allow" | "alert" | "block";
|
|
438
|
+
export interface LeakDetection {
|
|
439
|
+
pattern_name: string;
|
|
440
|
+
leak_type: LeakType;
|
|
441
|
+
severity: number;
|
|
442
|
+
match_found: boolean;
|
|
443
|
+
}
|
|
444
|
+
export interface LeakCheckResult {
|
|
445
|
+
action: PreventionActionType;
|
|
446
|
+
detections: LeakDetection[];
|
|
447
|
+
channel_allowed: boolean;
|
|
448
|
+
checked_at: number;
|
|
449
|
+
}
|
|
450
|
+
export interface PreventionStatsResult {
|
|
451
|
+
total_checks: number;
|
|
452
|
+
blocked_count: number;
|
|
453
|
+
alert_count: number;
|
|
454
|
+
by_leak_type: Record<string, number>;
|
|
455
|
+
}
|
|
456
|
+
export type TaintSourceType = "user_input" | "file_system" | "network" | "environment" | "secrets" | "database" | "agent_generated" | "tool_output" | "memory" | "external";
|
|
457
|
+
export type PropagationType = "assignment" | "parameter" | "return" | "concatenation" | "collection_inclusion" | "property" | "transformation" | "aggregation";
|
|
458
|
+
export interface TaintSource {
|
|
459
|
+
id: string;
|
|
460
|
+
source_type: string;
|
|
461
|
+
sensitivity: string;
|
|
462
|
+
registered_at: number;
|
|
463
|
+
tags: string[];
|
|
464
|
+
}
|
|
465
|
+
export interface TaintedData {
|
|
466
|
+
id: string;
|
|
467
|
+
source_id: string;
|
|
468
|
+
data_hash: string;
|
|
469
|
+
sensitivity: string;
|
|
470
|
+
location: DataLocation;
|
|
471
|
+
propagated_from: string[];
|
|
472
|
+
tainted_at: number;
|
|
473
|
+
can_sanitize: boolean;
|
|
474
|
+
last_accessed: number;
|
|
475
|
+
access_count: number;
|
|
476
|
+
}
|
|
477
|
+
export interface DataLocation {
|
|
478
|
+
location_type: string;
|
|
479
|
+
identifier: string;
|
|
480
|
+
context: string | null;
|
|
481
|
+
}
|
|
482
|
+
export interface TaintPropagation {
|
|
483
|
+
id: string;
|
|
484
|
+
source_id: string;
|
|
485
|
+
target_id: string;
|
|
486
|
+
propagation_type: string;
|
|
487
|
+
operation: string;
|
|
488
|
+
timestamp: number;
|
|
489
|
+
}
|
|
490
|
+
export interface FlowDecision {
|
|
491
|
+
allowed: boolean;
|
|
492
|
+
reason: string;
|
|
493
|
+
requires_sanitization: boolean;
|
|
494
|
+
}
|
|
495
|
+
export interface TaintStatsResult {
|
|
496
|
+
total_sources: number;
|
|
497
|
+
total_tainted: number;
|
|
498
|
+
total_propagations: number;
|
|
499
|
+
by_source_type: Record<string, number>;
|
|
500
|
+
by_sensitivity: Record<string, number>;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Classify data based on content and source
|
|
504
|
+
*/
|
|
505
|
+
export declare function classifyData(content: string, source: string, tags: string[]): Promise<ClassifiedData>;
|
|
506
|
+
/**
|
|
507
|
+
* Check if content contains sensitive data
|
|
508
|
+
*/
|
|
509
|
+
export declare function containsSensitiveData(content: string): Promise<boolean>;
|
|
510
|
+
/**
|
|
511
|
+
* Redact sensitive content
|
|
512
|
+
*/
|
|
513
|
+
export declare function redactSensitive(content: string, replacement?: string): Promise<string>;
|
|
514
|
+
/**
|
|
515
|
+
* Get sensitivity levels
|
|
516
|
+
*/
|
|
517
|
+
export declare function getSensitivityLevels(): Promise<SensitivityLevelInfo[]>;
|
|
518
|
+
/**
|
|
519
|
+
* Get data categories
|
|
520
|
+
*/
|
|
521
|
+
export declare function getDataCategories(): Promise<DataCategoryInfo[]>;
|
|
522
|
+
export interface SensitivityLevelInfo {
|
|
523
|
+
name: string;
|
|
524
|
+
value: number;
|
|
525
|
+
description: string;
|
|
526
|
+
}
|
|
527
|
+
export interface DataCategoryInfo {
|
|
528
|
+
name: string;
|
|
529
|
+
description: string;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Create a flow policy engine
|
|
533
|
+
*/
|
|
534
|
+
export declare function createFlowPolicyEngine(): Promise<FlowPolicyEngineHandle>;
|
|
535
|
+
export interface FlowPolicyEngineHandle {
|
|
536
|
+
addPolicy(policy: FlowPolicy): void;
|
|
537
|
+
removePolicy(policyId: string): boolean;
|
|
538
|
+
evaluate(data: ClassifiedData, sourceDomain: string, targetDomain: string): FlowValidationResult;
|
|
539
|
+
listPolicies(): FlowPolicy[];
|
|
540
|
+
setDefaultAction(action: string): void;
|
|
541
|
+
setBlpMode(mode: string): void;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Create an allow-all flow policy
|
|
545
|
+
*/
|
|
546
|
+
export declare function createAllowAllFlowPolicy(): Promise<FlowPolicy>;
|
|
547
|
+
/**
|
|
548
|
+
* Create a deny-all flow policy
|
|
549
|
+
*/
|
|
550
|
+
export declare function createDenyAllFlowPolicy(): Promise<FlowPolicy>;
|
|
551
|
+
/**
|
|
552
|
+
* Create a strict flow policy
|
|
553
|
+
*/
|
|
554
|
+
export declare function createStrictFlowPolicy(): Promise<FlowPolicy>;
|
|
555
|
+
/**
|
|
556
|
+
* Create a flow tracker
|
|
557
|
+
*/
|
|
558
|
+
export declare function createFlowTracker(): Promise<FlowTrackerHandle>;
|
|
559
|
+
export interface FlowTrackerHandle {
|
|
560
|
+
record(data: ClassifiedData, sourceDomain: string, targetDomain: string, direction: string, validation: FlowValidationResult, sessionId: string | null, actionId: string | null): FlowRecord;
|
|
561
|
+
getFlow(flowId: string): FlowRecord | null;
|
|
562
|
+
getLineage(dataId: string): FlowRecord[];
|
|
563
|
+
bySource(domain: string): FlowRecord[];
|
|
564
|
+
byTarget(domain: string): FlowRecord[];
|
|
565
|
+
bySession(sessionId: string): FlowRecord[];
|
|
566
|
+
blocked(): FlowRecord[];
|
|
567
|
+
allowed(): FlowRecord[];
|
|
568
|
+
recent(limit: number): FlowRecord[];
|
|
569
|
+
stats(): FlowTrackerStats;
|
|
570
|
+
domainStats(domain: string): DomainStats | null;
|
|
571
|
+
count(): number;
|
|
572
|
+
clear(): void;
|
|
573
|
+
setMaxFlows(max: number): void;
|
|
574
|
+
exportJsonl(): string;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Create a leak prevention engine
|
|
578
|
+
*/
|
|
579
|
+
export declare function createLeakPrevention(): Promise<LeakPreventionHandle>;
|
|
580
|
+
export interface LeakPreventionHandle {
|
|
581
|
+
check(content: string, channel: string): LeakCheckResult;
|
|
582
|
+
sanitize(content: string): string;
|
|
583
|
+
registerSensitive(data: string): void;
|
|
584
|
+
addChannel(channel: string): void;
|
|
585
|
+
removeChannel(channel: string): void;
|
|
586
|
+
setMode(mode: string): void;
|
|
587
|
+
stats(): PreventionStatsResult;
|
|
588
|
+
clearSensitive(): void;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Quick check content for leaks
|
|
592
|
+
*/
|
|
593
|
+
export declare function checkForLeaks(content: string, channel: string): Promise<LeakCheckResult>;
|
|
594
|
+
/**
|
|
595
|
+
* Quick sanitize content
|
|
596
|
+
*/
|
|
597
|
+
export declare function sanitizeContent(content: string): Promise<string>;
|
|
598
|
+
/**
|
|
599
|
+
* Create a taint tracker
|
|
600
|
+
*/
|
|
601
|
+
export declare function createTaintTracker(): Promise<TaintTrackerHandle>;
|
|
602
|
+
export interface TaintTrackerHandle {
|
|
603
|
+
registerSource(sourceType: string, sensitivity: string, tags: string[]): string;
|
|
604
|
+
taint(sourceId: string, data: string, locationType: string, identifier: string): string | null;
|
|
605
|
+
propagate(sourceTaintId: string, newData: string, locationType: string, identifier: string, propagationType: string, operation: string): string | null;
|
|
606
|
+
canFlow(taintId: string, sink: string): FlowDecision;
|
|
607
|
+
isTainted(data: string): boolean;
|
|
608
|
+
getTaint(taintId: string): TaintedData | null;
|
|
609
|
+
stats(): TaintStatsResult;
|
|
610
|
+
clear(taintId: string): boolean;
|
|
611
|
+
clearAll(): void;
|
|
612
|
+
}
|
|
613
|
+
export interface ImmutableDirective {
|
|
614
|
+
id: string;
|
|
615
|
+
directiveType: string;
|
|
616
|
+
rule: string;
|
|
617
|
+
domain: string;
|
|
618
|
+
priority: number;
|
|
619
|
+
overridable: boolean;
|
|
620
|
+
createdAt: number;
|
|
621
|
+
expiresAt?: number;
|
|
622
|
+
createdBy: string;
|
|
623
|
+
signature?: string;
|
|
624
|
+
signedBy?: string;
|
|
625
|
+
ruleHash: string;
|
|
626
|
+
}
|
|
627
|
+
export interface DirectiveResult {
|
|
628
|
+
allowed: boolean;
|
|
629
|
+
requiresApproval: boolean;
|
|
630
|
+
violations: DirectiveViolation[];
|
|
631
|
+
approvalDirectives: string[];
|
|
632
|
+
denialReason?: string;
|
|
633
|
+
}
|
|
634
|
+
export interface DirectiveViolation {
|
|
635
|
+
directiveId: string;
|
|
636
|
+
directiveType: string;
|
|
637
|
+
reason: string;
|
|
638
|
+
severity: string;
|
|
639
|
+
}
|
|
640
|
+
export interface SignedAction {
|
|
641
|
+
id: string;
|
|
642
|
+
sequence: number;
|
|
643
|
+
sessionId: string;
|
|
644
|
+
tool: string;
|
|
645
|
+
domain: string;
|
|
646
|
+
actionType: string;
|
|
647
|
+
target?: string;
|
|
648
|
+
paramsHash: string;
|
|
649
|
+
timestamp: number;
|
|
650
|
+
intentId?: string;
|
|
651
|
+
signature: string;
|
|
652
|
+
signedBy: string;
|
|
653
|
+
prevHash?: string;
|
|
654
|
+
hash: string;
|
|
655
|
+
}
|
|
656
|
+
export interface ActionVerification {
|
|
657
|
+
signatureValid: boolean;
|
|
658
|
+
chainIntact: boolean;
|
|
659
|
+
hashValid: boolean;
|
|
660
|
+
intentVerified: boolean;
|
|
661
|
+
valid: boolean;
|
|
662
|
+
error?: string;
|
|
663
|
+
}
|
|
664
|
+
export interface BehavioralProfile {
|
|
665
|
+
agentId: string;
|
|
666
|
+
intentId?: string;
|
|
667
|
+
createdAt: number;
|
|
668
|
+
updatedAt: number;
|
|
669
|
+
totalActions: number;
|
|
670
|
+
actionTypes: Record<string, number>;
|
|
671
|
+
domains: Record<string, number>;
|
|
672
|
+
tools: Record<string, number>;
|
|
673
|
+
actionsPerMinute: number;
|
|
674
|
+
rateWindow: number;
|
|
675
|
+
commonSequences: SequencePattern[];
|
|
676
|
+
forbiddenAttempts: number;
|
|
677
|
+
approvalRequests: number;
|
|
678
|
+
}
|
|
679
|
+
export interface SequencePattern {
|
|
680
|
+
sequence: string[];
|
|
681
|
+
count: number;
|
|
682
|
+
lastSeen: number;
|
|
683
|
+
}
|
|
684
|
+
export interface DriftIndicator {
|
|
685
|
+
indicatorType: string;
|
|
686
|
+
severity: number;
|
|
687
|
+
description: string;
|
|
688
|
+
factor: string;
|
|
689
|
+
evidence: string[];
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Create a directive store for immutable directives
|
|
693
|
+
*/
|
|
694
|
+
export declare function createDirectiveStore(): Promise<DirectiveStoreHandle>;
|
|
695
|
+
/**
|
|
696
|
+
* Create an action signer for cryptographic action signing
|
|
697
|
+
*/
|
|
698
|
+
export declare function createActionSigner(privateKeyHex: string, sessionId: string): Promise<ActionSignerHandle>;
|
|
699
|
+
/**
|
|
700
|
+
* Create a drift detector for behavioral analytics
|
|
701
|
+
*/
|
|
702
|
+
export declare function createDriftDetector(agentId: string, intentId?: string): Promise<DriftDetectorHandle>;
|
|
703
|
+
/**
|
|
704
|
+
* Create default financial protection directives
|
|
705
|
+
*/
|
|
706
|
+
export declare function createDefaultFinancialDirectives(store: DirectiveStoreHandle): Promise<ImmutableDirective[]>;
|
|
707
|
+
declare class DirectiveStoreHandle {
|
|
708
|
+
private directives;
|
|
709
|
+
setSigningKey(privateKeyHex: string): Promise<void>;
|
|
710
|
+
createDirective(directiveType: string, rule: string, domain: string, priority?: number, overridable?: boolean, createdBy?: string): Promise<ImmutableDirective>;
|
|
711
|
+
addDirective(directive: ImmutableDirective): Promise<void>;
|
|
712
|
+
evaluate(actionType: string, domain: string, target: string | null, params: string): Promise<DirectiveResult>;
|
|
713
|
+
private evaluateRule;
|
|
714
|
+
private hashRule;
|
|
715
|
+
}
|
|
716
|
+
declare class ActionSignerHandle {
|
|
717
|
+
private privateKey;
|
|
718
|
+
private _sessionId;
|
|
719
|
+
private _sequence;
|
|
720
|
+
private _lastHash;
|
|
721
|
+
private _intentId;
|
|
722
|
+
constructor(privateKey: string, sessionId: string);
|
|
723
|
+
setIntent(intentId: string): void;
|
|
724
|
+
sign(tool: string, domain: string, actionType: string, target: string | null, params: string): Promise<SignedAction>;
|
|
725
|
+
verify(action: SignedAction): Promise<ActionVerification>;
|
|
726
|
+
getSequence(): number;
|
|
727
|
+
getSessionId(): string;
|
|
728
|
+
get publicKey(): string;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Verify a signed action without needing a signer handle
|
|
732
|
+
*/
|
|
733
|
+
export declare function verifySignedAction(action: SignedAction, publicKeyHex: string): Promise<ActionVerification>;
|
|
734
|
+
declare class DriftDetectorHandle {
|
|
735
|
+
private agentId;
|
|
736
|
+
private intentId;
|
|
737
|
+
private profile;
|
|
738
|
+
private recentActions;
|
|
739
|
+
private actionTimes;
|
|
740
|
+
private threshold;
|
|
741
|
+
constructor(agentId: string, intentId?: string);
|
|
742
|
+
record(action: SignedAction): void;
|
|
743
|
+
recordForbidden(): void;
|
|
744
|
+
recordApproval(): void;
|
|
745
|
+
detect(): DriftResult;
|
|
746
|
+
getProfile(): BehavioralProfile;
|
|
747
|
+
setThreshold(threshold: number): void;
|
|
748
|
+
getRecentActions(): SignedAction[];
|
|
749
|
+
}
|
|
750
|
+
export * from "./hooks.js";
|
|
751
|
+
//# sourceMappingURL=index.d.ts.map
|