@dcyfr/ai 2.1.3 → 3.0.0
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/CHANGELOG.md +81 -0
- package/README.md +75 -10
- package/config/default.json +11 -5
- package/config/default.yaml +13 -5
- package/dist/.tsbuildinfo +1 -0
- package/dist/ai/agents/agent-loader.d.ts.map +1 -1
- package/dist/ai/agents/agent-loader.js +1 -0
- package/dist/ai/agents/agent-loader.js.map +1 -1
- package/dist/ai/agents/agent-registry.d.ts.map +1 -1
- package/dist/ai/agents/agent-registry.js.map +1 -1
- package/dist/ai/agents/agent-router.d.ts +3 -3
- package/dist/ai/agents/agent-router.d.ts.map +1 -1
- package/dist/ai/agents/agent-router.js +6 -7
- package/dist/ai/agents/agent-router.js.map +1 -1
- package/dist/ai/config/schema.js +3 -3
- package/dist/ai/config/schema.js.map +1 -1
- package/dist/ai/core/provider-registry.d.ts.map +1 -1
- package/dist/ai/core/provider-registry.js +47 -16
- package/dist/ai/core/provider-registry.js.map +1 -1
- package/dist/ai/core/telemetry-engine.d.ts.map +1 -1
- package/dist/ai/core/telemetry-engine.js +5 -3
- package/dist/ai/core/telemetry-engine.js.map +1 -1
- package/dist/ai/delegation/capability-bootstrap.js +1 -1
- package/dist/ai/delegation/capability-bootstrap.js.map +1 -1
- package/dist/ai/delegation/contract-manager.d.ts +54 -5
- package/dist/ai/delegation/contract-manager.d.ts.map +1 -1
- package/dist/ai/delegation/contract-manager.js +122 -7
- package/dist/ai/delegation/contract-manager.js.map +1 -1
- package/dist/ai/delegation/feature-flags.d.ts +1 -1
- package/dist/ai/delegation/feature-flags.d.ts.map +1 -1
- package/dist/ai/delegation/feature-flags.js +3 -1
- package/dist/ai/delegation/feature-flags.js.map +1 -1
- package/dist/ai/delegation/index.d.ts +1 -0
- package/dist/ai/delegation/index.d.ts.map +1 -1
- package/dist/ai/delegation/index.js +2 -0
- package/dist/ai/delegation/index.js.map +1 -1
- package/dist/ai/delegation/monitoring.d.ts.map +1 -1
- package/dist/ai/delegation/monitoring.js +1 -0
- package/dist/ai/delegation/monitoring.js.map +1 -1
- package/dist/ai/delegation/session-manager.d.ts +16 -1
- package/dist/ai/delegation/session-manager.d.ts.map +1 -1
- package/dist/ai/delegation/session-manager.js +10 -1
- package/dist/ai/delegation/session-manager.js.map +1 -1
- package/dist/ai/delegation/session-queue.d.ts.map +1 -1
- package/dist/ai/delegation/session-queue.js.map +1 -1
- package/dist/ai/examples/integration-demo.d.ts.map +1 -1
- package/dist/ai/examples/integration-demo.js +1 -0
- package/dist/ai/examples/integration-demo.js.map +1 -1
- package/dist/ai/index.d.ts +7 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +8 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/mcp/mcp-registry.d.ts.map +1 -1
- package/dist/ai/mcp/mcp-registry.js +1 -1
- package/dist/ai/mcp/mcp-registry.js.map +1 -1
- package/dist/ai/mcp/servers/analytics/index.d.ts.map +1 -1
- package/dist/ai/mcp/servers/analytics/index.js +1 -0
- package/dist/ai/mcp/servers/analytics/index.js.map +1 -1
- package/dist/ai/mcp/servers/content-manager/index.d.ts.map +1 -1
- package/dist/ai/mcp/servers/delegation-monitor/index.js +27 -27
- package/dist/ai/mcp/servers/delegation-monitor/index.js.map +1 -1
- package/dist/ai/mcp/servers/design-tokens/index.js +1 -1
- package/dist/ai/mcp/servers/design-tokens/index.js.map +1 -1
- package/dist/ai/mcp/servers/promptintel/index.d.ts.map +1 -1
- package/dist/ai/mcp/servers/promptintel/index.js +2 -1
- package/dist/ai/mcp/servers/promptintel/index.js.map +1 -1
- package/dist/ai/mcp/servers/shared/rate-limiter.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/rate-limiter.js +1 -0
- package/dist/ai/mcp/servers/shared/rate-limiter.js.map +1 -1
- package/dist/ai/mcp/servers/shared/redis-client.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/redis-client.js +2 -0
- package/dist/ai/mcp/servers/shared/redis-client.js.map +1 -1
- package/dist/ai/mcp/servers/shared/utils.js +12 -18
- package/dist/ai/mcp/servers/shared/utils.js.map +1 -1
- package/dist/ai/memory/dcyfr-memory.d.ts.map +1 -1
- package/dist/ai/memory/dcyfr-memory.js +11 -1
- package/dist/ai/memory/dcyfr-memory.js.map +1 -1
- package/dist/ai/memory/file-memory-adapter.d.ts +103 -0
- package/dist/ai/memory/file-memory-adapter.d.ts.map +1 -0
- package/dist/ai/memory/file-memory-adapter.js +532 -0
- package/dist/ai/memory/file-memory-adapter.js.map +1 -0
- package/dist/ai/memory/index.d.ts +6 -0
- package/dist/ai/memory/index.d.ts.map +1 -1
- package/dist/ai/memory/index.js +6 -0
- package/dist/ai/memory/index.js.map +1 -1
- package/dist/ai/memory/mem0-client.d.ts.map +1 -1
- package/dist/ai/memory/mem0-client.js +5 -2
- package/dist/ai/memory/mem0-client.js.map +1 -1
- package/dist/ai/memory/sqlite-index.d.ts +89 -0
- package/dist/ai/memory/sqlite-index.d.ts.map +1 -0
- package/dist/ai/memory/sqlite-index.js +295 -0
- package/dist/ai/memory/sqlite-index.js.map +1 -0
- package/dist/ai/memory/types.d.ts.map +1 -1
- package/dist/ai/memory/types.js +1 -0
- package/dist/ai/memory/types.js.map +1 -1
- package/dist/ai/memory/working-memory-persistence.d.ts +79 -0
- package/dist/ai/memory/working-memory-persistence.d.ts.map +1 -0
- package/dist/ai/memory/working-memory-persistence.js +220 -0
- package/dist/ai/memory/working-memory-persistence.js.map +1 -0
- package/dist/ai/permissions/attenuation-engine.d.ts.map +1 -1
- package/dist/ai/permissions/attenuation-engine.js.map +1 -1
- package/dist/ai/reputation/reputation-engine.d.ts +4 -0
- package/dist/ai/reputation/reputation-engine.d.ts.map +1 -1
- package/dist/ai/reputation/reputation-engine.js +1 -0
- package/dist/ai/reputation/reputation-engine.js.map +1 -1
- package/dist/ai/runtime/agent-runtime.d.ts.map +1 -1
- package/dist/ai/runtime/agent-runtime.js +9 -5
- package/dist/ai/runtime/agent-runtime.js.map +1 -1
- package/dist/ai/src/batch-processor.d.ts +6 -6
- package/dist/ai/src/batch-processor.d.ts.map +1 -1
- package/dist/ai/src/batch-processor.js +11 -4
- package/dist/ai/src/batch-processor.js.map +1 -1
- package/dist/ai/src/capability-bootstrap.d.ts.map +1 -1
- package/dist/ai/src/capability-bootstrap.js +1 -0
- package/dist/ai/src/capability-bootstrap.js.map +1 -1
- package/dist/ai/src/capability-registry.js +1 -1
- package/dist/ai/src/capability-registry.js.map +1 -1
- package/dist/ai/src/cli/telemetry-dashboard.d.ts +0 -11
- package/dist/ai/src/cli/telemetry-dashboard.d.ts.map +1 -1
- package/dist/ai/src/cli/telemetry-dashboard.js +12 -6
- package/dist/ai/src/cli/telemetry-dashboard.js.map +1 -1
- package/dist/ai/src/compaction/context-compactor.d.ts +149 -0
- package/dist/ai/src/compaction/context-compactor.d.ts.map +1 -0
- package/dist/ai/src/compaction/context-compactor.js +302 -0
- package/dist/ai/src/compaction/context-compactor.js.map +1 -0
- package/dist/ai/src/compaction/index.d.ts +11 -0
- package/dist/ai/src/compaction/index.d.ts.map +1 -0
- package/dist/ai/src/compaction/index.js +11 -0
- package/dist/ai/src/compaction/index.js.map +1 -0
- package/dist/ai/src/compaction/memory-compaction.d.ts +138 -0
- package/dist/ai/src/compaction/memory-compaction.d.ts.map +1 -0
- package/dist/ai/src/compaction/memory-compaction.js +630 -0
- package/dist/ai/src/compaction/memory-compaction.js.map +1 -0
- package/dist/ai/src/container/agent-container-dispatcher.d.ts +154 -0
- package/dist/ai/src/container/agent-container-dispatcher.d.ts.map +1 -0
- package/dist/ai/src/container/agent-container-dispatcher.js +329 -0
- package/dist/ai/src/container/agent-container-dispatcher.js.map +1 -0
- package/dist/ai/src/container/backend-factory.d.ts +89 -0
- package/dist/ai/src/container/backend-factory.d.ts.map +1 -0
- package/dist/ai/src/container/backend-factory.js +169 -0
- package/dist/ai/src/container/backend-factory.js.map +1 -0
- package/dist/ai/src/container/index.d.ts +13 -0
- package/dist/ai/src/container/index.d.ts.map +1 -0
- package/dist/ai/src/container/index.js +13 -0
- package/dist/ai/src/container/index.js.map +1 -0
- package/dist/ai/src/container/kubernetes-backend.d.ts +23 -0
- package/dist/ai/src/container/kubernetes-backend.d.ts.map +1 -0
- package/dist/ai/src/container/kubernetes-backend.js +39 -0
- package/dist/ai/src/container/kubernetes-backend.js.map +1 -0
- package/dist/ai/src/container/local-docker-backend.d.ts +77 -0
- package/dist/ai/src/container/local-docker-backend.d.ts.map +1 -0
- package/dist/ai/src/container/local-docker-backend.js +362 -0
- package/dist/ai/src/container/local-docker-backend.js.map +1 -0
- package/dist/ai/src/container/remote-docker-backend.d.ts +35 -0
- package/dist/ai/src/container/remote-docker-backend.d.ts.map +1 -0
- package/dist/ai/src/container/remote-docker-backend.js +189 -0
- package/dist/ai/src/container/remote-docker-backend.js.map +1 -0
- package/dist/ai/src/container/types.d.ts +270 -0
- package/dist/ai/src/container/types.d.ts.map +1 -0
- package/dist/ai/src/container/types.js +86 -0
- package/dist/ai/src/container/types.js.map +1 -0
- package/dist/ai/src/delegation/feature-flags.d.ts.map +1 -1
- package/dist/ai/src/delegation/feature-flags.js +1 -0
- package/dist/ai/src/delegation/feature-flags.js.map +1 -1
- package/dist/ai/src/delegation/liability-firebreak.d.ts.map +1 -1
- package/dist/ai/src/delegation/liability-firebreak.js +1 -0
- package/dist/ai/src/delegation/liability-firebreak.js.map +1 -1
- package/dist/ai/src/delegation/security-threat-model.d.ts.map +1 -1
- package/dist/ai/src/delegation/security-threat-model.js +1 -1
- package/dist/ai/src/delegation/security-threat-model.js.map +1 -1
- package/dist/ai/src/delegation-capability-integration.d.ts +1 -1
- package/dist/ai/src/delegation-capability-integration.d.ts.map +1 -1
- package/dist/ai/src/delegation-capability-integration.js +2 -7
- package/dist/ai/src/delegation-capability-integration.js.map +1 -1
- package/dist/ai/src/end-to-end-workflow-orchestrator.d.ts.map +1 -1
- package/dist/ai/src/end-to-end-workflow-orchestrator.js +2 -1
- package/dist/ai/src/end-to-end-workflow-orchestrator.js.map +1 -1
- package/dist/ai/src/enhanced-capability-detection.d.ts +1 -1
- package/dist/ai/src/enhanced-capability-detection.d.ts.map +1 -1
- package/dist/ai/src/enhanced-capability-detection.js +1 -1
- package/dist/ai/src/enhanced-capability-detection.js.map +1 -1
- package/dist/ai/src/gateway/index.d.ts +6 -0
- package/dist/ai/src/gateway/index.d.ts.map +1 -0
- package/dist/ai/src/gateway/index.js +6 -0
- package/dist/ai/src/gateway/index.js.map +1 -0
- package/dist/ai/src/gateway/message-gateway.d.ts +296 -0
- package/dist/ai/src/gateway/message-gateway.d.ts.map +1 -0
- package/dist/ai/src/gateway/message-gateway.js +415 -0
- package/dist/ai/src/gateway/message-gateway.js.map +1 -0
- package/dist/ai/src/intelligent-cache-manager.d.ts.map +1 -1
- package/dist/ai/src/intelligent-cache-manager.js +2 -1
- package/dist/ai/src/intelligent-cache-manager.js.map +1 -1
- package/dist/ai/src/mcp/index.d.ts +10 -0
- package/dist/ai/src/mcp/index.d.ts.map +1 -0
- package/dist/ai/src/mcp/index.js +10 -0
- package/dist/ai/src/mcp/index.js.map +1 -0
- package/dist/ai/src/mcp/mcp-tool-bridge.d.ts +186 -0
- package/dist/ai/src/mcp/mcp-tool-bridge.d.ts.map +1 -0
- package/dist/ai/src/mcp/mcp-tool-bridge.js +292 -0
- package/dist/ai/src/mcp/mcp-tool-bridge.js.map +1 -0
- package/dist/ai/src/mcp-auto-configuration.d.ts.map +1 -1
- package/dist/ai/src/mcp-auto-configuration.js +2 -1
- package/dist/ai/src/mcp-auto-configuration.js.map +1 -1
- package/dist/ai/src/performance-profiler.d.ts.map +1 -1
- package/dist/ai/src/performance-profiler.js +1 -0
- package/dist/ai/src/performance-profiler.js.map +1 -1
- package/dist/ai/src/plugins/anomaly/anomaly-detector.d.ts +58 -0
- package/dist/ai/src/plugins/anomaly/anomaly-detector.d.ts.map +1 -0
- package/dist/ai/src/plugins/anomaly/anomaly-detector.js +101 -0
- package/dist/ai/src/plugins/anomaly/anomaly-detector.js.map +1 -0
- package/dist/ai/src/plugins/anomaly/anomaly-monitor.d.ts +145 -0
- package/dist/ai/src/plugins/anomaly/anomaly-monitor.d.ts.map +1 -0
- package/dist/ai/src/plugins/anomaly/anomaly-monitor.js +245 -0
- package/dist/ai/src/plugins/anomaly/anomaly-monitor.js.map +1 -0
- package/dist/ai/src/plugins/anomaly/behavior-baseline.d.ts +79 -0
- package/dist/ai/src/plugins/anomaly/behavior-baseline.d.ts.map +1 -0
- package/dist/ai/src/plugins/anomaly/behavior-baseline.js +161 -0
- package/dist/ai/src/plugins/anomaly/behavior-baseline.js.map +1 -0
- package/dist/ai/src/plugins/anomaly/index.d.ts +15 -0
- package/dist/ai/src/plugins/anomaly/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/anomaly/index.js +12 -0
- package/dist/ai/src/plugins/anomaly/index.js.map +1 -0
- package/dist/ai/src/plugins/anomaly/types.d.ts +150 -0
- package/dist/ai/src/plugins/anomaly/types.d.ts.map +1 -0
- package/dist/ai/src/plugins/anomaly/types.js +68 -0
- package/dist/ai/src/plugins/anomaly/types.js.map +1 -0
- package/dist/ai/src/plugins/certification/certification-manager.d.ts +102 -0
- package/dist/ai/src/plugins/certification/certification-manager.d.ts.map +1 -0
- package/dist/ai/src/plugins/certification/certification-manager.js +321 -0
- package/dist/ai/src/plugins/certification/certification-manager.js.map +1 -0
- package/dist/ai/src/plugins/certification/index.d.ts +12 -0
- package/dist/ai/src/plugins/certification/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/certification/index.js +10 -0
- package/dist/ai/src/plugins/certification/index.js.map +1 -0
- package/dist/ai/src/plugins/certification/types.d.ts +128 -0
- package/dist/ai/src/plugins/certification/types.d.ts.map +1 -0
- package/dist/ai/src/plugins/certification/types.js +201 -0
- package/dist/ai/src/plugins/certification/types.js.map +1 -0
- package/dist/ai/src/plugins/escalation/escalation-trigger.d.ts +155 -0
- package/dist/ai/src/plugins/escalation/escalation-trigger.d.ts.map +1 -0
- package/dist/ai/src/plugins/escalation/escalation-trigger.js +183 -0
- package/dist/ai/src/plugins/escalation/escalation-trigger.js.map +1 -0
- package/dist/ai/src/plugins/escalation/index.d.ts +11 -0
- package/dist/ai/src/plugins/escalation/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/escalation/index.js +10 -0
- package/dist/ai/src/plugins/escalation/index.js.map +1 -0
- package/dist/ai/src/plugins/incidents/incident-response-manager.d.ts +165 -0
- package/dist/ai/src/plugins/incidents/incident-response-manager.d.ts.map +1 -0
- package/dist/ai/src/plugins/incidents/incident-response-manager.js +462 -0
- package/dist/ai/src/plugins/incidents/incident-response-manager.js.map +1 -0
- package/dist/ai/src/plugins/incidents/index.d.ts +8 -0
- package/dist/ai/src/plugins/incidents/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/incidents/index.js +7 -0
- package/dist/ai/src/plugins/incidents/index.js.map +1 -0
- package/dist/ai/src/plugins/incidents/types.d.ts +183 -0
- package/dist/ai/src/plugins/incidents/types.d.ts.map +1 -0
- package/dist/ai/src/plugins/incidents/types.js +55 -0
- package/dist/ai/src/plugins/incidents/types.js.map +1 -0
- package/dist/ai/src/plugins/permissions/index.d.ts +17 -0
- package/dist/ai/src/plugins/permissions/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/permissions/index.js +14 -0
- package/dist/ai/src/plugins/permissions/index.js.map +1 -0
- package/dist/ai/src/plugins/permissions/permission-attenuator.d.ts +29 -0
- package/dist/ai/src/plugins/permissions/permission-attenuator.d.ts.map +1 -0
- package/dist/ai/src/plugins/permissions/permission-attenuator.js +190 -0
- package/dist/ai/src/plugins/permissions/permission-attenuator.js.map +1 -0
- package/dist/ai/src/plugins/permissions/permission-audit-logger.d.ts +72 -0
- package/dist/ai/src/plugins/permissions/permission-audit-logger.d.ts.map +1 -0
- package/dist/ai/src/plugins/permissions/permission-audit-logger.js +176 -0
- package/dist/ai/src/plugins/permissions/permission-audit-logger.js.map +1 -0
- package/dist/ai/src/plugins/permissions/permission-enforcer.d.ts +99 -0
- package/dist/ai/src/plugins/permissions/permission-enforcer.d.ts.map +1 -0
- package/dist/ai/src/plugins/permissions/permission-enforcer.js +151 -0
- package/dist/ai/src/plugins/permissions/permission-enforcer.js.map +1 -0
- package/dist/ai/src/plugins/permissions/plugin-permission-validator.d.ts +39 -0
- package/dist/ai/src/plugins/permissions/plugin-permission-validator.d.ts.map +1 -0
- package/dist/ai/src/plugins/permissions/plugin-permission-validator.js +296 -0
- package/dist/ai/src/plugins/permissions/plugin-permission-validator.js.map +1 -0
- package/dist/ai/src/plugins/permissions/types.d.ts +116 -0
- package/dist/ai/src/plugins/permissions/types.d.ts.map +1 -0
- package/dist/ai/src/plugins/permissions/types.js +36 -0
- package/dist/ai/src/plugins/permissions/types.js.map +1 -0
- package/dist/ai/src/plugins/reputation/index.d.ts +9 -0
- package/dist/ai/src/plugins/reputation/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/reputation/index.js +8 -0
- package/dist/ai/src/plugins/reputation/index.js.map +1 -0
- package/dist/ai/src/plugins/reputation/plugin-reputation-db.d.ts +29 -0
- package/dist/ai/src/plugins/reputation/plugin-reputation-db.d.ts.map +1 -0
- package/dist/ai/src/plugins/reputation/plugin-reputation-db.js +120 -0
- package/dist/ai/src/plugins/reputation/plugin-reputation-db.js.map +1 -0
- package/dist/ai/src/plugins/reputation/plugin-reputation-engine.d.ts +115 -0
- package/dist/ai/src/plugins/reputation/plugin-reputation-engine.d.ts.map +1 -0
- package/dist/ai/src/plugins/reputation/plugin-reputation-engine.js +528 -0
- package/dist/ai/src/plugins/reputation/plugin-reputation-engine.js.map +1 -0
- package/dist/ai/src/plugins/reputation/types.d.ts +149 -0
- package/dist/ai/src/plugins/reputation/types.d.ts.map +1 -0
- package/dist/ai/src/plugins/reputation/types.js +14 -0
- package/dist/ai/src/plugins/reputation/types.js.map +1 -0
- package/dist/ai/src/plugins/reviews/index.d.ts +11 -0
- package/dist/ai/src/plugins/reviews/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/reviews/index.js +10 -0
- package/dist/ai/src/plugins/reviews/index.js.map +1 -0
- package/dist/ai/src/plugins/reviews/plugin-rating-aggregator.d.ts +116 -0
- package/dist/ai/src/plugins/reviews/plugin-rating-aggregator.d.ts.map +1 -0
- package/dist/ai/src/plugins/reviews/plugin-rating-aggregator.js +282 -0
- package/dist/ai/src/plugins/reviews/plugin-rating-aggregator.js.map +1 -0
- package/dist/ai/src/plugins/reviews/types.d.ts +113 -0
- package/dist/ai/src/plugins/reviews/types.d.ts.map +1 -0
- package/dist/ai/src/plugins/reviews/types.js +55 -0
- package/dist/ai/src/plugins/reviews/types.js.map +1 -0
- package/dist/ai/src/plugins/runtime/docker-plugin-runner.d.ts +77 -0
- package/dist/ai/src/plugins/runtime/docker-plugin-runner.d.ts.map +1 -0
- package/dist/ai/src/plugins/runtime/docker-plugin-runner.js +248 -0
- package/dist/ai/src/plugins/runtime/docker-plugin-runner.js.map +1 -0
- package/dist/ai/src/plugins/runtime/gvisor-plugin-runner.d.ts +99 -0
- package/dist/ai/src/plugins/runtime/gvisor-plugin-runner.d.ts.map +1 -0
- package/dist/ai/src/plugins/runtime/gvisor-plugin-runner.js +158 -0
- package/dist/ai/src/plugins/runtime/gvisor-plugin-runner.js.map +1 -0
- package/dist/ai/src/plugins/runtime/index.d.ts +13 -0
- package/dist/ai/src/plugins/runtime/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/runtime/index.js +11 -0
- package/dist/ai/src/plugins/runtime/index.js.map +1 -0
- package/dist/ai/src/plugins/runtime/types.d.ts +143 -0
- package/dist/ai/src/plugins/runtime/types.d.ts.map +1 -0
- package/dist/ai/src/plugins/runtime/types.js +19 -0
- package/dist/ai/src/plugins/runtime/types.js.map +1 -0
- package/dist/ai/src/plugins/runtime/wasm-plugin-runner.d.ts +104 -0
- package/dist/ai/src/plugins/runtime/wasm-plugin-runner.d.ts.map +1 -0
- package/dist/ai/src/plugins/runtime/wasm-plugin-runner.js +307 -0
- package/dist/ai/src/plugins/runtime/wasm-plugin-runner.js.map +1 -0
- package/dist/ai/src/plugins/security/index.d.ts +24 -0
- package/dist/ai/src/plugins/security/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/index.js +23 -0
- package/dist/ai/src/plugins/security/index.js.map +1 -0
- package/dist/ai/src/plugins/security/license-checker.d.ts +26 -0
- package/dist/ai/src/plugins/security/license-checker.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/license-checker.js +137 -0
- package/dist/ai/src/plugins/security/license-checker.js.map +1 -0
- package/dist/ai/src/plugins/security/malware-scanner.d.ts +19 -0
- package/dist/ai/src/plugins/security/malware-scanner.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/malware-scanner.js +121 -0
- package/dist/ai/src/plugins/security/malware-scanner.js.map +1 -0
- package/dist/ai/src/plugins/security/plugin-security-scanner.d.ts +36 -0
- package/dist/ai/src/plugins/security/plugin-security-scanner.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/plugin-security-scanner.js +160 -0
- package/dist/ai/src/plugins/security/plugin-security-scanner.js.map +1 -0
- package/dist/ai/src/plugins/security/sbom-generator.d.ts +23 -0
- package/dist/ai/src/plugins/security/sbom-generator.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/sbom-generator.js +115 -0
- package/dist/ai/src/plugins/security/sbom-generator.js.map +1 -0
- package/dist/ai/src/plugins/security/secret-detector.d.ts +19 -0
- package/dist/ai/src/plugins/security/secret-detector.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/secret-detector.js +204 -0
- package/dist/ai/src/plugins/security/secret-detector.js.map +1 -0
- package/dist/ai/src/plugins/security/signature-verifier.d.ts +21 -0
- package/dist/ai/src/plugins/security/signature-verifier.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/signature-verifier.js +75 -0
- package/dist/ai/src/plugins/security/signature-verifier.js.map +1 -0
- package/dist/ai/src/plugins/security/sonarcloud-client.d.ts +20 -0
- package/dist/ai/src/plugins/security/sonarcloud-client.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/sonarcloud-client.js +106 -0
- package/dist/ai/src/plugins/security/sonarcloud-client.js.map +1 -0
- package/dist/ai/src/plugins/security/trust-score.d.ts +58 -0
- package/dist/ai/src/plugins/security/trust-score.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/trust-score.js +173 -0
- package/dist/ai/src/plugins/security/trust-score.js.map +1 -0
- package/dist/ai/src/plugins/security/types.d.ts +220 -0
- package/dist/ai/src/plugins/security/types.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/types.js +12 -0
- package/dist/ai/src/plugins/security/types.js.map +1 -0
- package/dist/ai/src/plugins/security/vulnerability-scanner.d.ts +22 -0
- package/dist/ai/src/plugins/security/vulnerability-scanner.d.ts.map +1 -0
- package/dist/ai/src/plugins/security/vulnerability-scanner.js +109 -0
- package/dist/ai/src/plugins/security/vulnerability-scanner.js.map +1 -0
- package/dist/ai/src/plugins/tlp/index.d.ts +17 -0
- package/dist/ai/src/plugins/tlp/index.d.ts.map +1 -0
- package/dist/ai/src/plugins/tlp/index.js +17 -0
- package/dist/ai/src/plugins/tlp/index.js.map +1 -0
- package/dist/ai/src/plugins/tlp/tlp-classifier.d.ts +55 -0
- package/dist/ai/src/plugins/tlp/tlp-classifier.d.ts.map +1 -0
- package/dist/ai/src/plugins/tlp/tlp-classifier.js +232 -0
- package/dist/ai/src/plugins/tlp/tlp-classifier.js.map +1 -0
- package/dist/ai/src/plugins/tlp/tlp-validator.d.ts +97 -0
- package/dist/ai/src/plugins/tlp/tlp-validator.d.ts.map +1 -0
- package/dist/ai/src/plugins/tlp/tlp-validator.js +120 -0
- package/dist/ai/src/plugins/tlp/tlp-validator.js.map +1 -0
- package/dist/ai/src/plugins/tlp/types.d.ts +84 -0
- package/dist/ai/src/plugins/tlp/types.d.ts.map +1 -0
- package/dist/ai/src/plugins/tlp/types.js +20 -0
- package/dist/ai/src/plugins/tlp/types.js.map +1 -0
- package/dist/ai/src/resource-monitor.d.ts +1 -1
- package/dist/ai/src/resource-monitor.d.ts.map +1 -1
- package/dist/ai/src/resource-monitor.js +4 -3
- package/dist/ai/src/resource-monitor.js.map +1 -1
- package/dist/ai/src/runtime/agent-runtime.d.ts +77 -0
- package/dist/ai/src/runtime/agent-runtime.d.ts.map +1 -1
- package/dist/ai/src/runtime/agent-runtime.js +138 -2
- package/dist/ai/src/runtime/agent-runtime.js.map +1 -1
- package/dist/ai/src/scheduler/agent-scheduler.d.ts +365 -0
- package/dist/ai/src/scheduler/agent-scheduler.d.ts.map +1 -0
- package/dist/ai/src/scheduler/agent-scheduler.js +610 -0
- package/dist/ai/src/scheduler/agent-scheduler.js.map +1 -0
- package/dist/ai/src/scheduler/index.d.ts +6 -0
- package/dist/ai/src/scheduler/index.d.ts.map +1 -0
- package/dist/ai/src/scheduler/index.js +6 -0
- package/dist/ai/src/scheduler/index.js.map +1 -0
- package/dist/ai/src/session/index.d.ts +6 -0
- package/dist/ai/src/session/index.d.ts.map +1 -0
- package/dist/ai/src/session/index.js +6 -0
- package/dist/ai/src/session/index.js.map +1 -0
- package/dist/ai/src/session/session-manager.d.ts +380 -0
- package/dist/ai/src/session/session-manager.d.ts.map +1 -0
- package/dist/ai/src/session/session-manager.js +625 -0
- package/dist/ai/src/session/session-manager.js.map +1 -0
- package/dist/ai/src/skills/index.d.ts +10 -0
- package/dist/ai/src/skills/index.d.ts.map +1 -0
- package/dist/ai/src/skills/index.js +10 -0
- package/dist/ai/src/skills/index.js.map +1 -0
- package/dist/ai/src/skills/skill-registry.d.ts +181 -0
- package/dist/ai/src/skills/skill-registry.d.ts.map +1 -0
- package/dist/ai/src/skills/skill-registry.js +465 -0
- package/dist/ai/src/skills/skill-registry.js.map +1 -0
- package/dist/ai/src/telemetry/delegation-telemetry.d.ts.map +1 -1
- package/dist/ai/src/telemetry/delegation-telemetry.js +1 -0
- package/dist/ai/src/telemetry/delegation-telemetry.js.map +1 -1
- package/dist/ai/src/telemetry/runtime-telemetry-integration.d.ts +1 -1
- package/dist/ai/src/telemetry/runtime-telemetry-integration.d.ts.map +1 -1
- package/dist/ai/src/telemetry/runtime-telemetry-integration.js +3 -2
- package/dist/ai/src/telemetry/runtime-telemetry-integration.js.map +1 -1
- package/dist/ai/src/telemetry/telemetry-utils.d.ts.map +1 -1
- package/dist/ai/src/telemetry/telemetry-utils.js +1 -0
- package/dist/ai/src/telemetry/telemetry-utils.js.map +1 -1
- package/dist/ai/src/types/agent-capabilities.d.ts.map +1 -1
- package/dist/ai/src/types/agent-capabilities.js +1 -0
- package/dist/ai/src/types/agent-capabilities.js.map +1 -1
- package/dist/ai/src/types/delegation-contracts.d.ts +92 -0
- package/dist/ai/src/types/delegation-contracts.d.ts.map +1 -1
- package/dist/ai/src/types/delegation-contracts.js.map +1 -1
- package/dist/ai/src/validation-pipeline-integration.d.ts.map +1 -1
- package/dist/ai/src/validation-pipeline-integration.js +1 -2
- package/dist/ai/src/validation-pipeline-integration.js.map +1 -1
- package/dist/ai/src/verification/multi-modal-formatters.d.ts +1 -1
- package/dist/ai/src/verification/multi-modal-formatters.d.ts.map +1 -1
- package/dist/ai/src/verification/multi-modal-formatters.js +3 -2
- package/dist/ai/src/verification/multi-modal-formatters.js.map +1 -1
- package/dist/ai/src/verification/output-formatter.d.ts +1 -1
- package/dist/ai/src/verification/output-formatter.d.ts.map +1 -1
- package/dist/ai/src/verification/output-formatter.js +2 -1
- package/dist/ai/src/verification/output-formatter.js.map +1 -1
- package/dist/ai/src/verification/parser-integration.d.ts.map +1 -1
- package/dist/ai/src/verification/parser-integration.js.map +1 -1
- package/dist/ai/types/agent-capabilities.d.ts +7 -0
- package/dist/ai/types/agent-capabilities.d.ts.map +1 -1
- package/dist/ai/types/delegation-contracts.d.ts +75 -0
- package/dist/ai/types/delegation-contracts.d.ts.map +1 -1
- package/dist/ai/types/index.d.ts +3 -3
- package/dist/ai/types/index.d.ts.map +1 -1
- package/dist/ai/types/index.js.map +1 -1
- package/dist/ai/types/permission-tokens.d.ts +23 -0
- package/dist/ai/types/permission-tokens.d.ts.map +1 -1
- package/dist/ai/types/permission-tokens.js +65 -1
- package/dist/ai/types/permission-tokens.js.map +1 -1
- package/dist/ai/validation/validation-framework.d.ts.map +1 -1
- package/dist/ai/verification/policy-framework.d.ts +1 -1
- package/dist/ai/verification/policy-framework.d.ts.map +1 -1
- package/dist/ai/verification/policy-framework.js +4 -4
- package/dist/ai/verification/policy-framework.js.map +1 -1
- package/package.json +33 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Incident Response — Barrel Export
|
|
3
|
+
* @module plugins/incidents
|
|
4
|
+
*/
|
|
5
|
+
export { IncidentResponseManager, IncidentError } from './incident-response-manager.js';
|
|
6
|
+
export { DEFAULT_SLA, PLUGIN_INCIDENTS_SCHEMA_SQL } from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/ai/src/plugins/incidents/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAmBxF,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Incident Response SLA — Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Central type registry for the incident response system.
|
|
5
|
+
* Includes SQL DDL for persisting incidents to a relational store.
|
|
6
|
+
*
|
|
7
|
+
* SLA timers (measured from `createdAt`):
|
|
8
|
+
* critical (CVSS ≥9.0) — 24 hours
|
|
9
|
+
* high (CVSS 7.0–8.9) — 48 hours
|
|
10
|
+
* medium (CVSS 4.0–6.9) — 7 days
|
|
11
|
+
* low (CVSS 0.1–3.9) — 30 days
|
|
12
|
+
*
|
|
13
|
+
* @module plugins/incidents/types
|
|
14
|
+
* @version 1.0.0
|
|
15
|
+
* @date 2026-02-28
|
|
16
|
+
* @license MIT
|
|
17
|
+
*/
|
|
18
|
+
/** Severity aligned with CVSS v3.1 qualitative scale */
|
|
19
|
+
export type IncidentSeverity = 'critical' | 'high' | 'medium' | 'low' | 'informational';
|
|
20
|
+
/** Lifecycle status of a plugin security incident */
|
|
21
|
+
export type IncidentStatus = 'open' | 'acknowledged' | 'in_progress' | 'resolved' | 'closed' | 'sla_breached';
|
|
22
|
+
/** SLA response deadlines in milliseconds per severity */
|
|
23
|
+
export interface SlaConfig {
|
|
24
|
+
/** Max ms to resolve a critical incident (default 24h) */
|
|
25
|
+
criticalMs: number;
|
|
26
|
+
/** Max ms to resolve a high incident (default 48h) */
|
|
27
|
+
highMs: number;
|
|
28
|
+
/** Max ms to resolve a medium incident (default 7d) */
|
|
29
|
+
mediumMs: number;
|
|
30
|
+
/** Max ms to resolve a low incident (default 30d) */
|
|
31
|
+
lowMs: number;
|
|
32
|
+
}
|
|
33
|
+
/** Default SLA configuration */
|
|
34
|
+
export declare const DEFAULT_SLA: SlaConfig;
|
|
35
|
+
/** A single plugin security incident */
|
|
36
|
+
export interface Incident {
|
|
37
|
+
/** Unique UUID for this incident */
|
|
38
|
+
id: string;
|
|
39
|
+
/** Canonical plugin identifier (e.g. "author/plugin-name") */
|
|
40
|
+
pluginId: string;
|
|
41
|
+
/** Human-readable title */
|
|
42
|
+
title: string;
|
|
43
|
+
/** Detailed description of the vulnerability or issue */
|
|
44
|
+
description: string;
|
|
45
|
+
/** CVSS v3.1 numeric score (0.0 – 10.0) */
|
|
46
|
+
cvssScore: number;
|
|
47
|
+
/** Qualitative severity derived from cvssScore */
|
|
48
|
+
severity: IncidentSeverity;
|
|
49
|
+
/** CVE identifier(s), if applicable */
|
|
50
|
+
cveIds: string[];
|
|
51
|
+
/** Current lifecycle status */
|
|
52
|
+
status: IncidentStatus;
|
|
53
|
+
/** ISO-8601 timestamp when the incident was reported */
|
|
54
|
+
createdAt: string;
|
|
55
|
+
/** ISO-8601 timestamp when status changed to 'acknowledged' (or null) */
|
|
56
|
+
acknowledgedAt: string | null;
|
|
57
|
+
/** ISO-8601 timestamp when status changed to 'resolved' or 'closed' */
|
|
58
|
+
resolvedAt: string | null;
|
|
59
|
+
/** ISO-8601 deadline computed from createdAt + SLA for this severity */
|
|
60
|
+
slaDeadline: string;
|
|
61
|
+
/** Whether the plugin was automatically disabled due to CVSS ≥9.0 */
|
|
62
|
+
autoDisabled: boolean;
|
|
63
|
+
/** Assigned responder (name or email) */
|
|
64
|
+
assignee: string | null;
|
|
65
|
+
/** Free-text resolution notes populated on close */
|
|
66
|
+
resolution: string | null;
|
|
67
|
+
/** GitHub issue URL if one was created */
|
|
68
|
+
githubIssueUrl: string | null;
|
|
69
|
+
/** GitHub Security Advisory URL if one was created */
|
|
70
|
+
githubAdvisoryUrl: string | null;
|
|
71
|
+
/** Arbitrary metadata (reporter info, affected versions, etc.) */
|
|
72
|
+
metadata: Record<string, unknown>;
|
|
73
|
+
}
|
|
74
|
+
/** Input to create a new incident */
|
|
75
|
+
export interface CreateIncidentInput {
|
|
76
|
+
/** Plugin identifier */
|
|
77
|
+
pluginId: string;
|
|
78
|
+
/** Short title */
|
|
79
|
+
title: string;
|
|
80
|
+
/** Detailed description */
|
|
81
|
+
description: string;
|
|
82
|
+
/** CVSS v3.1 score */
|
|
83
|
+
cvssScore: number;
|
|
84
|
+
/** CVE IDs (optional) */
|
|
85
|
+
cveIds?: string[];
|
|
86
|
+
/** Arbitrary additional metadata */
|
|
87
|
+
metadata?: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
/** Input to acknowledge an incident */
|
|
90
|
+
export interface AcknowledgeIncidentInput {
|
|
91
|
+
/** Incident UUID */
|
|
92
|
+
id: string;
|
|
93
|
+
/** Person or system acknowledging */
|
|
94
|
+
assignee: string;
|
|
95
|
+
}
|
|
96
|
+
/** Input to resolve or close an incident */
|
|
97
|
+
export interface ResolveIncidentInput {
|
|
98
|
+
/** Incident UUID */
|
|
99
|
+
id: string;
|
|
100
|
+
/** Human-readable resolution summary */
|
|
101
|
+
resolution: string;
|
|
102
|
+
/** 'resolved' = fix deployed; 'closed' = won't fix / false positive */
|
|
103
|
+
finalStatus?: 'resolved' | 'closed';
|
|
104
|
+
}
|
|
105
|
+
/** Options for listing incidents */
|
|
106
|
+
export interface ListIncidentsOptions {
|
|
107
|
+
/** Filter by plugin */
|
|
108
|
+
pluginId?: string;
|
|
109
|
+
/** Filter by status */
|
|
110
|
+
status?: IncidentStatus | IncidentStatus[];
|
|
111
|
+
/** Filter by severity */
|
|
112
|
+
severity?: IncidentSeverity | IncidentSeverity[];
|
|
113
|
+
/** Include only SLA-breached incidents */
|
|
114
|
+
slaBreached?: boolean;
|
|
115
|
+
/** Page number (1-based, default 1) */
|
|
116
|
+
page?: number;
|
|
117
|
+
/** Page size (default 20, max 100) */
|
|
118
|
+
pageSize?: number;
|
|
119
|
+
}
|
|
120
|
+
/** Paginated incident listing */
|
|
121
|
+
export interface IncidentPage {
|
|
122
|
+
items: Incident[];
|
|
123
|
+
total: number;
|
|
124
|
+
page: number;
|
|
125
|
+
pageSize: number;
|
|
126
|
+
hasMore: boolean;
|
|
127
|
+
}
|
|
128
|
+
/** Payload passed to email notifier */
|
|
129
|
+
export interface EmailNotificationPayload {
|
|
130
|
+
incident: Incident;
|
|
131
|
+
/** List of affected user emails to notify */
|
|
132
|
+
affectedUsers: string[];
|
|
133
|
+
/** Email subject */
|
|
134
|
+
subject: string;
|
|
135
|
+
/** Plain-text body */
|
|
136
|
+
body: string;
|
|
137
|
+
}
|
|
138
|
+
/** Payload passed to GitHub issue creator */
|
|
139
|
+
export interface GithubIssuePayload {
|
|
140
|
+
incident: Incident;
|
|
141
|
+
/** Repo where the issue should be filed (e.g. "dcyfr/dcyfr-plugins") */
|
|
142
|
+
repo: string;
|
|
143
|
+
/** GitHub issue title */
|
|
144
|
+
title: string;
|
|
145
|
+
/** Markdown body */
|
|
146
|
+
body: string;
|
|
147
|
+
/** Label names to apply */
|
|
148
|
+
labels: string[];
|
|
149
|
+
}
|
|
150
|
+
/** Payload passed to GitHub Security Advisory creator */
|
|
151
|
+
export interface GithubAdvisoryPayload {
|
|
152
|
+
incident: Incident;
|
|
153
|
+
repo: string;
|
|
154
|
+
/** Advisory summary (≤ 128 chars) */
|
|
155
|
+
summary: string;
|
|
156
|
+
/** Full description in Markdown */
|
|
157
|
+
description: string;
|
|
158
|
+
/** CVSS vector string (optional) */
|
|
159
|
+
cvssVectorString?: string;
|
|
160
|
+
/** GHSA severity mapping */
|
|
161
|
+
ghsaSeverity: 'critical' | 'high' | 'medium' | 'low';
|
|
162
|
+
}
|
|
163
|
+
/** Payload passed to Axiom alert sender */
|
|
164
|
+
export interface AxiomAlertPayload {
|
|
165
|
+
incident: Incident;
|
|
166
|
+
alertType: 'sla_breach' | 'auto_disable' | 'new_critical';
|
|
167
|
+
message: string;
|
|
168
|
+
}
|
|
169
|
+
/** Pluggable email notifier — inject your provider (SendGrid, SES, etc.) */
|
|
170
|
+
export interface EmailNotifier {
|
|
171
|
+
send(payload: EmailNotificationPayload): Promise<void>;
|
|
172
|
+
}
|
|
173
|
+
/** Pluggable GitHub client — inject real Octokit or a test double */
|
|
174
|
+
export interface GithubClient {
|
|
175
|
+
createIssue(payload: GithubIssuePayload): Promise<string | null>;
|
|
176
|
+
createSecurityAdvisory(payload: GithubAdvisoryPayload): Promise<string | null>;
|
|
177
|
+
}
|
|
178
|
+
/** Pluggable Axiom logger — inject real Axiom client or a test double */
|
|
179
|
+
export interface AxiomLogger {
|
|
180
|
+
logAlert(payload: AxiomAlertPayload): Promise<void>;
|
|
181
|
+
}
|
|
182
|
+
export declare const PLUGIN_INCIDENTS_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS plugin_incidents (\n id TEXT PRIMARY KEY,\n plugin_id TEXT NOT NULL,\n title TEXT NOT NULL,\n description TEXT NOT NULL,\n cvss_score REAL NOT NULL,\n severity TEXT NOT NULL,\n cve_ids TEXT NOT NULL DEFAULT '[]',\n status TEXT NOT NULL DEFAULT 'open',\n created_at TEXT NOT NULL,\n acknowledged_at TEXT,\n resolved_at TEXT,\n sla_deadline TEXT NOT NULL,\n auto_disabled INTEGER NOT NULL DEFAULT 0,\n assignee TEXT,\n resolution TEXT,\n github_issue_url TEXT,\n github_advisory_url TEXT,\n metadata TEXT NOT NULL DEFAULT '{}'\n);\n\nCREATE INDEX IF NOT EXISTS idx_incidents_plugin_id ON plugin_incidents (plugin_id);\nCREATE INDEX IF NOT EXISTS idx_incidents_status ON plugin_incidents (status);\nCREATE INDEX IF NOT EXISTS idx_incidents_severity ON plugin_incidents (severity);\nCREATE INDEX IF NOT EXISTS idx_incidents_sla ON plugin_incidents (sla_deadline);\n";
|
|
183
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../packages/ai/src/plugins/incidents/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,eAAe,CAAC;AAExF,qDAAqD;AACrD,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,cAAc,GACd,aAAa,GACb,UAAU,GACV,QAAQ,GACR,cAAc,CAAC;AAMnB,0DAA0D;AAC1D,MAAM,WAAW,SAAS;IACxB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,gCAAgC;AAChC,eAAO,MAAM,WAAW,EAAE,SAKhB,CAAC;AAMX,wCAAwC;AACxC,MAAM,WAAW,QAAQ;IACvB,oCAAoC;IACpC,EAAE,EA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0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Incident Response SLA — Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Central type registry for the incident response system.
|
|
5
|
+
* Includes SQL DDL for persisting incidents to a relational store.
|
|
6
|
+
*
|
|
7
|
+
* SLA timers (measured from `createdAt`):
|
|
8
|
+
* critical (CVSS ≥9.0) — 24 hours
|
|
9
|
+
* high (CVSS 7.0–8.9) — 48 hours
|
|
10
|
+
* medium (CVSS 4.0–6.9) — 7 days
|
|
11
|
+
* low (CVSS 0.1–3.9) — 30 days
|
|
12
|
+
*
|
|
13
|
+
* @module plugins/incidents/types
|
|
14
|
+
* @version 1.0.0
|
|
15
|
+
* @date 2026-02-28
|
|
16
|
+
* @license MIT
|
|
17
|
+
*/
|
|
18
|
+
/** Default SLA configuration */
|
|
19
|
+
export const DEFAULT_SLA = {
|
|
20
|
+
criticalMs: 24 * 60 * 60 * 1000, // 24 hours
|
|
21
|
+
highMs: 48 * 60 * 60 * 1000, // 48 hours
|
|
22
|
+
mediumMs: 7 * 24 * 60 * 60 * 1000, // 7 days
|
|
23
|
+
lowMs: 30 * 24 * 60 * 60 * 1000, // 30 days
|
|
24
|
+
};
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// SQL DDL
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
export const PLUGIN_INCIDENTS_SCHEMA_SQL = /* sql */ `
|
|
29
|
+
CREATE TABLE IF NOT EXISTS plugin_incidents (
|
|
30
|
+
id TEXT PRIMARY KEY,
|
|
31
|
+
plugin_id TEXT NOT NULL,
|
|
32
|
+
title TEXT NOT NULL,
|
|
33
|
+
description TEXT NOT NULL,
|
|
34
|
+
cvss_score REAL NOT NULL,
|
|
35
|
+
severity TEXT NOT NULL,
|
|
36
|
+
cve_ids TEXT NOT NULL DEFAULT '[]',
|
|
37
|
+
status TEXT NOT NULL DEFAULT 'open',
|
|
38
|
+
created_at TEXT NOT NULL,
|
|
39
|
+
acknowledged_at TEXT,
|
|
40
|
+
resolved_at TEXT,
|
|
41
|
+
sla_deadline TEXT NOT NULL,
|
|
42
|
+
auto_disabled INTEGER NOT NULL DEFAULT 0,
|
|
43
|
+
assignee TEXT,
|
|
44
|
+
resolution TEXT,
|
|
45
|
+
github_issue_url TEXT,
|
|
46
|
+
github_advisory_url TEXT,
|
|
47
|
+
metadata TEXT NOT NULL DEFAULT '{}'
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
CREATE INDEX IF NOT EXISTS idx_incidents_plugin_id ON plugin_incidents (plugin_id);
|
|
51
|
+
CREATE INDEX IF NOT EXISTS idx_incidents_status ON plugin_incidents (status);
|
|
52
|
+
CREATE INDEX IF NOT EXISTS idx_incidents_severity ON plugin_incidents (severity);
|
|
53
|
+
CREATE INDEX IF NOT EXISTS idx_incidents_sla ON plugin_incidents (sla_deadline);
|
|
54
|
+
`;
|
|
55
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../packages/ai/src/plugins/incidents/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAkCH,gCAAgC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAc;IACpC,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAM,WAAW;IAChD,MAAM,EAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAM,WAAW;IAChD,QAAQ,EAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,SAAS;IAC9C,KAAK,EAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAC,UAAU;CACvC,CAAC;AAsLX,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BnD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Permissions System
|
|
3
|
+
*
|
|
4
|
+
* Exports all types, validators, enforcers, attenuators, and audit loggers
|
|
5
|
+
* for the DCYFR plugin permission model.
|
|
6
|
+
*
|
|
7
|
+
* @module plugins/permissions
|
|
8
|
+
*/
|
|
9
|
+
export type { FilesystemPermissions, NetworkPermissions, ExecutionPermissions, McpPermissions, DataPermissions, PluginPermissions, PermissionViolation, PermissionCheckResult, AttenuatedPermissions, PermissionAuditEvent, PermissionAuditEventType, } from './types.js';
|
|
10
|
+
export { createDenyAllPermissions, createAllowAllPermissions } from './types.js';
|
|
11
|
+
export { PluginPermissionValidator } from './plugin-permission-validator.js';
|
|
12
|
+
export { PermissionDeniedError, PermissionEnforcer, } from './permission-enforcer.js';
|
|
13
|
+
export type { EnforcementContext, RealFs, EnforcedFsApis, EnforcedFetch, EnforcedExec, } from './permission-enforcer.js';
|
|
14
|
+
export { attenuatePermissions, isSubsetOf } from './permission-attenuator.js';
|
|
15
|
+
export { PermissionAuditLogger } from './permission-audit-logger.js';
|
|
16
|
+
export type { PermissionAuditLoggerConfig, AuditLogResult, } from './permission-audit-logger.js';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/ai/src/plugins/permissions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,kBAAkB,EAClB,MAAM,EACN,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EACV,2BAA2B,EAC3B,cAAc,GACf,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Permissions System
|
|
3
|
+
*
|
|
4
|
+
* Exports all types, validators, enforcers, attenuators, and audit loggers
|
|
5
|
+
* for the DCYFR plugin permission model.
|
|
6
|
+
*
|
|
7
|
+
* @module plugins/permissions
|
|
8
|
+
*/
|
|
9
|
+
export { createDenyAllPermissions, createAllowAllPermissions } from './types.js';
|
|
10
|
+
export { PluginPermissionValidator } from './plugin-permission-validator.js';
|
|
11
|
+
export { PermissionDeniedError, PermissionEnforcer, } from './permission-enforcer.js';
|
|
12
|
+
export { attenuatePermissions, isSubsetOf } from './permission-attenuator.js';
|
|
13
|
+
export { PermissionAuditLogger } from './permission-audit-logger.js';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/ai/src/plugins/permissions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permission Attenuation
|
|
3
|
+
*
|
|
4
|
+
* Implements the principle that a delegating agent can only grant a
|
|
5
|
+
* sub-agent permissions it already holds. Narrows permissions at the
|
|
6
|
+
* point of delegation, producing an `AttenuatedPermissions` record.
|
|
7
|
+
*
|
|
8
|
+
* Compatible with the delegation framework's security middleware chain.
|
|
9
|
+
*
|
|
10
|
+
* @module plugins/permissions/permission-attenuator
|
|
11
|
+
* @version 1.0.0
|
|
12
|
+
* @date 2026-02-28
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
import type { PluginPermissions, AttenuatedPermissions } from './types.js';
|
|
16
|
+
/**
|
|
17
|
+
* Attenuate `requested` permissions against `granted` (the parent's actual
|
|
18
|
+
* permissions). The result is guaranteed to be a strict subset of `granted`.
|
|
19
|
+
*
|
|
20
|
+
* @param requested - Permissions the plugin wants to delegate downstream
|
|
21
|
+
* @param granted - Permissions the plugin currently holds
|
|
22
|
+
*/
|
|
23
|
+
export declare function attenuatePermissions(requested: PluginPermissions, granted: PluginPermissions): AttenuatedPermissions;
|
|
24
|
+
/**
|
|
25
|
+
* Check whether `subset` is a strict subset of `superset`.
|
|
26
|
+
* Returns `true` when every capability in `subset` is also present in `superset`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isSubsetOf(subset: PluginPermissions, superset: PluginPermissions): boolean;
|
|
29
|
+
//# sourceMappingURL=permission-attenuator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-attenuator.d.ts","sourceRoot":"","sources":["../../../../../packages/ai/src/plugins/permissions/permission-attenuator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EACV,iBAAiB,EAMjB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AA2KpB;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,iBAAiB,GACzB,qBAAqB,CA4BvB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,iBAAiB,GAC1B,OAAO,CAIT"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permission Attenuation
|
|
3
|
+
*
|
|
4
|
+
* Implements the principle that a delegating agent can only grant a
|
|
5
|
+
* sub-agent permissions it already holds. Narrows permissions at the
|
|
6
|
+
* point of delegation, producing an `AttenuatedPermissions` record.
|
|
7
|
+
*
|
|
8
|
+
* Compatible with the delegation framework's security middleware chain.
|
|
9
|
+
*
|
|
10
|
+
* @module plugins/permissions/permission-attenuator
|
|
11
|
+
* @version 1.0.0
|
|
12
|
+
* @date 2026-02-28
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
import { matchesGlob } from 'node:path';
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Intersection helpers (narrow A ∩ B)
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
/**
|
|
20
|
+
* Return only those patterns in `requested` that are covered by
|
|
21
|
+
* at least one pattern in `granted`. "Covered" = every path that
|
|
22
|
+
* matches `req` also matches at least one pattern in `granted`.
|
|
23
|
+
*
|
|
24
|
+
* For simplicity we use direct containment: a pattern is retained if it
|
|
25
|
+
* is equal to a granted pattern or if one of the granted patterns is the
|
|
26
|
+
* wildcard `**` (match all).
|
|
27
|
+
*/
|
|
28
|
+
function intersectGlobs(requested, granted) {
|
|
29
|
+
if (granted.includes('**'))
|
|
30
|
+
return requested;
|
|
31
|
+
return requested.filter((req) => granted.some((g) => {
|
|
32
|
+
if (g === req)
|
|
33
|
+
return true;
|
|
34
|
+
// If granted pattern ends with /** try to see if requested is a sub-path
|
|
35
|
+
try {
|
|
36
|
+
return matchesGlob(req, g);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
function intersectFilesystem(requested, granted) {
|
|
44
|
+
const read = intersectGlobs(requested.read, granted.read);
|
|
45
|
+
const write = intersectGlobs(requested.write, granted.write);
|
|
46
|
+
const delete_ = intersectGlobs(requested.delete, granted.delete);
|
|
47
|
+
const removed = [];
|
|
48
|
+
for (const p of requested.read) {
|
|
49
|
+
if (!read.includes(p))
|
|
50
|
+
removed.push(`filesystem.read: ${p}`);
|
|
51
|
+
}
|
|
52
|
+
for (const p of requested.write) {
|
|
53
|
+
if (!write.includes(p))
|
|
54
|
+
removed.push(`filesystem.write: ${p}`);
|
|
55
|
+
}
|
|
56
|
+
for (const p of requested.delete) {
|
|
57
|
+
if (!delete_.includes(p))
|
|
58
|
+
removed.push(`filesystem.delete: ${p}`);
|
|
59
|
+
}
|
|
60
|
+
return { result: { read, write, delete: delete_ }, removed };
|
|
61
|
+
}
|
|
62
|
+
function intersectNetwork(requested, granted) {
|
|
63
|
+
const removed = [];
|
|
64
|
+
const allowed = requested.allowed && granted.allowed;
|
|
65
|
+
if (requested.allowed && !granted.allowed) {
|
|
66
|
+
removed.push('network.allowed');
|
|
67
|
+
}
|
|
68
|
+
// Intersect domain lists
|
|
69
|
+
let allowedDomains = requested.allowedDomains;
|
|
70
|
+
if (granted.allowedDomains.length > 0) {
|
|
71
|
+
allowedDomains = requested.allowedDomains.filter((d) => granted.allowedDomains.includes(d));
|
|
72
|
+
for (const d of requested.allowedDomains) {
|
|
73
|
+
if (!allowedDomains.includes(d))
|
|
74
|
+
removed.push(`network.allowedDomains: ${d}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Take the stricter (lower) request limit
|
|
78
|
+
let maxRequests;
|
|
79
|
+
if (requested.maxRequests === 0) {
|
|
80
|
+
maxRequests = granted.maxRequests;
|
|
81
|
+
}
|
|
82
|
+
else if (granted.maxRequests === 0) {
|
|
83
|
+
maxRequests = requested.maxRequests;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
maxRequests = Math.min(requested.maxRequests, granted.maxRequests);
|
|
87
|
+
}
|
|
88
|
+
if (requested.maxRequests === 0 && granted.maxRequests > 0) {
|
|
89
|
+
removed.push(`network.maxRequests: unlimited → ${granted.maxRequests}`);
|
|
90
|
+
}
|
|
91
|
+
return { result: { allowed, allowedDomains, maxRequests }, removed };
|
|
92
|
+
}
|
|
93
|
+
function intersectExecution(requested, granted) {
|
|
94
|
+
const removed = [];
|
|
95
|
+
const allowShellCommands = requested.allowShellCommands && granted.allowShellCommands;
|
|
96
|
+
if (requested.allowShellCommands && !granted.allowShellCommands) {
|
|
97
|
+
removed.push('execution.allowShellCommands');
|
|
98
|
+
}
|
|
99
|
+
const allowedCommands = granted.allowShellCommands
|
|
100
|
+
? requested.allowedCommands
|
|
101
|
+
: requested.allowedCommands.filter((c) => granted.allowedCommands.includes(c));
|
|
102
|
+
for (const c of requested.allowedCommands) {
|
|
103
|
+
if (!allowedCommands.includes(c))
|
|
104
|
+
removed.push(`execution.allowedCommands: ${c}`);
|
|
105
|
+
}
|
|
106
|
+
let maxProcesses;
|
|
107
|
+
if (requested.maxProcesses === 0) {
|
|
108
|
+
maxProcesses = granted.maxProcesses;
|
|
109
|
+
}
|
|
110
|
+
else if (granted.maxProcesses === 0) {
|
|
111
|
+
maxProcesses = requested.maxProcesses;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
maxProcesses = Math.min(requested.maxProcesses, granted.maxProcesses);
|
|
115
|
+
}
|
|
116
|
+
return { result: { allowShellCommands, allowedCommands, maxProcesses }, removed };
|
|
117
|
+
}
|
|
118
|
+
function intersectMcp(requested, granted) {
|
|
119
|
+
const removed = [];
|
|
120
|
+
// Merge deny lists (union)
|
|
121
|
+
const deniedServers = [...new Set([...requested.deniedServers, ...granted.deniedServers])];
|
|
122
|
+
// Intersect allow lists
|
|
123
|
+
let allowedServers;
|
|
124
|
+
if (granted.allowedServers.includes('*')) {
|
|
125
|
+
allowedServers = requested.allowedServers;
|
|
126
|
+
}
|
|
127
|
+
else if (requested.allowedServers.includes('*')) {
|
|
128
|
+
allowedServers = granted.allowedServers;
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
allowedServers = requested.allowedServers.filter((s) => granted.allowedServers.includes(s));
|
|
132
|
+
for (const s of requested.allowedServers) {
|
|
133
|
+
if (!allowedServers.includes(s))
|
|
134
|
+
removed.push(`mcp.allowedServers: ${s}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return { result: { allowedServers, deniedServers }, removed };
|
|
138
|
+
}
|
|
139
|
+
function intersectData(requested, granted) {
|
|
140
|
+
const removed = [];
|
|
141
|
+
const allowEnvironmentVars = requested.allowEnvironmentVars && granted.allowEnvironmentVars;
|
|
142
|
+
const allowSecretAccess = requested.allowSecretAccess && granted.allowSecretAccess;
|
|
143
|
+
if (requested.allowEnvironmentVars && !granted.allowEnvironmentVars) {
|
|
144
|
+
removed.push('data.allowEnvironmentVars');
|
|
145
|
+
}
|
|
146
|
+
if (requested.allowSecretAccess && !granted.allowSecretAccess) {
|
|
147
|
+
removed.push('data.allowSecretAccess');
|
|
148
|
+
}
|
|
149
|
+
return { result: { allowEnvironmentVars, allowSecretAccess }, removed };
|
|
150
|
+
}
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
// Public API
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
/**
|
|
155
|
+
* Attenuate `requested` permissions against `granted` (the parent's actual
|
|
156
|
+
* permissions). The result is guaranteed to be a strict subset of `granted`.
|
|
157
|
+
*
|
|
158
|
+
* @param requested - Permissions the plugin wants to delegate downstream
|
|
159
|
+
* @param granted - Permissions the plugin currently holds
|
|
160
|
+
*/
|
|
161
|
+
export function attenuatePermissions(requested, granted) {
|
|
162
|
+
const removedCapabilities = [];
|
|
163
|
+
const fs = intersectFilesystem(requested.filesystem, granted.filesystem);
|
|
164
|
+
const net = intersectNetwork(requested.network, granted.network);
|
|
165
|
+
const exec = intersectExecution(requested.execution, granted.execution);
|
|
166
|
+
const mcp = intersectMcp(requested.mcp, granted.mcp);
|
|
167
|
+
const data = intersectData(requested.data, granted.data);
|
|
168
|
+
removedCapabilities.push(...fs.removed, ...net.removed, ...exec.removed, ...mcp.removed, ...data.removed);
|
|
169
|
+
return {
|
|
170
|
+
original: granted,
|
|
171
|
+
attenuated: {
|
|
172
|
+
filesystem: fs.result,
|
|
173
|
+
network: net.result,
|
|
174
|
+
execution: exec.result,
|
|
175
|
+
mcp: mcp.result,
|
|
176
|
+
data: data.result,
|
|
177
|
+
},
|
|
178
|
+
removedCapabilities,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Check whether `subset` is a strict subset of `superset`.
|
|
183
|
+
* Returns `true` when every capability in `subset` is also present in `superset`.
|
|
184
|
+
*/
|
|
185
|
+
export function isSubsetOf(subset, superset) {
|
|
186
|
+
const result = attenuatePermissions(subset, superset);
|
|
187
|
+
// If attenuation removed nothing AND the sets match, subset ⊆ superset
|
|
188
|
+
return result.removedCapabilities.length === 0;
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=permission-attenuator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-attenuator.js","sourceRoot":"","sources":["../../../../../packages/ai/src/plugins/permissions/permission-attenuator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAWxC,8EAA8E;AAC9E,sCAAsC;AACtC,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,SAAS,cAAc,CAAC,SAAmB,EAAE,OAAiB;IAC5D,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7C,OAAO,SAAS,CAAC,MAAM,CAAC,CA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,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD,mBAAmB,CAAC,IAAI,CACtB,GAAG,EAAE,CAAC,OAAO,EACb,GAAG,GAAG,CAAC,OAAO,EACd,GAAG,IAAI,CAAC,OAAO,EACf,GAAG,GAAG,CAAC,OAAO,EACd,GAAG,IAAI,CAAC,OAAO,CAChB,CAAC;IAEF,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,UAAU,EAAE;YACV,UAAU,EAAE,EAAE,CAAC,MAAM;YACrB,OAAO,EAAE,GAAG,CAAC,MAAM;YACnB,SAAS,EAAE,IAAI,CAAC,MAAM;YACtB,GAAG,EAAE,GAAG,CAAC,MAAM;YACf,IAAI,EAAE,IAAI,CAAC,MAAM;SAClB;QACD,mBAAmB;KACpB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CACxB,MAAyB,EACzB,QAA2B;IAE3B,MAAM,MAAM,GAAG,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtD,uEAAuE;IACvE,OAAO,MAAM,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permission Audit Logger
|
|
3
|
+
*
|
|
4
|
+
* Logs permission events to Axiom (when configured) or to
|
|
5
|
+
* stdout/stderr as a fallback. Used by the enforcer and validator
|
|
6
|
+
* to create an immutable audit trail for each plugin execution.
|
|
7
|
+
*
|
|
8
|
+
* @module plugins/permissions/permission-audit-logger
|
|
9
|
+
* @version 1.0.0
|
|
10
|
+
* @date 2026-02-28
|
|
11
|
+
* @license MIT
|
|
12
|
+
*/
|
|
13
|
+
import type { PermissionAuditEvent } from './types.js';
|
|
14
|
+
/** Configuration for PermissionAuditLogger */
|
|
15
|
+
export interface PermissionAuditLoggerConfig {
|
|
16
|
+
/** Axiom dataset name. Defaults to `AXIOM_DATASET` env var. */
|
|
17
|
+
axiomDataset?: string;
|
|
18
|
+
/** Axiom API token. Defaults to `AXIOM_TOKEN` env var. */
|
|
19
|
+
axiomToken?: string;
|
|
20
|
+
/** When true, always log to stdout regardless of Axiom config. Default false. */
|
|
21
|
+
alwaysConsole?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Result of a log call (used for testing) */
|
|
24
|
+
export interface AuditLogResult {
|
|
25
|
+
/** Where the event was dispatched */
|
|
26
|
+
destination: 'axiom' | 'stdout' | 'stderr';
|
|
27
|
+
/** Whether the dispatch succeeded */
|
|
28
|
+
success: boolean;
|
|
29
|
+
/** Error message, if any */
|
|
30
|
+
error?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Logs permission audit events to Axiom or stdout.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const logger = new PermissionAuditLogger({ axiomDataset: 'dcyfr-plugins' });
|
|
38
|
+
* await logger.log({
|
|
39
|
+
* timestamp: new Date().toISOString(),
|
|
40
|
+
* eventType: 'permission_granted',
|
|
41
|
+
* pluginId: 'my-plugin',
|
|
42
|
+
* pluginVersion: '1.0.0',
|
|
43
|
+
* category: 'filesystem',
|
|
44
|
+
* action: 'read',
|
|
45
|
+
* resource: '/src/index.ts',
|
|
46
|
+
* granted: true,
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class PermissionAuditLogger {
|
|
51
|
+
private readonly dataset;
|
|
52
|
+
private readonly token;
|
|
53
|
+
private readonly alwaysConsole;
|
|
54
|
+
constructor(config?: PermissionAuditLoggerConfig);
|
|
55
|
+
/**
|
|
56
|
+
* Whether Axiom is configured and events will be sent there.
|
|
57
|
+
*/
|
|
58
|
+
get isAxiomEnabled(): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Log a single permission audit event.
|
|
61
|
+
* Returns a result object describing where the event was sent.
|
|
62
|
+
*/
|
|
63
|
+
log(event: PermissionAuditEvent): Promise<AuditLogResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Log multiple events in a single batch request (Axiom supports this).
|
|
66
|
+
*/
|
|
67
|
+
logBatch(events: PermissionAuditEvent[]): Promise<AuditLogResult[]>;
|
|
68
|
+
private writeToConsole;
|
|
69
|
+
private sendToAxiom;
|
|
70
|
+
private sendBatchToAxiom;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=permission-audit-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-audit-logger.d.ts","sourceRoot":"","sources":["../../../../../packages/ai/src/plugins/permissions/permission-audit-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,8CAA8C;AAC9C,MAAM,WAAW,2BAA2B;IAC1C,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,8CAA8C;AAC9C,MAAM,WAAW,cAAc;IAC7B,qCAAqC;IACrC,WAAW,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3C,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoBD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;gBAE5B,MAAM,CAAC,EAAE,2BAA2B;IAQhD;;OAEG;IACH,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED;;;OAGG;IACG,GAAG,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAgB/D;;OAEG;IACG,QAAQ,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAsBzE,OAAO,CAAC,cAAc;YASR,WAAW;YA8BX,gBAAgB;CAuC/B"}
|