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.

Files changed (603) hide show
  1. package/README.md +51 -25
  2. package/dist/agents/base.d.ts +107 -0
  3. package/dist/agents/base.d.ts.map +1 -0
  4. package/dist/agents/base.js +101 -0
  5. package/dist/agents/base.js.map +1 -0
  6. package/dist/agents/orchestrator-model-driven.d.ts +41 -0
  7. package/dist/agents/orchestrator-model-driven.d.ts.map +1 -0
  8. package/dist/agents/orchestrator-model-driven.js +141 -0
  9. package/dist/agents/orchestrator-model-driven.js.map +1 -0
  10. package/dist/agents/react-orchestrator-agent.d.ts +15 -0
  11. package/dist/agents/react-orchestrator-agent.d.ts.map +1 -0
  12. package/dist/agents/react-orchestrator-agent.js +54 -0
  13. package/dist/agents/react-orchestrator-agent.js.map +1 -0
  14. package/dist/application/agents/execution-agent.d.ts +68 -0
  15. package/dist/application/agents/execution-agent.d.ts.map +1 -0
  16. package/dist/application/agents/execution-agent.js +299 -0
  17. package/dist/application/agents/execution-agent.js.map +1 -0
  18. package/dist/application/agents/multi-agent-orchestrator.d.ts +64 -0
  19. package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -0
  20. package/dist/application/agents/multi-agent-orchestrator.js +209 -0
  21. package/dist/application/agents/multi-agent-orchestrator.js.map +1 -0
  22. package/dist/application/agents/planning-agent.d.ts +61 -0
  23. package/dist/application/agents/planning-agent.d.ts.map +1 -0
  24. package/dist/application/agents/planning-agent.js +357 -0
  25. package/dist/application/agents/planning-agent.js.map +1 -0
  26. package/dist/application/agents/validation-agent.d.ts +64 -0
  27. package/dist/application/agents/validation-agent.d.ts.map +1 -0
  28. package/dist/application/agents/validation-agent.js +182 -0
  29. package/dist/application/agents/validation-agent.js.map +1 -0
  30. package/dist/application/architectures/plan-and-act.d.ts +94 -0
  31. package/dist/application/architectures/plan-and-act.d.ts.map +1 -0
  32. package/dist/application/architectures/plan-and-act.js +242 -0
  33. package/dist/application/architectures/plan-and-act.js.map +1 -0
  34. package/dist/application/index.d.ts +12 -0
  35. package/dist/application/index.d.ts.map +1 -0
  36. package/dist/application/index.js +12 -0
  37. package/dist/application/index.js.map +1 -0
  38. package/dist/application/services/agent-factory.d.ts +9 -0
  39. package/dist/application/services/agent-factory.d.ts.map +1 -0
  40. package/dist/application/services/agent-factory.js +28 -0
  41. package/dist/application/services/agent-factory.js.map +1 -0
  42. package/dist/application/services/dependency-container.d.ts +140 -0
  43. package/dist/application/services/dependency-container.d.ts.map +1 -0
  44. package/dist/application/services/dependency-container.js +402 -0
  45. package/dist/application/services/dependency-container.js.map +1 -0
  46. package/dist/application/services/git-context-service.d.ts +30 -0
  47. package/dist/application/services/git-context-service.d.ts.map +1 -0
  48. package/dist/application/services/git-context-service.js +83 -0
  49. package/dist/application/services/git-context-service.js.map +1 -0
  50. package/dist/application/services/intelligent-router.d.ts +74 -0
  51. package/dist/application/services/intelligent-router.d.ts.map +1 -0
  52. package/dist/application/services/intelligent-router.js +711 -0
  53. package/dist/application/services/intelligent-router.js.map +1 -0
  54. package/dist/application/services/tool-executor-service.d.ts +14 -0
  55. package/dist/application/services/tool-executor-service.d.ts.map +1 -0
  56. package/dist/application/services/tool-executor-service.js +94 -0
  57. package/dist/application/services/tool-executor-service.js.map +1 -0
  58. package/dist/application/use-cases/ask-question-use-case.d.ts +36 -0
  59. package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -0
  60. package/dist/application/use-cases/ask-question-use-case.js +150 -0
  61. package/dist/application/use-cases/ask-question-use-case.js.map +1 -0
  62. package/dist/application/use-cases/edit-file-use-case.d.ts +76 -0
  63. package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -0
  64. package/dist/application/use-cases/edit-file-use-case.js +685 -0
  65. package/dist/application/use-cases/edit-file-use-case.js.map +1 -0
  66. package/dist/application/use-cases/explain-file-use-case.d.ts +21 -0
  67. package/dist/application/use-cases/explain-file-use-case.d.ts.map +1 -0
  68. package/dist/application/use-cases/explain-file-use-case.js +50 -0
  69. package/dist/application/use-cases/explain-file-use-case.js.map +1 -0
  70. package/dist/application/use-cases/index-codebase-use-case.d.ts +46 -0
  71. package/dist/application/use-cases/index-codebase-use-case.d.ts.map +1 -0
  72. package/dist/application/use-cases/index-codebase-use-case.js +113 -0
  73. package/dist/application/use-cases/index-codebase-use-case.js.map +1 -0
  74. package/dist/application/use-cases/planning-use-case.d.ts +46 -0
  75. package/dist/application/use-cases/planning-use-case.d.ts.map +1 -0
  76. package/dist/application/use-cases/planning-use-case.js +267 -0
  77. package/dist/application/use-cases/planning-use-case.js.map +1 -0
  78. package/dist/application/use-cases/react-orchestration-use-case.d.ts +51 -0
  79. package/dist/application/use-cases/react-orchestration-use-case.d.ts.map +1 -0
  80. package/dist/application/use-cases/react-orchestration-use-case.js +325 -0
  81. package/dist/application/use-cases/react-orchestration-use-case.js.map +1 -0
  82. package/dist/application/use-cases/reflexion-use-case.d.ts +24 -0
  83. package/dist/application/use-cases/reflexion-use-case.d.ts.map +1 -0
  84. package/dist/application/use-cases/reflexion-use-case.js +30 -0
  85. package/dist/application/use-cases/reflexion-use-case.js.map +1 -0
  86. package/dist/application/workflows/deterministic-workflows.d.ts +61 -0
  87. package/dist/application/workflows/deterministic-workflows.d.ts.map +1 -0
  88. package/dist/application/workflows/deterministic-workflows.js +189 -0
  89. package/dist/application/workflows/deterministic-workflows.js.map +1 -0
  90. package/dist/cache.d.ts.map +1 -1
  91. package/dist/cache.js +1 -3
  92. package/dist/cache.js.map +1 -1
  93. package/dist/chat.js +10 -10
  94. package/dist/chat.js.map +1 -1
  95. package/dist/docs.d.ts.map +1 -1
  96. package/dist/docs.js +1 -2
  97. package/dist/docs.js.map +1 -1
  98. package/dist/domain/entities/code-chunk.d.ts +26 -0
  99. package/dist/domain/entities/code-chunk.d.ts.map +1 -0
  100. package/dist/domain/entities/code-chunk.js +6 -0
  101. package/dist/domain/entities/code-chunk.js.map +1 -0
  102. package/dist/domain/entities/decision.d.ts +37 -0
  103. package/dist/domain/entities/decision.d.ts.map +1 -0
  104. package/dist/domain/entities/decision.js +9 -0
  105. package/dist/domain/entities/decision.js.map +1 -0
  106. package/dist/domain/entities/edit.d.ts +35 -0
  107. package/dist/domain/entities/edit.d.ts.map +1 -0
  108. package/dist/domain/entities/edit.js +6 -0
  109. package/dist/domain/entities/edit.js.map +1 -0
  110. package/dist/domain/entities/knowledge-node.d.ts +83 -0
  111. package/dist/domain/entities/knowledge-node.d.ts.map +1 -0
  112. package/dist/domain/entities/knowledge-node.js +9 -0
  113. package/dist/domain/entities/knowledge-node.js.map +1 -0
  114. package/dist/domain/entities/knowledge-preservation.d.ts +42 -0
  115. package/dist/domain/entities/knowledge-preservation.d.ts.map +1 -0
  116. package/dist/domain/entities/knowledge-preservation.js +10 -0
  117. package/dist/domain/entities/knowledge-preservation.js.map +1 -0
  118. package/dist/domain/entities/memory.d.ts +36 -0
  119. package/dist/domain/entities/memory.d.ts.map +1 -0
  120. package/dist/domain/entities/memory.js +6 -0
  121. package/dist/domain/entities/memory.js.map +1 -0
  122. package/dist/domain/entities/pattern.d.ts +49 -0
  123. package/dist/domain/entities/pattern.d.ts.map +1 -0
  124. package/dist/domain/entities/pattern.js +7 -0
  125. package/dist/domain/entities/pattern.js.map +1 -0
  126. package/dist/domain/entities/plan.d.ts +42 -0
  127. package/dist/domain/entities/plan.d.ts.map +1 -0
  128. package/dist/domain/entities/plan.js +6 -0
  129. package/dist/domain/entities/plan.js.map +1 -0
  130. package/dist/domain/entities/query.d.ts +17 -0
  131. package/dist/domain/entities/query.d.ts.map +1 -0
  132. package/dist/domain/entities/query.js +6 -0
  133. package/dist/domain/entities/query.js.map +1 -0
  134. package/dist/domain/index.d.ts +16 -0
  135. package/dist/domain/index.d.ts.map +1 -0
  136. package/dist/domain/index.js +19 -0
  137. package/dist/domain/index.js.map +1 -0
  138. package/dist/domain/interfaces/ai-service.interface.d.ts +62 -0
  139. package/dist/domain/interfaces/ai-service.interface.d.ts.map +1 -0
  140. package/dist/domain/interfaces/ai-service.interface.js +6 -0
  141. package/dist/domain/interfaces/ai-service.interface.js.map +1 -0
  142. package/dist/domain/interfaces/code-analyzer.interface.d.ts +38 -0
  143. package/dist/domain/interfaces/code-analyzer.interface.d.ts.map +1 -0
  144. package/dist/domain/interfaces/code-analyzer.interface.js +6 -0
  145. package/dist/domain/interfaces/code-analyzer.interface.js.map +1 -0
  146. package/dist/domain/interfaces/decision-repository.interface.d.ts +51 -0
  147. package/dist/domain/interfaces/decision-repository.interface.d.ts.map +1 -0
  148. package/dist/domain/interfaces/decision-repository.interface.js +9 -0
  149. package/dist/domain/interfaces/decision-repository.interface.js.map +1 -0
  150. package/dist/domain/interfaces/embedding-repository.interface.d.ts +28 -0
  151. package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -0
  152. package/dist/domain/interfaces/embedding-repository.interface.js +6 -0
  153. package/dist/domain/interfaces/embedding-repository.interface.js.map +1 -0
  154. package/dist/domain/interfaces/knowledge-graph-repository.interface.d.ts +91 -0
  155. package/dist/domain/interfaces/knowledge-graph-repository.interface.d.ts.map +1 -0
  156. package/dist/domain/interfaces/knowledge-graph-repository.interface.js +9 -0
  157. package/dist/domain/interfaces/knowledge-graph-repository.interface.js.map +1 -0
  158. package/dist/domain/interfaces/knowledge-preservation-repository.interface.d.ts +50 -0
  159. package/dist/domain/interfaces/knowledge-preservation-repository.interface.d.ts.map +1 -0
  160. package/dist/domain/interfaces/knowledge-preservation-repository.interface.js +8 -0
  161. package/dist/domain/interfaces/knowledge-preservation-repository.interface.js.map +1 -0
  162. package/dist/domain/interfaces/memory-repository.interface.d.ts +49 -0
  163. package/dist/domain/interfaces/memory-repository.interface.d.ts.map +1 -0
  164. package/dist/domain/interfaces/memory-repository.interface.js +6 -0
  165. package/dist/domain/interfaces/memory-repository.interface.js.map +1 -0
  166. package/dist/domain/interfaces/pattern-repository.interface.d.ts +48 -0
  167. package/dist/domain/interfaces/pattern-repository.interface.d.ts.map +1 -0
  168. package/dist/domain/interfaces/pattern-repository.interface.js +6 -0
  169. package/dist/domain/interfaces/pattern-repository.interface.js.map +1 -0
  170. package/dist/domain/interfaces/verification-service.interface.d.ts +20 -0
  171. package/dist/domain/interfaces/verification-service.interface.d.ts.map +1 -0
  172. package/dist/domain/interfaces/verification-service.interface.js +6 -0
  173. package/dist/domain/interfaces/verification-service.interface.js.map +1 -0
  174. package/dist/domain/services/codebase-detector.d.ts +18 -0
  175. package/dist/domain/services/codebase-detector.d.ts.map +1 -0
  176. package/dist/domain/services/codebase-detector.js +91 -0
  177. package/dist/domain/services/codebase-detector.js.map +1 -0
  178. package/dist/domain/services/cross-team-pattern-sharing.d.ts +65 -0
  179. package/dist/domain/services/cross-team-pattern-sharing.d.ts.map +1 -0
  180. package/dist/domain/services/cross-team-pattern-sharing.js +125 -0
  181. package/dist/domain/services/cross-team-pattern-sharing.js.map +1 -0
  182. package/dist/domain/services/decision-recorder.d.ts +76 -0
  183. package/dist/domain/services/decision-recorder.d.ts.map +1 -0
  184. package/dist/domain/services/decision-recorder.js +223 -0
  185. package/dist/domain/services/decision-recorder.js.map +1 -0
  186. package/dist/domain/services/decision-retriever.d.ts +75 -0
  187. package/dist/domain/services/decision-retriever.d.ts.map +1 -0
  188. package/dist/domain/services/decision-retriever.js +133 -0
  189. package/dist/domain/services/decision-retriever.js.map +1 -0
  190. package/dist/domain/services/graded-memory-activation.d.ts +37 -0
  191. package/dist/domain/services/graded-memory-activation.d.ts.map +1 -0
  192. package/dist/domain/services/graded-memory-activation.js +69 -0
  193. package/dist/domain/services/graded-memory-activation.js.map +1 -0
  194. package/dist/domain/services/knowledge-access.d.ts +63 -0
  195. package/dist/domain/services/knowledge-access.d.ts.map +1 -0
  196. package/dist/domain/services/knowledge-access.js +132 -0
  197. package/dist/domain/services/knowledge-access.js.map +1 -0
  198. package/dist/domain/services/knowledge-extractor.d.ts +54 -0
  199. package/dist/domain/services/knowledge-extractor.d.ts.map +1 -0
  200. package/dist/domain/services/knowledge-extractor.js +247 -0
  201. package/dist/domain/services/knowledge-extractor.js.map +1 -0
  202. package/dist/domain/services/knowledge-graph-builder.d.ts +70 -0
  203. package/dist/domain/services/knowledge-graph-builder.d.ts.map +1 -0
  204. package/dist/domain/services/knowledge-graph-builder.js +268 -0
  205. package/dist/domain/services/knowledge-graph-builder.js.map +1 -0
  206. package/dist/domain/services/knowledge-graph-query.d.ts +69 -0
  207. package/dist/domain/services/knowledge-graph-query.d.ts.map +1 -0
  208. package/dist/domain/services/knowledge-graph-query.js +187 -0
  209. package/dist/domain/services/knowledge-graph-query.js.map +1 -0
  210. package/dist/domain/services/memory-retriever.d.ts +30 -0
  211. package/dist/domain/services/memory-retriever.d.ts.map +1 -0
  212. package/dist/domain/services/memory-retriever.js +82 -0
  213. package/dist/domain/services/memory-retriever.js.map +1 -0
  214. package/dist/domain/services/memory-synthesizer.d.ts +57 -0
  215. package/dist/domain/services/memory-synthesizer.d.ts.map +1 -0
  216. package/dist/domain/services/memory-synthesizer.js +91 -0
  217. package/dist/domain/services/memory-synthesizer.js.map +1 -0
  218. package/dist/domain/services/pattern-extractor.d.ts +108 -0
  219. package/dist/domain/services/pattern-extractor.d.ts.map +1 -0
  220. package/dist/domain/services/pattern-extractor.js +442 -0
  221. package/dist/domain/services/pattern-extractor.js.map +1 -0
  222. package/dist/domain/services/query-intent-classifier.d.ts +16 -0
  223. package/dist/domain/services/query-intent-classifier.d.ts.map +1 -0
  224. package/dist/domain/services/query-intent-classifier.js +140 -0
  225. package/dist/domain/services/query-intent-classifier.js.map +1 -0
  226. package/dist/domain/services/react-loop.d.ts +44 -0
  227. package/dist/domain/services/react-loop.d.ts.map +1 -0
  228. package/dist/domain/services/react-loop.js +110 -0
  229. package/dist/domain/services/react-loop.js.map +1 -0
  230. package/dist/edit.d.ts +0 -12
  231. package/dist/edit.d.ts.map +1 -1
  232. package/dist/edit.js +76 -351
  233. package/dist/edit.js.map +1 -1
  234. package/dist/embed.d.ts +0 -4
  235. package/dist/embed.d.ts.map +1 -1
  236. package/dist/embed.js +100 -174
  237. package/dist/embed.js.map +1 -1
  238. package/dist/error-handler.d.ts +1 -0
  239. package/dist/error-handler.d.ts.map +1 -1
  240. package/dist/error-handler.js +46 -3
  241. package/dist/error-handler.js.map +1 -1
  242. package/dist/index.js +228 -231
  243. package/dist/index.js.map +1 -1
  244. package/dist/infrastructure/ai/cohere-ai-service.d.ts +54 -0
  245. package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -0
  246. package/dist/infrastructure/ai/cohere-ai-service.js +547 -0
  247. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -0
  248. package/dist/infrastructure/ai/command-r-evaluation.d.ts +42 -0
  249. package/dist/infrastructure/ai/command-r-evaluation.d.ts.map +1 -0
  250. package/dist/infrastructure/ai/command-r-evaluation.js +206 -0
  251. package/dist/infrastructure/ai/command-r-evaluation.js.map +1 -0
  252. package/dist/infrastructure/ai/model-config.d.ts +47 -0
  253. package/dist/infrastructure/ai/model-config.d.ts.map +1 -0
  254. package/dist/infrastructure/ai/model-config.js +84 -0
  255. package/dist/infrastructure/ai/model-config.js.map +1 -0
  256. package/dist/infrastructure/cache/embedding-cache.d.ts +46 -0
  257. package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -0
  258. package/dist/infrastructure/cache/embedding-cache.js +104 -0
  259. package/dist/infrastructure/cache/embedding-cache.js.map +1 -0
  260. package/dist/infrastructure/chunking/ast-code-chunker.d.ts +12 -0
  261. package/dist/infrastructure/chunking/ast-code-chunker.d.ts.map +1 -0
  262. package/dist/infrastructure/chunking/ast-code-chunker.js +19 -0
  263. package/dist/infrastructure/chunking/ast-code-chunker.js.map +1 -0
  264. package/dist/infrastructure/chunking/code-aware-chunker.d.ts +63 -0
  265. package/dist/infrastructure/chunking/code-aware-chunker.d.ts.map +1 -0
  266. package/dist/infrastructure/chunking/code-aware-chunker.js +397 -0
  267. package/dist/infrastructure/chunking/code-aware-chunker.js.map +1 -0
  268. package/dist/infrastructure/config/config-manager.d.ts +79 -0
  269. package/dist/infrastructure/config/config-manager.d.ts.map +1 -0
  270. package/dist/infrastructure/config/config-manager.js +162 -0
  271. package/dist/infrastructure/config/config-manager.js.map +1 -0
  272. package/dist/infrastructure/cost/cost-tracker.d.ts +90 -0
  273. package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -0
  274. package/dist/infrastructure/cost/cost-tracker.js +353 -0
  275. package/dist/infrastructure/cost/cost-tracker.js.map +1 -0
  276. package/dist/infrastructure/file-scanner/file-scanner.d.ts +31 -0
  277. package/dist/infrastructure/file-scanner/file-scanner.d.ts.map +1 -0
  278. package/dist/infrastructure/file-scanner/file-scanner.js +106 -0
  279. package/dist/infrastructure/file-scanner/file-scanner.js.map +1 -0
  280. package/dist/infrastructure/governance/nist-ai-rmf.d.ts +107 -0
  281. package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -0
  282. package/dist/infrastructure/governance/nist-ai-rmf.js +294 -0
  283. package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -0
  284. package/dist/infrastructure/governance/policy-as-code.d.ts +90 -0
  285. package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -0
  286. package/dist/infrastructure/governance/policy-as-code.js +244 -0
  287. package/dist/infrastructure/governance/policy-as-code.js.map +1 -0
  288. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +138 -0
  289. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -0
  290. package/dist/infrastructure/governance/prompt-to-code-lineage.js +241 -0
  291. package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -0
  292. package/dist/infrastructure/index.d.ts +7 -0
  293. package/dist/infrastructure/index.d.ts.map +1 -0
  294. package/dist/infrastructure/index.js +7 -0
  295. package/dist/infrastructure/index.js.map +1 -0
  296. package/dist/infrastructure/observability/execution-tracer.d.ts +105 -0
  297. package/dist/infrastructure/observability/execution-tracer.d.ts.map +1 -0
  298. package/dist/infrastructure/observability/execution-tracer.js +190 -0
  299. package/dist/infrastructure/observability/execution-tracer.js.map +1 -0
  300. package/dist/infrastructure/observability/prompt-versioner.d.ts +67 -0
  301. package/dist/infrastructure/observability/prompt-versioner.d.ts.map +1 -0
  302. package/dist/infrastructure/observability/prompt-versioner.js +145 -0
  303. package/dist/infrastructure/observability/prompt-versioner.js.map +1 -0
  304. package/dist/infrastructure/protocols/a2a-metadata.d.ts +278 -0
  305. package/dist/infrastructure/protocols/a2a-metadata.d.ts.map +1 -0
  306. package/dist/infrastructure/protocols/a2a-metadata.js +137 -0
  307. package/dist/infrastructure/protocols/a2a-metadata.js.map +1 -0
  308. package/dist/infrastructure/protocols/a2a-protocol.d.ts +132 -0
  309. package/dist/infrastructure/protocols/a2a-protocol.d.ts.map +1 -0
  310. package/dist/infrastructure/protocols/a2a-protocol.js +314 -0
  311. package/dist/infrastructure/protocols/a2a-protocol.js.map +1 -0
  312. package/dist/infrastructure/protocols/mcp-oauth.d.ts +91 -0
  313. package/dist/infrastructure/protocols/mcp-oauth.d.ts.map +1 -0
  314. package/dist/infrastructure/protocols/mcp-oauth.js +184 -0
  315. package/dist/infrastructure/protocols/mcp-oauth.js.map +1 -0
  316. package/dist/infrastructure/protocols/mcp-server.d.ts +126 -0
  317. package/dist/infrastructure/protocols/mcp-server.d.ts.map +1 -0
  318. package/dist/infrastructure/protocols/mcp-server.js +333 -0
  319. package/dist/infrastructure/protocols/mcp-server.js.map +1 -0
  320. package/dist/infrastructure/protocols/streaming-handler.d.ts +57 -0
  321. package/dist/infrastructure/protocols/streaming-handler.d.ts.map +1 -0
  322. package/dist/infrastructure/protocols/streaming-handler.js +103 -0
  323. package/dist/infrastructure/protocols/streaming-handler.js.map +1 -0
  324. package/dist/infrastructure/security/ai-sast-scanner.d.ts +55 -0
  325. package/dist/infrastructure/security/ai-sast-scanner.d.ts.map +1 -0
  326. package/dist/infrastructure/security/ai-sast-scanner.js +163 -0
  327. package/dist/infrastructure/security/ai-sast-scanner.js.map +1 -0
  328. package/dist/infrastructure/security/docker-sandbox.d.ts +57 -0
  329. package/dist/infrastructure/security/docker-sandbox.d.ts.map +1 -0
  330. package/dist/infrastructure/security/docker-sandbox.js +178 -0
  331. package/dist/infrastructure/security/docker-sandbox.js.map +1 -0
  332. package/dist/infrastructure/security/enhanced-security-gate.d.ts +51 -0
  333. package/dist/infrastructure/security/enhanced-security-gate.d.ts.map +1 -0
  334. package/dist/infrastructure/security/enhanced-security-gate.js +92 -0
  335. package/dist/infrastructure/security/enhanced-security-gate.js.map +1 -0
  336. package/dist/infrastructure/security/input-validator.d.ts +33 -0
  337. package/dist/infrastructure/security/input-validator.d.ts.map +1 -0
  338. package/dist/infrastructure/security/input-validator.js +152 -0
  339. package/dist/infrastructure/security/input-validator.js.map +1 -0
  340. package/dist/infrastructure/security/license-scanner.d.ts +55 -0
  341. package/dist/infrastructure/security/license-scanner.d.ts.map +1 -0
  342. package/dist/infrastructure/security/license-scanner.js +167 -0
  343. package/dist/infrastructure/security/license-scanner.js.map +1 -0
  344. package/dist/infrastructure/security/provider-bias-detector.d.ts +53 -0
  345. package/dist/infrastructure/security/provider-bias-detector.d.ts.map +1 -0
  346. package/dist/infrastructure/security/provider-bias-detector.js +164 -0
  347. package/dist/infrastructure/security/provider-bias-detector.js.map +1 -0
  348. package/dist/infrastructure/security/sandbox-executor.d.ts +34 -0
  349. package/dist/infrastructure/security/sandbox-executor.d.ts.map +1 -0
  350. package/dist/infrastructure/security/sandbox-executor.js +64 -0
  351. package/dist/infrastructure/security/sandbox-executor.js.map +1 -0
  352. package/dist/infrastructure/storage/memory-stream-service.d.ts +47 -0
  353. package/dist/infrastructure/storage/memory-stream-service.d.ts.map +1 -0
  354. package/dist/infrastructure/storage/memory-stream-service.js +204 -0
  355. package/dist/infrastructure/storage/memory-stream-service.js.map +1 -0
  356. package/dist/infrastructure/storage/sqlite-decision-repository.d.ts +29 -0
  357. package/dist/infrastructure/storage/sqlite-decision-repository.d.ts.map +1 -0
  358. package/dist/infrastructure/storage/sqlite-decision-repository.js +232 -0
  359. package/dist/infrastructure/storage/sqlite-decision-repository.js.map +1 -0
  360. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +24 -0
  361. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -0
  362. package/dist/infrastructure/storage/sqlite-embedding-repository.js +162 -0
  363. package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -0
  364. package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.d.ts +41 -0
  365. package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.d.ts.map +1 -0
  366. package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js +417 -0
  367. package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js.map +1 -0
  368. package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.d.ts +29 -0
  369. package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.d.ts.map +1 -0
  370. package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js +230 -0
  371. package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js.map +1 -0
  372. package/dist/infrastructure/storage/sqlite-memory-repository.d.ts +40 -0
  373. package/dist/infrastructure/storage/sqlite-memory-repository.d.ts.map +1 -0
  374. package/dist/infrastructure/storage/sqlite-memory-repository.js +229 -0
  375. package/dist/infrastructure/storage/sqlite-memory-repository.js.map +1 -0
  376. package/dist/infrastructure/storage/sqlite-pattern-repository.d.ts +25 -0
  377. package/dist/infrastructure/storage/sqlite-pattern-repository.d.ts.map +1 -0
  378. package/dist/infrastructure/storage/sqlite-pattern-repository.js +249 -0
  379. package/dist/infrastructure/storage/sqlite-pattern-repository.js.map +1 -0
  380. package/dist/infrastructure/ux/appropriate-friction.d.ts +77 -0
  381. package/dist/infrastructure/ux/appropriate-friction.d.ts.map +1 -0
  382. package/dist/infrastructure/ux/appropriate-friction.js +213 -0
  383. package/dist/infrastructure/ux/appropriate-friction.js.map +1 -0
  384. package/dist/infrastructure/ux/bi-directional-learning.d.ts +109 -0
  385. package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -0
  386. package/dist/infrastructure/ux/bi-directional-learning.js +200 -0
  387. package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -0
  388. package/dist/infrastructure/ux/expectation-management.d.ts +65 -0
  389. package/dist/infrastructure/ux/expectation-management.d.ts.map +1 -0
  390. package/dist/infrastructure/ux/expectation-management.js +193 -0
  391. package/dist/infrastructure/ux/expectation-management.js.map +1 -0
  392. package/dist/infrastructure/ux/hitl-validation.d.ts +104 -0
  393. package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -0
  394. package/dist/infrastructure/ux/hitl-validation.js +211 -0
  395. package/dist/infrastructure/ux/hitl-validation.js.map +1 -0
  396. package/dist/infrastructure/ux/progressive-disclosure.d.ts +84 -0
  397. package/dist/infrastructure/ux/progressive-disclosure.d.ts.map +1 -0
  398. package/dist/infrastructure/ux/progressive-disclosure.js +235 -0
  399. package/dist/infrastructure/ux/progressive-disclosure.js.map +1 -0
  400. package/dist/infrastructure/ux/team-standards.d.ts +94 -0
  401. package/dist/infrastructure/ux/team-standards.d.ts.map +1 -0
  402. package/dist/infrastructure/ux/team-standards.js +196 -0
  403. package/dist/infrastructure/ux/team-standards.js.map +1 -0
  404. package/dist/infrastructure/verification/verification-service.d.ts +12 -0
  405. package/dist/infrastructure/verification/verification-service.d.ts.map +1 -0
  406. package/dist/infrastructure/verification/verification-service.js +47 -0
  407. package/dist/infrastructure/verification/verification-service.js.map +1 -0
  408. package/dist/infrastructure/xai/attention-visualizer.d.ts +73 -0
  409. package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -0
  410. package/dist/infrastructure/xai/attention-visualizer.js +174 -0
  411. package/dist/infrastructure/xai/attention-visualizer.js.map +1 -0
  412. package/dist/infrastructure/xai/cot-visualizer.d.ts +105 -0
  413. package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -0
  414. package/dist/infrastructure/xai/cot-visualizer.js +239 -0
  415. package/dist/infrastructure/xai/cot-visualizer.js.map +1 -0
  416. package/dist/infrastructure/xai/decision-tree-log.d.ts +104 -0
  417. package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -0
  418. package/dist/infrastructure/xai/decision-tree-log.js +216 -0
  419. package/dist/infrastructure/xai/decision-tree-log.js.map +1 -0
  420. package/dist/infrastructure/xai/interactive-xai.d.ts +106 -0
  421. package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -0
  422. package/dist/infrastructure/xai/interactive-xai.js +262 -0
  423. package/dist/infrastructure/xai/interactive-xai.js.map +1 -0
  424. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +80 -0
  425. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -0
  426. package/dist/infrastructure/xai/uncertainty-quantifier.js +201 -0
  427. package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -0
  428. package/dist/intelligent-retrieval.d.ts.map +1 -1
  429. package/dist/intelligent-retrieval.js +8 -1
  430. package/dist/intelligent-retrieval.js.map +1 -1
  431. package/dist/intent/classifier.d.ts +6 -0
  432. package/dist/intent/classifier.d.ts.map +1 -0
  433. package/dist/intent/classifier.js +2 -0
  434. package/dist/intent/classifier.js.map +1 -0
  435. package/dist/intent/context.d.ts +4 -0
  436. package/dist/intent/context.d.ts.map +1 -0
  437. package/dist/intent/context.js +2 -0
  438. package/dist/intent/context.js.map +1 -0
  439. package/dist/iterative-refinement.d.ts.map +1 -1
  440. package/dist/iterative-refinement.js +20 -3
  441. package/dist/iterative-refinement.js.map +1 -1
  442. package/dist/learning.d.ts.map +1 -1
  443. package/dist/learning.js +1 -2
  444. package/dist/learning.js.map +1 -1
  445. package/dist/monitoring.d.ts.map +1 -1
  446. package/dist/monitoring.js +1 -2
  447. package/dist/monitoring.js.map +1 -1
  448. package/dist/parallel-processor.d.ts +3 -2
  449. package/dist/parallel-processor.d.ts.map +1 -1
  450. package/dist/parallel-processor.js +183 -56
  451. package/dist/parallel-processor.js.map +1 -1
  452. package/dist/presentation/cli/commands/ask-command.d.ts +8 -0
  453. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -0
  454. package/dist/presentation/cli/commands/ask-command.js +133 -0
  455. package/dist/presentation/cli/commands/ask-command.js.map +1 -0
  456. package/dist/presentation/cli/commands/config-command.d.ts +9 -0
  457. package/dist/presentation/cli/commands/config-command.d.ts.map +1 -0
  458. package/dist/presentation/cli/commands/config-command.js +123 -0
  459. package/dist/presentation/cli/commands/config-command.js.map +1 -0
  460. package/dist/presentation/cli/commands/cost-command.d.ts +8 -0
  461. package/dist/presentation/cli/commands/cost-command.d.ts.map +1 -0
  462. package/dist/presentation/cli/commands/cost-command.js +191 -0
  463. package/dist/presentation/cli/commands/cost-command.js.map +1 -0
  464. package/dist/presentation/cli/commands/decision-command.d.ts +12 -0
  465. package/dist/presentation/cli/commands/decision-command.d.ts.map +1 -0
  466. package/dist/presentation/cli/commands/decision-command.js +207 -0
  467. package/dist/presentation/cli/commands/decision-command.js.map +1 -0
  468. package/dist/presentation/cli/commands/help-command.d.ts +9 -0
  469. package/dist/presentation/cli/commands/help-command.d.ts.map +1 -0
  470. package/dist/presentation/cli/commands/help-command.js +281 -0
  471. package/dist/presentation/cli/commands/help-command.js.map +1 -0
  472. package/dist/presentation/cli/commands/knowledge-command.d.ts +13 -0
  473. package/dist/presentation/cli/commands/knowledge-command.d.ts.map +1 -0
  474. package/dist/presentation/cli/commands/knowledge-command.js +129 -0
  475. package/dist/presentation/cli/commands/knowledge-command.js.map +1 -0
  476. package/dist/presentation/cli/commands/learning-dashboard-command.d.ts +8 -0
  477. package/dist/presentation/cli/commands/learning-dashboard-command.d.ts.map +1 -0
  478. package/dist/presentation/cli/commands/learning-dashboard-command.js +183 -0
  479. package/dist/presentation/cli/commands/learning-dashboard-command.js.map +1 -0
  480. package/dist/presentation/cli/commands/orchestrate-command.d.ts +8 -0
  481. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -0
  482. package/dist/presentation/cli/commands/orchestrate-command.js +112 -0
  483. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -0
  484. package/dist/presentation/cli/commands/plan-command.d.ts +8 -0
  485. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -0
  486. package/dist/presentation/cli/commands/plan-command.js +114 -0
  487. package/dist/presentation/cli/commands/plan-command.js.map +1 -0
  488. package/dist/presentation/cli/commands/react-command.d.ts +8 -0
  489. package/dist/presentation/cli/commands/react-command.d.ts.map +1 -0
  490. package/dist/presentation/cli/commands/react-command.js +99 -0
  491. package/dist/presentation/cli/commands/react-command.js.map +1 -0
  492. package/dist/presentation/cli/commands/setup-command.d.ts +10 -0
  493. package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -0
  494. package/dist/presentation/cli/commands/setup-command.js +231 -0
  495. package/dist/presentation/cli/commands/setup-command.js.map +1 -0
  496. package/dist/presentation/cli/commands/smart-command.d.ts +6 -0
  497. package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -0
  498. package/dist/presentation/cli/commands/smart-command.js +212 -0
  499. package/dist/presentation/cli/commands/smart-command.js.map +1 -0
  500. package/dist/presentation/cli/commands/trace-command.d.ts +8 -0
  501. package/dist/presentation/cli/commands/trace-command.d.ts.map +1 -0
  502. package/dist/presentation/cli/commands/trace-command.js +125 -0
  503. package/dist/presentation/cli/commands/trace-command.js.map +1 -0
  504. package/dist/presentation/cli/commands/undo-command.d.ts +8 -0
  505. package/dist/presentation/cli/commands/undo-command.d.ts.map +1 -0
  506. package/dist/presentation/cli/commands/undo-command.js +141 -0
  507. package/dist/presentation/cli/commands/undo-command.js.map +1 -0
  508. package/dist/presentation/cli/error-display.d.ts +23 -0
  509. package/dist/presentation/cli/error-display.d.ts.map +1 -0
  510. package/dist/presentation/cli/error-display.js +122 -0
  511. package/dist/presentation/cli/error-display.js.map +1 -0
  512. package/dist/refactor.d.ts.map +1 -1
  513. package/dist/refactor.js +2 -4
  514. package/dist/refactor.js.map +1 -1
  515. package/dist/search.d.ts.map +1 -1
  516. package/dist/search.js +2 -63
  517. package/dist/search.js.map +1 -1
  518. package/dist/session.d.ts.map +1 -1
  519. package/dist/session.js +52 -3
  520. package/dist/session.js.map +1 -1
  521. package/dist/testgen.d.ts.map +1 -1
  522. package/dist/testgen.js +1 -2
  523. package/dist/testgen.js.map +1 -1
  524. package/dist/tools/bash.d.ts +53 -0
  525. package/dist/tools/bash.d.ts.map +1 -0
  526. package/dist/tools/bash.js +213 -0
  527. package/dist/tools/bash.js.map +1 -0
  528. package/dist/tools/edit.d.ts +48 -0
  529. package/dist/tools/edit.d.ts.map +1 -0
  530. package/dist/tools/edit.js +235 -0
  531. package/dist/tools/edit.js.map +1 -0
  532. package/dist/tools/executor.d.ts +29 -0
  533. package/dist/tools/executor.d.ts.map +1 -0
  534. package/dist/tools/executor.js +153 -0
  535. package/dist/tools/executor.js.map +1 -0
  536. package/dist/tools/git-tool.d.ts +87 -0
  537. package/dist/tools/git-tool.d.ts.map +1 -0
  538. package/dist/tools/git-tool.js +292 -0
  539. package/dist/tools/git-tool.js.map +1 -0
  540. package/dist/tools/parser.d.ts +33 -0
  541. package/dist/tools/parser.d.ts.map +1 -0
  542. package/dist/tools/parser.js +158 -0
  543. package/dist/tools/parser.js.map +1 -0
  544. package/dist/tools/registry.d.ts +74 -0
  545. package/dist/tools/registry.d.ts.map +1 -0
  546. package/dist/tools/registry.js +302 -0
  547. package/dist/tools/registry.js.map +1 -0
  548. package/dist/tools/search.d.ts +41 -0
  549. package/dist/tools/search.d.ts.map +1 -0
  550. package/dist/tools/search.js +100 -0
  551. package/dist/tools/search.js.map +1 -0
  552. package/dist/ui.d.ts.map +1 -1
  553. package/dist/ui.js +4 -2
  554. package/dist/ui.js.map +1 -1
  555. package/dist/utils/check-api-status.d.ts +12 -0
  556. package/dist/utils/check-api-status.d.ts.map +1 -0
  557. package/dist/utils/check-api-status.js +82 -0
  558. package/dist/utils/check-api-status.js.map +1 -0
  559. package/dist/utils/diff-parser.d.ts +22 -0
  560. package/dist/utils/diff-parser.d.ts.map +1 -0
  561. package/dist/utils/diff-parser.js +160 -0
  562. package/dist/utils/diff-parser.js.map +1 -0
  563. package/dist/utils/logger.d.ts +34 -0
  564. package/dist/utils/logger.d.ts.map +1 -0
  565. package/dist/utils/logger.js +56 -0
  566. package/dist/utils/logger.js.map +1 -0
  567. package/dist/utils/version.d.ts +21 -0
  568. package/dist/utils/version.d.ts.map +1 -0
  569. package/dist/utils/version.js +52 -0
  570. package/dist/utils/version.js.map +1 -0
  571. package/dist/verification/backup.d.ts +30 -0
  572. package/dist/verification/backup.d.ts.map +1 -0
  573. package/dist/verification/backup.js +238 -0
  574. package/dist/verification/backup.js.map +1 -0
  575. package/dist/verification/compiler.d.ts +20 -0
  576. package/dist/verification/compiler.d.ts.map +1 -0
  577. package/dist/verification/compiler.js +228 -0
  578. package/dist/verification/compiler.js.map +1 -0
  579. package/dist/verification/index.d.ts +59 -0
  580. package/dist/verification/index.d.ts.map +1 -0
  581. package/dist/verification/index.js +273 -0
  582. package/dist/verification/index.js.map +1 -0
  583. package/dist/verification/test-runner.d.ts +27 -0
  584. package/dist/verification/test-runner.d.ts.map +1 -0
  585. package/dist/verification/test-runner.js +379 -0
  586. package/dist/verification/test-runner.js.map +1 -0
  587. package/package.json +39 -14
  588. package/ARCHITECTURE.md +0 -240
  589. package/CHANGELOG.md +0 -44
  590. package/CONTRIBUTING.md +0 -171
  591. package/dist/benchmark.d.ts +0 -39
  592. package/dist/benchmark.d.ts.map +0 -1
  593. package/dist/benchmark.js +0 -195
  594. package/dist/benchmark.js.map +0 -1
  595. package/dist/scaffold.d.ts +0 -14
  596. package/dist/scaffold.d.ts.map +0 -1
  597. package/dist/scaffold.js +0 -85
  598. package/dist/scaffold.js.map +0 -1
  599. package/templates/next-page/app/layout.tsx +0 -19
  600. package/templates/next-page/app/page.tsx +0 -10
  601. package/templates/next-page/package.json +0 -22
  602. package/templates/node-api/index.js +0 -57
  603. 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,CAAC;QAC7C,MAAM,aAAa,GAA6B,EAAE,CAAC;QAEnD,gCAAgC;QAChC,KAAK,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;YACrD,IAAI,CAAC,IAAI,CAAC,OAAO;gBAAE,SAAS;YAE5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACtD,OAAO,CAAC,IA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AK,EAAE,uBAAuB;oBAC9B,KAAK,EAAE,GAAG;iBACX;aACF;YACD,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;QAEH,qDAAqD;QACrD,IAAI,CAAC,UAAU,CAAC;YACd,EAAE,EAAE,sBAAsB;YAC1B,IAAI,EAAE,sBAAsB;YAC5B,WAAW,EAAE,qEAAqE;YAClF,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,gBAAgB;YACxB,OAAO,EAAE,IAAI;YACb,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,eAAe;oBACrB,QAAQ,EAAE,QAAQ;oBAClB,KAAK,EAAE,mBAAmB;oBAC1B,KAAK,EAAE,IAAI;iBACZ;aACF;YACD,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAEO,gBAAgB,CAAC,OAAe;QACtC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;QAChD,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,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,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,iBAAiB,GAAG,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAAC;I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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,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QACrF,MAAM,UAAU,GAAG,QAAQ,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC;QAE7C,MAAM,QAAQ,GAAgB;YAC5B,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,WAAW,EAAE,gBAAgB,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YAC1F,KAAK,EAAE,EAAE,MAAM,EAAE;YACjB,QAAQ,EAAE;gBACR,SAAS,EAAE,WAAW,EAAE,SAAS;gBACjC,SAAS,EAAE,WAAW,EAAE,SAAS;aAClC;YACD,YAAY,EAAE,EAAE;SACjB,CAAC;QAEF,MAAM,OAAO,GAAkB;YAC7B,SAAS;YACT,MAAM;YACN,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;g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AK,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,7 @@
1
+ /**
2
+ * Infrastructure Layer - Public Exports
3
+ */
4
+ export * from './ai/cohere-ai-service.js';
5
+ export * from './storage/sqlite-embedding-repository.js';
6
+ export * from './storage/sqlite-memory-repository.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -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,7 @@
1
+ /**
2
+ * Infrastructure Layer - Public Exports
3
+ */
4
+ export * from './ai/cohere-ai-service.js';
5
+ export * from './storage/sqlite-embedding-repository.js';
6
+ export * from './storage/sqlite-memory-repository.js';
7
+ //# sourceMappingURL=index.js.map
@@ -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"}