codehere 0.1.0 → 0.2.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.
Potentially problematic release.
This version of codehere might be problematic. Click here for more details.
- package/README.md +51 -25
- package/dist/agents/base.d.ts +107 -0
- package/dist/agents/base.d.ts.map +1 -0
- package/dist/agents/base.js +101 -0
- package/dist/agents/base.js.map +1 -0
- package/dist/agents/orchestrator-model-driven.d.ts +41 -0
- package/dist/agents/orchestrator-model-driven.d.ts.map +1 -0
- package/dist/agents/orchestrator-model-driven.js +141 -0
- package/dist/agents/orchestrator-model-driven.js.map +1 -0
- package/dist/agents/react-orchestrator-agent.d.ts +15 -0
- package/dist/agents/react-orchestrator-agent.d.ts.map +1 -0
- package/dist/agents/react-orchestrator-agent.js +54 -0
- package/dist/agents/react-orchestrator-agent.js.map +1 -0
- package/dist/application/agents/execution-agent.d.ts +68 -0
- package/dist/application/agents/execution-agent.d.ts.map +1 -0
- package/dist/application/agents/execution-agent.js +299 -0
- package/dist/application/agents/execution-agent.js.map +1 -0
- package/dist/application/agents/multi-agent-orchestrator.d.ts +64 -0
- package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -0
- package/dist/application/agents/multi-agent-orchestrator.js +209 -0
- package/dist/application/agents/multi-agent-orchestrator.js.map +1 -0
- package/dist/application/agents/planning-agent.d.ts +61 -0
- package/dist/application/agents/planning-agent.d.ts.map +1 -0
- package/dist/application/agents/planning-agent.js +357 -0
- package/dist/application/agents/planning-agent.js.map +1 -0
- package/dist/application/agents/validation-agent.d.ts +64 -0
- package/dist/application/agents/validation-agent.d.ts.map +1 -0
- package/dist/application/agents/validation-agent.js +182 -0
- package/dist/application/agents/validation-agent.js.map +1 -0
- package/dist/application/architectures/plan-and-act.d.ts +94 -0
- package/dist/application/architectures/plan-and-act.d.ts.map +1 -0
- package/dist/application/architectures/plan-and-act.js +242 -0
- package/dist/application/architectures/plan-and-act.js.map +1 -0
- package/dist/application/index.d.ts +12 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/index.js +12 -0
- package/dist/application/index.js.map +1 -0
- package/dist/application/services/agent-factory.d.ts +9 -0
- package/dist/application/services/agent-factory.d.ts.map +1 -0
- package/dist/application/services/agent-factory.js +28 -0
- package/dist/application/services/agent-factory.js.map +1 -0
- package/dist/application/services/dependency-container.d.ts +140 -0
- package/dist/application/services/dependency-container.d.ts.map +1 -0
- package/dist/application/services/dependency-container.js +402 -0
- package/dist/application/services/dependency-container.js.map +1 -0
- package/dist/application/services/git-context-service.d.ts +30 -0
- package/dist/application/services/git-context-service.d.ts.map +1 -0
- package/dist/application/services/git-context-service.js +83 -0
- package/dist/application/services/git-context-service.js.map +1 -0
- package/dist/application/services/intelligent-router.d.ts +74 -0
- package/dist/application/services/intelligent-router.d.ts.map +1 -0
- package/dist/application/services/intelligent-router.js +711 -0
- package/dist/application/services/intelligent-router.js.map +1 -0
- package/dist/application/services/tool-executor-service.d.ts +14 -0
- package/dist/application/services/tool-executor-service.d.ts.map +1 -0
- package/dist/application/services/tool-executor-service.js +94 -0
- package/dist/application/services/tool-executor-service.js.map +1 -0
- package/dist/application/use-cases/ask-question-use-case.d.ts +36 -0
- package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -0
- package/dist/application/use-cases/ask-question-use-case.js +150 -0
- package/dist/application/use-cases/ask-question-use-case.js.map +1 -0
- package/dist/application/use-cases/edit-file-use-case.d.ts +76 -0
- package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -0
- package/dist/application/use-cases/edit-file-use-case.js +685 -0
- package/dist/application/use-cases/edit-file-use-case.js.map +1 -0
- package/dist/application/use-cases/explain-file-use-case.d.ts +21 -0
- package/dist/application/use-cases/explain-file-use-case.d.ts.map +1 -0
- package/dist/application/use-cases/explain-file-use-case.js +50 -0
- package/dist/application/use-cases/explain-file-use-case.js.map +1 -0
- package/dist/application/use-cases/index-codebase-use-case.d.ts +46 -0
- package/dist/application/use-cases/index-codebase-use-case.d.ts.map +1 -0
- package/dist/application/use-cases/index-codebase-use-case.js +113 -0
- package/dist/application/use-cases/index-codebase-use-case.js.map +1 -0
- package/dist/application/use-cases/planning-use-case.d.ts +46 -0
- package/dist/application/use-cases/planning-use-case.d.ts.map +1 -0
- package/dist/application/use-cases/planning-use-case.js +267 -0
- package/dist/application/use-cases/planning-use-case.js.map +1 -0
- package/dist/application/use-cases/react-orchestration-use-case.d.ts +51 -0
- package/dist/application/use-cases/react-orchestration-use-case.d.ts.map +1 -0
- package/dist/application/use-cases/react-orchestration-use-case.js +325 -0
- package/dist/application/use-cases/react-orchestration-use-case.js.map +1 -0
- package/dist/application/use-cases/reflexion-use-case.d.ts +24 -0
- package/dist/application/use-cases/reflexion-use-case.d.ts.map +1 -0
- package/dist/application/use-cases/reflexion-use-case.js +30 -0
- package/dist/application/use-cases/reflexion-use-case.js.map +1 -0
- package/dist/application/workflows/deterministic-workflows.d.ts +61 -0
- package/dist/application/workflows/deterministic-workflows.d.ts.map +1 -0
- package/dist/application/workflows/deterministic-workflows.js +189 -0
- package/dist/application/workflows/deterministic-workflows.js.map +1 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +1 -3
- package/dist/cache.js.map +1 -1
- package/dist/chat.js +10 -10
- package/dist/chat.js.map +1 -1
- package/dist/docs.d.ts.map +1 -1
- package/dist/docs.js +1 -2
- package/dist/docs.js.map +1 -1
- package/dist/domain/entities/code-chunk.d.ts +26 -0
- package/dist/domain/entities/code-chunk.d.ts.map +1 -0
- package/dist/domain/entities/code-chunk.js +6 -0
- package/dist/domain/entities/code-chunk.js.map +1 -0
- package/dist/domain/entities/decision.d.ts +37 -0
- package/dist/domain/entities/decision.d.ts.map +1 -0
- package/dist/domain/entities/decision.js +9 -0
- package/dist/domain/entities/decision.js.map +1 -0
- package/dist/domain/entities/edit.d.ts +35 -0
- package/dist/domain/entities/edit.d.ts.map +1 -0
- package/dist/domain/entities/edit.js +6 -0
- package/dist/domain/entities/edit.js.map +1 -0
- package/dist/domain/entities/knowledge-node.d.ts +83 -0
- package/dist/domain/entities/knowledge-node.d.ts.map +1 -0
- package/dist/domain/entities/knowledge-node.js +9 -0
- package/dist/domain/entities/knowledge-node.js.map +1 -0
- package/dist/domain/entities/knowledge-preservation.d.ts +42 -0
- package/dist/domain/entities/knowledge-preservation.d.ts.map +1 -0
- package/dist/domain/entities/knowledge-preservation.js +10 -0
- package/dist/domain/entities/knowledge-preservation.js.map +1 -0
- package/dist/domain/entities/memory.d.ts +36 -0
- package/dist/domain/entities/memory.d.ts.map +1 -0
- package/dist/domain/entities/memory.js +6 -0
- package/dist/domain/entities/memory.js.map +1 -0
- package/dist/domain/entities/pattern.d.ts +49 -0
- package/dist/domain/entities/pattern.d.ts.map +1 -0
- package/dist/domain/entities/pattern.js +7 -0
- package/dist/domain/entities/pattern.js.map +1 -0
- package/dist/domain/entities/plan.d.ts +42 -0
- package/dist/domain/entities/plan.d.ts.map +1 -0
- package/dist/domain/entities/plan.js +6 -0
- package/dist/domain/entities/plan.js.map +1 -0
- package/dist/domain/entities/query.d.ts +17 -0
- package/dist/domain/entities/query.d.ts.map +1 -0
- package/dist/domain/entities/query.js +6 -0
- package/dist/domain/entities/query.js.map +1 -0
- package/dist/domain/index.d.ts +16 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +19 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/interfaces/ai-service.interface.d.ts +62 -0
- package/dist/domain/interfaces/ai-service.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/ai-service.interface.js +6 -0
- package/dist/domain/interfaces/ai-service.interface.js.map +1 -0
- package/dist/domain/interfaces/code-analyzer.interface.d.ts +38 -0
- package/dist/domain/interfaces/code-analyzer.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/code-analyzer.interface.js +6 -0
- package/dist/domain/interfaces/code-analyzer.interface.js.map +1 -0
- package/dist/domain/interfaces/decision-repository.interface.d.ts +51 -0
- package/dist/domain/interfaces/decision-repository.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/decision-repository.interface.js +9 -0
- package/dist/domain/interfaces/decision-repository.interface.js.map +1 -0
- package/dist/domain/interfaces/embedding-repository.interface.d.ts +28 -0
- package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/embedding-repository.interface.js +6 -0
- package/dist/domain/interfaces/embedding-repository.interface.js.map +1 -0
- package/dist/domain/interfaces/knowledge-graph-repository.interface.d.ts +91 -0
- package/dist/domain/interfaces/knowledge-graph-repository.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/knowledge-graph-repository.interface.js +9 -0
- package/dist/domain/interfaces/knowledge-graph-repository.interface.js.map +1 -0
- package/dist/domain/interfaces/knowledge-preservation-repository.interface.d.ts +50 -0
- package/dist/domain/interfaces/knowledge-preservation-repository.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/knowledge-preservation-repository.interface.js +8 -0
- package/dist/domain/interfaces/knowledge-preservation-repository.interface.js.map +1 -0
- package/dist/domain/interfaces/memory-repository.interface.d.ts +49 -0
- package/dist/domain/interfaces/memory-repository.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/memory-repository.interface.js +6 -0
- package/dist/domain/interfaces/memory-repository.interface.js.map +1 -0
- package/dist/domain/interfaces/pattern-repository.interface.d.ts +48 -0
- package/dist/domain/interfaces/pattern-repository.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/pattern-repository.interface.js +6 -0
- package/dist/domain/interfaces/pattern-repository.interface.js.map +1 -0
- package/dist/domain/interfaces/verification-service.interface.d.ts +20 -0
- package/dist/domain/interfaces/verification-service.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/verification-service.interface.js +6 -0
- package/dist/domain/interfaces/verification-service.interface.js.map +1 -0
- package/dist/domain/services/codebase-detector.d.ts +18 -0
- package/dist/domain/services/codebase-detector.d.ts.map +1 -0
- package/dist/domain/services/codebase-detector.js +91 -0
- package/dist/domain/services/codebase-detector.js.map +1 -0
- package/dist/domain/services/cross-team-pattern-sharing.d.ts +65 -0
- package/dist/domain/services/cross-team-pattern-sharing.d.ts.map +1 -0
- package/dist/domain/services/cross-team-pattern-sharing.js +125 -0
- package/dist/domain/services/cross-team-pattern-sharing.js.map +1 -0
- package/dist/domain/services/decision-recorder.d.ts +76 -0
- package/dist/domain/services/decision-recorder.d.ts.map +1 -0
- package/dist/domain/services/decision-recorder.js +223 -0
- package/dist/domain/services/decision-recorder.js.map +1 -0
- package/dist/domain/services/decision-retriever.d.ts +75 -0
- package/dist/domain/services/decision-retriever.d.ts.map +1 -0
- package/dist/domain/services/decision-retriever.js +133 -0
- package/dist/domain/services/decision-retriever.js.map +1 -0
- package/dist/domain/services/graded-memory-activation.d.ts +37 -0
- package/dist/domain/services/graded-memory-activation.d.ts.map +1 -0
- package/dist/domain/services/graded-memory-activation.js +69 -0
- package/dist/domain/services/graded-memory-activation.js.map +1 -0
- package/dist/domain/services/knowledge-access.d.ts +63 -0
- package/dist/domain/services/knowledge-access.d.ts.map +1 -0
- package/dist/domain/services/knowledge-access.js +132 -0
- package/dist/domain/services/knowledge-access.js.map +1 -0
- package/dist/domain/services/knowledge-extractor.d.ts +54 -0
- package/dist/domain/services/knowledge-extractor.d.ts.map +1 -0
- package/dist/domain/services/knowledge-extractor.js +247 -0
- package/dist/domain/services/knowledge-extractor.js.map +1 -0
- package/dist/domain/services/knowledge-graph-builder.d.ts +70 -0
- package/dist/domain/services/knowledge-graph-builder.d.ts.map +1 -0
- package/dist/domain/services/knowledge-graph-builder.js +268 -0
- package/dist/domain/services/knowledge-graph-builder.js.map +1 -0
- package/dist/domain/services/knowledge-graph-query.d.ts +69 -0
- package/dist/domain/services/knowledge-graph-query.d.ts.map +1 -0
- package/dist/domain/services/knowledge-graph-query.js +187 -0
- package/dist/domain/services/knowledge-graph-query.js.map +1 -0
- package/dist/domain/services/memory-retriever.d.ts +30 -0
- package/dist/domain/services/memory-retriever.d.ts.map +1 -0
- package/dist/domain/services/memory-retriever.js +82 -0
- package/dist/domain/services/memory-retriever.js.map +1 -0
- package/dist/domain/services/memory-synthesizer.d.ts +57 -0
- package/dist/domain/services/memory-synthesizer.d.ts.map +1 -0
- package/dist/domain/services/memory-synthesizer.js +91 -0
- package/dist/domain/services/memory-synthesizer.js.map +1 -0
- package/dist/domain/services/pattern-extractor.d.ts +108 -0
- package/dist/domain/services/pattern-extractor.d.ts.map +1 -0
- package/dist/domain/services/pattern-extractor.js +442 -0
- package/dist/domain/services/pattern-extractor.js.map +1 -0
- package/dist/domain/services/query-intent-classifier.d.ts +16 -0
- package/dist/domain/services/query-intent-classifier.d.ts.map +1 -0
- package/dist/domain/services/query-intent-classifier.js +140 -0
- package/dist/domain/services/query-intent-classifier.js.map +1 -0
- package/dist/domain/services/react-loop.d.ts +44 -0
- package/dist/domain/services/react-loop.d.ts.map +1 -0
- package/dist/domain/services/react-loop.js +110 -0
- package/dist/domain/services/react-loop.js.map +1 -0
- package/dist/edit.d.ts +0 -12
- package/dist/edit.d.ts.map +1 -1
- package/dist/edit.js +76 -351
- package/dist/edit.js.map +1 -1
- package/dist/embed.d.ts +0 -4
- package/dist/embed.d.ts.map +1 -1
- package/dist/embed.js +100 -174
- package/dist/embed.js.map +1 -1
- package/dist/error-handler.d.ts +1 -0
- package/dist/error-handler.d.ts.map +1 -1
- package/dist/error-handler.js +46 -3
- package/dist/error-handler.js.map +1 -1
- package/dist/index.js +228 -231
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.d.ts +54 -0
- package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -0
- package/dist/infrastructure/ai/cohere-ai-service.js +547 -0
- package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -0
- package/dist/infrastructure/ai/command-r-evaluation.d.ts +42 -0
- package/dist/infrastructure/ai/command-r-evaluation.d.ts.map +1 -0
- package/dist/infrastructure/ai/command-r-evaluation.js +206 -0
- package/dist/infrastructure/ai/command-r-evaluation.js.map +1 -0
- package/dist/infrastructure/ai/model-config.d.ts +47 -0
- package/dist/infrastructure/ai/model-config.d.ts.map +1 -0
- package/dist/infrastructure/ai/model-config.js +84 -0
- package/dist/infrastructure/ai/model-config.js.map +1 -0
- package/dist/infrastructure/cache/embedding-cache.d.ts +46 -0
- package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/embedding-cache.js +104 -0
- package/dist/infrastructure/cache/embedding-cache.js.map +1 -0
- package/dist/infrastructure/chunking/ast-code-chunker.d.ts +12 -0
- package/dist/infrastructure/chunking/ast-code-chunker.d.ts.map +1 -0
- package/dist/infrastructure/chunking/ast-code-chunker.js +19 -0
- package/dist/infrastructure/chunking/ast-code-chunker.js.map +1 -0
- package/dist/infrastructure/chunking/code-aware-chunker.d.ts +63 -0
- package/dist/infrastructure/chunking/code-aware-chunker.d.ts.map +1 -0
- package/dist/infrastructure/chunking/code-aware-chunker.js +397 -0
- package/dist/infrastructure/chunking/code-aware-chunker.js.map +1 -0
- package/dist/infrastructure/config/config-manager.d.ts +79 -0
- package/dist/infrastructure/config/config-manager.d.ts.map +1 -0
- package/dist/infrastructure/config/config-manager.js +162 -0
- package/dist/infrastructure/config/config-manager.js.map +1 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts +90 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -0
- package/dist/infrastructure/cost/cost-tracker.js +353 -0
- package/dist/infrastructure/cost/cost-tracker.js.map +1 -0
- package/dist/infrastructure/file-scanner/file-scanner.d.ts +31 -0
- package/dist/infrastructure/file-scanner/file-scanner.d.ts.map +1 -0
- package/dist/infrastructure/file-scanner/file-scanner.js +106 -0
- package/dist/infrastructure/file-scanner/file-scanner.js.map +1 -0
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts +107 -0
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -0
- package/dist/infrastructure/governance/nist-ai-rmf.js +294 -0
- package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -0
- package/dist/infrastructure/governance/policy-as-code.d.ts +90 -0
- package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -0
- package/dist/infrastructure/governance/policy-as-code.js +244 -0
- package/dist/infrastructure/governance/policy-as-code.js.map +1 -0
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +138 -0
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -0
- package/dist/infrastructure/governance/prompt-to-code-lineage.js +241 -0
- package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -0
- package/dist/infrastructure/index.d.ts +7 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +7 -0
- package/dist/infrastructure/index.js.map +1 -0
- package/dist/infrastructure/observability/execution-tracer.d.ts +105 -0
- package/dist/infrastructure/observability/execution-tracer.d.ts.map +1 -0
- package/dist/infrastructure/observability/execution-tracer.js +190 -0
- package/dist/infrastructure/observability/execution-tracer.js.map +1 -0
- package/dist/infrastructure/observability/prompt-versioner.d.ts +67 -0
- package/dist/infrastructure/observability/prompt-versioner.d.ts.map +1 -0
- package/dist/infrastructure/observability/prompt-versioner.js +145 -0
- package/dist/infrastructure/observability/prompt-versioner.js.map +1 -0
- package/dist/infrastructure/protocols/a2a-metadata.d.ts +278 -0
- package/dist/infrastructure/protocols/a2a-metadata.d.ts.map +1 -0
- package/dist/infrastructure/protocols/a2a-metadata.js +137 -0
- package/dist/infrastructure/protocols/a2a-metadata.js.map +1 -0
- package/dist/infrastructure/protocols/a2a-protocol.d.ts +132 -0
- package/dist/infrastructure/protocols/a2a-protocol.d.ts.map +1 -0
- package/dist/infrastructure/protocols/a2a-protocol.js +314 -0
- package/dist/infrastructure/protocols/a2a-protocol.js.map +1 -0
- package/dist/infrastructure/protocols/mcp-oauth.d.ts +91 -0
- package/dist/infrastructure/protocols/mcp-oauth.d.ts.map +1 -0
- package/dist/infrastructure/protocols/mcp-oauth.js +184 -0
- package/dist/infrastructure/protocols/mcp-oauth.js.map +1 -0
- package/dist/infrastructure/protocols/mcp-server.d.ts +126 -0
- package/dist/infrastructure/protocols/mcp-server.d.ts.map +1 -0
- package/dist/infrastructure/protocols/mcp-server.js +333 -0
- package/dist/infrastructure/protocols/mcp-server.js.map +1 -0
- package/dist/infrastructure/protocols/streaming-handler.d.ts +57 -0
- package/dist/infrastructure/protocols/streaming-handler.d.ts.map +1 -0
- package/dist/infrastructure/protocols/streaming-handler.js +103 -0
- package/dist/infrastructure/protocols/streaming-handler.js.map +1 -0
- package/dist/infrastructure/security/ai-sast-scanner.d.ts +55 -0
- package/dist/infrastructure/security/ai-sast-scanner.d.ts.map +1 -0
- package/dist/infrastructure/security/ai-sast-scanner.js +163 -0
- package/dist/infrastructure/security/ai-sast-scanner.js.map +1 -0
- package/dist/infrastructure/security/docker-sandbox.d.ts +57 -0
- package/dist/infrastructure/security/docker-sandbox.d.ts.map +1 -0
- package/dist/infrastructure/security/docker-sandbox.js +178 -0
- package/dist/infrastructure/security/docker-sandbox.js.map +1 -0
- package/dist/infrastructure/security/enhanced-security-gate.d.ts +51 -0
- package/dist/infrastructure/security/enhanced-security-gate.d.ts.map +1 -0
- package/dist/infrastructure/security/enhanced-security-gate.js +92 -0
- package/dist/infrastructure/security/enhanced-security-gate.js.map +1 -0
- package/dist/infrastructure/security/input-validator.d.ts +33 -0
- package/dist/infrastructure/security/input-validator.d.ts.map +1 -0
- package/dist/infrastructure/security/input-validator.js +152 -0
- package/dist/infrastructure/security/input-validator.js.map +1 -0
- package/dist/infrastructure/security/license-scanner.d.ts +55 -0
- package/dist/infrastructure/security/license-scanner.d.ts.map +1 -0
- package/dist/infrastructure/security/license-scanner.js +167 -0
- package/dist/infrastructure/security/license-scanner.js.map +1 -0
- package/dist/infrastructure/security/provider-bias-detector.d.ts +53 -0
- package/dist/infrastructure/security/provider-bias-detector.d.ts.map +1 -0
- package/dist/infrastructure/security/provider-bias-detector.js +164 -0
- package/dist/infrastructure/security/provider-bias-detector.js.map +1 -0
- package/dist/infrastructure/security/sandbox-executor.d.ts +34 -0
- package/dist/infrastructure/security/sandbox-executor.d.ts.map +1 -0
- package/dist/infrastructure/security/sandbox-executor.js +64 -0
- package/dist/infrastructure/security/sandbox-executor.js.map +1 -0
- package/dist/infrastructure/storage/memory-stream-service.d.ts +47 -0
- package/dist/infrastructure/storage/memory-stream-service.d.ts.map +1 -0
- package/dist/infrastructure/storage/memory-stream-service.js +204 -0
- package/dist/infrastructure/storage/memory-stream-service.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-decision-repository.d.ts +29 -0
- package/dist/infrastructure/storage/sqlite-decision-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/sqlite-decision-repository.js +232 -0
- package/dist/infrastructure/storage/sqlite-decision-repository.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +24 -0
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/sqlite-embedding-repository.js +162 -0
- package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.d.ts +41 -0
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js +417 -0
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.d.ts +29 -0
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js +230 -0
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-memory-repository.d.ts +40 -0
- package/dist/infrastructure/storage/sqlite-memory-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/sqlite-memory-repository.js +229 -0
- package/dist/infrastructure/storage/sqlite-memory-repository.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-pattern-repository.d.ts +25 -0
- package/dist/infrastructure/storage/sqlite-pattern-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/sqlite-pattern-repository.js +249 -0
- package/dist/infrastructure/storage/sqlite-pattern-repository.js.map +1 -0
- package/dist/infrastructure/ux/appropriate-friction.d.ts +77 -0
- package/dist/infrastructure/ux/appropriate-friction.d.ts.map +1 -0
- package/dist/infrastructure/ux/appropriate-friction.js +213 -0
- package/dist/infrastructure/ux/appropriate-friction.js.map +1 -0
- package/dist/infrastructure/ux/bi-directional-learning.d.ts +109 -0
- package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -0
- package/dist/infrastructure/ux/bi-directional-learning.js +200 -0
- package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -0
- package/dist/infrastructure/ux/expectation-management.d.ts +65 -0
- package/dist/infrastructure/ux/expectation-management.d.ts.map +1 -0
- package/dist/infrastructure/ux/expectation-management.js +193 -0
- package/dist/infrastructure/ux/expectation-management.js.map +1 -0
- package/dist/infrastructure/ux/hitl-validation.d.ts +104 -0
- package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -0
- package/dist/infrastructure/ux/hitl-validation.js +211 -0
- package/dist/infrastructure/ux/hitl-validation.js.map +1 -0
- package/dist/infrastructure/ux/progressive-disclosure.d.ts +84 -0
- package/dist/infrastructure/ux/progressive-disclosure.d.ts.map +1 -0
- package/dist/infrastructure/ux/progressive-disclosure.js +235 -0
- package/dist/infrastructure/ux/progressive-disclosure.js.map +1 -0
- package/dist/infrastructure/ux/team-standards.d.ts +94 -0
- package/dist/infrastructure/ux/team-standards.d.ts.map +1 -0
- package/dist/infrastructure/ux/team-standards.js +196 -0
- package/dist/infrastructure/ux/team-standards.js.map +1 -0
- package/dist/infrastructure/verification/verification-service.d.ts +12 -0
- package/dist/infrastructure/verification/verification-service.d.ts.map +1 -0
- package/dist/infrastructure/verification/verification-service.js +47 -0
- package/dist/infrastructure/verification/verification-service.js.map +1 -0
- package/dist/infrastructure/xai/attention-visualizer.d.ts +73 -0
- package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -0
- package/dist/infrastructure/xai/attention-visualizer.js +174 -0
- package/dist/infrastructure/xai/attention-visualizer.js.map +1 -0
- package/dist/infrastructure/xai/cot-visualizer.d.ts +105 -0
- package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -0
- package/dist/infrastructure/xai/cot-visualizer.js +239 -0
- package/dist/infrastructure/xai/cot-visualizer.js.map +1 -0
- package/dist/infrastructure/xai/decision-tree-log.d.ts +104 -0
- package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -0
- package/dist/infrastructure/xai/decision-tree-log.js +216 -0
- package/dist/infrastructure/xai/decision-tree-log.js.map +1 -0
- package/dist/infrastructure/xai/interactive-xai.d.ts +106 -0
- package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -0
- package/dist/infrastructure/xai/interactive-xai.js +262 -0
- package/dist/infrastructure/xai/interactive-xai.js.map +1 -0
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +80 -0
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -0
- package/dist/infrastructure/xai/uncertainty-quantifier.js +201 -0
- package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -0
- package/dist/intelligent-retrieval.d.ts.map +1 -1
- package/dist/intelligent-retrieval.js +8 -1
- package/dist/intelligent-retrieval.js.map +1 -1
- package/dist/intent/classifier.d.ts +6 -0
- package/dist/intent/classifier.d.ts.map +1 -0
- package/dist/intent/classifier.js +2 -0
- package/dist/intent/classifier.js.map +1 -0
- package/dist/intent/context.d.ts +4 -0
- package/dist/intent/context.d.ts.map +1 -0
- package/dist/intent/context.js +2 -0
- package/dist/intent/context.js.map +1 -0
- package/dist/iterative-refinement.d.ts.map +1 -1
- package/dist/iterative-refinement.js +20 -3
- package/dist/iterative-refinement.js.map +1 -1
- package/dist/learning.d.ts.map +1 -1
- package/dist/learning.js +1 -2
- package/dist/learning.js.map +1 -1
- package/dist/monitoring.d.ts.map +1 -1
- package/dist/monitoring.js +1 -2
- package/dist/monitoring.js.map +1 -1
- package/dist/parallel-processor.d.ts +3 -2
- package/dist/parallel-processor.d.ts.map +1 -1
- package/dist/parallel-processor.js +183 -56
- package/dist/parallel-processor.js.map +1 -1
- package/dist/presentation/cli/commands/ask-command.d.ts +8 -0
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/ask-command.js +133 -0
- package/dist/presentation/cli/commands/ask-command.js.map +1 -0
- package/dist/presentation/cli/commands/config-command.d.ts +9 -0
- package/dist/presentation/cli/commands/config-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/config-command.js +123 -0
- package/dist/presentation/cli/commands/config-command.js.map +1 -0
- package/dist/presentation/cli/commands/cost-command.d.ts +8 -0
- package/dist/presentation/cli/commands/cost-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/cost-command.js +191 -0
- package/dist/presentation/cli/commands/cost-command.js.map +1 -0
- package/dist/presentation/cli/commands/decision-command.d.ts +12 -0
- package/dist/presentation/cli/commands/decision-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/decision-command.js +207 -0
- package/dist/presentation/cli/commands/decision-command.js.map +1 -0
- package/dist/presentation/cli/commands/help-command.d.ts +9 -0
- package/dist/presentation/cli/commands/help-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/help-command.js +281 -0
- package/dist/presentation/cli/commands/help-command.js.map +1 -0
- package/dist/presentation/cli/commands/knowledge-command.d.ts +13 -0
- package/dist/presentation/cli/commands/knowledge-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/knowledge-command.js +129 -0
- package/dist/presentation/cli/commands/knowledge-command.js.map +1 -0
- package/dist/presentation/cli/commands/learning-dashboard-command.d.ts +8 -0
- package/dist/presentation/cli/commands/learning-dashboard-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/learning-dashboard-command.js +183 -0
- package/dist/presentation/cli/commands/learning-dashboard-command.js.map +1 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts +8 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/orchestrate-command.js +112 -0
- package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -0
- package/dist/presentation/cli/commands/plan-command.d.ts +8 -0
- package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/plan-command.js +114 -0
- package/dist/presentation/cli/commands/plan-command.js.map +1 -0
- package/dist/presentation/cli/commands/react-command.d.ts +8 -0
- package/dist/presentation/cli/commands/react-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/react-command.js +99 -0
- package/dist/presentation/cli/commands/react-command.js.map +1 -0
- package/dist/presentation/cli/commands/setup-command.d.ts +10 -0
- package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/setup-command.js +231 -0
- package/dist/presentation/cli/commands/setup-command.js.map +1 -0
- package/dist/presentation/cli/commands/smart-command.d.ts +6 -0
- package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/smart-command.js +212 -0
- package/dist/presentation/cli/commands/smart-command.js.map +1 -0
- package/dist/presentation/cli/commands/trace-command.d.ts +8 -0
- package/dist/presentation/cli/commands/trace-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/trace-command.js +125 -0
- package/dist/presentation/cli/commands/trace-command.js.map +1 -0
- package/dist/presentation/cli/commands/undo-command.d.ts +8 -0
- package/dist/presentation/cli/commands/undo-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/undo-command.js +141 -0
- package/dist/presentation/cli/commands/undo-command.js.map +1 -0
- package/dist/presentation/cli/error-display.d.ts +23 -0
- package/dist/presentation/cli/error-display.d.ts.map +1 -0
- package/dist/presentation/cli/error-display.js +122 -0
- package/dist/presentation/cli/error-display.js.map +1 -0
- package/dist/refactor.d.ts.map +1 -1
- package/dist/refactor.js +2 -4
- package/dist/refactor.js.map +1 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +2 -63
- package/dist/search.js.map +1 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +52 -3
- package/dist/session.js.map +1 -1
- package/dist/testgen.d.ts.map +1 -1
- package/dist/testgen.js +1 -2
- package/dist/testgen.js.map +1 -1
- package/dist/tools/bash.d.ts +53 -0
- package/dist/tools/bash.d.ts.map +1 -0
- package/dist/tools/bash.js +213 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/edit.d.ts +48 -0
- package/dist/tools/edit.d.ts.map +1 -0
- package/dist/tools/edit.js +235 -0
- package/dist/tools/edit.js.map +1 -0
- package/dist/tools/executor.d.ts +29 -0
- package/dist/tools/executor.d.ts.map +1 -0
- package/dist/tools/executor.js +153 -0
- package/dist/tools/executor.js.map +1 -0
- package/dist/tools/git-tool.d.ts +87 -0
- package/dist/tools/git-tool.d.ts.map +1 -0
- package/dist/tools/git-tool.js +292 -0
- package/dist/tools/git-tool.js.map +1 -0
- package/dist/tools/parser.d.ts +33 -0
- package/dist/tools/parser.d.ts.map +1 -0
- package/dist/tools/parser.js +158 -0
- package/dist/tools/parser.js.map +1 -0
- package/dist/tools/registry.d.ts +74 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +302 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/search.d.ts +41 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +100 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +4 -2
- package/dist/ui.js.map +1 -1
- package/dist/utils/check-api-status.d.ts +12 -0
- package/dist/utils/check-api-status.d.ts.map +1 -0
- package/dist/utils/check-api-status.js +82 -0
- package/dist/utils/check-api-status.js.map +1 -0
- package/dist/utils/diff-parser.d.ts +22 -0
- package/dist/utils/diff-parser.d.ts.map +1 -0
- package/dist/utils/diff-parser.js +160 -0
- package/dist/utils/diff-parser.js.map +1 -0
- package/dist/utils/logger.d.ts +34 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +56 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/version.d.ts +21 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +52 -0
- package/dist/utils/version.js.map +1 -0
- package/dist/verification/backup.d.ts +30 -0
- package/dist/verification/backup.d.ts.map +1 -0
- package/dist/verification/backup.js +238 -0
- package/dist/verification/backup.js.map +1 -0
- package/dist/verification/compiler.d.ts +20 -0
- package/dist/verification/compiler.d.ts.map +1 -0
- package/dist/verification/compiler.js +228 -0
- package/dist/verification/compiler.js.map +1 -0
- package/dist/verification/index.d.ts +59 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +273 -0
- package/dist/verification/index.js.map +1 -0
- package/dist/verification/test-runner.d.ts +27 -0
- package/dist/verification/test-runner.d.ts.map +1 -0
- package/dist/verification/test-runner.js +379 -0
- package/dist/verification/test-runner.js.map +1 -0
- package/package.json +39 -14
- package/ARCHITECTURE.md +0 -240
- package/CHANGELOG.md +0 -44
- package/CONTRIBUTING.md +0 -171
- package/dist/benchmark.d.ts +0 -39
- package/dist/benchmark.d.ts.map +0 -1
- package/dist/benchmark.js +0 -195
- package/dist/benchmark.js.map +0 -1
- package/dist/scaffold.d.ts +0 -14
- package/dist/scaffold.d.ts.map +0 -1
- package/dist/scaffold.js +0 -85
- package/dist/scaffold.js.map +0 -1
- package/templates/next-page/app/layout.tsx +0 -19
- package/templates/next-page/app/page.tsx +0 -10
- package/templates/next-page/package.json +0 -22
- package/templates/node-api/index.js +0 -57
- package/templates/node-api/package.json +0 -13
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure: Policy-as-Code (PaC) Framework
|
|
3
|
+
*
|
|
4
|
+
* Treats policy definitions like code for automated enforcement and version control
|
|
5
|
+
* Research: Policy-as-Code enables automated compliance, version control for policies, CI/CD integration
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Policy definitions as code (YAML/JSON)
|
|
9
|
+
* - Automated enforcement at runtime
|
|
10
|
+
* - Version control and audit trails
|
|
11
|
+
* - CI/CD integration
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Policy-as-Code Framework
|
|
15
|
+
* Enforces policies automatically based on code-defined rules
|
|
16
|
+
*/
|
|
17
|
+
export class PolicyAsCode {
|
|
18
|
+
policies = new Map();
|
|
19
|
+
defaultPolicies = [];
|
|
20
|
+
constructor() {
|
|
21
|
+
this.initializeDefaultPolicies();
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Load policy from code definition
|
|
25
|
+
*/
|
|
26
|
+
loadPolicy(rule) {
|
|
27
|
+
this.policies.set(rule.id, rule);
|
|
28
|
+
this.defaultPolicies.push(rule);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Evaluate policies against context
|
|
32
|
+
*/
|
|
33
|
+
async evaluate(context) {
|
|
34
|
+
const results = [];
|
|
35
|
+
const blockingRules = [];
|
|
36
|
+
// Evaluate all enabled policies
|
|
37
|
+
for (const [ruleId, rule] of this.policies.entries()) {
|
|
38
|
+
if (!rule.enabled)
|
|
39
|
+
continue;
|
|
40
|
+
const result = await this.evaluateRule(rule, context);
|
|
41
|
+
results.push(result);
|
|
42
|
+
if (!result.passed && (result.action === 'block' || result.action === 'require_review')) {
|
|
43
|
+
blockingRules.push(result);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const passed = blockingRules.length === 0;
|
|
47
|
+
return {
|
|
48
|
+
passed,
|
|
49
|
+
results,
|
|
50
|
+
blockingRules,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get all policies
|
|
55
|
+
*/
|
|
56
|
+
getPolicies() {
|
|
57
|
+
return Array.from(this.policies.values());
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Enable/disable policy
|
|
61
|
+
*/
|
|
62
|
+
setPolicyEnabled(ruleId, enabled) {
|
|
63
|
+
const rule = this.policies.get(ruleId);
|
|
64
|
+
if (!rule)
|
|
65
|
+
return false;
|
|
66
|
+
rule.enabled = enabled;
|
|
67
|
+
rule.updatedAt = Date.now();
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Update policy
|
|
72
|
+
*/
|
|
73
|
+
updatePolicy(ruleId, updates) {
|
|
74
|
+
const rule = this.policies.get(ruleId);
|
|
75
|
+
if (!rule)
|
|
76
|
+
return false;
|
|
77
|
+
Object.assign(rule, updates);
|
|
78
|
+
rule.updatedAt = Date.now();
|
|
79
|
+
rule.version = this.incrementVersion(rule.version);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
// Private methods
|
|
83
|
+
async evaluateRule(rule, context) {
|
|
84
|
+
// Evaluate all conditions (AND logic - all must pass)
|
|
85
|
+
let passed = true;
|
|
86
|
+
const evidence = {};
|
|
87
|
+
for (const condition of rule.conditions) {
|
|
88
|
+
const conditionResult = this.evaluateCondition(condition, context);
|
|
89
|
+
if (!conditionResult.passed) {
|
|
90
|
+
passed = false;
|
|
91
|
+
}
|
|
92
|
+
evidence[condition.field] = {
|
|
93
|
+
expected: condition.value,
|
|
94
|
+
actual: conditionResult.actual,
|
|
95
|
+
passed: conditionResult.passed,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
ruleId: rule.id,
|
|
100
|
+
ruleName: rule.name,
|
|
101
|
+
passed,
|
|
102
|
+
severity: rule.severity,
|
|
103
|
+
action: rule.action,
|
|
104
|
+
message: passed
|
|
105
|
+
? `Policy "${rule.name}" passed`
|
|
106
|
+
: `Policy "${rule.name}" failed: ${rule.description}`,
|
|
107
|
+
evidence,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
evaluateCondition(condition, context) {
|
|
111
|
+
let actual;
|
|
112
|
+
// Get actual value from context based on condition type
|
|
113
|
+
switch (condition.type) {
|
|
114
|
+
case 'security':
|
|
115
|
+
actual = context.securityFindings?.length || 0;
|
|
116
|
+
break;
|
|
117
|
+
case 'license':
|
|
118
|
+
actual = context.licenseFindings?.length || 0;
|
|
119
|
+
break;
|
|
120
|
+
case 'provider_bias':
|
|
121
|
+
actual = (context.providerBiasFindings?.length || 0) > 0;
|
|
122
|
+
break;
|
|
123
|
+
case 'uncertainty':
|
|
124
|
+
actual = context.uncertainty?.epistemic?.value || 0;
|
|
125
|
+
break;
|
|
126
|
+
case 'test_coverage':
|
|
127
|
+
actual = context.testCoverage || 0;
|
|
128
|
+
break;
|
|
129
|
+
default:
|
|
130
|
+
actual = context.metadata?.[condition.field] || null;
|
|
131
|
+
}
|
|
132
|
+
// Evaluate condition based on operator
|
|
133
|
+
let passed = false;
|
|
134
|
+
switch (condition.operator) {
|
|
135
|
+
case 'equals':
|
|
136
|
+
passed = actual === condition.value;
|
|
137
|
+
break;
|
|
138
|
+
case 'greater_than':
|
|
139
|
+
passed = actual > condition.value;
|
|
140
|
+
break;
|
|
141
|
+
case 'less_than':
|
|
142
|
+
passed = actual < condition.value;
|
|
143
|
+
break;
|
|
144
|
+
case 'contains':
|
|
145
|
+
passed = String(actual).includes(String(condition.value));
|
|
146
|
+
break;
|
|
147
|
+
case 'not_contains':
|
|
148
|
+
passed = !String(actual).includes(String(condition.value));
|
|
149
|
+
break;
|
|
150
|
+
case 'exists':
|
|
151
|
+
passed = actual !== null && actual !== undefined;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
return { passed, actual };
|
|
155
|
+
}
|
|
156
|
+
initializeDefaultPolicies() {
|
|
157
|
+
// Default Policy 1: Block critical security vulnerabilities
|
|
158
|
+
this.loadPolicy({
|
|
159
|
+
id: 'security-critical-block',
|
|
160
|
+
name: 'Block Critical Security Vulnerabilities',
|
|
161
|
+
description: 'Block code with critical security vulnerabilities',
|
|
162
|
+
severity: 'critical',
|
|
163
|
+
action: 'block',
|
|
164
|
+
enabled: true,
|
|
165
|
+
conditions: [
|
|
166
|
+
{
|
|
167
|
+
type: 'security',
|
|
168
|
+
operator: 'greater_than',
|
|
169
|
+
field: 'critical_vulnerabilities',
|
|
170
|
+
value: 0,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
version: '1.0.0',
|
|
174
|
+
createdAt: Date.now(),
|
|
175
|
+
updatedAt: Date.now(),
|
|
176
|
+
});
|
|
177
|
+
// Default Policy 2: Block license conflicts
|
|
178
|
+
this.loadPolicy({
|
|
179
|
+
id: 'license-conflict-block',
|
|
180
|
+
name: 'Block License Conflicts',
|
|
181
|
+
description: 'Block code with license conflicts (GPL/MIT contamination)',
|
|
182
|
+
severity: 'critical',
|
|
183
|
+
action: 'block',
|
|
184
|
+
enabled: true,
|
|
185
|
+
conditions: [
|
|
186
|
+
{
|
|
187
|
+
type: 'license',
|
|
188
|
+
operator: 'greater_than',
|
|
189
|
+
field: 'license_conflicts',
|
|
190
|
+
value: 0,
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
version: '1.0.0',
|
|
194
|
+
createdAt: Date.now(),
|
|
195
|
+
updatedAt: Date.now(),
|
|
196
|
+
});
|
|
197
|
+
// Default Policy 3: Warn on high uncertainty
|
|
198
|
+
this.loadPolicy({
|
|
199
|
+
id: 'uncertainty-high-warn',
|
|
200
|
+
name: 'Warn on High Uncertainty',
|
|
201
|
+
description: 'Warn when epistemic uncertainty exceeds threshold (hallucination risk)',
|
|
202
|
+
severity: 'high',
|
|
203
|
+
action: 'warn',
|
|
204
|
+
enabled: true,
|
|
205
|
+
conditions: [
|
|
206
|
+
{
|
|
207
|
+
type: 'uncertainty',
|
|
208
|
+
operator: 'greater_than',
|
|
209
|
+
field: 'epistemic_uncertainty',
|
|
210
|
+
value: 0.7,
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
version: '1.0.0',
|
|
214
|
+
createdAt: Date.now(),
|
|
215
|
+
updatedAt: Date.now(),
|
|
216
|
+
});
|
|
217
|
+
// Default Policy 4: Require review for provider bias
|
|
218
|
+
this.loadPolicy({
|
|
219
|
+
id: 'provider-bias-review',
|
|
220
|
+
name: 'Review Provider Bias',
|
|
221
|
+
description: 'Require review when provider bias is detected (vendor lock-in risk)',
|
|
222
|
+
severity: 'medium',
|
|
223
|
+
action: 'require_review',
|
|
224
|
+
enabled: true,
|
|
225
|
+
conditions: [
|
|
226
|
+
{
|
|
227
|
+
type: 'provider_bias',
|
|
228
|
+
operator: 'equals',
|
|
229
|
+
field: 'has_provider_bias',
|
|
230
|
+
value: true,
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
version: '1.0.0',
|
|
234
|
+
createdAt: Date.now(),
|
|
235
|
+
updatedAt: Date.now(),
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
incrementVersion(version) {
|
|
239
|
+
const parts = version.split('.');
|
|
240
|
+
const patch = parseInt(parts[2] || '0', 10) + 1;
|
|
241
|
+
return `${parts[0]}.${parts[1]}.${patch}`;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=policy-as-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-as-code.js","sourceRoot":"","sources":["../../../src/infrastructure/governance/policy-as-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA+CH;;;GAGG;AACH,MAAM,OAAO,YAAY;IACf,QAAQ,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC9C,eAAe,GAAiB,EAAE,CAAC;IAE3C;QACE,IAAI,CAAC,yBAAyB,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,IAAgB;QACzB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAgC;QAK7C,MAAM,OAAO,GAA6B,EAAE,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K,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure: Prompt-to-Code Lineage
|
|
3
|
+
*
|
|
4
|
+
* Tracks the journey from user prompt to generated code artifact for auditability
|
|
5
|
+
* Research: Prompt-to-code lineage critical for auditability, compliance, and fault attribution
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Complete trace from prompt → planning → execution → code artifact
|
|
9
|
+
* - User context and intent tracking
|
|
10
|
+
* - Model invocation tracking
|
|
11
|
+
* - Input/output artifact tracking
|
|
12
|
+
* - Human intervention points
|
|
13
|
+
*/
|
|
14
|
+
export interface LineageNode {
|
|
15
|
+
nodeId: string;
|
|
16
|
+
type: 'prompt' | 'plan' | 'tool_call' | 'code_generation' | 'verification' | 'human_review' | 'final_artifact';
|
|
17
|
+
timestamp: number;
|
|
18
|
+
description: string;
|
|
19
|
+
input?: any;
|
|
20
|
+
output?: any;
|
|
21
|
+
metadata: {
|
|
22
|
+
user?: string;
|
|
23
|
+
sessionId?: string;
|
|
24
|
+
model?: string;
|
|
25
|
+
confidence?: number;
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
};
|
|
28
|
+
parentNodeId?: string;
|
|
29
|
+
childNodeIds: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface PromptLineage {
|
|
32
|
+
lineageId: string;
|
|
33
|
+
prompt: string;
|
|
34
|
+
userContext?: {
|
|
35
|
+
userId?: string;
|
|
36
|
+
sessionId?: string;
|
|
37
|
+
workspace?: string;
|
|
38
|
+
timestamp: number;
|
|
39
|
+
};
|
|
40
|
+
intent?: {
|
|
41
|
+
parsed: string;
|
|
42
|
+
confidence: number;
|
|
43
|
+
type: 'edit' | 'create' | 'explain' | 'plan' | 'refactor';
|
|
44
|
+
};
|
|
45
|
+
nodes: Map<string, LineageNode>;
|
|
46
|
+
rootNodeId: string;
|
|
47
|
+
finalArtifactId?: string;
|
|
48
|
+
humanInterventions: Array<{
|
|
49
|
+
timestamp: number;
|
|
50
|
+
type: 'approval' | 'rejection' | 'modification';
|
|
51
|
+
nodeId: string;
|
|
52
|
+
reason?: string;
|
|
53
|
+
changes?: any;
|
|
54
|
+
}>;
|
|
55
|
+
createdAt: number;
|
|
56
|
+
completedAt?: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Prompt-to-Code Lineage Tracker
|
|
60
|
+
* Maintains complete audit trail from prompt to code artifact
|
|
61
|
+
*/
|
|
62
|
+
export declare class PromptToCodeLineage {
|
|
63
|
+
private lineages;
|
|
64
|
+
/**
|
|
65
|
+
* Create new lineage trace for a user prompt
|
|
66
|
+
*/
|
|
67
|
+
createLineage(prompt: string, userContext?: {
|
|
68
|
+
userId?: string;
|
|
69
|
+
sessionId: string;
|
|
70
|
+
workspace?: string;
|
|
71
|
+
}): string;
|
|
72
|
+
/**
|
|
73
|
+
* Add node to lineage (plan, tool call, code generation, etc.)
|
|
74
|
+
*/
|
|
75
|
+
addNode(lineageId: string, node: Omit<LineageNode, 'nodeId' | 'childNodeIds'>, parentNodeId: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* Track code generation artifact
|
|
78
|
+
*/
|
|
79
|
+
trackCodeGeneration(lineageId: string, parentNodeId: string, artifact: {
|
|
80
|
+
filepath: string;
|
|
81
|
+
content: string;
|
|
82
|
+
diff?: string;
|
|
83
|
+
originalContent?: string;
|
|
84
|
+
}, metadata?: {
|
|
85
|
+
model?: string;
|
|
86
|
+
confidence?: number;
|
|
87
|
+
verificationPassed?: boolean;
|
|
88
|
+
}): string;
|
|
89
|
+
/**
|
|
90
|
+
* Track verification result
|
|
91
|
+
*/
|
|
92
|
+
trackVerification(lineageId: string, parentNodeId: string, verification: {
|
|
93
|
+
passed: boolean;
|
|
94
|
+
reason?: string;
|
|
95
|
+
findings?: any[];
|
|
96
|
+
}): string;
|
|
97
|
+
/**
|
|
98
|
+
* Track human intervention (approval, rejection, modification)
|
|
99
|
+
*/
|
|
100
|
+
trackHumanIntervention(lineageId: string, nodeId: string, intervention: {
|
|
101
|
+
type: 'approval' | 'rejection' | 'modification';
|
|
102
|
+
reason?: string;
|
|
103
|
+
changes?: any;
|
|
104
|
+
}): void;
|
|
105
|
+
/**
|
|
106
|
+
* Mark final artifact (code that was actually applied/committed)
|
|
107
|
+
*/
|
|
108
|
+
setFinalArtifact(lineageId: string, artifactNodeId: string): void;
|
|
109
|
+
/**
|
|
110
|
+
* Get complete lineage trace
|
|
111
|
+
*/
|
|
112
|
+
getLineage(lineageId: string): PromptLineage | null;
|
|
113
|
+
/**
|
|
114
|
+
* Get lineage path (trace from root to final artifact)
|
|
115
|
+
*/
|
|
116
|
+
getLineagePath(lineageId: string): LineageNode[];
|
|
117
|
+
/**
|
|
118
|
+
* Get all human interventions for audit
|
|
119
|
+
*/
|
|
120
|
+
getHumanInterventions(lineageId: string): PromptLineage['humanInterventions'];
|
|
121
|
+
/**
|
|
122
|
+
* Get lineage tree (complete decision tree from prompt to artifact)
|
|
123
|
+
*/
|
|
124
|
+
getLineageTree(lineageId: string): LineageNode | null;
|
|
125
|
+
/**
|
|
126
|
+
* Search lineages by criteria
|
|
127
|
+
*/
|
|
128
|
+
searchLineages(criteria: {
|
|
129
|
+
userId?: string;
|
|
130
|
+
sessionId?: string;
|
|
131
|
+
filepath?: string;
|
|
132
|
+
startTime?: number;
|
|
133
|
+
endTime?: number;
|
|
134
|
+
intentType?: string;
|
|
135
|
+
}): PromptLineage[];
|
|
136
|
+
private buildTree;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=prompt-to-code-lineage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-to-code-lineage.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/governance/prompt-to-code-lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,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,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE;QACZ,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,cAAc,CAAC;QAChD,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,GAAG,CAAC;KACf,GACA,IAAI;IAmBP;;OAEG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI;IAUjE;;OAEG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAInD;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE;IAyBhD;;OAEG;IACH,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,oBAAoB,CAAC;IAK7E;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IASrD;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,GAAG,aAAa,EAAE;IA+CnB,OAAO,CAAC,SAAS;CAYlB"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure: Prompt-to-Code Lineage
|
|
3
|
+
*
|
|
4
|
+
* Tracks the journey from user prompt to generated code artifact for auditability
|
|
5
|
+
* Research: Prompt-to-code lineage critical for auditability, compliance, and fault attribution
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Complete trace from prompt → planning → execution → code artifact
|
|
9
|
+
* - User context and intent tracking
|
|
10
|
+
* - Model invocation tracking
|
|
11
|
+
* - Input/output artifact tracking
|
|
12
|
+
* - Human intervention points
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Prompt-to-Code Lineage Tracker
|
|
16
|
+
* Maintains complete audit trail from prompt to code artifact
|
|
17
|
+
*/
|
|
18
|
+
export class PromptToCodeLineage {
|
|
19
|
+
lineages = new Map();
|
|
20
|
+
/**
|
|
21
|
+
* Create new lineage trace for a user prompt
|
|
22
|
+
*/
|
|
23
|
+
createLineage(prompt, userContext) {
|
|
24
|
+
const lineageId = `lineage-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
25
|
+
const rootNodeId = `node-${Date.now()}-root`;
|
|
26
|
+
const rootNode = {
|
|
27
|
+
nodeId: rootNodeId,
|
|
28
|
+
type: 'prompt',
|
|
29
|
+
timestamp: Date.now(),
|
|
30
|
+
description: `User prompt: ${prompt.substring(0, 100)}${prompt.length > 100 ? '...' : ''}`,
|
|
31
|
+
input: { prompt },
|
|
32
|
+
metadata: {
|
|
33
|
+
sessionId: userContext?.sessionId,
|
|
34
|
+
workspace: userContext?.workspace,
|
|
35
|
+
},
|
|
36
|
+
childNodeIds: [],
|
|
37
|
+
};
|
|
38
|
+
const lineage = {
|
|
39
|
+
lineageId,
|
|
40
|
+
prompt,
|
|
41
|
+
userContext: userContext ? {
|
|
42
|
+
...userContext,
|
|
43
|
+
timestamp: Date.now(),
|
|
44
|
+
} : undefined,
|
|
45
|
+
nodes: new Map([[rootNodeId, rootNode]]),
|
|
46
|
+
rootNodeId,
|
|
47
|
+
humanInterventions: [],
|
|
48
|
+
createdAt: Date.now(),
|
|
49
|
+
};
|
|
50
|
+
this.lineages.set(lineageId, lineage);
|
|
51
|
+
return lineageId;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Add node to lineage (plan, tool call, code generation, etc.)
|
|
55
|
+
*/
|
|
56
|
+
addNode(lineageId, node, parentNodeId) {
|
|
57
|
+
const lineage = this.lineages.get(lineageId);
|
|
58
|
+
if (!lineage) {
|
|
59
|
+
throw new Error(`Lineage ${lineageId} not found`);
|
|
60
|
+
}
|
|
61
|
+
const nodeId = `node-${Date.now()}-${node.type}`;
|
|
62
|
+
const fullNode = {
|
|
63
|
+
...node,
|
|
64
|
+
nodeId,
|
|
65
|
+
childNodeIds: [],
|
|
66
|
+
parentNodeId,
|
|
67
|
+
};
|
|
68
|
+
lineage.nodes.set(nodeId, fullNode);
|
|
69
|
+
// Link to parent
|
|
70
|
+
const parentNode = lineage.nodes.get(parentNodeId);
|
|
71
|
+
if (parentNode) {
|
|
72
|
+
parentNode.childNodeIds.push(nodeId);
|
|
73
|
+
}
|
|
74
|
+
return nodeId;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Track code generation artifact
|
|
78
|
+
*/
|
|
79
|
+
trackCodeGeneration(lineageId, parentNodeId, artifact, metadata) {
|
|
80
|
+
return this.addNode(lineageId, {
|
|
81
|
+
type: 'code_generation',
|
|
82
|
+
timestamp: Date.now(),
|
|
83
|
+
description: `Generated code artifact: ${artifact.filepath}`,
|
|
84
|
+
input: {
|
|
85
|
+
filepath: artifact.filepath,
|
|
86
|
+
originalContent: artifact.originalContent,
|
|
87
|
+
},
|
|
88
|
+
output: {
|
|
89
|
+
filepath: artifact.filepath,
|
|
90
|
+
content: artifact.content,
|
|
91
|
+
diff: artifact.diff,
|
|
92
|
+
},
|
|
93
|
+
metadata: metadata || {},
|
|
94
|
+
}, parentNodeId);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Track verification result
|
|
98
|
+
*/
|
|
99
|
+
trackVerification(lineageId, parentNodeId, verification) {
|
|
100
|
+
return this.addNode(lineageId, {
|
|
101
|
+
type: 'verification',
|
|
102
|
+
timestamp: Date.now(),
|
|
103
|
+
description: verification.passed ? 'Verification passed' : `Verification failed: ${verification.reason}`,
|
|
104
|
+
input: { parentNodeId },
|
|
105
|
+
output: verification,
|
|
106
|
+
metadata: {},
|
|
107
|
+
}, parentNodeId);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Track human intervention (approval, rejection, modification)
|
|
111
|
+
*/
|
|
112
|
+
trackHumanIntervention(lineageId, nodeId, intervention) {
|
|
113
|
+
const lineage = this.lineages.get(lineageId);
|
|
114
|
+
if (!lineage) {
|
|
115
|
+
throw new Error(`Lineage ${lineageId} not found`);
|
|
116
|
+
}
|
|
117
|
+
lineage.humanInterventions.push({
|
|
118
|
+
timestamp: Date.now(),
|
|
119
|
+
nodeId,
|
|
120
|
+
...intervention,
|
|
121
|
+
});
|
|
122
|
+
// Update node metadata with intervention
|
|
123
|
+
const node = lineage.nodes.get(nodeId);
|
|
124
|
+
if (node) {
|
|
125
|
+
node.metadata.humanIntervention = intervention;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Mark final artifact (code that was actually applied/committed)
|
|
130
|
+
*/
|
|
131
|
+
setFinalArtifact(lineageId, artifactNodeId) {
|
|
132
|
+
const lineage = this.lineages.get(lineageId);
|
|
133
|
+
if (!lineage) {
|
|
134
|
+
throw new Error(`Lineage ${lineageId} not found`);
|
|
135
|
+
}
|
|
136
|
+
lineage.finalArtifactId = artifactNodeId;
|
|
137
|
+
lineage.completedAt = Date.now();
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get complete lineage trace
|
|
141
|
+
*/
|
|
142
|
+
getLineage(lineageId) {
|
|
143
|
+
return this.lineages.get(lineageId) || null;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get lineage path (trace from root to final artifact)
|
|
147
|
+
*/
|
|
148
|
+
getLineagePath(lineageId) {
|
|
149
|
+
const lineage = this.lineages.get(lineageId);
|
|
150
|
+
if (!lineage) {
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
const path = [];
|
|
154
|
+
let currentNodeId = lineage.finalArtifactId || lineage.rootNodeId;
|
|
155
|
+
// Traverse from final artifact (or root) back to root
|
|
156
|
+
const visited = new Set();
|
|
157
|
+
while (currentNodeId && !visited.has(currentNodeId)) {
|
|
158
|
+
visited.add(currentNodeId);
|
|
159
|
+
const node = lineage.nodes.get(currentNodeId);
|
|
160
|
+
if (node) {
|
|
161
|
+
path.unshift(node); // Add to beginning
|
|
162
|
+
currentNodeId = node.parentNodeId;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return path;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Get all human interventions for audit
|
|
172
|
+
*/
|
|
173
|
+
getHumanInterventions(lineageId) {
|
|
174
|
+
const lineage = this.lineages.get(lineageId);
|
|
175
|
+
return lineage?.humanInterventions || [];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Get lineage tree (complete decision tree from prompt to artifact)
|
|
179
|
+
*/
|
|
180
|
+
getLineageTree(lineageId) {
|
|
181
|
+
const lineage = this.lineages.get(lineageId);
|
|
182
|
+
if (!lineage) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
return this.buildTree(lineage.rootNodeId, lineage.nodes);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Search lineages by criteria
|
|
189
|
+
*/
|
|
190
|
+
searchLineages(criteria) {
|
|
191
|
+
const results = [];
|
|
192
|
+
for (const lineage of this.lineages.values()) {
|
|
193
|
+
// Filter by user context
|
|
194
|
+
if (criteria.userId && lineage.userContext?.userId !== criteria.userId) {
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
if (criteria.sessionId && lineage.userContext?.sessionId !== criteria.sessionId) {
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
// Filter by time range
|
|
201
|
+
if (criteria.startTime && lineage.createdAt < criteria.startTime) {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
if (criteria.endTime && lineage.createdAt > criteria.endTime) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
// Filter by intent
|
|
208
|
+
if (criteria.intentType && lineage.intent?.type !== criteria.intentType) {
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
// Filter by filepath (check all code generation nodes)
|
|
212
|
+
if (criteria.filepath) {
|
|
213
|
+
let found = false;
|
|
214
|
+
for (const node of lineage.nodes.values()) {
|
|
215
|
+
if (node.type === 'code_generation' && node.output?.filepath === criteria.filepath) {
|
|
216
|
+
found = true;
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (!found)
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
results.push(lineage);
|
|
224
|
+
}
|
|
225
|
+
return results.sort((a, b) => b.createdAt - a.createdAt);
|
|
226
|
+
}
|
|
227
|
+
// Private helpers
|
|
228
|
+
buildTree(nodeId, nodes) {
|
|
229
|
+
const node = nodes.get(nodeId);
|
|
230
|
+
if (!node)
|
|
231
|
+
return null;
|
|
232
|
+
return {
|
|
233
|
+
...node,
|
|
234
|
+
childNodeIds: node.childNodeIds.map(childId => {
|
|
235
|
+
const childNode = nodes.get(childId);
|
|
236
|
+
return childNode ? childNode.nodeId : '';
|
|
237
|
+
}).filter(Boolean),
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=prompt-to-code-lineage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-to-code-lineage.js","sourceRoot":"","sources":["../../../src/infrastructure/governance/prompt-to-code-lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgDH;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IACtB,QAAQ,GAA+B,IAAI,GAAG,EAAE,CAAC;IAEzD;;OAEG;IACH,aAAa,CAAC,MAAc,EAAE,WAI7B;QACC,MAAM,SAAS,GAAG,WAAW,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,M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AQ,KAAK,QAAQ,CAAC,QAAQ,EAAE,CAAC;wBACnF,KAAK,GAAG,IAAI,CAAC;wBACb,MAAM;oBACR,CAAC;gBACH,CAAC;gBACD,IAAI,CAAC,KAAK;oBAAE,SAAS;YACvB,CAAC;YAED,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED,kBAAkB;IAEV,SAAS,CAAC,MAAc,EAAE,KAA+B;QAC/D,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QAEvB,OAAO;YACL,GAAG,IAAI;YACP,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;gBAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACrC,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;SACnB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC"}
|