promptspeak-mcp-server 0.1.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/README.md +98 -0
- package/dist/agents/database.d.ts +174 -0
- package/dist/agents/database.d.ts.map +1 -0
- package/dist/agents/database.js +1029 -0
- package/dist/agents/database.js.map +1 -0
- package/dist/agents/index.d.ts +13 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +20 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/integration.d.ts +75 -0
- package/dist/agents/integration.d.ts.map +1 -0
- package/dist/agents/integration.js +166 -0
- package/dist/agents/integration.js.map +1 -0
- package/dist/agents/proposal-manager.d.ts +137 -0
- package/dist/agents/proposal-manager.d.ts.map +1 -0
- package/dist/agents/proposal-manager.js +782 -0
- package/dist/agents/proposal-manager.js.map +1 -0
- package/dist/agents/registry.d.ts +168 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +716 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/templates/index.d.ts +50 -0
- package/dist/agents/templates/index.d.ts.map +1 -0
- package/dist/agents/templates/index.js +415 -0
- package/dist/agents/templates/index.js.map +1 -0
- package/dist/agents/tools.d.ts +156 -0
- package/dist/agents/tools.d.ts.map +1 -0
- package/dist/agents/tools.js +590 -0
- package/dist/agents/tools.js.map +1 -0
- package/dist/agents/types.d.ts +513 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +20 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/auth/api-key.d.ts +37 -0
- package/dist/auth/api-key.d.ts.map +1 -0
- package/dist/auth/api-key.js +202 -0
- package/dist/auth/api-key.js.map +1 -0
- package/dist/auth/index.d.ts +8 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +8 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/oauth.d.ts +125 -0
- package/dist/auth/oauth.d.ts.map +1 -0
- package/dist/auth/oauth.js +225 -0
- package/dist/auth/oauth.js.map +1 -0
- package/dist/boot-camp/boot-camp-controller.d.ts +185 -0
- package/dist/boot-camp/boot-camp-controller.d.ts.map +1 -0
- package/dist/boot-camp/boot-camp-controller.js +696 -0
- package/dist/boot-camp/boot-camp-controller.js.map +1 -0
- package/dist/boot-camp/database.d.ts +79 -0
- package/dist/boot-camp/database.d.ts.map +1 -0
- package/dist/boot-camp/database.js +594 -0
- package/dist/boot-camp/database.js.map +1 -0
- package/dist/boot-camp/index.d.ts +104 -0
- package/dist/boot-camp/index.d.ts.map +1 -0
- package/dist/boot-camp/index.js +140 -0
- package/dist/boot-camp/index.js.map +1 -0
- package/dist/boot-camp/phases/base-phase.d.ts +98 -0
- package/dist/boot-camp/phases/base-phase.d.ts.map +1 -0
- package/dist/boot-camp/phases/base-phase.js +170 -0
- package/dist/boot-camp/phases/base-phase.js.map +1 -0
- package/dist/boot-camp/phases/combat.d.ts +52 -0
- package/dist/boot-camp/phases/combat.d.ts.map +1 -0
- package/dist/boot-camp/phases/combat.js +413 -0
- package/dist/boot-camp/phases/combat.js.map +1 -0
- package/dist/boot-camp/phases/conditioning.d.ts +53 -0
- package/dist/boot-camp/phases/conditioning.d.ts.map +1 -0
- package/dist/boot-camp/phases/conditioning.js +354 -0
- package/dist/boot-camp/phases/conditioning.js.map +1 -0
- package/dist/boot-camp/phases/crucible.d.ts +52 -0
- package/dist/boot-camp/phases/crucible.d.ts.map +1 -0
- package/dist/boot-camp/phases/crucible.js +442 -0
- package/dist/boot-camp/phases/crucible.js.map +1 -0
- package/dist/boot-camp/phases/graduation.d.ts +52 -0
- package/dist/boot-camp/phases/graduation.d.ts.map +1 -0
- package/dist/boot-camp/phases/graduation.js +422 -0
- package/dist/boot-camp/phases/graduation.js.map +1 -0
- package/dist/boot-camp/phases/index.d.ts +14 -0
- package/dist/boot-camp/phases/index.d.ts.map +1 -0
- package/dist/boot-camp/phases/index.js +14 -0
- package/dist/boot-camp/phases/index.js.map +1 -0
- package/dist/boot-camp/phases/marksmanship.d.ts +50 -0
- package/dist/boot-camp/phases/marksmanship.d.ts.map +1 -0
- package/dist/boot-camp/phases/marksmanship.js +373 -0
- package/dist/boot-camp/phases/marksmanship.js.map +1 -0
- package/dist/boot-camp/phases/phase-factory.d.ts +24 -0
- package/dist/boot-camp/phases/phase-factory.d.ts.map +1 -0
- package/dist/boot-camp/phases/phase-factory.js +74 -0
- package/dist/boot-camp/phases/phase-factory.js.map +1 -0
- package/dist/boot-camp/phases/receiving.d.ts +49 -0
- package/dist/boot-camp/phases/receiving.d.ts.map +1 -0
- package/dist/boot-camp/phases/receiving.js +168 -0
- package/dist/boot-camp/phases/receiving.js.map +1 -0
- package/dist/boot-camp/swarm-integration.d.ts +164 -0
- package/dist/boot-camp/swarm-integration.d.ts.map +1 -0
- package/dist/boot-camp/swarm-integration.js +405 -0
- package/dist/boot-camp/swarm-integration.js.map +1 -0
- package/dist/boot-camp/tools.d.ts +718 -0
- package/dist/boot-camp/tools.d.ts.map +1 -0
- package/dist/boot-camp/tools.js +592 -0
- package/dist/boot-camp/tools.js.map +1 -0
- package/dist/boot-camp/types.d.ts +342 -0
- package/dist/boot-camp/types.d.ts.map +1 -0
- package/dist/boot-camp/types.js +179 -0
- package/dist/boot-camp/types.js.map +1 -0
- package/dist/core/config/env.d.ts +146 -0
- package/dist/core/config/env.d.ts.map +1 -0
- package/dist/core/config/env.js +230 -0
- package/dist/core/config/env.js.map +1 -0
- package/dist/core/config/index.d.ts +23 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +31 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/errors/base.d.ts +168 -0
- package/dist/core/errors/base.d.ts.map +1 -0
- package/dist/core/errors/base.js +195 -0
- package/dist/core/errors/base.js.map +1 -0
- package/dist/core/errors/codes.d.ts +170 -0
- package/dist/core/errors/codes.d.ts.map +1 -0
- package/dist/core/errors/codes.js +460 -0
- package/dist/core/errors/codes.js.map +1 -0
- package/dist/core/errors/index.d.ts +40 -0
- package/dist/core/errors/index.d.ts.map +1 -0
- package/dist/core/errors/index.js +79 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/errors/types.d.ts +708 -0
- package/dist/core/errors/types.d.ts.map +1 -0
- package/dist/core/errors/types.js +791 -0
- package/dist/core/errors/types.js.map +1 -0
- package/dist/core/http/http-client.d.ts +140 -0
- package/dist/core/http/http-client.d.ts.map +1 -0
- package/dist/core/http/http-client.js +278 -0
- package/dist/core/http/http-client.js.map +1 -0
- package/dist/core/http/index.d.ts +37 -0
- package/dist/core/http/index.d.ts.map +1 -0
- package/dist/core/http/index.js +41 -0
- package/dist/core/http/index.js.map +1 -0
- package/dist/core/http/retry-policy.d.ts +99 -0
- package/dist/core/http/retry-policy.d.ts.map +1 -0
- package/dist/core/http/retry-policy.js +152 -0
- package/dist/core/http/retry-policy.js.map +1 -0
- package/dist/core/logging/context.d.ts +84 -0
- package/dist/core/logging/context.d.ts.map +1 -0
- package/dist/core/logging/context.js +124 -0
- package/dist/core/logging/context.js.map +1 -0
- package/dist/core/logging/formatters.d.ts +48 -0
- package/dist/core/logging/formatters.d.ts.map +1 -0
- package/dist/core/logging/formatters.js +186 -0
- package/dist/core/logging/formatters.js.map +1 -0
- package/dist/core/logging/index.d.ts +49 -0
- package/dist/core/logging/index.d.ts.map +1 -0
- package/dist/core/logging/index.js +52 -0
- package/dist/core/logging/index.js.map +1 -0
- package/dist/core/logging/logger.d.ts +120 -0
- package/dist/core/logging/logger.d.ts.map +1 -0
- package/dist/core/logging/logger.js +213 -0
- package/dist/core/logging/logger.js.map +1 -0
- package/dist/core/logging/types.d.ts +64 -0
- package/dist/core/logging/types.d.ts.map +1 -0
- package/dist/core/logging/types.js +29 -0
- package/dist/core/logging/types.js.map +1 -0
- package/dist/core/patterns/index.d.ts +11 -0
- package/dist/core/patterns/index.d.ts.map +1 -0
- package/dist/core/patterns/index.js +11 -0
- package/dist/core/patterns/index.js.map +1 -0
- package/dist/core/patterns/singleton.d.ts +69 -0
- package/dist/core/patterns/singleton.d.ts.map +1 -0
- package/dist/core/patterns/singleton.js +115 -0
- package/dist/core/patterns/singleton.js.map +1 -0
- package/dist/core/result/batch.d.ts +190 -0
- package/dist/core/result/batch.d.ts.map +1 -0
- package/dist/core/result/batch.js +391 -0
- package/dist/core/result/batch.js.map +1 -0
- package/dist/core/result/builders.d.ts +310 -0
- package/dist/core/result/builders.d.ts.map +1 -0
- package/dist/core/result/builders.js +454 -0
- package/dist/core/result/builders.js.map +1 -0
- package/dist/core/result/index.d.ts +51 -0
- package/dist/core/result/index.d.ts.map +1 -0
- package/dist/core/result/index.js +83 -0
- package/dist/core/result/index.js.map +1 -0
- package/dist/core/result/mcp-adapter.d.ts +192 -0
- package/dist/core/result/mcp-adapter.d.ts.map +1 -0
- package/dist/core/result/mcp-adapter.js +255 -0
- package/dist/core/result/mcp-adapter.js.map +1 -0
- package/dist/core/result/types.d.ts +170 -0
- package/dist/core/result/types.d.ts.map +1 -0
- package/dist/core/result/types.js +21 -0
- package/dist/core/result/types.js.map +1 -0
- package/dist/core/security/index.d.ts +41 -0
- package/dist/core/security/index.d.ts.map +1 -0
- package/dist/core/security/index.js +43 -0
- package/dist/core/security/index.js.map +1 -0
- package/dist/core/security/redaction.d.ts +138 -0
- package/dist/core/security/redaction.d.ts.map +1 -0
- package/dist/core/security/redaction.js +295 -0
- package/dist/core/security/redaction.js.map +1 -0
- package/dist/core/security/secure-logging.d.ts +189 -0
- package/dist/core/security/secure-logging.d.ts.map +1 -0
- package/dist/core/security/secure-logging.js +253 -0
- package/dist/core/security/secure-logging.js.map +1 -0
- package/dist/core/types/http-types.d.ts +94 -0
- package/dist/core/types/http-types.d.ts.map +1 -0
- package/dist/core/types/http-types.js +36 -0
- package/dist/core/types/http-types.js.map +1 -0
- package/dist/core/types/id-generators.d.ts +69 -0
- package/dist/core/types/id-generators.d.ts.map +1 -0
- package/dist/core/types/id-generators.js +96 -0
- package/dist/core/types/id-generators.js.map +1 -0
- package/dist/core/types/index.d.ts +13 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/core/types/index.js +14 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/document/agent.d.ts +63 -0
- package/dist/document/agent.d.ts.map +1 -0
- package/dist/document/agent.js +245 -0
- package/dist/document/agent.js.map +1 -0
- package/dist/document/extractor.d.ts +158 -0
- package/dist/document/extractor.d.ts.map +1 -0
- package/dist/document/extractor.js +720 -0
- package/dist/document/extractor.js.map +1 -0
- package/dist/document/index.d.ts +16 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +22 -0
- package/dist/document/index.js.map +1 -0
- package/dist/document/merger.d.ts +59 -0
- package/dist/document/merger.d.ts.map +1 -0
- package/dist/document/merger.js +593 -0
- package/dist/document/merger.js.map +1 -0
- package/dist/document/parser.d.ts +67 -0
- package/dist/document/parser.d.ts.map +1 -0
- package/dist/document/parser.js +359 -0
- package/dist/document/parser.js.map +1 -0
- package/dist/document/tools.d.ts +14 -0
- package/dist/document/tools.d.ts.map +1 -0
- package/dist/document/tools.js +279 -0
- package/dist/document/tools.js.map +1 -0
- package/dist/document/types.d.ts +290 -0
- package/dist/document/types.d.ts.map +1 -0
- package/dist/document/types.js +12 -0
- package/dist/document/types.js.map +1 -0
- package/dist/drift/baseline.d.ts +65 -0
- package/dist/drift/baseline.d.ts.map +1 -0
- package/dist/drift/baseline.js +179 -0
- package/dist/drift/baseline.js.map +1 -0
- package/dist/drift/circuit-breaker.d.ts +91 -0
- package/dist/drift/circuit-breaker.d.ts.map +1 -0
- package/dist/drift/circuit-breaker.js +237 -0
- package/dist/drift/circuit-breaker.js.map +1 -0
- package/dist/drift/index.d.ts +161 -0
- package/dist/drift/index.d.ts.map +1 -0
- package/dist/drift/index.js +247 -0
- package/dist/drift/index.js.map +1 -0
- package/dist/drift/monitor.d.ts +115 -0
- package/dist/drift/monitor.d.ts.map +1 -0
- package/dist/drift/monitor.js +367 -0
- package/dist/drift/monitor.js.map +1 -0
- package/dist/drift/tripwire.d.ts +81 -0
- package/dist/drift/tripwire.d.ts.map +1 -0
- package/dist/drift/tripwire.js +196 -0
- package/dist/drift/tripwire.js.map +1 -0
- package/dist/fidelity/index.d.ts +12 -0
- package/dist/fidelity/index.d.ts.map +1 -0
- package/dist/fidelity/index.js +12 -0
- package/dist/fidelity/index.js.map +1 -0
- package/dist/fidelity/refresh-hooks.d.ts +75 -0
- package/dist/fidelity/refresh-hooks.d.ts.map +1 -0
- package/dist/fidelity/refresh-hooks.js +151 -0
- package/dist/fidelity/refresh-hooks.js.map +1 -0
- package/dist/gatekeeper/checklist-generator.d.ts +45 -0
- package/dist/gatekeeper/checklist-generator.d.ts.map +1 -0
- package/dist/gatekeeper/checklist-generator.js +336 -0
- package/dist/gatekeeper/checklist-generator.js.map +1 -0
- package/dist/gatekeeper/coverage.d.ts +28 -0
- package/dist/gatekeeper/coverage.d.ts.map +1 -0
- package/dist/gatekeeper/coverage.js +234 -0
- package/dist/gatekeeper/coverage.js.map +1 -0
- package/dist/gatekeeper/hold-manager.d.ts +174 -0
- package/dist/gatekeeper/hold-manager.d.ts.map +1 -0
- package/dist/gatekeeper/hold-manager.js +723 -0
- package/dist/gatekeeper/hold-manager.js.map +1 -0
- package/dist/gatekeeper/index.d.ts +244 -0
- package/dist/gatekeeper/index.d.ts.map +1 -0
- package/dist/gatekeeper/index.js +854 -0
- package/dist/gatekeeper/index.js.map +1 -0
- package/dist/gatekeeper/interceptor.d.ts +54 -0
- package/dist/gatekeeper/interceptor.d.ts.map +1 -0
- package/dist/gatekeeper/interceptor.js +217 -0
- package/dist/gatekeeper/interceptor.js.map +1 -0
- package/dist/gatekeeper/resolver.d.ts +53 -0
- package/dist/gatekeeper/resolver.d.ts.map +1 -0
- package/dist/gatekeeper/resolver.js +314 -0
- package/dist/gatekeeper/resolver.js.map +1 -0
- package/dist/gatekeeper/validator.d.ts +26 -0
- package/dist/gatekeeper/validator.d.ts.map +1 -0
- package/dist/gatekeeper/validator.js +686 -0
- package/dist/gatekeeper/validator.js.map +1 -0
- package/dist/government/adapters/base-adapter.d.ts +366 -0
- package/dist/government/adapters/base-adapter.d.ts.map +1 -0
- package/dist/government/adapters/base-adapter.js +598 -0
- package/dist/government/adapters/base-adapter.js.map +1 -0
- package/dist/government/adapters/federal-register-adapter.d.ts +327 -0
- package/dist/government/adapters/federal-register-adapter.d.ts.map +1 -0
- package/dist/government/adapters/federal-register-adapter.js +595 -0
- package/dist/government/adapters/federal-register-adapter.js.map +1 -0
- package/dist/government/adapters/regulations-adapter.d.ts +432 -0
- package/dist/government/adapters/regulations-adapter.d.ts.map +1 -0
- package/dist/government/adapters/regulations-adapter.js +727 -0
- package/dist/government/adapters/regulations-adapter.js.map +1 -0
- package/dist/government/adapters/sam-entity-adapter.d.ts +354 -0
- package/dist/government/adapters/sam-entity-adapter.d.ts.map +1 -0
- package/dist/government/adapters/sam-entity-adapter.js +599 -0
- package/dist/government/adapters/sam-entity-adapter.js.map +1 -0
- package/dist/government/adapters/sam-opportunities-adapter.d.ts +221 -0
- package/dist/government/adapters/sam-opportunities-adapter.d.ts.map +1 -0
- package/dist/government/adapters/sam-opportunities-adapter.js +538 -0
- package/dist/government/adapters/sam-opportunities-adapter.js.map +1 -0
- package/dist/government/adapters/usaspending-adapter.d.ts +390 -0
- package/dist/government/adapters/usaspending-adapter.d.ts.map +1 -0
- package/dist/government/adapters/usaspending-adapter.js +455 -0
- package/dist/government/adapters/usaspending-adapter.js.map +1 -0
- package/dist/government/index.d.ts +128 -0
- package/dist/government/index.d.ts.map +1 -0
- package/dist/government/index.js +183 -0
- package/dist/government/index.js.map +1 -0
- package/dist/government/mappers/symbol-mapper.d.ts +87 -0
- package/dist/government/mappers/symbol-mapper.d.ts.map +1 -0
- package/dist/government/mappers/symbol-mapper.js +647 -0
- package/dist/government/mappers/symbol-mapper.js.map +1 -0
- package/dist/handlers/index.d.ts +10 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +11 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/recon-tools.d.ts +364 -0
- package/dist/handlers/recon-tools.d.ts.map +1 -0
- package/dist/handlers/recon-tools.js +678 -0
- package/dist/handlers/recon-tools.js.map +1 -0
- package/dist/handlers/tool-dispatcher.d.ts +71 -0
- package/dist/handlers/tool-dispatcher.d.ts.map +1 -0
- package/dist/handlers/tool-dispatcher.js +114 -0
- package/dist/handlers/tool-dispatcher.js.map +1 -0
- package/dist/handlers/tool-registry.d.ts +76 -0
- package/dist/handlers/tool-registry.d.ts.map +1 -0
- package/dist/handlers/tool-registry.js +636 -0
- package/dist/handlers/tool-registry.js.map +1 -0
- package/dist/http/app.d.ts +24 -0
- package/dist/http/app.d.ts.map +1 -0
- package/dist/http/app.js +35 -0
- package/dist/http/app.js.map +1 -0
- package/dist/http/config.d.ts +42 -0
- package/dist/http/config.d.ts.map +1 -0
- package/dist/http/config.js +62 -0
- package/dist/http/config.js.map +1 -0
- package/dist/http/database/index.d.ts +49 -0
- package/dist/http/database/index.d.ts.map +1 -0
- package/dist/http/database/index.js +115 -0
- package/dist/http/database/index.js.map +1 -0
- package/dist/http/middleware/auth.d.ts +28 -0
- package/dist/http/middleware/auth.d.ts.map +1 -0
- package/dist/http/middleware/auth.js +157 -0
- package/dist/http/middleware/auth.js.map +1 -0
- package/dist/http/middleware/error-handler.d.ts +47 -0
- package/dist/http/middleware/error-handler.d.ts.map +1 -0
- package/dist/http/middleware/error-handler.js +213 -0
- package/dist/http/middleware/error-handler.js.map +1 -0
- package/dist/http/middleware/index.d.ts +38 -0
- package/dist/http/middleware/index.d.ts.map +1 -0
- package/dist/http/middleware/index.js +124 -0
- package/dist/http/middleware/index.js.map +1 -0
- package/dist/http/middleware/request-logger.d.ts +8 -0
- package/dist/http/middleware/request-logger.d.ts.map +1 -0
- package/dist/http/middleware/request-logger.js +58 -0
- package/dist/http/middleware/request-logger.js.map +1 -0
- package/dist/http/routes/agent-runtime.d.ts +9 -0
- package/dist/http/routes/agent-runtime.d.ts.map +1 -0
- package/dist/http/routes/agent-runtime.js +415 -0
- package/dist/http/routes/agent-runtime.js.map +1 -0
- package/dist/http/routes/agents.d.ts +9 -0
- package/dist/http/routes/agents.d.ts.map +1 -0
- package/dist/http/routes/agents.js +503 -0
- package/dist/http/routes/agents.js.map +1 -0
- package/dist/http/routes/broadcasts.d.ts +9 -0
- package/dist/http/routes/broadcasts.d.ts.map +1 -0
- package/dist/http/routes/broadcasts.js +223 -0
- package/dist/http/routes/broadcasts.js.map +1 -0
- package/dist/http/routes/dashboard.d.ts +9 -0
- package/dist/http/routes/dashboard.d.ts.map +1 -0
- package/dist/http/routes/dashboard.js +169 -0
- package/dist/http/routes/dashboard.js.map +1 -0
- package/dist/http/routes/ebay.d.ts +15 -0
- package/dist/http/routes/ebay.d.ts.map +1 -0
- package/dist/http/routes/ebay.js +242 -0
- package/dist/http/routes/ebay.js.map +1 -0
- package/dist/http/routes/health.d.ts +8 -0
- package/dist/http/routes/health.d.ts.map +1 -0
- package/dist/http/routes/health.js +66 -0
- package/dist/http/routes/health.js.map +1 -0
- package/dist/http/routes/index.d.ts +39 -0
- package/dist/http/routes/index.d.ts.map +1 -0
- package/dist/http/routes/index.js +89 -0
- package/dist/http/routes/index.js.map +1 -0
- package/dist/http/routes/missions.d.ts +9 -0
- package/dist/http/routes/missions.d.ts.map +1 -0
- package/dist/http/routes/missions.js +587 -0
- package/dist/http/routes/missions.js.map +1 -0
- package/dist/http/routes/openapi.d.ts +8 -0
- package/dist/http/routes/openapi.d.ts.map +1 -0
- package/dist/http/routes/openapi.js +76 -0
- package/dist/http/routes/openapi.js.map +1 -0
- package/dist/http/routes/symbols.d.ts +19 -0
- package/dist/http/routes/symbols.d.ts.map +1 -0
- package/dist/http/routes/symbols.js +219 -0
- package/dist/http/routes/symbols.js.map +1 -0
- package/dist/http/server-init.d.ts +69 -0
- package/dist/http/server-init.d.ts.map +1 -0
- package/dist/http/server-init.js +270 -0
- package/dist/http/server-init.js.map +1 -0
- package/dist/http/server.d.ts +14 -0
- package/dist/http/server.d.ts.map +1 -0
- package/dist/http/server.js +114 -0
- package/dist/http/server.js.map +1 -0
- package/dist/http/services/agent-runtime.d.ts +211 -0
- package/dist/http/services/agent-runtime.d.ts.map +1 -0
- package/dist/http/services/agent-runtime.js +603 -0
- package/dist/http/services/agent-runtime.js.map +1 -0
- package/dist/http/services/broadcasts.d.ts +142 -0
- package/dist/http/services/broadcasts.d.ts.map +1 -0
- package/dist/http/services/broadcasts.js +335 -0
- package/dist/http/services/broadcasts.js.map +1 -0
- package/dist/http/services/index.d.ts +10 -0
- package/dist/http/services/index.d.ts.map +1 -0
- package/dist/http/services/index.js +14 -0
- package/dist/http/services/index.js.map +1 -0
- package/dist/http/services/metrics.d.ts +144 -0
- package/dist/http/services/metrics.d.ts.map +1 -0
- package/dist/http/services/metrics.js +351 -0
- package/dist/http/services/metrics.js.map +1 -0
- package/dist/http/services/missions.d.ts +224 -0
- package/dist/http/services/missions.d.ts.map +1 -0
- package/dist/http/services/missions.js +701 -0
- package/dist/http/services/missions.js.map +1 -0
- package/dist/http/services/symbol.service.d.ts +62 -0
- package/dist/http/services/symbol.service.d.ts.map +1 -0
- package/dist/http/services/symbol.service.js +222 -0
- package/dist/http/services/symbol.service.js.map +1 -0
- package/dist/http/websocket/index.d.ts +50 -0
- package/dist/http/websocket/index.d.ts.map +1 -0
- package/dist/http/websocket/index.js +293 -0
- package/dist/http/websocket/index.js.map +1 -0
- package/dist/legal/__tests__/calendar-integration.test.d.ts +7 -0
- package/dist/legal/__tests__/calendar-integration.test.d.ts.map +1 -0
- package/dist/legal/__tests__/calendar-integration.test.js +643 -0
- package/dist/legal/__tests__/calendar-integration.test.js.map +1 -0
- package/dist/legal/batch-parser.d.ts +185 -0
- package/dist/legal/batch-parser.d.ts.map +1 -0
- package/dist/legal/batch-parser.js +348 -0
- package/dist/legal/batch-parser.js.map +1 -0
- package/dist/legal/calendar-integration.d.ts +209 -0
- package/dist/legal/calendar-integration.d.ts.map +1 -0
- package/dist/legal/calendar-integration.js +341 -0
- package/dist/legal/calendar-integration.js.map +1 -0
- package/dist/legal/calendar-tools.d.ts +39 -0
- package/dist/legal/calendar-tools.d.ts.map +1 -0
- package/dist/legal/calendar-tools.js +606 -0
- package/dist/legal/calendar-tools.js.map +1 -0
- package/dist/legal/calendar-types.d.ts +152 -0
- package/dist/legal/calendar-types.d.ts.map +1 -0
- package/dist/legal/calendar-types.js +88 -0
- package/dist/legal/calendar-types.js.map +1 -0
- package/dist/legal/citation-validator.d.ts +97 -0
- package/dist/legal/citation-validator.d.ts.map +1 -0
- package/dist/legal/citation-validator.js +1487 -0
- package/dist/legal/citation-validator.js.map +1 -0
- package/dist/legal/courtlistener-adapter.d.ts +156 -0
- package/dist/legal/courtlistener-adapter.d.ts.map +1 -0
- package/dist/legal/courtlistener-adapter.js +684 -0
- package/dist/legal/courtlistener-adapter.js.map +1 -0
- package/dist/legal/deadline-extractor.d.ts +71 -0
- package/dist/legal/deadline-extractor.d.ts.map +1 -0
- package/dist/legal/deadline-extractor.js +557 -0
- package/dist/legal/deadline-extractor.js.map +1 -0
- package/dist/legal/ical-generator.d.ts +83 -0
- package/dist/legal/ical-generator.d.ts.map +1 -0
- package/dist/legal/ical-generator.js +322 -0
- package/dist/legal/ical-generator.js.map +1 -0
- package/dist/legal/index.d.ts +17 -0
- package/dist/legal/index.d.ts.map +1 -0
- package/dist/legal/index.js +32 -0
- package/dist/legal/index.js.map +1 -0
- package/dist/legal/legal-preflight.d.ts +86 -0
- package/dist/legal/legal-preflight.d.ts.map +1 -0
- package/dist/legal/legal-preflight.js +442 -0
- package/dist/legal/legal-preflight.js.map +1 -0
- package/dist/legal/types.d.ts +303 -0
- package/dist/legal/types.d.ts.map +1 -0
- package/dist/legal/types.js +38 -0
- package/dist/legal/types.js.map +1 -0
- package/dist/multi_agent/__tests__/intent-tools.test.d.ts +7 -0
- package/dist/multi_agent/__tests__/intent-tools.test.d.ts.map +1 -0
- package/dist/multi_agent/__tests__/intent-tools.test.js +604 -0
- package/dist/multi_agent/__tests__/intent-tools.test.js.map +1 -0
- package/dist/multi_agent/agent-registry.d.ts +132 -0
- package/dist/multi_agent/agent-registry.d.ts.map +1 -0
- package/dist/multi_agent/agent-registry.js +311 -0
- package/dist/multi_agent/agent-registry.js.map +1 -0
- package/dist/multi_agent/boot-camp.d.ts +159 -0
- package/dist/multi_agent/boot-camp.d.ts.map +1 -0
- package/dist/multi_agent/boot-camp.js +463 -0
- package/dist/multi_agent/boot-camp.js.map +1 -0
- package/dist/multi_agent/container.d.ts +87 -0
- package/dist/multi_agent/container.d.ts.map +1 -0
- package/dist/multi_agent/container.js +99 -0
- package/dist/multi_agent/container.js.map +1 -0
- package/dist/multi_agent/index.d.ts +32 -0
- package/dist/multi_agent/index.d.ts.map +1 -0
- package/dist/multi_agent/index.js +67 -0
- package/dist/multi_agent/index.js.map +1 -0
- package/dist/multi_agent/intent-manager.d.ts +119 -0
- package/dist/multi_agent/intent-manager.d.ts.map +1 -0
- package/dist/multi_agent/intent-manager.js +571 -0
- package/dist/multi_agent/intent-manager.js.map +1 -0
- package/dist/multi_agent/intent-tools.d.ts +370 -0
- package/dist/multi_agent/intent-tools.d.ts.map +1 -0
- package/dist/multi_agent/intent-tools.js +661 -0
- package/dist/multi_agent/intent-tools.js.map +1 -0
- package/dist/multi_agent/intent-types.d.ts +435 -0
- package/dist/multi_agent/intent-types.d.ts.map +1 -0
- package/dist/multi_agent/intent-types.js +17 -0
- package/dist/multi_agent/intent-types.js.map +1 -0
- package/dist/multi_agent/lru-cache.d.ts +140 -0
- package/dist/multi_agent/lru-cache.d.ts.map +1 -0
- package/dist/multi_agent/lru-cache.js +310 -0
- package/dist/multi_agent/lru-cache.js.map +1 -0
- package/dist/multi_agent/mission.d.ts +151 -0
- package/dist/multi_agent/mission.d.ts.map +1 -0
- package/dist/multi_agent/mission.js +439 -0
- package/dist/multi_agent/mission.js.map +1 -0
- package/dist/multi_agent/tool-dispatcher.d.ts +325 -0
- package/dist/multi_agent/tool-dispatcher.d.ts.map +1 -0
- package/dist/multi_agent/tool-dispatcher.js +108 -0
- package/dist/multi_agent/tool-dispatcher.js.map +1 -0
- package/dist/multi_agent/tools.d.ts +543 -0
- package/dist/multi_agent/tools.d.ts.map +1 -0
- package/dist/multi_agent/tools.js +1081 -0
- package/dist/multi_agent/tools.js.map +1 -0
- package/dist/notifications/webhook-dispatcher.d.ts +98 -0
- package/dist/notifications/webhook-dispatcher.d.ts.map +1 -0
- package/dist/notifications/webhook-dispatcher.js +548 -0
- package/dist/notifications/webhook-dispatcher.js.map +1 -0
- package/dist/operator/config.d.ts +128 -0
- package/dist/operator/config.d.ts.map +1 -0
- package/dist/operator/config.js +309 -0
- package/dist/operator/config.js.map +1 -0
- package/dist/operator/index.d.ts +116 -0
- package/dist/operator/index.d.ts.map +1 -0
- package/dist/operator/index.js +207 -0
- package/dist/operator/index.js.map +1 -0
- package/dist/policies/loader.d.ts +120 -0
- package/dist/policies/loader.d.ts.map +1 -0
- package/dist/policies/loader.js +193 -0
- package/dist/policies/loader.js.map +1 -0
- package/dist/recon/agent/analyst.d.ts +159 -0
- package/dist/recon/agent/analyst.d.ts.map +1 -0
- package/dist/recon/agent/analyst.js +689 -0
- package/dist/recon/agent/analyst.js.map +1 -0
- package/dist/recon/agent/performer.d.ts +175 -0
- package/dist/recon/agent/performer.d.ts.map +1 -0
- package/dist/recon/agent/performer.js +367 -0
- package/dist/recon/agent/performer.js.map +1 -0
- package/dist/recon/agent/runtime.d.ts +184 -0
- package/dist/recon/agent/runtime.d.ts.map +1 -0
- package/dist/recon/agent/runtime.js +474 -0
- package/dist/recon/agent/runtime.js.map +1 -0
- package/dist/recon/agent/veto-gate.d.ts +167 -0
- package/dist/recon/agent/veto-gate.d.ts.map +1 -0
- package/dist/recon/agent/veto-gate.js +393 -0
- package/dist/recon/agent/veto-gate.js.map +1 -0
- package/dist/recon/chat/web-chat-adapter.d.ts +190 -0
- package/dist/recon/chat/web-chat-adapter.d.ts.map +1 -0
- package/dist/recon/chat/web-chat-adapter.js +368 -0
- package/dist/recon/chat/web-chat-adapter.js.map +1 -0
- package/dist/recon/delivery/base-channel.d.ts +130 -0
- package/dist/recon/delivery/base-channel.d.ts.map +1 -0
- package/dist/recon/delivery/base-channel.js +260 -0
- package/dist/recon/delivery/base-channel.js.map +1 -0
- package/dist/recon/delivery/callback-channel.d.ts +156 -0
- package/dist/recon/delivery/callback-channel.d.ts.map +1 -0
- package/dist/recon/delivery/callback-channel.js +321 -0
- package/dist/recon/delivery/callback-channel.js.map +1 -0
- package/dist/recon/delivery/console-channel.d.ts +109 -0
- package/dist/recon/delivery/console-channel.d.ts.map +1 -0
- package/dist/recon/delivery/console-channel.js +311 -0
- package/dist/recon/delivery/console-channel.js.map +1 -0
- package/dist/recon/delivery/delivery-manager.d.ts +129 -0
- package/dist/recon/delivery/delivery-manager.d.ts.map +1 -0
- package/dist/recon/delivery/delivery-manager.js +450 -0
- package/dist/recon/delivery/delivery-manager.js.map +1 -0
- package/dist/recon/delivery/index.d.ts +52 -0
- package/dist/recon/delivery/index.d.ts.map +1 -0
- package/dist/recon/delivery/index.js +83 -0
- package/dist/recon/delivery/index.js.map +1 -0
- package/dist/recon/delivery/types.d.ts +191 -0
- package/dist/recon/delivery/types.d.ts.map +1 -0
- package/dist/recon/delivery/types.js +37 -0
- package/dist/recon/delivery/types.js.map +1 -0
- package/dist/recon/index.d.ts +86 -0
- package/dist/recon/index.d.ts.map +1 -0
- package/dist/recon/index.js +189 -0
- package/dist/recon/index.js.map +1 -0
- package/dist/recon/persistence/index.d.ts +103 -0
- package/dist/recon/persistence/index.d.ts.map +1 -0
- package/dist/recon/persistence/index.js +118 -0
- package/dist/recon/persistence/index.js.map +1 -0
- package/dist/recon/persistence/storage.d.ts +166 -0
- package/dist/recon/persistence/storage.d.ts.map +1 -0
- package/dist/recon/persistence/storage.js +793 -0
- package/dist/recon/persistence/storage.js.map +1 -0
- package/dist/recon/persistence/types.d.ts +254 -0
- package/dist/recon/persistence/types.d.ts.map +1 -0
- package/dist/recon/persistence/types.js +130 -0
- package/dist/recon/persistence/types.js.map +1 -0
- package/dist/recon/ralph-loop/executor.d.ts +122 -0
- package/dist/recon/ralph-loop/executor.d.ts.map +1 -0
- package/dist/recon/ralph-loop/executor.js +426 -0
- package/dist/recon/ralph-loop/executor.js.map +1 -0
- package/dist/recon/ralph-loop/scheduler.d.ts +145 -0
- package/dist/recon/ralph-loop/scheduler.d.ts.map +1 -0
- package/dist/recon/ralph-loop/scheduler.js +244 -0
- package/dist/recon/ralph-loop/scheduler.js.map +1 -0
- package/dist/recon/reports/formatters/index.d.ts +13 -0
- package/dist/recon/reports/formatters/index.d.ts.map +1 -0
- package/dist/recon/reports/formatters/index.js +13 -0
- package/dist/recon/reports/formatters/index.js.map +1 -0
- package/dist/recon/reports/formatters/json-formatter.d.ts +39 -0
- package/dist/recon/reports/formatters/json-formatter.d.ts.map +1 -0
- package/dist/recon/reports/formatters/json-formatter.js +260 -0
- package/dist/recon/reports/formatters/json-formatter.js.map +1 -0
- package/dist/recon/reports/formatters/markdown-formatter.d.ts +16 -0
- package/dist/recon/reports/formatters/markdown-formatter.d.ts.map +1 -0
- package/dist/recon/reports/formatters/markdown-formatter.js +332 -0
- package/dist/recon/reports/formatters/markdown-formatter.js.map +1 -0
- package/dist/recon/reports/formatters/text-formatter.d.ts +29 -0
- package/dist/recon/reports/formatters/text-formatter.d.ts.map +1 -0
- package/dist/recon/reports/formatters/text-formatter.js +360 -0
- package/dist/recon/reports/formatters/text-formatter.js.map +1 -0
- package/dist/recon/reports/index.d.ts +31 -0
- package/dist/recon/reports/index.d.ts.map +1 -0
- package/dist/recon/reports/index.js +33 -0
- package/dist/recon/reports/index.js.map +1 -0
- package/dist/recon/reports/report-generator.d.ts +147 -0
- package/dist/recon/reports/report-generator.d.ts.map +1 -0
- package/dist/recon/reports/report-generator.js +434 -0
- package/dist/recon/reports/report-generator.js.map +1 -0
- package/dist/recon/reports/sections/constraint-violations.d.ts +22 -0
- package/dist/recon/reports/sections/constraint-violations.d.ts.map +1 -0
- package/dist/recon/reports/sections/constraint-violations.js +383 -0
- package/dist/recon/reports/sections/constraint-violations.js.map +1 -0
- package/dist/recon/reports/sections/drift-analysis.d.ts +22 -0
- package/dist/recon/reports/sections/drift-analysis.d.ts.map +1 -0
- package/dist/recon/reports/sections/drift-analysis.js +270 -0
- package/dist/recon/reports/sections/drift-analysis.js.map +1 -0
- package/dist/recon/reports/sections/index.d.ts +23 -0
- package/dist/recon/reports/sections/index.d.ts.map +1 -0
- package/dist/recon/reports/sections/index.js +18 -0
- package/dist/recon/reports/sections/index.js.map +1 -0
- package/dist/recon/reports/sections/intelligence-gathered.d.ts +22 -0
- package/dist/recon/reports/sections/intelligence-gathered.d.ts.map +1 -0
- package/dist/recon/reports/sections/intelligence-gathered.js +373 -0
- package/dist/recon/reports/sections/intelligence-gathered.js.map +1 -0
- package/dist/recon/reports/sections/mission-overview.d.ts +22 -0
- package/dist/recon/reports/sections/mission-overview.d.ts.map +1 -0
- package/dist/recon/reports/sections/mission-overview.js +256 -0
- package/dist/recon/reports/sections/mission-overview.js.map +1 -0
- package/dist/recon/reports/sections/opposing-agent-profile.d.ts +22 -0
- package/dist/recon/reports/sections/opposing-agent-profile.d.ts.map +1 -0
- package/dist/recon/reports/sections/opposing-agent-profile.js +253 -0
- package/dist/recon/reports/sections/opposing-agent-profile.js.map +1 -0
- package/dist/recon/reports/sections/recommendations.d.ts +22 -0
- package/dist/recon/reports/sections/recommendations.d.ts.map +1 -0
- package/dist/recon/reports/sections/recommendations.js +341 -0
- package/dist/recon/reports/sections/recommendations.js.map +1 -0
- package/dist/recon/reports/sections/tactics-observed.d.ts +30 -0
- package/dist/recon/reports/sections/tactics-observed.d.ts.map +1 -0
- package/dist/recon/reports/sections/tactics-observed.js +275 -0
- package/dist/recon/reports/sections/tactics-observed.js.map +1 -0
- package/dist/recon/reports/types.d.ts +320 -0
- package/dist/recon/reports/types.d.ts.map +1 -0
- package/dist/recon/reports/types.js +13 -0
- package/dist/recon/reports/types.js.map +1 -0
- package/dist/recon/stealth/timing-calculator.d.ts +128 -0
- package/dist/recon/stealth/timing-calculator.d.ts.map +1 -0
- package/dist/recon/stealth/timing-calculator.js +288 -0
- package/dist/recon/stealth/timing-calculator.js.map +1 -0
- package/dist/recon/stealth/typing-simulator.d.ts +107 -0
- package/dist/recon/stealth/typing-simulator.d.ts.map +1 -0
- package/dist/recon/stealth/typing-simulator.js +376 -0
- package/dist/recon/stealth/typing-simulator.js.map +1 -0
- package/dist/recon/stealth/typo-generator.d.ts +95 -0
- package/dist/recon/stealth/typo-generator.d.ts.map +1 -0
- package/dist/recon/stealth/typo-generator.js +354 -0
- package/dist/recon/stealth/typo-generator.js.map +1 -0
- package/dist/recon/symbol/schema.d.ts +124 -0
- package/dist/recon/symbol/schema.d.ts.map +1 -0
- package/dist/recon/symbol/schema.js +441 -0
- package/dist/recon/symbol/schema.js.map +1 -0
- package/dist/recon/symbol/validator.d.ts +130 -0
- package/dist/recon/symbol/validator.d.ts.map +1 -0
- package/dist/recon/symbol/validator.js +619 -0
- package/dist/recon/symbol/validator.js.map +1 -0
- package/dist/recon/templates/customer-service/account-issue.d.ts +59 -0
- package/dist/recon/templates/customer-service/account-issue.d.ts.map +1 -0
- package/dist/recon/templates/customer-service/account-issue.js +170 -0
- package/dist/recon/templates/customer-service/account-issue.js.map +1 -0
- package/dist/recon/templates/customer-service/complaint.d.ts +60 -0
- package/dist/recon/templates/customer-service/complaint.d.ts.map +1 -0
- package/dist/recon/templates/customer-service/complaint.js +171 -0
- package/dist/recon/templates/customer-service/complaint.js.map +1 -0
- package/dist/recon/templates/customer-service/index.d.ts +21 -0
- package/dist/recon/templates/customer-service/index.d.ts.map +1 -0
- package/dist/recon/templates/customer-service/index.js +29 -0
- package/dist/recon/templates/customer-service/index.js.map +1 -0
- package/dist/recon/templates/customer-service/refund-request.d.ts +58 -0
- package/dist/recon/templates/customer-service/refund-request.d.ts.map +1 -0
- package/dist/recon/templates/customer-service/refund-request.js +161 -0
- package/dist/recon/templates/customer-service/refund-request.js.map +1 -0
- package/dist/recon/templates/index.d.ts +186 -0
- package/dist/recon/templates/index.d.ts.map +1 -0
- package/dist/recon/templates/index.js +316 -0
- package/dist/recon/templates/index.js.map +1 -0
- package/dist/recon/templates/sales/index.d.ts +20 -0
- package/dist/recon/templates/sales/index.d.ts.map +1 -0
- package/dist/recon/templates/sales/index.js +26 -0
- package/dist/recon/templates/sales/index.js.map +1 -0
- package/dist/recon/templates/sales/price-negotiation.d.ts +60 -0
- package/dist/recon/templates/sales/price-negotiation.d.ts.map +1 -0
- package/dist/recon/templates/sales/price-negotiation.js +167 -0
- package/dist/recon/templates/sales/price-negotiation.js.map +1 -0
- package/dist/recon/templates/sales/product-inquiry.d.ts +60 -0
- package/dist/recon/templates/sales/product-inquiry.d.ts.map +1 -0
- package/dist/recon/templates/sales/product-inquiry.js +167 -0
- package/dist/recon/templates/sales/product-inquiry.js.map +1 -0
- package/dist/recon/templates/support/feature-request.d.ts +60 -0
- package/dist/recon/templates/support/feature-request.d.ts.map +1 -0
- package/dist/recon/templates/support/feature-request.js +167 -0
- package/dist/recon/templates/support/feature-request.js.map +1 -0
- package/dist/recon/templates/support/index.d.ts +20 -0
- package/dist/recon/templates/support/index.d.ts.map +1 -0
- package/dist/recon/templates/support/index.js +26 -0
- package/dist/recon/templates/support/index.js.map +1 -0
- package/dist/recon/templates/support/troubleshooting.d.ts +60 -0
- package/dist/recon/templates/support/troubleshooting.d.ts.map +1 -0
- package/dist/recon/templates/support/troubleshooting.js +173 -0
- package/dist/recon/templates/support/troubleshooting.js.map +1 -0
- package/dist/recon/templates/types.d.ts +144 -0
- package/dist/recon/templates/types.d.ts.map +1 -0
- package/dist/recon/templates/types.js +40 -0
- package/dist/recon/templates/types.js.map +1 -0
- package/dist/recon/testing/index.d.ts +43 -0
- package/dist/recon/testing/index.d.ts.map +1 -0
- package/dist/recon/testing/index.js +55 -0
- package/dist/recon/testing/index.js.map +1 -0
- package/dist/recon/testing/metrics-collector.d.ts +185 -0
- package/dist/recon/testing/metrics-collector.d.ts.map +1 -0
- package/dist/recon/testing/metrics-collector.js +397 -0
- package/dist/recon/testing/metrics-collector.js.map +1 -0
- package/dist/recon/testing/mock-chatbot.d.ts +147 -0
- package/dist/recon/testing/mock-chatbot.d.ts.map +1 -0
- package/dist/recon/testing/mock-chatbot.js +500 -0
- package/dist/recon/testing/mock-chatbot.js.map +1 -0
- package/dist/recon/testing/scenario-runner.d.ts +154 -0
- package/dist/recon/testing/scenario-runner.d.ts.map +1 -0
- package/dist/recon/testing/scenario-runner.js +242 -0
- package/dist/recon/testing/scenario-runner.js.map +1 -0
- package/dist/recon/testing/test-scenarios.d.ts +135 -0
- package/dist/recon/testing/test-scenarios.d.ts.map +1 -0
- package/dist/recon/testing/test-scenarios.js +358 -0
- package/dist/recon/testing/test-scenarios.js.map +1 -0
- package/dist/recon/types.d.ts +821 -0
- package/dist/recon/types.d.ts.map +1 -0
- package/dist/recon/types.js +167 -0
- package/dist/recon/types.js.map +1 -0
- package/dist/scheduler/naics-monitor.d.ts +82 -0
- package/dist/scheduler/naics-monitor.d.ts.map +1 -0
- package/dist/scheduler/naics-monitor.js +534 -0
- package/dist/scheduler/naics-monitor.js.map +1 -0
- package/dist/server-init.d.ts +89 -0
- package/dist/server-init.d.ts.map +1 -0
- package/dist/server-init.js +242 -0
- package/dist/server-init.js.map +1 -0
- package/dist/server.d.ts +14 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +99 -0
- package/dist/server.js.map +1 -0
- package/dist/swarm/alerts/alert-engine.d.ts +64 -0
- package/dist/swarm/alerts/alert-engine.d.ts.map +1 -0
- package/dist/swarm/alerts/alert-engine.js +343 -0
- package/dist/swarm/alerts/alert-engine.js.map +1 -0
- package/dist/swarm/alerts/index.d.ts +7 -0
- package/dist/swarm/alerts/index.d.ts.map +1 -0
- package/dist/swarm/alerts/index.js +7 -0
- package/dist/swarm/alerts/index.js.map +1 -0
- package/dist/swarm/budget-allocator.d.ts +153 -0
- package/dist/swarm/budget-allocator.d.ts.map +1 -0
- package/dist/swarm/budget-allocator.js +402 -0
- package/dist/swarm/budget-allocator.js.map +1 -0
- package/dist/swarm/database.d.ts +202 -0
- package/dist/swarm/database.d.ts.map +1 -0
- package/dist/swarm/database.js +1389 -0
- package/dist/swarm/database.js.map +1 -0
- package/dist/swarm/demo/fixtures/index.d.ts +7 -0
- package/dist/swarm/demo/fixtures/index.d.ts.map +1 -0
- package/dist/swarm/demo/fixtures/index.js +7 -0
- package/dist/swarm/demo/fixtures/index.js.map +1 -0
- package/dist/swarm/demo/fixtures/sample-listings.d.ts +38 -0
- package/dist/swarm/demo/fixtures/sample-listings.d.ts.map +1 -0
- package/dist/swarm/demo/fixtures/sample-listings.js +390 -0
- package/dist/swarm/demo/fixtures/sample-listings.js.map +1 -0
- package/dist/swarm/demo/index.d.ts +9 -0
- package/dist/swarm/demo/index.d.ts.map +1 -0
- package/dist/swarm/demo/index.js +12 -0
- package/dist/swarm/demo/index.js.map +1 -0
- package/dist/swarm/demo/swarm-demo.d.ts +110 -0
- package/dist/swarm/demo/swarm-demo.d.ts.map +1 -0
- package/dist/swarm/demo/swarm-demo.js +423 -0
- package/dist/swarm/demo/swarm-demo.js.map +1 -0
- package/dist/swarm/ebay/auth.d.ts +98 -0
- package/dist/swarm/ebay/auth.d.ts.map +1 -0
- package/dist/swarm/ebay/auth.js +268 -0
- package/dist/swarm/ebay/auth.js.map +1 -0
- package/dist/swarm/ebay/client.d.ts +111 -0
- package/dist/swarm/ebay/client.d.ts.map +1 -0
- package/dist/swarm/ebay/client.js +433 -0
- package/dist/swarm/ebay/client.js.map +1 -0
- package/dist/swarm/ebay/index.d.ts +11 -0
- package/dist/swarm/ebay/index.d.ts.map +1 -0
- package/dist/swarm/ebay/index.js +11 -0
- package/dist/swarm/ebay/index.js.map +1 -0
- package/dist/swarm/ebay/rate-limiter.d.ts +115 -0
- package/dist/swarm/ebay/rate-limiter.d.ts.map +1 -0
- package/dist/swarm/ebay/rate-limiter.js +264 -0
- package/dist/swarm/ebay/rate-limiter.js.map +1 -0
- package/dist/swarm/ebay/sandbox-config.d.ts +280 -0
- package/dist/swarm/ebay/sandbox-config.d.ts.map +1 -0
- package/dist/swarm/ebay/sandbox-config.js +353 -0
- package/dist/swarm/ebay/sandbox-config.js.map +1 -0
- package/dist/swarm/ebay/types.d.ts +532 -0
- package/dist/swarm/ebay/types.d.ts.map +1 -0
- package/dist/swarm/ebay/types.js +64 -0
- package/dist/swarm/ebay/types.js.map +1 -0
- package/dist/swarm/hooks/alert-hook.d.ts +18 -0
- package/dist/swarm/hooks/alert-hook.d.ts.map +1 -0
- package/dist/swarm/hooks/alert-hook.js +44 -0
- package/dist/swarm/hooks/alert-hook.js.map +1 -0
- package/dist/swarm/hooks/database-sync-hook.d.ts +19 -0
- package/dist/swarm/hooks/database-sync-hook.d.ts.map +1 -0
- package/dist/swarm/hooks/database-sync-hook.js +121 -0
- package/dist/swarm/hooks/database-sync-hook.js.map +1 -0
- package/dist/swarm/hooks/index.d.ts +61 -0
- package/dist/swarm/hooks/index.d.ts.map +1 -0
- package/dist/swarm/hooks/index.js +103 -0
- package/dist/swarm/hooks/index.js.map +1 -0
- package/dist/swarm/hooks/observation-hooks.d.ts +178 -0
- package/dist/swarm/hooks/observation-hooks.d.ts.map +1 -0
- package/dist/swarm/hooks/observation-hooks.js +319 -0
- package/dist/swarm/hooks/observation-hooks.js.map +1 -0
- package/dist/swarm/hooks/pinecone-sync-hook.d.ts +58 -0
- package/dist/swarm/hooks/pinecone-sync-hook.d.ts.map +1 -0
- package/dist/swarm/hooks/pinecone-sync-hook.js +193 -0
- package/dist/swarm/hooks/pinecone-sync-hook.js.map +1 -0
- package/dist/swarm/hooks/webhook-alert-hook.d.ts +35 -0
- package/dist/swarm/hooks/webhook-alert-hook.d.ts.map +1 -0
- package/dist/swarm/hooks/webhook-alert-hook.js +251 -0
- package/dist/swarm/hooks/webhook-alert-hook.js.map +1 -0
- package/dist/swarm/index.d.ts +33 -0
- package/dist/swarm/index.d.ts.map +1 -0
- package/dist/swarm/index.js +59 -0
- package/dist/swarm/index.js.map +1 -0
- package/dist/swarm/registry/event-emitter.d.ts +116 -0
- package/dist/swarm/registry/event-emitter.d.ts.map +1 -0
- package/dist/swarm/registry/event-emitter.js +188 -0
- package/dist/swarm/registry/event-emitter.js.map +1 -0
- package/dist/swarm/registry/index.d.ts +9 -0
- package/dist/swarm/registry/index.d.ts.map +1 -0
- package/dist/swarm/registry/index.js +9 -0
- package/dist/swarm/registry/index.js.map +1 -0
- package/dist/swarm/registry/insight-computer.d.ts +114 -0
- package/dist/swarm/registry/insight-computer.d.ts.map +1 -0
- package/dist/swarm/registry/insight-computer.js +387 -0
- package/dist/swarm/registry/insight-computer.js.map +1 -0
- package/dist/swarm/registry/symbol-mapper.d.ts +115 -0
- package/dist/swarm/registry/symbol-mapper.d.ts.map +1 -0
- package/dist/swarm/registry/symbol-mapper.js +229 -0
- package/dist/swarm/registry/symbol-mapper.js.map +1 -0
- package/dist/swarm/resources/index.d.ts +7 -0
- package/dist/swarm/resources/index.d.ts.map +1 -0
- package/dist/swarm/resources/index.js +7 -0
- package/dist/swarm/resources/index.js.map +1 -0
- package/dist/swarm/resources/intelligence-resources.d.ts +64 -0
- package/dist/swarm/resources/intelligence-resources.d.ts.map +1 -0
- package/dist/swarm/resources/intelligence-resources.js +309 -0
- package/dist/swarm/resources/intelligence-resources.js.map +1 -0
- package/dist/swarm/strategies/early-aggressive.d.ts +59 -0
- package/dist/swarm/strategies/early-aggressive.d.ts.map +1 -0
- package/dist/swarm/strategies/early-aggressive.js +283 -0
- package/dist/swarm/strategies/early-aggressive.js.map +1 -0
- package/dist/swarm/strategies/hybrid.d.ts +58 -0
- package/dist/swarm/strategies/hybrid.d.ts.map +1 -0
- package/dist/swarm/strategies/hybrid.js +336 -0
- package/dist/swarm/strategies/hybrid.js.map +1 -0
- package/dist/swarm/strategies/index.d.ts +35 -0
- package/dist/swarm/strategies/index.d.ts.map +1 -0
- package/dist/swarm/strategies/index.js +94 -0
- package/dist/swarm/strategies/index.js.map +1 -0
- package/dist/swarm/strategies/negotiator.d.ts +66 -0
- package/dist/swarm/strategies/negotiator.d.ts.map +1 -0
- package/dist/swarm/strategies/negotiator.js +326 -0
- package/dist/swarm/strategies/negotiator.js.map +1 -0
- package/dist/swarm/strategies/passive.d.ts +56 -0
- package/dist/swarm/strategies/passive.d.ts.map +1 -0
- package/dist/swarm/strategies/passive.js +247 -0
- package/dist/swarm/strategies/passive.js.map +1 -0
- package/dist/swarm/strategies/sniper.d.ts +43 -0
- package/dist/swarm/strategies/sniper.d.ts.map +1 -0
- package/dist/swarm/strategies/sniper.js +176 -0
- package/dist/swarm/strategies/sniper.js.map +1 -0
- package/dist/swarm/strategies/types.d.ts +256 -0
- package/dist/swarm/strategies/types.d.ts.map +1 -0
- package/dist/swarm/strategies/types.js +251 -0
- package/dist/swarm/strategies/types.js.map +1 -0
- package/dist/swarm/swarm-controller.d.ts +197 -0
- package/dist/swarm/swarm-controller.d.ts.map +1 -0
- package/dist/swarm/swarm-controller.js +812 -0
- package/dist/swarm/swarm-controller.js.map +1 -0
- package/dist/swarm/tools/index.d.ts +7 -0
- package/dist/swarm/tools/index.d.ts.map +1 -0
- package/dist/swarm/tools/index.js +7 -0
- package/dist/swarm/tools/index.js.map +1 -0
- package/dist/swarm/tools/intelligence-tools.d.ts +36 -0
- package/dist/swarm/tools/intelligence-tools.d.ts.map +1 -0
- package/dist/swarm/tools/intelligence-tools.js +508 -0
- package/dist/swarm/tools/intelligence-tools.js.map +1 -0
- package/dist/swarm/tools.d.ts +451 -0
- package/dist/swarm/tools.d.ts.map +1 -0
- package/dist/swarm/tools.js +465 -0
- package/dist/swarm/tools.js.map +1 -0
- package/dist/swarm/types.d.ts +744 -0
- package/dist/swarm/types.d.ts.map +1 -0
- package/dist/swarm/types.js +109 -0
- package/dist/swarm/types.js.map +1 -0
- package/dist/swarm/vectors/index.d.ts +8 -0
- package/dist/swarm/vectors/index.d.ts.map +1 -0
- package/dist/swarm/vectors/index.js +15 -0
- package/dist/swarm/vectors/index.js.map +1 -0
- package/dist/swarm/vectors/pinecone-client.d.ts +234 -0
- package/dist/swarm/vectors/pinecone-client.d.ts.map +1 -0
- package/dist/swarm/vectors/pinecone-client.js +290 -0
- package/dist/swarm/vectors/pinecone-client.js.map +1 -0
- package/dist/swarm/vectors/swarm-vectors.d.ts +119 -0
- package/dist/swarm/vectors/swarm-vectors.d.ts.map +1 -0
- package/dist/swarm/vectors/swarm-vectors.js +217 -0
- package/dist/swarm/vectors/swarm-vectors.js.map +1 -0
- package/dist/symbols/audit.d.ts +100 -0
- package/dist/symbols/audit.d.ts.map +1 -0
- package/dist/symbols/audit.js +391 -0
- package/dist/symbols/audit.js.map +1 -0
- package/dist/symbols/claim-validator.d.ts +113 -0
- package/dist/symbols/claim-validator.d.ts.map +1 -0
- package/dist/symbols/claim-validator.js +386 -0
- package/dist/symbols/claim-validator.js.map +1 -0
- package/dist/symbols/database.d.ts +285 -0
- package/dist/symbols/database.d.ts.map +1 -0
- package/dist/symbols/database.js +932 -0
- package/dist/symbols/database.js.map +1 -0
- package/dist/symbols/epistemic-types.d.ts +71 -0
- package/dist/symbols/epistemic-types.d.ts.map +1 -0
- package/dist/symbols/epistemic-types.js +101 -0
- package/dist/symbols/epistemic-types.js.map +1 -0
- package/dist/symbols/graph-manager.d.ts +117 -0
- package/dist/symbols/graph-manager.d.ts.map +1 -0
- package/dist/symbols/graph-manager.js +616 -0
- package/dist/symbols/graph-manager.js.map +1 -0
- package/dist/symbols/graph-tools.d.ts +15 -0
- package/dist/symbols/graph-tools.d.ts.map +1 -0
- package/dist/symbols/graph-tools.js +467 -0
- package/dist/symbols/graph-tools.js.map +1 -0
- package/dist/symbols/graph-types.d.ts +291 -0
- package/dist/symbols/graph-types.d.ts.map +1 -0
- package/dist/symbols/graph-types.js +93 -0
- package/dist/symbols/graph-types.js.map +1 -0
- package/dist/symbols/index.d.ts +18 -0
- package/dist/symbols/index.d.ts.map +1 -0
- package/dist/symbols/index.js +26 -0
- package/dist/symbols/index.js.map +1 -0
- package/dist/symbols/manager.d.ts +114 -0
- package/dist/symbols/manager.d.ts.map +1 -0
- package/dist/symbols/manager.js +1000 -0
- package/dist/symbols/manager.js.map +1 -0
- package/dist/symbols/sanitizer.d.ts +142 -0
- package/dist/symbols/sanitizer.d.ts.map +1 -0
- package/dist/symbols/sanitizer.js +582 -0
- package/dist/symbols/sanitizer.js.map +1 -0
- package/dist/symbols/simple-retrieval.d.ts +65 -0
- package/dist/symbols/simple-retrieval.d.ts.map +1 -0
- package/dist/symbols/simple-retrieval.js +110 -0
- package/dist/symbols/simple-retrieval.js.map +1 -0
- package/dist/symbols/test-epistemic-vendor59655.d.ts +28 -0
- package/dist/symbols/test-epistemic-vendor59655.d.ts.map +1 -0
- package/dist/symbols/test-epistemic-vendor59655.js +129 -0
- package/dist/symbols/test-epistemic-vendor59655.js.map +1 -0
- package/dist/symbols/tools.d.ts +19 -0
- package/dist/symbols/tools.d.ts.map +1 -0
- package/dist/symbols/tools.js +697 -0
- package/dist/symbols/tools.js.map +1 -0
- package/dist/symbols/types.d.ts +626 -0
- package/dist/symbols/types.d.ts.map +1 -0
- package/dist/symbols/types.js +100 -0
- package/dist/symbols/types.js.map +1 -0
- package/dist/symbols/validation-pipeline.d.ts +116 -0
- package/dist/symbols/validation-pipeline.d.ts.map +1 -0
- package/dist/symbols/validation-pipeline.js +119 -0
- package/dist/symbols/validation-pipeline.js.map +1 -0
- package/dist/tools/index.d.ts +15 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +24 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/ps_calendar.d.ts +68 -0
- package/dist/tools/ps_calendar.d.ts.map +1 -0
- package/dist/tools/ps_calendar.js +377 -0
- package/dist/tools/ps_calendar.js.map +1 -0
- package/dist/tools/ps_delegate.d.ts +83 -0
- package/dist/tools/ps_delegate.d.ts.map +1 -0
- package/dist/tools/ps_delegate.js +307 -0
- package/dist/tools/ps_delegate.js.map +1 -0
- package/dist/tools/ps_execute.d.ts +84 -0
- package/dist/tools/ps_execute.d.ts.map +1 -0
- package/dist/tools/ps_execute.js +211 -0
- package/dist/tools/ps_execute.js.map +1 -0
- package/dist/tools/ps_hold.d.ts +50 -0
- package/dist/tools/ps_hold.d.ts.map +1 -0
- package/dist/tools/ps_hold.js +227 -0
- package/dist/tools/ps_hold.js.map +1 -0
- package/dist/tools/ps_legal.d.ts +111 -0
- package/dist/tools/ps_legal.d.ts.map +1 -0
- package/dist/tools/ps_legal.js +456 -0
- package/dist/tools/ps_legal.js.map +1 -0
- package/dist/tools/ps_state.d.ts +146 -0
- package/dist/tools/ps_state.d.ts.map +1 -0
- package/dist/tools/ps_state.js +286 -0
- package/dist/tools/ps_state.js.map +1 -0
- package/dist/tools/ps_validate.d.ts +51 -0
- package/dist/tools/ps_validate.d.ts.map +1 -0
- package/dist/tools/ps_validate.js +191 -0
- package/dist/tools/ps_validate.js.map +1 -0
- package/dist/tools/registry.d.ts +52 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +456 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/translation/compiler.d.ts +37 -0
- package/dist/translation/compiler.d.ts.map +1 -0
- package/dist/translation/compiler.js +281 -0
- package/dist/translation/compiler.js.map +1 -0
- package/dist/translation/decompiler.d.ts +29 -0
- package/dist/translation/decompiler.d.ts.map +1 -0
- package/dist/translation/decompiler.js +454 -0
- package/dist/translation/decompiler.js.map +1 -0
- package/dist/translation/frame-translator.d.ts +75 -0
- package/dist/translation/frame-translator.d.ts.map +1 -0
- package/dist/translation/frame-translator.js +347 -0
- package/dist/translation/frame-translator.js.map +1 -0
- package/dist/translation/index.d.ts +349 -0
- package/dist/translation/index.d.ts.map +1 -0
- package/dist/translation/index.js +397 -0
- package/dist/translation/index.js.map +1 -0
- package/dist/translation/llm-extractor.d.ts +56 -0
- package/dist/translation/llm-extractor.d.ts.map +1 -0
- package/dist/translation/llm-extractor.js +345 -0
- package/dist/translation/llm-extractor.js.map +1 -0
- package/dist/translation/mappings.d.ts +91 -0
- package/dist/translation/mappings.d.ts.map +1 -0
- package/dist/translation/mappings.js +558 -0
- package/dist/translation/mappings.js.map +1 -0
- package/dist/translation/opacity-layer.d.ts +93 -0
- package/dist/translation/opacity-layer.d.ts.map +1 -0
- package/dist/translation/opacity-layer.js +404 -0
- package/dist/translation/opacity-layer.js.map +1 -0
- package/dist/translation/types.d.ts +307 -0
- package/dist/translation/types.d.ts.map +1 -0
- package/dist/translation/types.js +8 -0
- package/dist/translation/types.js.map +1 -0
- package/dist/types/index.d.ts +700 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/embeddings.d.ts +20 -0
- package/dist/utils/embeddings.d.ts.map +1 -0
- package/dist/utils/embeddings.js +110 -0
- package/dist/utils/embeddings.js.map +1 -0
- package/dist/utils/hash.d.ts +34 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +72 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/verification/cross-llm.d.ts +116 -0
- package/dist/verification/cross-llm.d.ts.map +1 -0
- package/dist/verification/cross-llm.js +438 -0
- package/dist/verification/cross-llm.js.map +1 -0
- package/dist/verification/dashboard.d.ts +127 -0
- package/dist/verification/dashboard.d.ts.map +1 -0
- package/dist/verification/dashboard.js +630 -0
- package/dist/verification/dashboard.js.map +1 -0
- package/dist/verification/index.d.ts +11 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +11 -0
- package/dist/verification/index.js.map +1 -0
- package/dist/verification/tools.d.ts +105 -0
- package/dist/verification/tools.d.ts.map +1 -0
- package/dist/verification/tools.js +162 -0
- package/dist/verification/tools.js.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,854 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// PROMPTSPEAK MCP SERVER - GATEKEEPER CORE
|
|
3
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
4
|
+
// The Gatekeeper is the central enforcement layer that:
|
|
5
|
+
// 1. Resolves frames with operator overrides
|
|
6
|
+
// 2. Validates frames against all rules
|
|
7
|
+
// 3. Intercepts actions and enforces constraints
|
|
8
|
+
// 4. Calculates coverage confidence
|
|
9
|
+
// 5. PRE-EXECUTION BLOCKING via circuit breaker and drift prediction
|
|
10
|
+
// 6. HUMAN-IN-THE-LOOP holds for risky operations
|
|
11
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
12
|
+
import { DynamicResolver } from './resolver.js';
|
|
13
|
+
import { FrameValidator } from './validator.js';
|
|
14
|
+
import { ActionInterceptor } from './interceptor.js';
|
|
15
|
+
import { CoverageCalculator } from './coverage.js';
|
|
16
|
+
import { holdManager } from './hold-manager.js';
|
|
17
|
+
import { driftEngine } from '../drift/index.js';
|
|
18
|
+
import { generateAuditId, generateBehaviorHash } from '../utils/hash.js';
|
|
19
|
+
import { createLogger } from '../core/logging/index.js';
|
|
20
|
+
const logger = createLogger('Gatekeeper');
|
|
21
|
+
const DEFAULT_EVICTION_CONFIG = {
|
|
22
|
+
maxAgents: 1000,
|
|
23
|
+
maxExecutionsPerAgent: 1000,
|
|
24
|
+
inactivityThresholdMs: 30 * 60 * 1000, // 30 minutes
|
|
25
|
+
enablePeriodicCleanup: true,
|
|
26
|
+
cleanupIntervalMs: 5 * 60 * 1000, // 5 minutes
|
|
27
|
+
logEvictions: true,
|
|
28
|
+
};
|
|
29
|
+
export class Gatekeeper {
|
|
30
|
+
resolver;
|
|
31
|
+
validator;
|
|
32
|
+
interceptor;
|
|
33
|
+
coverageCalculator;
|
|
34
|
+
holdManager;
|
|
35
|
+
// Frame cache for chain validation (with eviction)
|
|
36
|
+
activeFrames = new Map();
|
|
37
|
+
// Execution history for post-audit (with eviction)
|
|
38
|
+
executionHistory = new Map();
|
|
39
|
+
// Agent activity tracking for LRU eviction
|
|
40
|
+
agentLastActivity = new Map();
|
|
41
|
+
// Eviction configuration
|
|
42
|
+
evictionConfig;
|
|
43
|
+
// Cleanup timer
|
|
44
|
+
cleanupTimer = null;
|
|
45
|
+
// Eviction statistics
|
|
46
|
+
evictionStats = {
|
|
47
|
+
totalEvictions: 0,
|
|
48
|
+
lastEvictionTime: 0,
|
|
49
|
+
evictedByCapacity: 0,
|
|
50
|
+
evictedByInactivity: 0,
|
|
51
|
+
};
|
|
52
|
+
constructor(evictionConfig) {
|
|
53
|
+
this.resolver = new DynamicResolver();
|
|
54
|
+
this.validator = new FrameValidator();
|
|
55
|
+
this.interceptor = new ActionInterceptor();
|
|
56
|
+
this.coverageCalculator = new CoverageCalculator();
|
|
57
|
+
this.holdManager = holdManager; // Use singleton
|
|
58
|
+
this.evictionConfig = { ...DEFAULT_EVICTION_CONFIG, ...evictionConfig };
|
|
59
|
+
// Start periodic cleanup if enabled
|
|
60
|
+
if (this.evictionConfig.enablePeriodicCleanup) {
|
|
61
|
+
this.startPeriodicCleanup();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
65
|
+
// AGENT EVICTION POLICY (Memory Management)
|
|
66
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
67
|
+
/**
|
|
68
|
+
* Update eviction configuration.
|
|
69
|
+
*/
|
|
70
|
+
setEvictionConfig(config) {
|
|
71
|
+
this.evictionConfig = { ...this.evictionConfig, ...config };
|
|
72
|
+
// Restart periodic cleanup with new interval if needed
|
|
73
|
+
if (this.cleanupTimer) {
|
|
74
|
+
clearInterval(this.cleanupTimer);
|
|
75
|
+
this.cleanupTimer = null;
|
|
76
|
+
}
|
|
77
|
+
if (this.evictionConfig.enablePeriodicCleanup) {
|
|
78
|
+
this.startPeriodicCleanup();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get current eviction configuration.
|
|
83
|
+
*/
|
|
84
|
+
getEvictionConfig() {
|
|
85
|
+
return { ...this.evictionConfig };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get eviction statistics.
|
|
89
|
+
*/
|
|
90
|
+
getEvictionStats() {
|
|
91
|
+
return {
|
|
92
|
+
...this.evictionStats,
|
|
93
|
+
activeAgents: this.agentLastActivity.size,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Start periodic cleanup timer.
|
|
98
|
+
*/
|
|
99
|
+
startPeriodicCleanup() {
|
|
100
|
+
this.cleanupTimer = setInterval(() => {
|
|
101
|
+
this.evictInactiveAgents();
|
|
102
|
+
}, this.evictionConfig.cleanupIntervalMs);
|
|
103
|
+
// Ensure timer doesn't prevent process exit
|
|
104
|
+
if (this.cleanupTimer.unref) {
|
|
105
|
+
this.cleanupTimer.unref();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Stop periodic cleanup timer.
|
|
110
|
+
*/
|
|
111
|
+
stopPeriodicCleanup() {
|
|
112
|
+
if (this.cleanupTimer) {
|
|
113
|
+
clearInterval(this.cleanupTimer);
|
|
114
|
+
this.cleanupTimer = null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Touch agent activity timestamp (called on every operation).
|
|
119
|
+
*/
|
|
120
|
+
touchAgent(agentId) {
|
|
121
|
+
const now = Date.now();
|
|
122
|
+
this.agentLastActivity.set(agentId, now);
|
|
123
|
+
// Check if we need to evict agents due to capacity
|
|
124
|
+
if (this.agentLastActivity.size > this.evictionConfig.maxAgents) {
|
|
125
|
+
this.evictLeastRecentlyUsed();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Evict the least recently used agent.
|
|
130
|
+
*/
|
|
131
|
+
evictLeastRecentlyUsed() {
|
|
132
|
+
if (this.agentLastActivity.size === 0)
|
|
133
|
+
return;
|
|
134
|
+
// Find the agent with the oldest activity timestamp
|
|
135
|
+
let oldestAgent = null;
|
|
136
|
+
let oldestTime = Infinity;
|
|
137
|
+
for (const [agentId, lastActivity] of this.agentLastActivity) {
|
|
138
|
+
if (lastActivity < oldestTime) {
|
|
139
|
+
oldestTime = lastActivity;
|
|
140
|
+
oldestAgent = agentId;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (oldestAgent) {
|
|
144
|
+
this.evictAgent(oldestAgent, 'capacity');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Evict inactive agents (called periodically or on demand).
|
|
149
|
+
*/
|
|
150
|
+
evictInactiveAgents() {
|
|
151
|
+
const now = Date.now();
|
|
152
|
+
const threshold = now - this.evictionConfig.inactivityThresholdMs;
|
|
153
|
+
const toEvict = [];
|
|
154
|
+
for (const [agentId, lastActivity] of this.agentLastActivity) {
|
|
155
|
+
if (lastActivity < threshold) {
|
|
156
|
+
toEvict.push(agentId);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
for (const agentId of toEvict) {
|
|
160
|
+
this.evictAgent(agentId, 'inactivity');
|
|
161
|
+
}
|
|
162
|
+
return toEvict.length;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Evict a specific agent and clean up all its data.
|
|
166
|
+
*/
|
|
167
|
+
evictAgent(agentId, reason) {
|
|
168
|
+
// Remove from all tracking structures
|
|
169
|
+
this.activeFrames.delete(agentId);
|
|
170
|
+
this.executionHistory.delete(agentId);
|
|
171
|
+
this.agentLastActivity.delete(agentId);
|
|
172
|
+
// Update statistics
|
|
173
|
+
this.evictionStats.totalEvictions++;
|
|
174
|
+
this.evictionStats.lastEvictionTime = Date.now();
|
|
175
|
+
if (reason === 'capacity') {
|
|
176
|
+
this.evictionStats.evictedByCapacity++;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
this.evictionStats.evictedByInactivity++;
|
|
180
|
+
}
|
|
181
|
+
// Log if enabled
|
|
182
|
+
if (this.evictionConfig.logEvictions) {
|
|
183
|
+
logger.info(`Evicted agent ${agentId} (reason: ${reason})`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Manually evict an agent (for testing or admin purposes).
|
|
188
|
+
*/
|
|
189
|
+
forceEvictAgent(agentId) {
|
|
190
|
+
if (!this.agentLastActivity.has(agentId)) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
this.evictAgent(agentId, 'capacity');
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Get list of all tracked agent IDs.
|
|
198
|
+
*/
|
|
199
|
+
getTrackedAgents() {
|
|
200
|
+
const agents = [];
|
|
201
|
+
for (const [agentId, lastActivity] of this.agentLastActivity) {
|
|
202
|
+
agents.push({ agentId, lastActivity });
|
|
203
|
+
}
|
|
204
|
+
return agents.sort((a, b) => b.lastActivity - a.lastActivity);
|
|
205
|
+
}
|
|
206
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
207
|
+
// DRIFT ENGINE ACCESS (for external integration)
|
|
208
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
209
|
+
/**
|
|
210
|
+
* Get the drift detection engine for external access.
|
|
211
|
+
*/
|
|
212
|
+
getDriftEngine() {
|
|
213
|
+
return driftEngine;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Get the hold manager for external access.
|
|
217
|
+
*/
|
|
218
|
+
getHoldManager() {
|
|
219
|
+
return this.holdManager;
|
|
220
|
+
}
|
|
221
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
222
|
+
// CONFIGURATION
|
|
223
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
224
|
+
/**
|
|
225
|
+
* Set the active policy overlay.
|
|
226
|
+
*/
|
|
227
|
+
setOverlay(overlay) {
|
|
228
|
+
this.resolver.setOverlay(overlay);
|
|
229
|
+
if (overlay?.confidenceThresholds) {
|
|
230
|
+
this.interceptor.setThresholds(overlay.confidenceThresholds);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Update confidence thresholds.
|
|
235
|
+
*/
|
|
236
|
+
setThresholds(thresholds) {
|
|
237
|
+
this.interceptor.setThresholds(thresholds);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Get current thresholds.
|
|
241
|
+
*/
|
|
242
|
+
getThresholds() {
|
|
243
|
+
return this.interceptor.getThresholds();
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Set execution control configuration (human-in-the-loop, pre-flight checks).
|
|
247
|
+
*/
|
|
248
|
+
setExecutionControlConfig(config) {
|
|
249
|
+
this.holdManager.setConfig(config);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Get execution control configuration.
|
|
253
|
+
*/
|
|
254
|
+
getExecutionControlConfig() {
|
|
255
|
+
return this.holdManager.getConfig();
|
|
256
|
+
}
|
|
257
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
258
|
+
// FRAME OPERATIONS
|
|
259
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
260
|
+
/**
|
|
261
|
+
* Parse a raw frame string.
|
|
262
|
+
* Returns an empty frame structure if parsing fails.
|
|
263
|
+
*/
|
|
264
|
+
parseFrame(rawFrame) {
|
|
265
|
+
const result = this.resolver.parseFrame(rawFrame);
|
|
266
|
+
if (result)
|
|
267
|
+
return result;
|
|
268
|
+
// Return empty frame structure for invalid frames
|
|
269
|
+
return {
|
|
270
|
+
raw: rawFrame,
|
|
271
|
+
symbols: [],
|
|
272
|
+
mode: null,
|
|
273
|
+
modifiers: [],
|
|
274
|
+
domain: null,
|
|
275
|
+
source: null,
|
|
276
|
+
constraints: [],
|
|
277
|
+
action: null,
|
|
278
|
+
entity: null,
|
|
279
|
+
metadata: {},
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Resolve a frame with operator overrides.
|
|
284
|
+
*/
|
|
285
|
+
resolveFrame(frame) {
|
|
286
|
+
const parsed = typeof frame === 'string' ? this.parseFrame(frame) : frame;
|
|
287
|
+
return this.resolver.resolveFrame(parsed);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Validate a frame.
|
|
291
|
+
*/
|
|
292
|
+
validateFrame(frame, parentFrame) {
|
|
293
|
+
const parsed = typeof frame === 'string' ? this.parseFrame(frame) : frame;
|
|
294
|
+
const parsedParent = parentFrame
|
|
295
|
+
? (typeof parentFrame === 'string' ? this.parseFrame(parentFrame) : parentFrame)
|
|
296
|
+
: undefined;
|
|
297
|
+
return this.validator.validate(parsed, parsedParent);
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Full validation pipeline: parse, resolve, validate.
|
|
301
|
+
*/
|
|
302
|
+
processFrame(rawFrame, parentFrame) {
|
|
303
|
+
const parsed = this.parseFrame(rawFrame);
|
|
304
|
+
const resolved = this.resolveFrame(parsed);
|
|
305
|
+
const parentParsed = parentFrame ? this.parseFrame(parentFrame) : undefined;
|
|
306
|
+
const validation = this.validator.validate(parsed, parentParsed);
|
|
307
|
+
return { parsed, resolved, validation };
|
|
308
|
+
}
|
|
309
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
310
|
+
// EXECUTION CONTROL
|
|
311
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
312
|
+
/**
|
|
313
|
+
* Execute an action through the gatekeeper.
|
|
314
|
+
* This is the main entry point for all agent actions.
|
|
315
|
+
*
|
|
316
|
+
* EXECUTION ORDER (for deterministic pre-execution blocking):
|
|
317
|
+
* 1. CIRCUIT BREAKER CHECK - Block halted agents immediately
|
|
318
|
+
* 2. FRAME VALIDATION - Structural/semantic validation
|
|
319
|
+
* 3. PRE-FLIGHT DRIFT PREDICTION - Predict if this action will cause drift
|
|
320
|
+
* 4. HOLD CHECK - Determine if human approval needed
|
|
321
|
+
* 5. INTERCEPTOR - Final frame-based permission check
|
|
322
|
+
* 6. TOOL EXECUTION - Only if all checks pass
|
|
323
|
+
* 7. POST-AUDIT - Confirm behavior matches prediction
|
|
324
|
+
* 8. IMMEDIATE ACTION - Halt agent if critical drift detected
|
|
325
|
+
*/
|
|
326
|
+
execute(request) {
|
|
327
|
+
const { agentId, frame, tool, arguments: args, bypassHold, holdDecision } = request;
|
|
328
|
+
const config = this.holdManager.getConfig();
|
|
329
|
+
const timestamp = Date.now();
|
|
330
|
+
const auditId = generateAuditId();
|
|
331
|
+
// Track agent activity for eviction policy
|
|
332
|
+
this.touchAgent(agentId);
|
|
333
|
+
// Initialize pre-flight check result
|
|
334
|
+
const preFlightCheck = {
|
|
335
|
+
passed: false,
|
|
336
|
+
blocked: false,
|
|
337
|
+
held: false,
|
|
338
|
+
checks: {
|
|
339
|
+
circuitBreaker: { passed: true },
|
|
340
|
+
driftPrediction: { passed: true },
|
|
341
|
+
baseline: { passed: true },
|
|
342
|
+
confidence: { passed: true },
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
346
|
+
// STEP 1: CIRCUIT BREAKER CHECK (FIRST - deterministic stop)
|
|
347
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
348
|
+
if (config.enableCircuitBreakerCheck) {
|
|
349
|
+
const isAllowed = driftEngine.circuitBreaker.isAllowed(agentId);
|
|
350
|
+
if (!isAllowed) {
|
|
351
|
+
const cbState = driftEngine.circuitBreaker.getState(agentId);
|
|
352
|
+
preFlightCheck.checks.circuitBreaker = {
|
|
353
|
+
passed: false,
|
|
354
|
+
reason: cbState.reason || 'Circuit breaker open',
|
|
355
|
+
};
|
|
356
|
+
preFlightCheck.blocked = true;
|
|
357
|
+
preFlightCheck.blockReason = `Agent halted: ${cbState.reason || 'Circuit breaker open'}`;
|
|
358
|
+
// Log to audit trail
|
|
359
|
+
this.logCircuitBreakerBlock(agentId, frame, tool, cbState.reason);
|
|
360
|
+
return {
|
|
361
|
+
success: false,
|
|
362
|
+
allowed: false,
|
|
363
|
+
held: false,
|
|
364
|
+
error: preFlightCheck.blockReason,
|
|
365
|
+
preFlightCheck,
|
|
366
|
+
interceptorDecision: {
|
|
367
|
+
allowed: false,
|
|
368
|
+
reason: preFlightCheck.blockReason,
|
|
369
|
+
frame,
|
|
370
|
+
proposedAction: tool,
|
|
371
|
+
coverageConfidence: 0,
|
|
372
|
+
timestamp,
|
|
373
|
+
auditId,
|
|
374
|
+
preFlightChecks: {
|
|
375
|
+
circuitBreakerPassed: false,
|
|
376
|
+
driftPredictionPassed: true,
|
|
377
|
+
baselineCheckPassed: true,
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
preFlightCheck.checks.circuitBreaker.passed = true;
|
|
384
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
385
|
+
// STEP 2: FRAME VALIDATION
|
|
386
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
387
|
+
const { parsed, resolved, validation } = this.processFrame(frame);
|
|
388
|
+
if (!validation.valid) {
|
|
389
|
+
preFlightCheck.blocked = true;
|
|
390
|
+
preFlightCheck.blockReason = 'Frame validation failed';
|
|
391
|
+
return {
|
|
392
|
+
success: false,
|
|
393
|
+
allowed: false,
|
|
394
|
+
error: `Frame validation failed: ${(validation.structural ?? []).concat(validation.semantic ?? [], validation.chain ?? [])
|
|
395
|
+
.filter(r => !r.passed && r.severity === 'error')
|
|
396
|
+
.map(r => r.message)
|
|
397
|
+
.join('; ')}`,
|
|
398
|
+
preFlightCheck,
|
|
399
|
+
interceptorDecision: {
|
|
400
|
+
allowed: false,
|
|
401
|
+
reason: 'Frame validation failed',
|
|
402
|
+
frame,
|
|
403
|
+
proposedAction: tool,
|
|
404
|
+
coverageConfidence: 0,
|
|
405
|
+
timestamp,
|
|
406
|
+
auditId,
|
|
407
|
+
},
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
411
|
+
// STEP 3: PRE-FLIGHT DRIFT PREDICTION
|
|
412
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
413
|
+
let predictedDriftScore = 0;
|
|
414
|
+
let baselineDeviation = 0;
|
|
415
|
+
if (config.enablePreFlightDriftPrediction || config.enableBaselineComparison) {
|
|
416
|
+
const baselineResult = driftEngine.baselineStore.compareToBaseline(parsed, parsed.symbols.map(s => s.definition?.name || s.symbol).join(' '), [tool], agentId);
|
|
417
|
+
if (baselineResult.hasBaseline) {
|
|
418
|
+
predictedDriftScore = baselineResult.driftScore;
|
|
419
|
+
baselineDeviation = baselineResult.driftScore;
|
|
420
|
+
// Check drift prediction threshold
|
|
421
|
+
if (config.enablePreFlightDriftPrediction &&
|
|
422
|
+
predictedDriftScore > config.driftPredictionThreshold) {
|
|
423
|
+
preFlightCheck.checks.driftPrediction = {
|
|
424
|
+
passed: false,
|
|
425
|
+
predictedScore: predictedDriftScore,
|
|
426
|
+
threshold: config.driftPredictionThreshold,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
// Check baseline deviation threshold
|
|
430
|
+
if (config.enableBaselineComparison &&
|
|
431
|
+
baselineDeviation > config.baselineDeviationThreshold) {
|
|
432
|
+
preFlightCheck.checks.baseline = {
|
|
433
|
+
passed: false,
|
|
434
|
+
deviation: baselineDeviation,
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
440
|
+
// STEP 4: HOLD CHECK (Human-in-the-Loop)
|
|
441
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
442
|
+
// Skip hold check if this is a resume from an approved hold
|
|
443
|
+
if (!bypassHold) {
|
|
444
|
+
const holdCheck = this.holdManager.shouldHold(request, {
|
|
445
|
+
circuitBreakerBlocked: !preFlightCheck.checks.circuitBreaker.passed,
|
|
446
|
+
predictedDriftScore,
|
|
447
|
+
baselineDeviation,
|
|
448
|
+
confidenceScore: resolved.parseConfidence,
|
|
449
|
+
isForbidden: resolved.effectiveConstraint?.name === 'forbidden',
|
|
450
|
+
requiresMcpValidation: this.holdManager.requiresMcpValidation(tool),
|
|
451
|
+
});
|
|
452
|
+
if (holdCheck) {
|
|
453
|
+
// Create hold request for human review
|
|
454
|
+
const holdRequest = this.holdManager.createHold(request, holdCheck.reason, holdCheck.severity, {
|
|
455
|
+
...holdCheck.evidence,
|
|
456
|
+
predictedDrift: predictedDriftScore,
|
|
457
|
+
frame,
|
|
458
|
+
tool,
|
|
459
|
+
agentId,
|
|
460
|
+
});
|
|
461
|
+
preFlightCheck.held = true;
|
|
462
|
+
preFlightCheck.holdRequest = holdRequest;
|
|
463
|
+
return {
|
|
464
|
+
success: false,
|
|
465
|
+
allowed: false,
|
|
466
|
+
held: true,
|
|
467
|
+
holdRequest,
|
|
468
|
+
preFlightCheck,
|
|
469
|
+
interceptorDecision: {
|
|
470
|
+
allowed: false,
|
|
471
|
+
held: true,
|
|
472
|
+
holdReason: holdCheck.reason,
|
|
473
|
+
reason: `Execution held for approval: ${holdCheck.reason}`,
|
|
474
|
+
frame,
|
|
475
|
+
proposedAction: tool,
|
|
476
|
+
coverageConfidence: resolved.parseConfidence || 0,
|
|
477
|
+
timestamp,
|
|
478
|
+
auditId,
|
|
479
|
+
preFlightChecks: {
|
|
480
|
+
circuitBreakerPassed: preFlightCheck.checks.circuitBreaker.passed,
|
|
481
|
+
driftPredictionPassed: preFlightCheck.checks.driftPrediction.passed,
|
|
482
|
+
baselineCheckPassed: preFlightCheck.checks.baseline.passed,
|
|
483
|
+
predictedDriftScore,
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
// If resuming from hold, use modified frame/args if provided
|
|
490
|
+
const effectiveFrame = holdDecision?.modifiedFrame || frame;
|
|
491
|
+
const effectiveArgs = holdDecision?.modifiedArgs || args;
|
|
492
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
493
|
+
// STEP 5: INTERCEPTOR CHECK
|
|
494
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
495
|
+
const decision = this.interceptor.intercept(resolved, tool, effectiveArgs, agentId);
|
|
496
|
+
if (!decision.allowed) {
|
|
497
|
+
this.recordExecution(agentId, request, decision, undefined);
|
|
498
|
+
// Record operation as blocked in drift engine
|
|
499
|
+
driftEngine.recordOperation(agentId, frame, tool, false);
|
|
500
|
+
return {
|
|
501
|
+
success: false,
|
|
502
|
+
allowed: false,
|
|
503
|
+
error: decision.reason,
|
|
504
|
+
preFlightCheck,
|
|
505
|
+
interceptorDecision: {
|
|
506
|
+
...decision,
|
|
507
|
+
preFlightChecks: {
|
|
508
|
+
circuitBreakerPassed: preFlightCheck.checks.circuitBreaker.passed,
|
|
509
|
+
driftPredictionPassed: preFlightCheck.checks.driftPrediction.passed,
|
|
510
|
+
baselineCheckPassed: preFlightCheck.checks.baseline.passed,
|
|
511
|
+
predictedDriftScore,
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
517
|
+
// STEP 6: TOOL EXECUTION
|
|
518
|
+
// All pre-execution checks passed - now execute
|
|
519
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
520
|
+
preFlightCheck.passed = true;
|
|
521
|
+
const result = this.simulateToolExecution(tool, effectiveArgs);
|
|
522
|
+
// Record successful operation in drift engine
|
|
523
|
+
driftEngine.recordOperation(agentId, frame, tool, true);
|
|
524
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
525
|
+
// STEP 7: POST-AUDIT
|
|
526
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
527
|
+
const postAudit = this.performPostAudit(agentId, request, decision, result);
|
|
528
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
529
|
+
// STEP 8: IMMEDIATE ACTION ON DRIFT
|
|
530
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
531
|
+
if (postAudit.driftDetected && postAudit.alerts.length > 0) {
|
|
532
|
+
const maxSeverity = postAudit.alerts.reduce((max, a) => a.severity === 'critical' ? 'critical' :
|
|
533
|
+
a.severity === 'high' && max !== 'critical' ? 'high' :
|
|
534
|
+
a.severity === 'medium' && max !== 'critical' && max !== 'high' ? 'medium' : max, 'low');
|
|
535
|
+
// Take immediate action based on configuration
|
|
536
|
+
if (config.haltOnCriticalDrift && maxSeverity === 'critical') {
|
|
537
|
+
driftEngine.haltAgent(agentId, `Critical drift detected: ${postAudit.alerts[0].message}`);
|
|
538
|
+
}
|
|
539
|
+
else if (config.haltOnHighDrift && (maxSeverity === 'critical' || maxSeverity === 'high')) {
|
|
540
|
+
driftEngine.haltAgent(agentId, `High drift detected: ${postAudit.alerts[0].message}`);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
544
|
+
// STEP 9: RECORD AND RETURN
|
|
545
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
546
|
+
this.recordExecution(agentId, request, decision, result);
|
|
547
|
+
this.activeFrames.set(agentId, resolved);
|
|
548
|
+
return {
|
|
549
|
+
success: true,
|
|
550
|
+
allowed: true,
|
|
551
|
+
result,
|
|
552
|
+
preFlightCheck,
|
|
553
|
+
interceptorDecision: {
|
|
554
|
+
...decision,
|
|
555
|
+
preFlightChecks: {
|
|
556
|
+
circuitBreakerPassed: true,
|
|
557
|
+
driftPredictionPassed: preFlightCheck.checks.driftPrediction.passed,
|
|
558
|
+
baselineCheckPassed: preFlightCheck.checks.baseline.passed,
|
|
559
|
+
predictedDriftScore,
|
|
560
|
+
},
|
|
561
|
+
},
|
|
562
|
+
postAudit,
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Log circuit breaker block to audit trail.
|
|
567
|
+
*/
|
|
568
|
+
logCircuitBreakerBlock(agentId, frame, tool, reason) {
|
|
569
|
+
// Record in drift engine
|
|
570
|
+
driftEngine.recordOperation(agentId, frame, tool, false);
|
|
571
|
+
// Add to execution history with blocked status
|
|
572
|
+
const decision = {
|
|
573
|
+
allowed: false,
|
|
574
|
+
reason: `Circuit breaker blocked: ${reason || 'Agent halted'}`,
|
|
575
|
+
frame,
|
|
576
|
+
proposedAction: tool,
|
|
577
|
+
coverageConfidence: 0,
|
|
578
|
+
timestamp: Date.now(),
|
|
579
|
+
auditId: generateAuditId(),
|
|
580
|
+
};
|
|
581
|
+
this.recordExecution(agentId, { agentId, frame, tool, arguments: {} }, decision, undefined);
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Simulate tool execution (placeholder for actual implementation).
|
|
585
|
+
*/
|
|
586
|
+
simulateToolExecution(tool, args) {
|
|
587
|
+
// In real implementation, this would call the actual tool
|
|
588
|
+
return {
|
|
589
|
+
tool,
|
|
590
|
+
executed: true,
|
|
591
|
+
timestamp: Date.now(),
|
|
592
|
+
args,
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Perform post-execution audit.
|
|
597
|
+
*/
|
|
598
|
+
performPostAudit(agentId, request, decision, result) {
|
|
599
|
+
const auditId = generateAuditId();
|
|
600
|
+
const alerts = [];
|
|
601
|
+
// Check 1: Action match - did result match expected behavior?
|
|
602
|
+
const expectedActions = [request.tool];
|
|
603
|
+
const actualActions = this.extractActionsFromResult(result);
|
|
604
|
+
const actionMatch = this.calculateActionMatch(expectedActions, actualActions);
|
|
605
|
+
// Check 2: Drift detection - compare to historical behavior
|
|
606
|
+
const history = this.executionHistory.get(agentId) || [];
|
|
607
|
+
const similarExecutions = history.filter(h => h.request.frame === request.frame);
|
|
608
|
+
if (similarExecutions.length > 5) {
|
|
609
|
+
const historicalActions = similarExecutions.map(h => this.extractActionsFromResult(h.result)).flat();
|
|
610
|
+
const currentActions = this.extractActionsFromResult(result);
|
|
611
|
+
// If current behavior differs significantly from historical, flag drift
|
|
612
|
+
const behaviorHash = generateBehaviorHash(currentActions);
|
|
613
|
+
const historicalHash = generateBehaviorHash(historicalActions.slice(-10));
|
|
614
|
+
if (behaviorHash !== historicalHash && similarExecutions.length > 10) {
|
|
615
|
+
alerts.push({
|
|
616
|
+
alertId: generateAuditId(),
|
|
617
|
+
agentId,
|
|
618
|
+
type: 'goal_displacement',
|
|
619
|
+
severity: 'medium',
|
|
620
|
+
message: 'Behavior pattern change detected for identical frame',
|
|
621
|
+
detectedAt: Date.now(),
|
|
622
|
+
evidence: {
|
|
623
|
+
frame: request.frame,
|
|
624
|
+
historicalPattern: historicalHash.substring(0, 16),
|
|
625
|
+
currentPattern: behaviorHash.substring(0, 16),
|
|
626
|
+
},
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
return {
|
|
631
|
+
auditId,
|
|
632
|
+
actionMatchScore: actionMatch,
|
|
633
|
+
driftDetected: alerts.length > 0,
|
|
634
|
+
alerts,
|
|
635
|
+
timestamp: Date.now(),
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Extract action names from a result object.
|
|
640
|
+
*/
|
|
641
|
+
extractActionsFromResult(result) {
|
|
642
|
+
if (!result || typeof result !== 'object') {
|
|
643
|
+
return [];
|
|
644
|
+
}
|
|
645
|
+
const actions = [];
|
|
646
|
+
const r = result;
|
|
647
|
+
if (r['tool'])
|
|
648
|
+
actions.push(String(r['tool']));
|
|
649
|
+
if (r['action'])
|
|
650
|
+
actions.push(String(r['action']));
|
|
651
|
+
if (r['executed'])
|
|
652
|
+
actions.push('executed');
|
|
653
|
+
return actions;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Calculate how well actual actions matched expected.
|
|
657
|
+
*/
|
|
658
|
+
calculateActionMatch(expected, actual) {
|
|
659
|
+
if (expected.length === 0)
|
|
660
|
+
return 1;
|
|
661
|
+
const matches = expected.filter(e => actual.includes(e));
|
|
662
|
+
return matches.length / expected.length;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Record an execution in history.
|
|
666
|
+
*/
|
|
667
|
+
recordExecution(agentId, request, decision, result) {
|
|
668
|
+
if (!this.executionHistory.has(agentId)) {
|
|
669
|
+
this.executionHistory.set(agentId, []);
|
|
670
|
+
}
|
|
671
|
+
const history = this.executionHistory.get(agentId);
|
|
672
|
+
history.push({
|
|
673
|
+
request,
|
|
674
|
+
decision,
|
|
675
|
+
result,
|
|
676
|
+
timestamp: Date.now(),
|
|
677
|
+
});
|
|
678
|
+
// Keep only last N executions per agent (configurable via evictionConfig)
|
|
679
|
+
const maxExecutions = this.evictionConfig.maxExecutionsPerAgent;
|
|
680
|
+
if (history.length > maxExecutions) {
|
|
681
|
+
this.executionHistory.set(agentId, history.slice(-maxExecutions));
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
685
|
+
// AGENT MANAGEMENT
|
|
686
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
687
|
+
/**
|
|
688
|
+
* Get the active frame for an agent.
|
|
689
|
+
*/
|
|
690
|
+
getActiveFrame(agentId) {
|
|
691
|
+
return this.activeFrames.get(agentId);
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Clear the active frame for an agent.
|
|
695
|
+
*/
|
|
696
|
+
clearActiveFrame(agentId) {
|
|
697
|
+
this.activeFrames.delete(agentId);
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Get execution history for an agent.
|
|
701
|
+
*/
|
|
702
|
+
getExecutionHistory(agentId, limit = 100) {
|
|
703
|
+
const history = this.executionHistory.get(agentId) || [];
|
|
704
|
+
return history.slice(-limit);
|
|
705
|
+
}
|
|
706
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
707
|
+
// PRECHECK (DRY RUN)
|
|
708
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
709
|
+
/**
|
|
710
|
+
* Check if an action would be allowed without executing.
|
|
711
|
+
*/
|
|
712
|
+
precheck(frame, tool, args, parentFrame) {
|
|
713
|
+
// Parse and resolve
|
|
714
|
+
const { parsed, resolved, validation } = this.processFrame(frame, parentFrame);
|
|
715
|
+
if (!validation.valid) {
|
|
716
|
+
return {
|
|
717
|
+
allowed: false,
|
|
718
|
+
reason: 'Frame validation failed',
|
|
719
|
+
frame,
|
|
720
|
+
proposedAction: tool,
|
|
721
|
+
coverageConfidence: 0,
|
|
722
|
+
timestamp: Date.now(),
|
|
723
|
+
auditId: generateAuditId(),
|
|
724
|
+
validationReport: validation,
|
|
725
|
+
uncoveredAspects: ['validation']
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
// Calculate coverage
|
|
729
|
+
const coverage = this.coverageCalculator.calculate(resolved, tool, args);
|
|
730
|
+
// Get interceptor decision (without executing)
|
|
731
|
+
const decision = this.interceptor.intercept(resolved, tool, args, 'precheck');
|
|
732
|
+
return {
|
|
733
|
+
...decision,
|
|
734
|
+
validationReport: validation,
|
|
735
|
+
coverageConfidence: coverage.confidence,
|
|
736
|
+
uncoveredAspects: coverage.uncoveredAspects
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
740
|
+
// STATE MANAGEMENT
|
|
741
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
742
|
+
/**
|
|
743
|
+
* Get agent state for ps_state tool.
|
|
744
|
+
*/
|
|
745
|
+
getAgentState(agentId) {
|
|
746
|
+
const history = this.executionHistory.get(agentId);
|
|
747
|
+
if (!history || history.length === 0)
|
|
748
|
+
return null;
|
|
749
|
+
const lastExecution = history[history.length - 1];
|
|
750
|
+
const activeFrame = this.activeFrames.get(agentId);
|
|
751
|
+
return {
|
|
752
|
+
activeFrame: activeFrame?.raw ?? null,
|
|
753
|
+
lastAction: lastExecution.request.tool ?? null,
|
|
754
|
+
lastActionTime: lastExecution.timestamp,
|
|
755
|
+
delegationsAsParent: 0, // Managed by ps_delegate
|
|
756
|
+
delegationsAsChild: 0 // Managed by ps_delegate
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Get operation statistics.
|
|
761
|
+
*/
|
|
762
|
+
getOperationStats() {
|
|
763
|
+
let total = 0, successful = 0, blocked = 0, failed = 0;
|
|
764
|
+
for (const history of this.executionHistory.values()) {
|
|
765
|
+
for (const execution of history) {
|
|
766
|
+
total++;
|
|
767
|
+
if (execution.decision.allowed) {
|
|
768
|
+
if (execution.result)
|
|
769
|
+
successful++;
|
|
770
|
+
else
|
|
771
|
+
failed++;
|
|
772
|
+
}
|
|
773
|
+
else {
|
|
774
|
+
blocked++;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
return { total, successful, blocked, failed };
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Get operation statistics for a specific agent.
|
|
782
|
+
*/
|
|
783
|
+
getAgentOperationStats(agentId) {
|
|
784
|
+
const history = this.executionHistory.get(agentId);
|
|
785
|
+
if (!history)
|
|
786
|
+
return null;
|
|
787
|
+
let successful = 0, blocked = 0, failed = 0;
|
|
788
|
+
for (const execution of history) {
|
|
789
|
+
if (execution.decision.allowed) {
|
|
790
|
+
if (execution.result)
|
|
791
|
+
successful++;
|
|
792
|
+
else
|
|
793
|
+
failed++;
|
|
794
|
+
}
|
|
795
|
+
else {
|
|
796
|
+
blocked++;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return {
|
|
800
|
+
total: history.length,
|
|
801
|
+
successful,
|
|
802
|
+
blocked,
|
|
803
|
+
failed
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
807
|
+
// CONVENIENCE ALIASES
|
|
808
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
809
|
+
/**
|
|
810
|
+
* Alias for resolveFrame - resolve a frame with operator overrides.
|
|
811
|
+
*/
|
|
812
|
+
resolve(frame) {
|
|
813
|
+
return this.resolveFrame(frame);
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Alias for validateFrame - validate a frame.
|
|
817
|
+
*/
|
|
818
|
+
validate(frame, parentFrame) {
|
|
819
|
+
return this.validateFrame(frame, parentFrame);
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Alias for execute that returns just the interceptor decision.
|
|
823
|
+
* Wraps execute() to provide a simpler API for action interception.
|
|
824
|
+
*/
|
|
825
|
+
intercept(action, frame, agentId) {
|
|
826
|
+
const result = this.execute({ agentId, frame, tool: action, arguments: {} });
|
|
827
|
+
return result.interceptorDecision;
|
|
828
|
+
}
|
|
829
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
830
|
+
// AUDIT
|
|
831
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
832
|
+
/**
|
|
833
|
+
* Get audit log.
|
|
834
|
+
*/
|
|
835
|
+
getAuditLog(limit = 100) {
|
|
836
|
+
return this.interceptor.getAuditLog(limit);
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Get audit log for a specific agent.
|
|
840
|
+
*/
|
|
841
|
+
getAgentAuditLog(agentId, limit = 100) {
|
|
842
|
+
return this.interceptor.getAgentAuditLog(agentId, limit);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
// Export singleton and classes
|
|
846
|
+
export const gatekeeper = new Gatekeeper();
|
|
847
|
+
export { DynamicResolver } from './resolver.js';
|
|
848
|
+
export { FrameValidator } from './validator.js';
|
|
849
|
+
export { ActionInterceptor } from './interceptor.js';
|
|
850
|
+
export { CoverageCalculator } from './coverage.js';
|
|
851
|
+
export { HoldManager, holdManager } from './hold-manager.js';
|
|
852
|
+
// Re-export drift engine for convenience
|
|
853
|
+
export { driftEngine } from '../drift/index.js';
|
|
854
|
+
//# sourceMappingURL=index.js.map
|