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,723 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// PROMPTSPEAK MCP SERVER - HOLD MANAGER
|
|
3
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
4
|
+
// The Hold Manager implements human-in-the-loop approval for:
|
|
5
|
+
// - High-risk tool calls that need human review
|
|
6
|
+
// - Drift predictions that exceed thresholds
|
|
7
|
+
// - MCP validation pending states
|
|
8
|
+
// - Circuit breaker overrides
|
|
9
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
10
|
+
import { generateAuditId } from '../utils/hash.js';
|
|
11
|
+
const DEFAULT_HOLD_TIMEOUT_MS = 300000; // 5 minutes
|
|
12
|
+
const DEFAULT_EXECUTION_CONTROL = {
|
|
13
|
+
// Pre-execution blocking - ALL ENABLED BY DEFAULT
|
|
14
|
+
enableCircuitBreakerCheck: true,
|
|
15
|
+
enablePreFlightDriftPrediction: true,
|
|
16
|
+
enableBaselineComparison: true,
|
|
17
|
+
// Hold behavior
|
|
18
|
+
holdOnDriftPrediction: true, // Hold for human review instead of hard block
|
|
19
|
+
holdOnLowConfidence: true,
|
|
20
|
+
holdOnForbiddenWithOverride: false, // ⛔ is hard block by default
|
|
21
|
+
holdTimeoutMs: DEFAULT_HOLD_TIMEOUT_MS,
|
|
22
|
+
// Thresholds
|
|
23
|
+
driftPredictionThreshold: 0.25, // Matches circuit breaker default
|
|
24
|
+
baselineDeviationThreshold: 0.30,
|
|
25
|
+
// MCP validation
|
|
26
|
+
enableMcpValidation: true,
|
|
27
|
+
mcpValidationTools: [], // Operator configures which tools need MCP validation
|
|
28
|
+
// Immediate action on post-audit
|
|
29
|
+
haltOnCriticalDrift: true,
|
|
30
|
+
haltOnHighDrift: true,
|
|
31
|
+
};
|
|
32
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
33
|
+
// LEGAL HOLD CONFIGURATION
|
|
34
|
+
// Legal domain (◇) frames require special handling for:
|
|
35
|
+
// - Malpractice risk (bar discipline, sanctions)
|
|
36
|
+
// - Privilege waiver (permanent, catastrophic)
|
|
37
|
+
// - Court deadlines (jurisdictional, non-recoverable)
|
|
38
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
39
|
+
const DEFAULT_LEGAL_HOLD_CONFIG = {
|
|
40
|
+
enableLegalHolds: true,
|
|
41
|
+
citationVerification: {
|
|
42
|
+
enabled: true,
|
|
43
|
+
databases: ['westlaw', 'lexis', 'courtlistener'],
|
|
44
|
+
verificationTimeoutMs: 30000,
|
|
45
|
+
cacheResults: true,
|
|
46
|
+
},
|
|
47
|
+
deadlineMonitoring: {
|
|
48
|
+
enabled: true,
|
|
49
|
+
warningThresholdHours: 168, // 7 days
|
|
50
|
+
criticalThresholdHours: 24, // 24 hours
|
|
51
|
+
calendarIntegration: undefined,
|
|
52
|
+
},
|
|
53
|
+
judgePreference: {
|
|
54
|
+
enabled: true,
|
|
55
|
+
dataStalenessThresholdDays: 365,
|
|
56
|
+
minimumConfidenceThreshold: 0.5,
|
|
57
|
+
},
|
|
58
|
+
jurisdictionCheck: {
|
|
59
|
+
enabled: true,
|
|
60
|
+
strictMode: false, // Allow persuasive authority by default
|
|
61
|
+
},
|
|
62
|
+
privilegeDetection: {
|
|
63
|
+
enabled: true,
|
|
64
|
+
sensitivityLevel: 'high', // Default to high for safety
|
|
65
|
+
alwaysHoldForExternal: true, // Always hold if destination is external
|
|
66
|
+
},
|
|
67
|
+
fabricationDetection: {
|
|
68
|
+
enabled: true,
|
|
69
|
+
semanticEntropyThreshold: 0.6,
|
|
70
|
+
requireSourceVerification: true,
|
|
71
|
+
},
|
|
72
|
+
notifications: {
|
|
73
|
+
deadlineAlertEmails: [],
|
|
74
|
+
privilegeAlertEmails: [],
|
|
75
|
+
escalationEmails: [],
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
// Legal domain symbol for frame detection
|
|
79
|
+
const LEGAL_DOMAIN_SYMBOL = '◇';
|
|
80
|
+
// Hold reasons that should NEVER auto-expire (require human decision)
|
|
81
|
+
const NEVER_EXPIRE_REASONS = ['legal_privilege_risk'];
|
|
82
|
+
// Critical deadline types that escalate severity
|
|
83
|
+
const CRITICAL_DEADLINE_TYPES = [
|
|
84
|
+
'statute_of_limitations',
|
|
85
|
+
'appellate_filing',
|
|
86
|
+
];
|
|
87
|
+
export class HoldManager {
|
|
88
|
+
pendingHolds = new Map();
|
|
89
|
+
holdHistory = [];
|
|
90
|
+
config;
|
|
91
|
+
legalConfig;
|
|
92
|
+
// Callbacks for external notification
|
|
93
|
+
onHoldCreated;
|
|
94
|
+
onHoldDecided;
|
|
95
|
+
onLegalHoldEscalation;
|
|
96
|
+
constructor(config, legalConfig) {
|
|
97
|
+
this.config = { ...DEFAULT_EXECUTION_CONTROL, ...config };
|
|
98
|
+
this.legalConfig = { ...DEFAULT_LEGAL_HOLD_CONFIG, ...legalConfig };
|
|
99
|
+
}
|
|
100
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
101
|
+
// CONFIGURATION
|
|
102
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
103
|
+
/**
|
|
104
|
+
* Update execution control configuration.
|
|
105
|
+
* This is the operator's "knob" for controlling hold behavior.
|
|
106
|
+
*/
|
|
107
|
+
setConfig(config) {
|
|
108
|
+
this.config = { ...this.config, ...config };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get current configuration.
|
|
112
|
+
*/
|
|
113
|
+
getConfig() {
|
|
114
|
+
return { ...this.config };
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Update legal hold configuration.
|
|
118
|
+
*/
|
|
119
|
+
setLegalConfig(config) {
|
|
120
|
+
this.legalConfig = { ...this.legalConfig, ...config };
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get current legal hold configuration.
|
|
124
|
+
*/
|
|
125
|
+
getLegalConfig() {
|
|
126
|
+
return { ...this.legalConfig };
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Set callback for when a hold is created (for MCP notification).
|
|
130
|
+
*/
|
|
131
|
+
setOnHoldCreated(callback) {
|
|
132
|
+
this.onHoldCreated = callback;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Set callback for legal hold escalation (deadline missed, privilege stale).
|
|
136
|
+
*/
|
|
137
|
+
setOnLegalHoldEscalation(callback) {
|
|
138
|
+
this.onLegalHoldEscalation = callback;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Set callback for when a hold is decided.
|
|
142
|
+
*/
|
|
143
|
+
setOnHoldDecided(callback) {
|
|
144
|
+
this.onHoldDecided = callback;
|
|
145
|
+
}
|
|
146
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
147
|
+
// HOLD CREATION
|
|
148
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
149
|
+
/**
|
|
150
|
+
* Create a hold request for human review.
|
|
151
|
+
*
|
|
152
|
+
* @param customExpiryMs - Optional custom expiry time in ms (used for deadline_risk)
|
|
153
|
+
* Pass Infinity for holds that should NEVER expire (privilege_risk)
|
|
154
|
+
*/
|
|
155
|
+
createHold(request, reason, severity, evidence, customExpiryMs) {
|
|
156
|
+
const holdId = `hold_${generateAuditId()}`;
|
|
157
|
+
const now = Date.now();
|
|
158
|
+
// Determine expiry time
|
|
159
|
+
let expiresAt;
|
|
160
|
+
if (NEVER_EXPIRE_REASONS.includes(reason)) {
|
|
161
|
+
// Privilege risk and other critical legal holds NEVER auto-expire
|
|
162
|
+
expiresAt = Infinity;
|
|
163
|
+
}
|
|
164
|
+
else if (customExpiryMs !== undefined) {
|
|
165
|
+
// Custom expiry (e.g., deadline-based)
|
|
166
|
+
expiresAt = now + customExpiryMs;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
// Default timeout
|
|
170
|
+
expiresAt = now + this.config.holdTimeoutMs;
|
|
171
|
+
}
|
|
172
|
+
const hold = {
|
|
173
|
+
holdId,
|
|
174
|
+
agentId: request.agentId,
|
|
175
|
+
frame: request.frame,
|
|
176
|
+
tool: request.tool,
|
|
177
|
+
arguments: request.arguments,
|
|
178
|
+
reason,
|
|
179
|
+
severity,
|
|
180
|
+
createdAt: now,
|
|
181
|
+
expiresAt,
|
|
182
|
+
state: 'pending',
|
|
183
|
+
driftScore: evidence['driftScore'],
|
|
184
|
+
predictedDrift: evidence['predictedDrift'],
|
|
185
|
+
evidence,
|
|
186
|
+
};
|
|
187
|
+
this.pendingHolds.set(holdId, hold);
|
|
188
|
+
// Notify via callback
|
|
189
|
+
if (this.onHoldCreated) {
|
|
190
|
+
this.onHoldCreated(hold);
|
|
191
|
+
}
|
|
192
|
+
return hold;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Check if a request should be held based on configuration.
|
|
196
|
+
* Returns null if no hold needed, or the reason if hold required.
|
|
197
|
+
*/
|
|
198
|
+
shouldHold(request, preFlightResults) {
|
|
199
|
+
// Check MCP validation first
|
|
200
|
+
if (this.config.enableMcpValidation && preFlightResults.requiresMcpValidation) {
|
|
201
|
+
return {
|
|
202
|
+
reason: 'mcp_validation_pending',
|
|
203
|
+
severity: 'medium',
|
|
204
|
+
evidence: { tool: request.tool, requiresMcpValidation: true },
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
// Check drift prediction
|
|
208
|
+
if (this.config.enablePreFlightDriftPrediction &&
|
|
209
|
+
this.config.holdOnDriftPrediction &&
|
|
210
|
+
preFlightResults.predictedDriftScore !== undefined &&
|
|
211
|
+
preFlightResults.predictedDriftScore > this.config.driftPredictionThreshold) {
|
|
212
|
+
const severity = preFlightResults.predictedDriftScore > 0.5 ? 'critical' :
|
|
213
|
+
preFlightResults.predictedDriftScore > 0.35 ? 'high' : 'medium';
|
|
214
|
+
return {
|
|
215
|
+
reason: 'pre_flight_drift_prediction',
|
|
216
|
+
severity,
|
|
217
|
+
evidence: {
|
|
218
|
+
predictedDrift: preFlightResults.predictedDriftScore,
|
|
219
|
+
threshold: this.config.driftPredictionThreshold,
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
// Check baseline deviation
|
|
224
|
+
if (this.config.enableBaselineComparison &&
|
|
225
|
+
preFlightResults.baselineDeviation !== undefined &&
|
|
226
|
+
preFlightResults.baselineDeviation > this.config.baselineDeviationThreshold) {
|
|
227
|
+
return {
|
|
228
|
+
reason: 'drift_threshold_exceeded',
|
|
229
|
+
severity: 'high',
|
|
230
|
+
evidence: {
|
|
231
|
+
baselineDeviation: preFlightResults.baselineDeviation,
|
|
232
|
+
threshold: this.config.baselineDeviationThreshold,
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
// Check low confidence
|
|
237
|
+
if (this.config.holdOnLowConfidence &&
|
|
238
|
+
preFlightResults.confidenceScore !== undefined &&
|
|
239
|
+
preFlightResults.confidenceScore < 0.7 // Hardcoded low confidence threshold
|
|
240
|
+
) {
|
|
241
|
+
return {
|
|
242
|
+
reason: 'confidence_below_threshold',
|
|
243
|
+
severity: 'low',
|
|
244
|
+
evidence: {
|
|
245
|
+
confidenceScore: preFlightResults.confidenceScore,
|
|
246
|
+
threshold: 0.7,
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
// Check forbidden with override
|
|
251
|
+
if (this.config.holdOnForbiddenWithOverride && preFlightResults.isForbidden) {
|
|
252
|
+
return {
|
|
253
|
+
reason: 'forbidden_constraint',
|
|
254
|
+
severity: 'critical',
|
|
255
|
+
evidence: { isForbidden: true, allowOverride: true },
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
261
|
+
// LEGAL DOMAIN HOLDS (◇ Frame Detection)
|
|
262
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
263
|
+
/**
|
|
264
|
+
* Check if frame is in legal domain (◇).
|
|
265
|
+
*/
|
|
266
|
+
isLegalDomainFrame(frame) {
|
|
267
|
+
return frame.includes(LEGAL_DOMAIN_SYMBOL);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Calculate deadline hold severity based on time remaining.
|
|
271
|
+
* Severity escalates as deadline approaches.
|
|
272
|
+
*/
|
|
273
|
+
calculateDeadlineSeverity(hoursRemaining, deadlineType) {
|
|
274
|
+
// Past deadline = always critical
|
|
275
|
+
if (hoursRemaining < 0)
|
|
276
|
+
return 'critical';
|
|
277
|
+
const isCriticalType = CRITICAL_DEADLINE_TYPES.includes(deadlineType);
|
|
278
|
+
const criticalHours = this.legalConfig.deadlineMonitoring.criticalThresholdHours;
|
|
279
|
+
const warningHours = this.legalConfig.deadlineMonitoring.warningThresholdHours;
|
|
280
|
+
if (hoursRemaining < criticalHours) {
|
|
281
|
+
return 'critical';
|
|
282
|
+
}
|
|
283
|
+
else if (hoursRemaining < criticalHours * 3) { // 72 hours by default
|
|
284
|
+
return isCriticalType ? 'critical' : 'high';
|
|
285
|
+
}
|
|
286
|
+
else if (hoursRemaining < warningHours) {
|
|
287
|
+
return isCriticalType ? 'high' : 'medium';
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
return isCriticalType ? 'medium' : 'low';
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Calculate custom expiry for deadline holds.
|
|
295
|
+
* Expires 2 hours before deadline (minimum 15 minutes).
|
|
296
|
+
*/
|
|
297
|
+
calculateDeadlineHoldExpiry(deadline) {
|
|
298
|
+
const deadlineMs = deadline.deadlineTimestamp;
|
|
299
|
+
const now = Date.now();
|
|
300
|
+
// Hold expires 2 hours before deadline (minimum 15 minutes from now)
|
|
301
|
+
const twoHoursBefore = deadlineMs - (2 * 60 * 60 * 1000);
|
|
302
|
+
const fifteenMinutes = now + (15 * 60 * 1000);
|
|
303
|
+
// Take the later of: 15 min from now, or 2 hours before deadline
|
|
304
|
+
// But never after the deadline itself
|
|
305
|
+
return Math.min(Math.max(twoHoursBefore, fifteenMinutes), deadlineMs);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Check if a legal domain request should be held.
|
|
309
|
+
* Called for frames containing ◇ (legal domain symbol).
|
|
310
|
+
*
|
|
311
|
+
* Checks are ordered by severity (critical first):
|
|
312
|
+
* 1. privilege_risk (NEVER auto-expires)
|
|
313
|
+
* 2. deadline_risk (dynamic severity)
|
|
314
|
+
* 3. fabrication_flag
|
|
315
|
+
* 4. citation_unverified
|
|
316
|
+
* 5. jurisdiction_mismatch
|
|
317
|
+
* 6. judge_preference_unknown
|
|
318
|
+
*
|
|
319
|
+
* @returns null if no legal hold needed, otherwise hold details with optional custom expiry
|
|
320
|
+
*/
|
|
321
|
+
shouldHoldLegal(request, legalResults) {
|
|
322
|
+
// Only applies to legal domain frames (◇)
|
|
323
|
+
if (!legalResults.isLegalDomain)
|
|
324
|
+
return null;
|
|
325
|
+
if (!this.legalConfig.enableLegalHolds)
|
|
326
|
+
return null;
|
|
327
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
328
|
+
// 1. PRIVILEGE RISK - Always critical, NEVER auto-expires
|
|
329
|
+
// Privilege waiver is often permanent and catastrophic.
|
|
330
|
+
// Bar Rule 1.6 (Confidentiality) violations can result in disbarment.
|
|
331
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
332
|
+
if (this.legalConfig.privilegeDetection.enabled &&
|
|
333
|
+
legalResults.privilegeCheck &&
|
|
334
|
+
legalResults.privilegeCheck.riskScore > 0.5) {
|
|
335
|
+
const privilegeEvidence = legalResults.privilegeCheck.privilegeIndicators[0];
|
|
336
|
+
return {
|
|
337
|
+
reason: 'legal_privilege_risk',
|
|
338
|
+
severity: 'critical',
|
|
339
|
+
evidence: {
|
|
340
|
+
...privilegeEvidence,
|
|
341
|
+
riskScore: legalResults.privilegeCheck.riskScore,
|
|
342
|
+
indicators: legalResults.privilegeCheck.privilegeIndicators.length,
|
|
343
|
+
// Include bar discipline warning
|
|
344
|
+
barRiskLevel: 'severe',
|
|
345
|
+
malpracticeExposure: true,
|
|
346
|
+
neverAutoExpire: true,
|
|
347
|
+
},
|
|
348
|
+
// Note: createHold will set expiresAt to Infinity for privilege_risk
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
352
|
+
// 2. DEADLINE RISK - Dynamic severity based on time remaining
|
|
353
|
+
// Filing deadlines are often jurisdictional (cannot be cured).
|
|
354
|
+
// Statute of limitations misses waive client's entire claim.
|
|
355
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
356
|
+
if (this.legalConfig.deadlineMonitoring.enabled &&
|
|
357
|
+
legalResults.deadlineCheck?.criticalDeadline) {
|
|
358
|
+
const deadline = legalResults.deadlineCheck.criticalDeadline;
|
|
359
|
+
const severity = this.calculateDeadlineSeverity(deadline.hoursRemaining, deadline.deadlineType);
|
|
360
|
+
const customExpiryMs = this.calculateDeadlineHoldExpiry(deadline) - Date.now();
|
|
361
|
+
return {
|
|
362
|
+
reason: 'legal_deadline_risk',
|
|
363
|
+
severity,
|
|
364
|
+
evidence: {
|
|
365
|
+
...deadline,
|
|
366
|
+
nearbyDeadlines: legalResults.deadlineCheck.nearbyDeadlines.length,
|
|
367
|
+
barRiskLevel: deadline.hoursRemaining < 0 ? 'severe' : 'high',
|
|
368
|
+
malpracticeExposure: true,
|
|
369
|
+
},
|
|
370
|
+
customExpiryMs: Math.max(customExpiryMs, 15 * 60 * 1000), // Min 15 minutes
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
374
|
+
// 3. FABRICATION FLAG - Critical for citations, high otherwise
|
|
375
|
+
// Fabricated citations violate Rule 3.3 (Candor toward tribunal).
|
|
376
|
+
// Can result in sanctions, malpractice, and bar discipline.
|
|
377
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
378
|
+
if (this.legalConfig.fabricationDetection.enabled &&
|
|
379
|
+
legalResults.fabricationCheck &&
|
|
380
|
+
legalResults.fabricationCheck.overallScore > this.legalConfig.fabricationDetection.semanticEntropyThreshold) {
|
|
381
|
+
const hasCitationFabrication = legalResults.fabricationCheck.flaggedContent
|
|
382
|
+
.some(f => f.fabricationType === 'fabricated_citation');
|
|
383
|
+
const fabricationEvidence = legalResults.fabricationCheck.flaggedContent[0];
|
|
384
|
+
return {
|
|
385
|
+
reason: 'legal_fabrication_flag',
|
|
386
|
+
severity: hasCitationFabrication ? 'critical' : 'high',
|
|
387
|
+
evidence: {
|
|
388
|
+
...fabricationEvidence,
|
|
389
|
+
overallScore: legalResults.fabricationCheck.overallScore,
|
|
390
|
+
flaggedItems: legalResults.fabricationCheck.flaggedContent.length,
|
|
391
|
+
hasCitationFabrication,
|
|
392
|
+
barRiskLevel: hasCitationFabrication ? 'severe' : 'high',
|
|
393
|
+
malpracticeExposure: true,
|
|
394
|
+
},
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
398
|
+
// 4. CITATION UNVERIFIED - High severity
|
|
399
|
+
// Unverified citations risk Rule 3.3 violations.
|
|
400
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
401
|
+
if (this.legalConfig.citationVerification.enabled &&
|
|
402
|
+
legalResults.citationVerification &&
|
|
403
|
+
legalResults.citationVerification.unverifiedCitations.length > 0) {
|
|
404
|
+
return {
|
|
405
|
+
reason: 'legal_citation_unverified',
|
|
406
|
+
severity: 'high',
|
|
407
|
+
evidence: {
|
|
408
|
+
...legalResults.citationVerification.evidence,
|
|
409
|
+
unverifiedCount: legalResults.citationVerification.unverifiedCitations.length,
|
|
410
|
+
unverifiedCitations: legalResults.citationVerification.unverifiedCitations,
|
|
411
|
+
verificationScore: legalResults.citationVerification.verificationScore,
|
|
412
|
+
barRiskLevel: 'high',
|
|
413
|
+
malpracticeExposure: true,
|
|
414
|
+
},
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
418
|
+
// 5. JURISDICTION MISMATCH - High for binding issues, medium otherwise
|
|
419
|
+
// Citing non-binding authority as binding violates candor rules.
|
|
420
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
421
|
+
if (this.legalConfig.jurisdictionCheck.enabled &&
|
|
422
|
+
legalResults.jurisdictionCheck &&
|
|
423
|
+
legalResults.jurisdictionCheck.mismatches.length > 0) {
|
|
424
|
+
const hasBindingMismatch = legalResults.jurisdictionCheck.mismatches.some(m => m.mismatchType === 'wrong_circuit' || m.mismatchType === 'wrong_state');
|
|
425
|
+
const mismatchEvidence = legalResults.jurisdictionCheck.mismatches[0];
|
|
426
|
+
return {
|
|
427
|
+
reason: 'legal_jurisdiction_mismatch',
|
|
428
|
+
severity: hasBindingMismatch ? 'high' : 'medium',
|
|
429
|
+
evidence: {
|
|
430
|
+
...mismatchEvidence,
|
|
431
|
+
totalMismatches: legalResults.jurisdictionCheck.mismatches.length,
|
|
432
|
+
hasBindingMismatch,
|
|
433
|
+
barRiskLevel: hasBindingMismatch ? 'moderate' : 'low',
|
|
434
|
+
malpracticeExposure: hasBindingMismatch,
|
|
435
|
+
},
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
439
|
+
// 6. JUDGE PREFERENCE UNKNOWN - Medium severity (low bar risk)
|
|
440
|
+
// Not a rule violation, but affects case strategy.
|
|
441
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
442
|
+
if (this.legalConfig.judgePreference.enabled &&
|
|
443
|
+
legalResults.judgePreference &&
|
|
444
|
+
!legalResults.judgePreference.preferenceDataExists) {
|
|
445
|
+
// Escalate if hearing is imminent
|
|
446
|
+
const hasImminentHearing = legalResults.judgePreference.evidence?.nextHearing &&
|
|
447
|
+
legalResults.judgePreference.evidence.nextHearing.hoursAway < 72;
|
|
448
|
+
return {
|
|
449
|
+
reason: 'legal_judge_preference_unknown',
|
|
450
|
+
severity: hasImminentHearing ? 'high' : 'medium',
|
|
451
|
+
evidence: {
|
|
452
|
+
...legalResults.judgePreference.evidence,
|
|
453
|
+
judgeId: legalResults.judgePreference.judgeId,
|
|
454
|
+
dataConfidence: legalResults.judgePreference.dataConfidence,
|
|
455
|
+
hasImminentHearing,
|
|
456
|
+
barRiskLevel: 'none',
|
|
457
|
+
malpracticeExposure: false,
|
|
458
|
+
},
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
464
|
+
// HOLD DECISIONS
|
|
465
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
466
|
+
/**
|
|
467
|
+
* Approve a held request (human decision).
|
|
468
|
+
*/
|
|
469
|
+
approveHold(holdId, decidedBy = 'human', reason = 'Approved by operator', modifiedFrame, modifiedArgs) {
|
|
470
|
+
const hold = this.pendingHolds.get(holdId);
|
|
471
|
+
if (!hold)
|
|
472
|
+
return null;
|
|
473
|
+
hold.state = 'approved';
|
|
474
|
+
this.pendingHolds.delete(holdId);
|
|
475
|
+
const decision = {
|
|
476
|
+
holdId,
|
|
477
|
+
state: 'approved',
|
|
478
|
+
decidedBy,
|
|
479
|
+
decidedAt: Date.now(),
|
|
480
|
+
reason,
|
|
481
|
+
modifiedFrame,
|
|
482
|
+
modifiedArgs,
|
|
483
|
+
};
|
|
484
|
+
this.holdHistory.push(decision);
|
|
485
|
+
if (this.onHoldDecided) {
|
|
486
|
+
this.onHoldDecided(decision);
|
|
487
|
+
}
|
|
488
|
+
return decision;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Reject a held request (human decision).
|
|
492
|
+
*/
|
|
493
|
+
rejectHold(holdId, decidedBy = 'human', reason = 'Rejected by operator') {
|
|
494
|
+
const hold = this.pendingHolds.get(holdId);
|
|
495
|
+
if (!hold)
|
|
496
|
+
return null;
|
|
497
|
+
hold.state = 'rejected';
|
|
498
|
+
this.pendingHolds.delete(holdId);
|
|
499
|
+
const decision = {
|
|
500
|
+
holdId,
|
|
501
|
+
state: 'rejected',
|
|
502
|
+
decidedBy,
|
|
503
|
+
decidedAt: Date.now(),
|
|
504
|
+
reason,
|
|
505
|
+
};
|
|
506
|
+
this.holdHistory.push(decision);
|
|
507
|
+
if (this.onHoldDecided) {
|
|
508
|
+
this.onHoldDecided(decision);
|
|
509
|
+
}
|
|
510
|
+
return decision;
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Check for expired holds and auto-reject them.
|
|
514
|
+
*
|
|
515
|
+
* SPECIAL HANDLING:
|
|
516
|
+
* - legal_privilege_risk holds NEVER auto-expire (expiresAt = Infinity)
|
|
517
|
+
* - Stale privilege holds (>24 hours) trigger escalation notifications
|
|
518
|
+
* - legal_deadline_risk holds may have custom expiry times
|
|
519
|
+
*/
|
|
520
|
+
processExpiredHolds() {
|
|
521
|
+
const now = Date.now();
|
|
522
|
+
const expired = [];
|
|
523
|
+
const STALE_PRIVILEGE_THRESHOLD_MS = 24 * 60 * 60 * 1000; // 24 hours
|
|
524
|
+
for (const [holdId, hold] of this.pendingHolds) {
|
|
525
|
+
// NEVER auto-expire privilege_risk holds
|
|
526
|
+
if (NEVER_EXPIRE_REASONS.includes(hold.reason)) {
|
|
527
|
+
// Check if stale and trigger escalation (but don't expire)
|
|
528
|
+
const age = now - hold.createdAt;
|
|
529
|
+
if (age > STALE_PRIVILEGE_THRESHOLD_MS && this.onLegalHoldEscalation) {
|
|
530
|
+
this.onLegalHoldEscalation(hold, `Privilege risk hold pending for ${Math.round(age / (60 * 60 * 1000))} hours without decision`);
|
|
531
|
+
}
|
|
532
|
+
continue; // Do NOT expire
|
|
533
|
+
}
|
|
534
|
+
// Normal expiry handling for other holds
|
|
535
|
+
if (now > hold.expiresAt) {
|
|
536
|
+
// For deadline_risk, add special message
|
|
537
|
+
let expiryReason = 'Hold expired without decision';
|
|
538
|
+
if (hold.reason === 'legal_deadline_risk') {
|
|
539
|
+
const hoursRemaining = hold.evidence['hoursRemaining'];
|
|
540
|
+
if (hoursRemaining !== undefined && hoursRemaining < 0) {
|
|
541
|
+
expiryReason = `CRITICAL: Deadline has passed. Hold expired. Deadline was ${Math.abs(hoursRemaining).toFixed(1)} hours ago.`;
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
expiryReason = `Deadline hold expired. Review required before proceeding.`;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
const decision = this.rejectHold(holdId, 'timeout', expiryReason);
|
|
548
|
+
if (decision) {
|
|
549
|
+
decision.state = 'expired';
|
|
550
|
+
expired.push(decision);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
return expired;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Update deadline hold severities as deadlines approach.
|
|
558
|
+
* Should be called periodically (e.g., every minute).
|
|
559
|
+
*/
|
|
560
|
+
updateDeadlineHoldSeverities() {
|
|
561
|
+
for (const hold of this.pendingHolds.values()) {
|
|
562
|
+
if (hold.reason === 'legal_deadline_risk') {
|
|
563
|
+
const deadlineTimestamp = hold.evidence['deadlineTimestamp'];
|
|
564
|
+
const deadlineType = hold.evidence['deadlineType'];
|
|
565
|
+
if (deadlineTimestamp === undefined || deadlineType === undefined)
|
|
566
|
+
continue;
|
|
567
|
+
const hoursRemaining = (deadlineTimestamp - Date.now()) / (60 * 60 * 1000);
|
|
568
|
+
// Update hours remaining in evidence
|
|
569
|
+
hold.evidence['hoursRemaining'] = hoursRemaining;
|
|
570
|
+
// Recalculate severity
|
|
571
|
+
const newSeverity = this.calculateDeadlineSeverity(hoursRemaining, deadlineType);
|
|
572
|
+
// Update if severity increased
|
|
573
|
+
const severityOrder = { 'low': 0, 'medium': 1, 'high': 2, 'critical': 3 };
|
|
574
|
+
if (severityOrder[newSeverity] > severityOrder[hold.severity]) {
|
|
575
|
+
hold.severity = newSeverity;
|
|
576
|
+
// Trigger escalation notification
|
|
577
|
+
if (this.onLegalHoldEscalation) {
|
|
578
|
+
this.onLegalHoldEscalation(hold, `Deadline hold severity escalated to ${newSeverity}. ${hoursRemaining.toFixed(1)} hours remaining.`);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
// Check for missed deadline
|
|
582
|
+
const deadlineMissed = hold.evidence['deadlineMissed'];
|
|
583
|
+
if (hoursRemaining < 0 && !deadlineMissed) {
|
|
584
|
+
hold.evidence['deadlineMissed'] = true;
|
|
585
|
+
hold.evidence['missedAt'] = Date.now();
|
|
586
|
+
if (this.onLegalHoldEscalation) {
|
|
587
|
+
this.onLegalHoldEscalation(hold, `CRITICAL: Deadline MISSED. Was due ${Math.abs(hoursRemaining).toFixed(1)} hours ago.`);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
594
|
+
// QUERIES
|
|
595
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
596
|
+
/**
|
|
597
|
+
* Get a pending hold by ID.
|
|
598
|
+
*/
|
|
599
|
+
getHold(holdId) {
|
|
600
|
+
return this.pendingHolds.get(holdId);
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Get all pending holds.
|
|
604
|
+
*/
|
|
605
|
+
getPendingHolds() {
|
|
606
|
+
return Array.from(this.pendingHolds.values());
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Get pending holds for an agent.
|
|
610
|
+
*/
|
|
611
|
+
getAgentPendingHolds(agentId) {
|
|
612
|
+
return Array.from(this.pendingHolds.values())
|
|
613
|
+
.filter(h => h.agentId === agentId);
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Get hold decision history.
|
|
617
|
+
*/
|
|
618
|
+
getHoldHistory(limit = 100) {
|
|
619
|
+
return this.holdHistory.slice(-limit);
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Get hold statistics.
|
|
623
|
+
*/
|
|
624
|
+
getStats() {
|
|
625
|
+
const byReason = {
|
|
626
|
+
// System hold reasons
|
|
627
|
+
circuit_breaker_open: 0,
|
|
628
|
+
drift_threshold_exceeded: 0,
|
|
629
|
+
pre_flight_drift_prediction: 0,
|
|
630
|
+
human_approval_required: 0,
|
|
631
|
+
mcp_validation_pending: 0,
|
|
632
|
+
forbidden_constraint: 0,
|
|
633
|
+
confidence_below_threshold: 0,
|
|
634
|
+
// Agent orchestration hold reasons
|
|
635
|
+
agent_spawn_approval: 0,
|
|
636
|
+
agent_resource_exceeded: 0,
|
|
637
|
+
// Legal hold reasons
|
|
638
|
+
legal_citation_unverified: 0,
|
|
639
|
+
legal_deadline_risk: 0,
|
|
640
|
+
legal_judge_preference_unknown: 0,
|
|
641
|
+
legal_jurisdiction_mismatch: 0,
|
|
642
|
+
legal_privilege_risk: 0,
|
|
643
|
+
legal_fabrication_flag: 0,
|
|
644
|
+
};
|
|
645
|
+
for (const hold of this.pendingHolds.values()) {
|
|
646
|
+
byReason[hold.reason]++;
|
|
647
|
+
}
|
|
648
|
+
// Calculate legal hold summary
|
|
649
|
+
const legalHolds = {
|
|
650
|
+
total: byReason.legal_citation_unverified +
|
|
651
|
+
byReason.legal_deadline_risk +
|
|
652
|
+
byReason.legal_judge_preference_unknown +
|
|
653
|
+
byReason.legal_jurisdiction_mismatch +
|
|
654
|
+
byReason.legal_privilege_risk +
|
|
655
|
+
byReason.legal_fabrication_flag,
|
|
656
|
+
privilegeRisk: byReason.legal_privilege_risk,
|
|
657
|
+
deadlineRisk: byReason.legal_deadline_risk,
|
|
658
|
+
fabricationFlag: byReason.legal_fabrication_flag,
|
|
659
|
+
citationUnverified: byReason.legal_citation_unverified,
|
|
660
|
+
jurisdictionMismatch: byReason.legal_jurisdiction_mismatch,
|
|
661
|
+
judgePreferenceUnknown: byReason.legal_judge_preference_unknown,
|
|
662
|
+
};
|
|
663
|
+
return {
|
|
664
|
+
pending: this.pendingHolds.size,
|
|
665
|
+
approved: this.holdHistory.filter(d => d.state === 'approved').length,
|
|
666
|
+
rejected: this.holdHistory.filter(d => d.state === 'rejected').length,
|
|
667
|
+
expired: this.holdHistory.filter(d => d.state === 'expired').length,
|
|
668
|
+
byReason,
|
|
669
|
+
legalHolds,
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Get legal holds only.
|
|
674
|
+
*/
|
|
675
|
+
getLegalHolds() {
|
|
676
|
+
return Array.from(this.pendingHolds.values()).filter(h => h.reason.startsWith('legal_'));
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Get critical legal holds requiring immediate attention.
|
|
680
|
+
* Returns privilege_risk holds and deadline_risk holds with < 24 hours remaining.
|
|
681
|
+
*/
|
|
682
|
+
getCriticalLegalHolds() {
|
|
683
|
+
return Array.from(this.pendingHolds.values()).filter(h => {
|
|
684
|
+
if (h.reason === 'legal_privilege_risk')
|
|
685
|
+
return true;
|
|
686
|
+
if (h.reason === 'legal_deadline_risk') {
|
|
687
|
+
const hoursRemaining = h.evidence['hoursRemaining'];
|
|
688
|
+
return hoursRemaining !== undefined && hoursRemaining < 24;
|
|
689
|
+
}
|
|
690
|
+
return h.severity === 'critical' && h.reason.startsWith('legal_');
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Check if a tool requires MCP validation.
|
|
695
|
+
*/
|
|
696
|
+
requiresMcpValidation(toolName) {
|
|
697
|
+
if (!this.config.enableMcpValidation)
|
|
698
|
+
return false;
|
|
699
|
+
// Check exact match or wildcard patterns
|
|
700
|
+
for (const pattern of this.config.mcpValidationTools) {
|
|
701
|
+
if (pattern === '*')
|
|
702
|
+
return true;
|
|
703
|
+
if (pattern === toolName)
|
|
704
|
+
return true;
|
|
705
|
+
if (pattern.includes('*')) {
|
|
706
|
+
const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$');
|
|
707
|
+
if (regex.test(toolName))
|
|
708
|
+
return true;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
return false;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Clear all holds.
|
|
715
|
+
*/
|
|
716
|
+
clearAll() {
|
|
717
|
+
this.pendingHolds.clear();
|
|
718
|
+
this.holdHistory = [];
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
// Singleton instance
|
|
722
|
+
export const holdManager = new HoldManager();
|
|
723
|
+
//# sourceMappingURL=hold-manager.js.map
|