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,684 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// COURTLISTENER API ADAPTER
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Implements CaseDatabase interface using CourtListener's Citation Lookup API.
|
|
5
|
+
// https://www.courtlistener.com/help/api/rest/v3/citation-lookup/
|
|
6
|
+
//
|
|
7
|
+
// CourtListener is provided by Free Law Project, a 501(c)(3) nonprofit.
|
|
8
|
+
// API is rate-limited to 60 valid citations per minute.
|
|
9
|
+
//
|
|
10
|
+
// This adapter:
|
|
11
|
+
// 1. Queries CourtListener to verify citations exist
|
|
12
|
+
// 2. Caches results to reduce API calls
|
|
13
|
+
// 3. Falls back gracefully on API errors
|
|
14
|
+
// =============================================================================
|
|
15
|
+
import { createLogger } from '../core/logging/index.js';
|
|
16
|
+
const logger = createLogger('CourtListener');
|
|
17
|
+
const DEFAULT_CONFIG = {
|
|
18
|
+
baseUrl: 'https://www.courtlistener.com/api/rest/v4',
|
|
19
|
+
timeoutMs: 30000,
|
|
20
|
+
enableCache: true,
|
|
21
|
+
cacheTtlMs: 24 * 60 * 60 * 1000, // 24 hours
|
|
22
|
+
maxCacheSize: 10000,
|
|
23
|
+
maxRequestsPerMinute: 55, // Stay under 60 limit
|
|
24
|
+
};
|
|
25
|
+
const NOMINATIVE_REPORTERS = [
|
|
26
|
+
{ name: 'Dallas', abbreviation: 'Dall.', usVolumeStart: 1, usVolumeEnd: 4 },
|
|
27
|
+
{ name: 'Cranch', abbreviation: 'Cranch', usVolumeStart: 5, usVolumeEnd: 13 },
|
|
28
|
+
{ name: 'Wheaton', abbreviation: 'Wheat.', usVolumeStart: 14, usVolumeEnd: 25 },
|
|
29
|
+
{ name: 'Peters', abbreviation: 'Pet.', usVolumeStart: 26, usVolumeEnd: 41 },
|
|
30
|
+
{ name: 'Howard', abbreviation: 'How.', usVolumeStart: 42, usVolumeEnd: 65 },
|
|
31
|
+
{ name: 'Black', abbreviation: 'Black', usVolumeStart: 66, usVolumeEnd: 67 },
|
|
32
|
+
{ name: 'Wallace', abbreviation: 'Wall.', usVolumeStart: 68, usVolumeEnd: 90 },
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Convert a U.S. Reports citation to its nominative reporter equivalent.
|
|
36
|
+
* Example: "5 U.S. 137" → "1 Cranch 137"
|
|
37
|
+
*
|
|
38
|
+
* @returns The nominative citation string, or null if not a pre-1875 case
|
|
39
|
+
*/
|
|
40
|
+
function convertToNominativeCitation(volume, reporter, page) {
|
|
41
|
+
// Only apply to U.S. Reports citations
|
|
42
|
+
const normalizedReporter = reporter.toUpperCase().replace(/\./g, '').replace(/\s/g, '');
|
|
43
|
+
if (normalizedReporter !== 'US') {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
// Find the nominative reporter for this volume
|
|
47
|
+
const nominative = NOMINATIVE_REPORTERS.find(r => volume >= r.usVolumeStart && volume <= r.usVolumeEnd);
|
|
48
|
+
if (!nominative) {
|
|
49
|
+
return null; // Volume 91+ uses standard U.S. Reports
|
|
50
|
+
}
|
|
51
|
+
// Calculate the nominative volume number
|
|
52
|
+
// e.g., 5 U.S. → Cranch starts at 5, so 5 - 5 + 1 = 1 Cranch
|
|
53
|
+
const nominativeVolume = volume - nominative.usVolumeStart + 1;
|
|
54
|
+
return `${nominativeVolume} ${nominative.name} ${page}`;
|
|
55
|
+
}
|
|
56
|
+
class CitationCache {
|
|
57
|
+
cache = new Map();
|
|
58
|
+
config;
|
|
59
|
+
constructor(config) {
|
|
60
|
+
this.config = config;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Generate cache key from citation components.
|
|
64
|
+
*/
|
|
65
|
+
makeKey(volume, reporter, page) {
|
|
66
|
+
const normReporter = (reporter ?? '').replace(/\s+/g, '').toLowerCase();
|
|
67
|
+
return `${volume ?? ''}-${normReporter}-${page ?? ''}`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get cached result if valid.
|
|
71
|
+
*/
|
|
72
|
+
get(volume, reporter, page) {
|
|
73
|
+
if (!this.config.enableCache)
|
|
74
|
+
return null;
|
|
75
|
+
const key = this.makeKey(volume, reporter, page);
|
|
76
|
+
const entry = this.cache.get(key);
|
|
77
|
+
if (!entry)
|
|
78
|
+
return null;
|
|
79
|
+
// Check if expired
|
|
80
|
+
if (Date.now() - entry.timestamp > this.config.cacheTtlMs) {
|
|
81
|
+
this.cache.delete(key);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return entry;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Store result in cache.
|
|
88
|
+
*/
|
|
89
|
+
set(volume, reporter, page, record, apiResponse) {
|
|
90
|
+
if (!this.config.enableCache)
|
|
91
|
+
return;
|
|
92
|
+
// Evict oldest entries if at capacity
|
|
93
|
+
if (this.cache.size >= this.config.maxCacheSize) {
|
|
94
|
+
const oldestKey = this.cache.keys().next().value;
|
|
95
|
+
if (oldestKey) {
|
|
96
|
+
this.cache.delete(oldestKey);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const key = this.makeKey(volume, reporter, page);
|
|
100
|
+
this.cache.set(key, {
|
|
101
|
+
record,
|
|
102
|
+
timestamp: Date.now(),
|
|
103
|
+
apiResponse,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get cache statistics.
|
|
108
|
+
*/
|
|
109
|
+
getStats() {
|
|
110
|
+
return {
|
|
111
|
+
size: this.cache.size,
|
|
112
|
+
hitRate: 0, // Would need hit/miss tracking for accurate rate
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Clear the cache.
|
|
117
|
+
*/
|
|
118
|
+
clear() {
|
|
119
|
+
this.cache.clear();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// =============================================================================
|
|
123
|
+
// RATE LIMITER
|
|
124
|
+
// =============================================================================
|
|
125
|
+
class RateLimiter {
|
|
126
|
+
requests = [];
|
|
127
|
+
maxRequests;
|
|
128
|
+
windowMs = 60000; // 1 minute
|
|
129
|
+
constructor(maxRequestsPerMinute) {
|
|
130
|
+
this.maxRequests = maxRequestsPerMinute;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Check if we can make a request.
|
|
134
|
+
*/
|
|
135
|
+
canRequest() {
|
|
136
|
+
this.cleanup();
|
|
137
|
+
return this.requests.length < this.maxRequests;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Record a request.
|
|
141
|
+
*/
|
|
142
|
+
recordRequest() {
|
|
143
|
+
this.requests.push(Date.now());
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get time until next request allowed (ms).
|
|
147
|
+
*/
|
|
148
|
+
getWaitTime() {
|
|
149
|
+
this.cleanup();
|
|
150
|
+
if (this.requests.length < this.maxRequests)
|
|
151
|
+
return 0;
|
|
152
|
+
const oldestRequest = this.requests[0];
|
|
153
|
+
const waitUntil = oldestRequest + this.windowMs;
|
|
154
|
+
return Math.max(0, waitUntil - Date.now());
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Remove expired requests from the window.
|
|
158
|
+
*/
|
|
159
|
+
cleanup() {
|
|
160
|
+
const cutoff = Date.now() - this.windowMs;
|
|
161
|
+
this.requests = this.requests.filter(t => t > cutoff);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// =============================================================================
|
|
165
|
+
// COURTLISTENER CASE DATABASE
|
|
166
|
+
// =============================================================================
|
|
167
|
+
/**
|
|
168
|
+
* CaseDatabase implementation backed by CourtListener API.
|
|
169
|
+
*
|
|
170
|
+
* Usage:
|
|
171
|
+
* const db = new CourtListenerCaseDatabase();
|
|
172
|
+
* const record = await db.lookupCaseAsync('Smith', 500, 'F.3d', 123);
|
|
173
|
+
*
|
|
174
|
+
* Note: The CaseDatabase interface uses synchronous methods, but CourtListener
|
|
175
|
+
* requires async HTTP calls. This adapter provides both sync (cached-only) and
|
|
176
|
+
* async (with API fallback) methods.
|
|
177
|
+
*/
|
|
178
|
+
export class CourtListenerCaseDatabase {
|
|
179
|
+
config;
|
|
180
|
+
cache;
|
|
181
|
+
rateLimiter;
|
|
182
|
+
localOverrides = new Map();
|
|
183
|
+
pendingLookups = new Map();
|
|
184
|
+
// Statistics
|
|
185
|
+
stats = {
|
|
186
|
+
totalLookups: 0,
|
|
187
|
+
cacheHits: 0,
|
|
188
|
+
apiCalls: 0,
|
|
189
|
+
apiErrors: 0,
|
|
190
|
+
casesFound: 0,
|
|
191
|
+
casesNotFound: 0,
|
|
192
|
+
};
|
|
193
|
+
constructor(config) {
|
|
194
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
195
|
+
this.cache = new CitationCache(this.config);
|
|
196
|
+
this.rateLimiter = new RateLimiter(this.config.maxRequestsPerMinute);
|
|
197
|
+
}
|
|
198
|
+
// ===========================================================================
|
|
199
|
+
// CaseDatabase INTERFACE METHODS (Synchronous - Cache Only)
|
|
200
|
+
// ===========================================================================
|
|
201
|
+
/**
|
|
202
|
+
* Synchronous lookup - returns cached results only.
|
|
203
|
+
* For API-backed lookup, use lookupCaseAsync().
|
|
204
|
+
*
|
|
205
|
+
* Returns null if not in cache (caller should use async method).
|
|
206
|
+
*/
|
|
207
|
+
lookupCase(caseName, volume, reporter, page) {
|
|
208
|
+
this.stats.totalLookups++;
|
|
209
|
+
// Check local overrides first
|
|
210
|
+
const overrideKey = this.makeKey(volume, reporter, page);
|
|
211
|
+
const override = this.localOverrides.get(overrideKey);
|
|
212
|
+
if (override) {
|
|
213
|
+
this.stats.cacheHits++;
|
|
214
|
+
return override;
|
|
215
|
+
}
|
|
216
|
+
// Check cache
|
|
217
|
+
const cached = this.cache.get(volume, reporter, page);
|
|
218
|
+
if (cached) {
|
|
219
|
+
this.stats.cacheHits++;
|
|
220
|
+
return cached.record;
|
|
221
|
+
}
|
|
222
|
+
// Not in cache - return null (caller should use async method)
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Add a verified case to local overrides.
|
|
227
|
+
*/
|
|
228
|
+
addVerifiedCase(record) {
|
|
229
|
+
const key = this.makeKey(record.volume, record.reporter, record.page);
|
|
230
|
+
this.localOverrides.set(key, {
|
|
231
|
+
...record,
|
|
232
|
+
addedAt: Date.now(),
|
|
233
|
+
});
|
|
234
|
+
// Also add to cache
|
|
235
|
+
this.cache.set(record.volume, record.reporter, record.page, { ...record, addedAt: Date.now() });
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Mark a case as overruled.
|
|
239
|
+
*/
|
|
240
|
+
markOverruled(volume, reporter, page, overruledBy) {
|
|
241
|
+
const key = this.makeKey(volume, reporter, page);
|
|
242
|
+
// Check if in local overrides
|
|
243
|
+
const existing = this.localOverrides.get(key);
|
|
244
|
+
if (existing) {
|
|
245
|
+
this.localOverrides.set(key, {
|
|
246
|
+
...existing,
|
|
247
|
+
overruled: true,
|
|
248
|
+
overruledBy,
|
|
249
|
+
});
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
// Check cache
|
|
253
|
+
const cached = this.cache.get(volume, reporter, page);
|
|
254
|
+
if (cached?.record) {
|
|
255
|
+
const updated = { ...cached.record, overruled: true, overruledBy };
|
|
256
|
+
this.cache.set(volume, reporter, page, updated, cached.apiResponse);
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Get database statistics.
|
|
263
|
+
*/
|
|
264
|
+
getStats() {
|
|
265
|
+
const overrides = Array.from(this.localOverrides.values());
|
|
266
|
+
return {
|
|
267
|
+
totalCases: overrides.length + this.cache.getStats().size,
|
|
268
|
+
overruledCases: overrides.filter(r => r.overruled).length,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
// ===========================================================================
|
|
272
|
+
// ASYNC LOOKUP METHODS (API-Backed)
|
|
273
|
+
// ===========================================================================
|
|
274
|
+
/**
|
|
275
|
+
* Async lookup with CourtListener API fallback.
|
|
276
|
+
* This is the preferred method for actual citation verification.
|
|
277
|
+
*/
|
|
278
|
+
async lookupCaseAsync(caseName, volume, reporter, page) {
|
|
279
|
+
// Check synchronous sources first
|
|
280
|
+
const syncResult = this.lookupCase(caseName, volume, reporter, page);
|
|
281
|
+
if (syncResult)
|
|
282
|
+
return syncResult;
|
|
283
|
+
// Need volume, reporter, and page for API lookup
|
|
284
|
+
if (volume === null || reporter === null || page === null) {
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
// Check for pending lookup (dedup concurrent requests)
|
|
288
|
+
const key = this.makeKey(volume, reporter, page);
|
|
289
|
+
const pending = this.pendingLookups.get(key);
|
|
290
|
+
if (pending) {
|
|
291
|
+
return pending;
|
|
292
|
+
}
|
|
293
|
+
// Create new lookup promise
|
|
294
|
+
const lookupPromise = this.performApiLookup(caseName, volume, reporter, page);
|
|
295
|
+
this.pendingLookups.set(key, lookupPromise);
|
|
296
|
+
try {
|
|
297
|
+
const result = await lookupPromise;
|
|
298
|
+
return result;
|
|
299
|
+
}
|
|
300
|
+
finally {
|
|
301
|
+
this.pendingLookups.delete(key);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Lookup a citation by text (uses CourtListener's search API).
|
|
306
|
+
* Updated to use /search/ endpoint which is more reliable than /citation-lookup/.
|
|
307
|
+
*
|
|
308
|
+
* IMPORTANT: This method verifies that returned results actually contain the
|
|
309
|
+
* exact citation we're looking for, not just any document matching search terms.
|
|
310
|
+
*
|
|
311
|
+
* For pre-1875 Supreme Court cases, it will automatically try the nominative
|
|
312
|
+
* reporter format (e.g., "1 Cranch 137" instead of "5 U.S. 137").
|
|
313
|
+
*/
|
|
314
|
+
async lookupByText(citationText) {
|
|
315
|
+
// Parse the citation we're looking for
|
|
316
|
+
const citationMatch = citationText.match(/(\d+)\s+([A-Za-z.\s]+?)\s+(\d+)/);
|
|
317
|
+
if (!citationMatch) {
|
|
318
|
+
logger.warn(`Could not parse citation: ${citationText}`);
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
const searchVolume = parseInt(citationMatch[1]);
|
|
322
|
+
const searchReporter = this.normalizeReporter(citationMatch[2]);
|
|
323
|
+
const searchPage = parseInt(citationMatch[3]);
|
|
324
|
+
// First, try the original citation
|
|
325
|
+
const result = await this.performCitationSearch(citationText, searchVolume, searchReporter, searchPage);
|
|
326
|
+
if (result) {
|
|
327
|
+
return result;
|
|
328
|
+
}
|
|
329
|
+
// If not found and it's a pre-1875 U.S. Reports citation, try nominative format
|
|
330
|
+
const nominativeCitation = convertToNominativeCitation(searchVolume, citationMatch[2], // Use original reporter text for conversion check
|
|
331
|
+
searchPage);
|
|
332
|
+
if (nominativeCitation) {
|
|
333
|
+
logger.info(`Trying nominative citation: ${nominativeCitation}`);
|
|
334
|
+
// Parse the nominative citation
|
|
335
|
+
const nomMatch = nominativeCitation.match(/(\d+)\s+([A-Za-z.\s]+?)\s+(\d+)/);
|
|
336
|
+
if (nomMatch) {
|
|
337
|
+
const nomVolume = parseInt(nomMatch[1]);
|
|
338
|
+
const nomReporter = this.normalizeReporter(nomMatch[2]);
|
|
339
|
+
const nomPage = parseInt(nomMatch[3]);
|
|
340
|
+
const nomResult = await this.performCitationSearch(nominativeCitation, nomVolume, nomReporter, nomPage);
|
|
341
|
+
if (nomResult) {
|
|
342
|
+
// Return with original U.S. Reports citation info
|
|
343
|
+
return {
|
|
344
|
+
...nomResult,
|
|
345
|
+
volume: searchVolume,
|
|
346
|
+
reporter: searchReporter,
|
|
347
|
+
page: searchPage,
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
this.stats.casesNotFound++;
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Perform a single citation search against CourtListener API.
|
|
357
|
+
* This is the core search logic used by lookupByText.
|
|
358
|
+
*/
|
|
359
|
+
async performCitationSearch(citationText, targetVolume, targetReporter, targetPage) {
|
|
360
|
+
// Check rate limit
|
|
361
|
+
if (!this.rateLimiter.canRequest()) {
|
|
362
|
+
const waitTime = this.rateLimiter.getWaitTime();
|
|
363
|
+
logger.warn(`Rate limited. Wait ${waitTime}ms`);
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
try {
|
|
367
|
+
this.stats.apiCalls++;
|
|
368
|
+
this.rateLimiter.recordRequest();
|
|
369
|
+
// Use citation= parameter for exact citation matching instead of q= for full-text
|
|
370
|
+
// This returns only cases that have the citation in their citation list
|
|
371
|
+
const searchParams = new URLSearchParams({
|
|
372
|
+
citation: citationText,
|
|
373
|
+
type: 'o', // opinions
|
|
374
|
+
page_size: '20', // Get more results to find exact match
|
|
375
|
+
});
|
|
376
|
+
const url = `${this.config.baseUrl}/search/?${searchParams.toString()}`;
|
|
377
|
+
const headers = {
|
|
378
|
+
'Accept': 'application/json',
|
|
379
|
+
};
|
|
380
|
+
if (this.config.apiToken) {
|
|
381
|
+
headers['Authorization'] = `Token ${this.config.apiToken}`;
|
|
382
|
+
}
|
|
383
|
+
const controller = new AbortController();
|
|
384
|
+
const timeout = setTimeout(() => controller.abort(), this.config.timeoutMs);
|
|
385
|
+
const response = await fetch(url, {
|
|
386
|
+
method: 'GET',
|
|
387
|
+
headers,
|
|
388
|
+
signal: controller.signal,
|
|
389
|
+
});
|
|
390
|
+
clearTimeout(timeout);
|
|
391
|
+
if (!response.ok) {
|
|
392
|
+
this.stats.apiErrors++;
|
|
393
|
+
logger.error(`API error: ${response.status} ${response.statusText}`);
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
const data = await response.json();
|
|
397
|
+
// Search through results to find one with an EXACT citation match
|
|
398
|
+
if (data.results && data.results.length > 0) {
|
|
399
|
+
for (const result of data.results) {
|
|
400
|
+
const citations = result.citation || [];
|
|
401
|
+
// Check each citation in the result
|
|
402
|
+
for (const citeStr of citations) {
|
|
403
|
+
if (this.citationMatches(citeStr, targetVolume, targetReporter, targetPage)) {
|
|
404
|
+
this.stats.casesFound++;
|
|
405
|
+
// Extract year from result
|
|
406
|
+
const dateStr = String(result.dateFiled || result.date_filed || '');
|
|
407
|
+
const yearMatch = dateStr.match(/(\d{4})/);
|
|
408
|
+
const year = yearMatch ? parseInt(yearMatch[1]) : new Date().getFullYear();
|
|
409
|
+
// Extract case name and court
|
|
410
|
+
const caseName = String(result.caseName || result.case_name || 'Unknown Case');
|
|
411
|
+
const courtValue = String(result.court || result.court_id || 'unknown');
|
|
412
|
+
return {
|
|
413
|
+
caseName,
|
|
414
|
+
normalizedName: caseName.toLowerCase().replace(/[^a-z]/g, ''),
|
|
415
|
+
volume: targetVolume,
|
|
416
|
+
reporter: targetReporter,
|
|
417
|
+
page: targetPage,
|
|
418
|
+
year,
|
|
419
|
+
court: courtValue,
|
|
420
|
+
jurisdiction: this.inferJurisdiction(courtValue),
|
|
421
|
+
overruled: false,
|
|
422
|
+
source: 'verified_addition',
|
|
423
|
+
addedAt: Date.now(),
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
// No exact match found in this search
|
|
430
|
+
return null;
|
|
431
|
+
}
|
|
432
|
+
catch (error) {
|
|
433
|
+
this.stats.apiErrors++;
|
|
434
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
435
|
+
logger.error('Request timed out');
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
logger.error('API error', error instanceof Error ? error : undefined);
|
|
439
|
+
}
|
|
440
|
+
return null;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Normalize a reporter name for comparison.
|
|
445
|
+
* Handles variations like "U.S." vs "US", "F.3d" vs "F. 3d", etc.
|
|
446
|
+
*/
|
|
447
|
+
normalizeReporter(reporter) {
|
|
448
|
+
return reporter
|
|
449
|
+
.replace(/\s+/g, ' ') // Normalize whitespace
|
|
450
|
+
.replace(/\.\s*/g, '.') // Remove spaces after periods
|
|
451
|
+
.trim()
|
|
452
|
+
.toUpperCase();
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Check if a citation string matches volume/reporter/page.
|
|
456
|
+
* Handles various citation formats like "347 U.S. 483", "500 F.3d 123", etc.
|
|
457
|
+
*/
|
|
458
|
+
citationMatches(citationStr, targetVolume, targetReporter, targetPage) {
|
|
459
|
+
// Parse the citation string
|
|
460
|
+
const match = citationStr.match(/(\d+)\s+([A-Za-z.\s]+?)\s+(\d+)/);
|
|
461
|
+
if (!match)
|
|
462
|
+
return false;
|
|
463
|
+
const volume = parseInt(match[1]);
|
|
464
|
+
const reporter = this.normalizeReporter(match[2]);
|
|
465
|
+
const page = parseInt(match[3]);
|
|
466
|
+
// Check for exact match
|
|
467
|
+
if (volume !== targetVolume || page !== targetPage)
|
|
468
|
+
return false;
|
|
469
|
+
// Compare reporters (allowing some flexibility)
|
|
470
|
+
const normalizedTarget = targetReporter.replace(/\./g, '').replace(/\s/g, '');
|
|
471
|
+
const normalizedFound = reporter.replace(/\./g, '').replace(/\s/g, '');
|
|
472
|
+
return normalizedTarget === normalizedFound;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Batch lookup multiple citations.
|
|
476
|
+
* More efficient than individual lookups.
|
|
477
|
+
*/
|
|
478
|
+
async lookupBatch(citations) {
|
|
479
|
+
const results = new Map();
|
|
480
|
+
// First, check cache for all
|
|
481
|
+
const uncached = [];
|
|
482
|
+
for (const c of citations) {
|
|
483
|
+
const cached = this.lookupCase(c.caseName, c.volume, c.reporter, c.page);
|
|
484
|
+
const key = this.makeKey(c.volume, c.reporter, c.page);
|
|
485
|
+
if (cached) {
|
|
486
|
+
results.set(key, cached);
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
uncached.push(c);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
// Build citation text for batch lookup
|
|
493
|
+
if (uncached.length > 0) {
|
|
494
|
+
const citationTexts = uncached
|
|
495
|
+
.map(c => `${c.volume} ${c.reporter} ${c.page}`)
|
|
496
|
+
.join('\n');
|
|
497
|
+
const batchResult = await this.lookupByText(citationTexts);
|
|
498
|
+
// For now, simple implementation - individual lookups for uncached
|
|
499
|
+
// TODO: Parse batch response properly
|
|
500
|
+
for (const c of uncached) {
|
|
501
|
+
const key = this.makeKey(c.volume, c.reporter, c.page);
|
|
502
|
+
if (!results.has(key)) {
|
|
503
|
+
const result = await this.lookupCaseAsync(c.caseName, c.volume, c.reporter, c.page);
|
|
504
|
+
results.set(key, result);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return results;
|
|
509
|
+
}
|
|
510
|
+
// ===========================================================================
|
|
511
|
+
// PRIVATE METHODS
|
|
512
|
+
// ===========================================================================
|
|
513
|
+
makeKey(volume, reporter, page) {
|
|
514
|
+
const normReporter = (reporter ?? '').replace(/\s+/g, '').toLowerCase();
|
|
515
|
+
return `${volume ?? ''}-${normReporter}-${page ?? ''}`;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Perform API lookup to CourtListener using the search endpoint.
|
|
519
|
+
* The search endpoint is more reliable than citation-lookup for verification.
|
|
520
|
+
*
|
|
521
|
+
* IMPORTANT: Verifies that returned results contain the EXACT citation,
|
|
522
|
+
* not just documents that happen to match search terms.
|
|
523
|
+
*
|
|
524
|
+
* For pre-1875 Supreme Court cases, automatically tries nominative reporter
|
|
525
|
+
* format (e.g., "1 Cranch 137" instead of "5 U.S. 137").
|
|
526
|
+
*/
|
|
527
|
+
async performApiLookup(caseName, volume, reporter, page) {
|
|
528
|
+
const citationStr = `${volume} ${reporter} ${page}`;
|
|
529
|
+
const normalizedReporter = this.normalizeReporter(reporter);
|
|
530
|
+
// First, try the original citation
|
|
531
|
+
const result = await this.performCitationSearch(citationStr, volume, normalizedReporter, page);
|
|
532
|
+
if (result) {
|
|
533
|
+
// Cache and return
|
|
534
|
+
this.cache.set(volume, reporter, page, result);
|
|
535
|
+
return result;
|
|
536
|
+
}
|
|
537
|
+
// If not found and it's a pre-1875 U.S. Reports citation, try nominative format
|
|
538
|
+
const nominativeCitation = convertToNominativeCitation(volume, reporter, page);
|
|
539
|
+
if (nominativeCitation) {
|
|
540
|
+
logger.info(`Trying nominative citation: ${nominativeCitation}`);
|
|
541
|
+
// Parse the nominative citation
|
|
542
|
+
const nomMatch = nominativeCitation.match(/(\d+)\s+([A-Za-z.\s]+?)\s+(\d+)/);
|
|
543
|
+
if (nomMatch) {
|
|
544
|
+
const nomVolume = parseInt(nomMatch[1]);
|
|
545
|
+
const nomReporter = this.normalizeReporter(nomMatch[2]);
|
|
546
|
+
const nomPage = parseInt(nomMatch[3]);
|
|
547
|
+
const nomResult = await this.performCitationSearch(nominativeCitation, nomVolume, nomReporter, nomPage);
|
|
548
|
+
if (nomResult) {
|
|
549
|
+
// Return with original U.S. Reports citation info
|
|
550
|
+
const record = {
|
|
551
|
+
...nomResult,
|
|
552
|
+
volume,
|
|
553
|
+
reporter,
|
|
554
|
+
page,
|
|
555
|
+
};
|
|
556
|
+
this.cache.set(volume, reporter, page, record);
|
|
557
|
+
return record;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
// No match found - cache negative result
|
|
562
|
+
this.stats.casesNotFound++;
|
|
563
|
+
this.cache.set(volume, reporter, page, null);
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Infer jurisdiction from court ID.
|
|
568
|
+
*/
|
|
569
|
+
inferJurisdiction(courtId) {
|
|
570
|
+
if (!courtId)
|
|
571
|
+
return 'unknown';
|
|
572
|
+
const id = courtId.toLowerCase();
|
|
573
|
+
if (id.includes('scotus') || id.includes('supreme'))
|
|
574
|
+
return 'federal';
|
|
575
|
+
if (id.startsWith('ca') || id.includes('circuit'))
|
|
576
|
+
return 'federal';
|
|
577
|
+
if (id.includes('dist') || id.includes('d.'))
|
|
578
|
+
return 'federal';
|
|
579
|
+
if (id.includes('bap') || id.includes('bankr'))
|
|
580
|
+
return 'federal';
|
|
581
|
+
return 'state';
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Convert CourtListener API response to KnownCaseRecord.
|
|
585
|
+
*/
|
|
586
|
+
convertToRecord(result) {
|
|
587
|
+
// Extract first citation details
|
|
588
|
+
const firstCitation = result.citations?.[0];
|
|
589
|
+
// Parse date to year
|
|
590
|
+
let year = 0;
|
|
591
|
+
if (result.date_filed) {
|
|
592
|
+
const parsed = new Date(result.date_filed);
|
|
593
|
+
if (!isNaN(parsed.getTime())) {
|
|
594
|
+
year = parsed.getFullYear();
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
// Determine jurisdiction
|
|
598
|
+
let jurisdiction = 'unknown';
|
|
599
|
+
if (result.court?.jurisdiction) {
|
|
600
|
+
jurisdiction = result.court.jurisdiction;
|
|
601
|
+
}
|
|
602
|
+
else if (result.court?.id) {
|
|
603
|
+
// Infer from court ID
|
|
604
|
+
if (result.court.id.startsWith('scotus')) {
|
|
605
|
+
jurisdiction = 'federal';
|
|
606
|
+
}
|
|
607
|
+
else if (result.court.id.includes('ca')) {
|
|
608
|
+
jurisdiction = 'federal';
|
|
609
|
+
}
|
|
610
|
+
else if (result.court.id.includes('d-')) {
|
|
611
|
+
jurisdiction = 'federal';
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return {
|
|
615
|
+
caseName: result.case_name ?? 'Unknown Case',
|
|
616
|
+
normalizedName: (result.case_name ?? '').toLowerCase().replace(/[^\w\s]/g, ''),
|
|
617
|
+
volume: firstCitation?.volume ?? 0,
|
|
618
|
+
reporter: firstCitation?.reporter ?? '',
|
|
619
|
+
page: parseInt(firstCitation?.page ?? '0', 10),
|
|
620
|
+
court: result.court?.name_abbreviation ?? result.court?.id ?? '',
|
|
621
|
+
year,
|
|
622
|
+
jurisdiction,
|
|
623
|
+
overruled: false, // CourtListener doesn't provide this directly
|
|
624
|
+
source: 'verified_addition',
|
|
625
|
+
addedAt: Date.now(),
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
// ===========================================================================
|
|
629
|
+
// UTILITY METHODS
|
|
630
|
+
// ===========================================================================
|
|
631
|
+
/**
|
|
632
|
+
* Get detailed statistics.
|
|
633
|
+
*/
|
|
634
|
+
getDetailedStats() {
|
|
635
|
+
const cacheHitRate = this.stats.totalLookups > 0
|
|
636
|
+
? this.stats.cacheHits / this.stats.totalLookups
|
|
637
|
+
: 0;
|
|
638
|
+
const apiErrorRate = this.stats.apiCalls > 0
|
|
639
|
+
? this.stats.apiErrors / this.stats.apiCalls
|
|
640
|
+
: 0;
|
|
641
|
+
return {
|
|
642
|
+
...this.stats,
|
|
643
|
+
cacheHitRate,
|
|
644
|
+
apiErrorRate,
|
|
645
|
+
cacheSize: this.cache.getStats().size,
|
|
646
|
+
rateLimitRemaining: this.config.maxRequestsPerMinute - this.stats.apiCalls,
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Clear all caches.
|
|
651
|
+
*/
|
|
652
|
+
clearCache() {
|
|
653
|
+
this.cache.clear();
|
|
654
|
+
this.localOverrides.clear();
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Get configuration.
|
|
658
|
+
*/
|
|
659
|
+
getConfig() {
|
|
660
|
+
return { ...this.config };
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Update configuration.
|
|
664
|
+
*/
|
|
665
|
+
setConfig(config) {
|
|
666
|
+
this.config = { ...this.config, ...config };
|
|
667
|
+
this.cache = new CitationCache(this.config);
|
|
668
|
+
this.rateLimiter = new RateLimiter(this.config.maxRequestsPerMinute);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
// =============================================================================
|
|
672
|
+
// FACTORY FUNCTION
|
|
673
|
+
// =============================================================================
|
|
674
|
+
/**
|
|
675
|
+
* Create a CourtListener-backed case database.
|
|
676
|
+
*/
|
|
677
|
+
export function createCourtListenerDatabase(config) {
|
|
678
|
+
return new CourtListenerCaseDatabase(config);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Default singleton instance.
|
|
682
|
+
*/
|
|
683
|
+
export const courtListenerDb = createCourtListenerDatabase();
|
|
684
|
+
//# sourceMappingURL=courtlistener-adapter.js.map
|