codehere 0.3.0 → 0.5.0-alpha

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.
Files changed (455) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +329 -65
  3. package/dist/application/agents/documentation-agent.d.ts +24 -0
  4. package/dist/application/agents/documentation-agent.d.ts.map +1 -0
  5. package/dist/application/agents/documentation-agent.js +399 -0
  6. package/dist/application/agents/documentation-agent.js.map +1 -0
  7. package/dist/application/agents/execution-agent.d.ts +11 -0
  8. package/dist/application/agents/execution-agent.d.ts.map +1 -1
  9. package/dist/application/agents/execution-agent.js +289 -80
  10. package/dist/application/agents/execution-agent.js.map +1 -1
  11. package/dist/application/agents/multi-agent-orchestrator.d.ts +4 -0
  12. package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
  13. package/dist/application/agents/multi-agent-orchestrator.js +95 -2
  14. package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
  15. package/dist/application/agents/planning-agent.d.ts +3 -0
  16. package/dist/application/agents/planning-agent.d.ts.map +1 -1
  17. package/dist/application/agents/planning-agent.js +151 -71
  18. package/dist/application/agents/planning-agent.js.map +1 -1
  19. package/dist/application/agents/product-requirements-agent.d.ts +21 -0
  20. package/dist/application/agents/product-requirements-agent.d.ts.map +1 -0
  21. package/dist/application/agents/product-requirements-agent.js +247 -0
  22. package/dist/application/agents/product-requirements-agent.js.map +1 -0
  23. package/dist/application/agents/validation-agent.d.ts +5 -1
  24. package/dist/application/agents/validation-agent.d.ts.map +1 -1
  25. package/dist/application/agents/validation-agent.js +156 -21
  26. package/dist/application/agents/validation-agent.js.map +1 -1
  27. package/dist/application/reasoning/multi-model-planning-strategy.d.ts +21 -0
  28. package/dist/application/reasoning/multi-model-planning-strategy.d.ts.map +1 -0
  29. package/dist/application/reasoning/multi-model-planning-strategy.js +158 -0
  30. package/dist/application/reasoning/multi-model-planning-strategy.js.map +1 -0
  31. package/dist/application/reasoning/reasoning-config.d.ts +15 -0
  32. package/dist/application/reasoning/reasoning-config.d.ts.map +1 -0
  33. package/dist/application/reasoning/reasoning-config.js +50 -0
  34. package/dist/application/reasoning/reasoning-config.js.map +1 -0
  35. package/dist/application/reasoning/reasoning-orchestrator.d.ts +18 -0
  36. package/dist/application/reasoning/reasoning-orchestrator.d.ts.map +1 -0
  37. package/dist/application/reasoning/reasoning-orchestrator.js +170 -0
  38. package/dist/application/reasoning/reasoning-orchestrator.js.map +1 -0
  39. package/dist/application/reasoning/reasoning-strategy.interface.d.ts +24 -0
  40. package/dist/application/reasoning/reasoning-strategy.interface.d.ts.map +1 -0
  41. package/dist/application/reasoning/reasoning-strategy.interface.js +6 -0
  42. package/dist/application/reasoning/reasoning-strategy.interface.js.map +1 -0
  43. package/dist/application/reasoning/role-provider-resolver.d.ts +36 -0
  44. package/dist/application/reasoning/role-provider-resolver.d.ts.map +1 -0
  45. package/dist/application/reasoning/role-provider-resolver.js +74 -0
  46. package/dist/application/reasoning/role-provider-resolver.js.map +1 -0
  47. package/dist/application/reasoning/simple-planning-strategy.d.ts +22 -0
  48. package/dist/application/reasoning/simple-planning-strategy.d.ts.map +1 -0
  49. package/dist/application/reasoning/simple-planning-strategy.js +217 -0
  50. package/dist/application/reasoning/simple-planning-strategy.js.map +1 -0
  51. package/dist/application/reasoning/types.d.ts +65 -0
  52. package/dist/application/reasoning/types.d.ts.map +1 -0
  53. package/dist/application/reasoning/types.js +6 -0
  54. package/dist/application/reasoning/types.js.map +1 -0
  55. package/dist/application/reasoning/validator-strategy.d.ts +56 -0
  56. package/dist/application/reasoning/validator-strategy.d.ts.map +1 -0
  57. package/dist/application/reasoning/validator-strategy.js +103 -0
  58. package/dist/application/reasoning/validator-strategy.js.map +1 -0
  59. package/dist/application/services/dependency-container.d.ts +46 -2
  60. package/dist/application/services/dependency-container.d.ts.map +1 -1
  61. package/dist/application/services/dependency-container.js +198 -8
  62. package/dist/application/services/dependency-container.js.map +1 -1
  63. package/dist/application/services/intelligent-router.d.ts +19 -0
  64. package/dist/application/services/intelligent-router.d.ts.map +1 -1
  65. package/dist/application/services/intelligent-router.js +393 -91
  66. package/dist/application/services/intelligent-router.js.map +1 -1
  67. package/dist/application/use-cases/ask-question-use-case.d.ts +20 -0
  68. package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
  69. package/dist/application/use-cases/ask-question-use-case.js +129 -49
  70. package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
  71. package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -1
  72. package/dist/application/use-cases/edit-file-use-case.js +16 -1
  73. package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
  74. package/dist/application/use-cases/planning-use-case.d.ts +14 -1
  75. package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
  76. package/dist/application/use-cases/planning-use-case.js +109 -2
  77. package/dist/application/use-cases/planning-use-case.js.map +1 -1
  78. package/dist/domain/entities/documentation.d.ts +35 -0
  79. package/dist/domain/entities/documentation.d.ts.map +1 -0
  80. package/dist/domain/entities/documentation.js +6 -0
  81. package/dist/domain/entities/documentation.js.map +1 -0
  82. package/dist/domain/entities/memory.d.ts.map +1 -1
  83. package/dist/domain/entities/product-requirements.d.ts +50 -0
  84. package/dist/domain/entities/product-requirements.d.ts.map +1 -0
  85. package/dist/domain/entities/product-requirements.js +6 -0
  86. package/dist/domain/entities/product-requirements.js.map +1 -0
  87. package/dist/domain/entities/task.d.ts +152 -0
  88. package/dist/domain/entities/task.d.ts.map +1 -0
  89. package/dist/domain/entities/task.js +61 -0
  90. package/dist/domain/entities/task.js.map +1 -0
  91. package/dist/domain/errors/embeddings-not-found-error.d.ts +9 -0
  92. package/dist/domain/errors/embeddings-not-found-error.d.ts.map +1 -0
  93. package/dist/domain/errors/embeddings-not-found-error.js +13 -0
  94. package/dist/domain/errors/embeddings-not-found-error.js.map +1 -0
  95. package/dist/domain/interfaces/agent.interface.d.ts +15 -0
  96. package/dist/domain/interfaces/agent.interface.d.ts.map +1 -0
  97. package/dist/domain/interfaces/agent.interface.js +6 -0
  98. package/dist/domain/interfaces/agent.interface.js.map +1 -0
  99. package/dist/domain/interfaces/embedding-repository.interface.d.ts +5 -0
  100. package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -1
  101. package/dist/domain/services/environment-mode-manager.d.ts +12 -0
  102. package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
  103. package/dist/domain/services/environment-mode-manager.js +22 -0
  104. package/dist/domain/services/environment-mode-manager.js.map +1 -0
  105. package/dist/domain/services/query-intent-classifier.d.ts.map +1 -1
  106. package/dist/domain/services/query-intent-classifier.js +20 -1
  107. package/dist/domain/services/query-intent-classifier.js.map +1 -1
  108. package/dist/domain/services/risk-tier-detector.d.ts +17 -0
  109. package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
  110. package/dist/domain/services/risk-tier-detector.js +78 -0
  111. package/dist/domain/services/risk-tier-detector.js.map +1 -0
  112. package/dist/embed.d.ts.map +1 -1
  113. package/dist/embed.js +18 -8
  114. package/dist/embed.js.map +1 -1
  115. package/dist/formatter.d.ts.map +1 -1
  116. package/dist/formatter.js +10 -3
  117. package/dist/formatter.js.map +1 -1
  118. package/dist/index.js +494 -167
  119. package/dist/index.js.map +1 -1
  120. package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
  121. package/dist/infrastructure/ai/cohere-ai-service.js +19 -6
  122. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
  123. package/dist/infrastructure/ai/fake-ai-service.d.ts +22 -0
  124. package/dist/infrastructure/ai/fake-ai-service.d.ts.map +1 -0
  125. package/dist/infrastructure/ai/fake-ai-service.js +59 -0
  126. package/dist/infrastructure/ai/fake-ai-service.js.map +1 -0
  127. package/dist/infrastructure/ai/provider-ai-service.d.ts +59 -0
  128. package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -0
  129. package/dist/infrastructure/ai/provider-ai-service.js +477 -0
  130. package/dist/infrastructure/ai/provider-ai-service.js.map +1 -0
  131. package/dist/infrastructure/cache/embedding-cache.d.ts +13 -1
  132. package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -1
  133. package/dist/infrastructure/cache/embedding-cache.js +80 -9
  134. package/dist/infrastructure/cache/embedding-cache.js.map +1 -1
  135. package/dist/infrastructure/cache/query-result-cache.d.ts +14 -55
  136. package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -1
  137. package/dist/infrastructure/cache/query-result-cache.js +40 -112
  138. package/dist/infrastructure/cache/query-result-cache.js.map +1 -1
  139. package/dist/infrastructure/cache/response-cache.d.ts +18 -0
  140. package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
  141. package/dist/infrastructure/cache/response-cache.js +48 -0
  142. package/dist/infrastructure/cache/response-cache.js.map +1 -0
  143. package/dist/infrastructure/cache/security-scan-cache.d.ts +8 -49
  144. package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -1
  145. package/dist/infrastructure/cache/security-scan-cache.js +25 -102
  146. package/dist/infrastructure/cache/security-scan-cache.js.map +1 -1
  147. package/dist/infrastructure/completion/bash-completion.d.ts +2 -3
  148. package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -1
  149. package/dist/infrastructure/completion/bash-completion.js +11 -87
  150. package/dist/infrastructure/completion/bash-completion.js.map +1 -1
  151. package/dist/infrastructure/completion/fish-completion.d.ts +2 -3
  152. package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -1
  153. package/dist/infrastructure/completion/fish-completion.js +15 -58
  154. package/dist/infrastructure/completion/fish-completion.js.map +1 -1
  155. package/dist/infrastructure/completion/zsh-completion.d.ts +2 -3
  156. package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -1
  157. package/dist/infrastructure/completion/zsh-completion.js +18 -73
  158. package/dist/infrastructure/completion/zsh-completion.js.map +1 -1
  159. package/dist/infrastructure/config/config-manager.d.ts +10 -0
  160. package/dist/infrastructure/config/config-manager.d.ts.map +1 -1
  161. package/dist/infrastructure/config/config-manager.js +13 -2
  162. package/dist/infrastructure/config/config-manager.js.map +1 -1
  163. package/dist/infrastructure/context/conversation-context.d.ts +54 -0
  164. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
  165. package/dist/infrastructure/context/conversation-context.js +129 -0
  166. package/dist/infrastructure/context/conversation-context.js.map +1 -0
  167. package/dist/infrastructure/context/session-manager.d.ts +42 -0
  168. package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
  169. package/dist/infrastructure/context/session-manager.js +94 -0
  170. package/dist/infrastructure/context/session-manager.js.map +1 -0
  171. package/dist/infrastructure/cost/cost-tracker.d.ts +1 -0
  172. package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
  173. package/dist/infrastructure/cost/cost-tracker.js +12 -5
  174. package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
  175. package/dist/infrastructure/governance/nist-ai-rmf.d.ts +6 -8
  176. package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -1
  177. package/dist/infrastructure/governance/nist-ai-rmf.js +6 -8
  178. package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -1
  179. package/dist/infrastructure/governance/policy-as-code.d.ts +6 -8
  180. package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -1
  181. package/dist/infrastructure/governance/policy-as-code.js +6 -8
  182. package/dist/infrastructure/governance/policy-as-code.js.map +1 -1
  183. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +7 -9
  184. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -1
  185. package/dist/infrastructure/governance/prompt-to-code-lineage.js +7 -9
  186. package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -1
  187. package/dist/infrastructure/protocols/a2a-metadata.js +1 -1
  188. package/dist/infrastructure/protocols/mcp-oauth.js +1 -1
  189. package/dist/infrastructure/providers/cohere-provider.d.ts +39 -0
  190. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -0
  191. package/dist/infrastructure/providers/cohere-provider.js +444 -0
  192. package/dist/infrastructure/providers/cohere-provider.js.map +1 -0
  193. package/dist/infrastructure/providers/fake-provider.d.ts +43 -0
  194. package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -0
  195. package/dist/infrastructure/providers/fake-provider.js +130 -0
  196. package/dist/infrastructure/providers/fake-provider.js.map +1 -0
  197. package/dist/infrastructure/providers/local-llm-provider.d.ts +49 -0
  198. package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -0
  199. package/dist/infrastructure/providers/local-llm-provider.js +330 -0
  200. package/dist/infrastructure/providers/local-llm-provider.js.map +1 -0
  201. package/dist/infrastructure/providers/model-config.types.d.ts +70 -0
  202. package/dist/infrastructure/providers/model-config.types.d.ts.map +1 -0
  203. package/dist/infrastructure/providers/model-config.types.js +9 -0
  204. package/dist/infrastructure/providers/model-config.types.js.map +1 -0
  205. package/dist/infrastructure/providers/model-provider.interface.d.ts +113 -0
  206. package/dist/infrastructure/providers/model-provider.interface.d.ts.map +1 -0
  207. package/dist/infrastructure/providers/model-provider.interface.js +8 -0
  208. package/dist/infrastructure/providers/model-provider.interface.js.map +1 -0
  209. package/dist/infrastructure/providers/openai-provider.d.ts +38 -0
  210. package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -0
  211. package/dist/infrastructure/providers/openai-provider.js +413 -0
  212. package/dist/infrastructure/providers/openai-provider.js.map +1 -0
  213. package/dist/infrastructure/providers/openrouter-provider.d.ts +42 -0
  214. package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -0
  215. package/dist/infrastructure/providers/openrouter-provider.js +401 -0
  216. package/dist/infrastructure/providers/openrouter-provider.js.map +1 -0
  217. package/dist/infrastructure/providers/operation-provider-resolver.d.ts +48 -0
  218. package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
  219. package/dist/infrastructure/providers/operation-provider-resolver.js +131 -0
  220. package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -0
  221. package/dist/infrastructure/providers/provider-config-loader.d.ts +37 -0
  222. package/dist/infrastructure/providers/provider-config-loader.d.ts.map +1 -0
  223. package/dist/infrastructure/providers/provider-config-loader.js +120 -0
  224. package/dist/infrastructure/providers/provider-config-loader.js.map +1 -0
  225. package/dist/infrastructure/providers/provider-registry.d.ts +53 -0
  226. package/dist/infrastructure/providers/provider-registry.d.ts.map +1 -0
  227. package/dist/infrastructure/providers/provider-registry.js +88 -0
  228. package/dist/infrastructure/providers/provider-registry.js.map +1 -0
  229. package/dist/infrastructure/security/input-validator.d.ts.map +1 -1
  230. package/dist/infrastructure/security/input-validator.js +19 -6
  231. package/dist/infrastructure/security/input-validator.js.map +1 -1
  232. package/dist/infrastructure/serialization/toon-serializer.d.ts +45 -0
  233. package/dist/infrastructure/serialization/toon-serializer.d.ts.map +1 -0
  234. package/dist/infrastructure/serialization/toon-serializer.js +119 -0
  235. package/dist/infrastructure/serialization/toon-serializer.js.map +1 -0
  236. package/dist/infrastructure/storage/embeddings-path.d.ts +18 -0
  237. package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -0
  238. package/dist/infrastructure/storage/embeddings-path.js +37 -0
  239. package/dist/infrastructure/storage/embeddings-path.js.map +1 -0
  240. package/dist/infrastructure/storage/plan-repository.d.ts +2 -0
  241. package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
  242. package/dist/infrastructure/storage/plan-repository.js +36 -73
  243. package/dist/infrastructure/storage/plan-repository.js.map +1 -1
  244. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +10 -1
  245. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
  246. package/dist/infrastructure/storage/sqlite-embedding-repository.js +37 -3
  247. package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
  248. package/dist/infrastructure/storage/task-helpers.d.ts +69 -0
  249. package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
  250. package/dist/infrastructure/storage/task-helpers.js +197 -0
  251. package/dist/infrastructure/storage/task-helpers.js.map +1 -0
  252. package/dist/infrastructure/storage/task-repository.d.ts +68 -0
  253. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
  254. package/dist/infrastructure/storage/task-repository.js +216 -0
  255. package/dist/infrastructure/storage/task-repository.js.map +1 -0
  256. package/dist/infrastructure/telemetry/telemetry-service.d.ts +74 -0
  257. package/dist/infrastructure/telemetry/telemetry-service.d.ts.map +1 -0
  258. package/dist/infrastructure/telemetry/telemetry-service.js +167 -0
  259. package/dist/infrastructure/telemetry/telemetry-service.js.map +1 -0
  260. package/dist/infrastructure/ux/bi-directional-learning.d.ts +22 -0
  261. package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -1
  262. package/dist/infrastructure/ux/bi-directional-learning.js +144 -7
  263. package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -1
  264. package/dist/infrastructure/ux/capability-boundaries.d.ts +22 -0
  265. package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
  266. package/dist/infrastructure/ux/capability-boundaries.js +42 -0
  267. package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
  268. package/dist/infrastructure/ux/comprehensive-formatter.d.ts +21 -0
  269. package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
  270. package/dist/infrastructure/ux/comprehensive-formatter.js +117 -0
  271. package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
  272. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +5 -18
  273. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -1
  274. package/dist/infrastructure/ux/contextual-feature-discovery.js +5 -139
  275. package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -1
  276. package/dist/infrastructure/ux/feature-discovery.d.ts +3 -33
  277. package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -1
  278. package/dist/infrastructure/ux/feature-discovery.js +5 -181
  279. package/dist/infrastructure/ux/feature-discovery.js.map +1 -1
  280. package/dist/infrastructure/ux/feedback-prompt.d.ts +26 -0
  281. package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
  282. package/dist/infrastructure/ux/feedback-prompt.js +45 -0
  283. package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
  284. package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -1
  285. package/dist/infrastructure/ux/hitl-review-portal.js +4 -1
  286. package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -1
  287. package/dist/infrastructure/ux/hitl-validation.d.ts +35 -0
  288. package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -1
  289. package/dist/infrastructure/ux/hitl-validation.js +86 -0
  290. package/dist/infrastructure/ux/hitl-validation.js.map +1 -1
  291. package/dist/infrastructure/ux/progress-indicator.d.ts +5 -6
  292. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
  293. package/dist/infrastructure/ux/progress-indicator.js +36 -41
  294. package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
  295. package/dist/infrastructure/ux/proportional-friction.d.ts +73 -0
  296. package/dist/infrastructure/ux/proportional-friction.d.ts.map +1 -0
  297. package/dist/infrastructure/ux/proportional-friction.js +200 -0
  298. package/dist/infrastructure/ux/proportional-friction.js.map +1 -0
  299. package/dist/infrastructure/ux/review-checkpoint.d.ts +3 -1
  300. package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -1
  301. package/dist/infrastructure/ux/review-checkpoint.js +33 -80
  302. package/dist/infrastructure/ux/review-checkpoint.js.map +1 -1
  303. package/dist/infrastructure/ux/staged-feature-intro.d.ts +14 -39
  304. package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -1
  305. package/dist/infrastructure/ux/staged-feature-intro.js +12 -132
  306. package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -1
  307. package/dist/infrastructure/ux/syntax-highlighter.d.ts +1 -2
  308. package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -1
  309. package/dist/infrastructure/ux/syntax-highlighter.js +67 -148
  310. package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -1
  311. package/dist/infrastructure/validation/agent-feedback.d.ts +51 -0
  312. package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
  313. package/dist/infrastructure/validation/agent-feedback.js +55 -0
  314. package/dist/infrastructure/validation/agent-feedback.js.map +1 -0
  315. package/dist/infrastructure/validation/agent-validation-helper.d.ts +75 -0
  316. package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -0
  317. package/dist/infrastructure/validation/agent-validation-helper.js +137 -0
  318. package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -0
  319. package/dist/infrastructure/validation/feedback-stats.d.ts +99 -0
  320. package/dist/infrastructure/validation/feedback-stats.d.ts.map +1 -0
  321. package/dist/infrastructure/validation/feedback-stats.js +173 -0
  322. package/dist/infrastructure/validation/feedback-stats.js.map +1 -0
  323. package/dist/infrastructure/validation/review-handler.d.ts +26 -0
  324. package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
  325. package/dist/infrastructure/validation/review-handler.js +40 -0
  326. package/dist/infrastructure/validation/review-handler.js.map +1 -0
  327. package/dist/infrastructure/validation/summary-aggregator.d.ts +45 -0
  328. package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
  329. package/dist/infrastructure/validation/summary-aggregator.js +70 -0
  330. package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
  331. package/dist/infrastructure/validation/summary-extractor.d.ts +24 -0
  332. package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
  333. package/dist/infrastructure/validation/summary-extractor.js +45 -0
  334. package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
  335. package/dist/infrastructure/validation/trace-summary.d.ts +45 -0
  336. package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
  337. package/dist/infrastructure/validation/trace-summary.js +52 -0
  338. package/dist/infrastructure/validation/trace-summary.js.map +1 -0
  339. package/dist/infrastructure/validation/trust-config.d.ts +27 -0
  340. package/dist/infrastructure/validation/trust-config.d.ts.map +1 -0
  341. package/dist/infrastructure/validation/trust-config.js +113 -0
  342. package/dist/infrastructure/validation/trust-config.js.map +1 -0
  343. package/dist/infrastructure/xai/attention-visualizer.d.ts +6 -8
  344. package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -1
  345. package/dist/infrastructure/xai/attention-visualizer.js +6 -8
  346. package/dist/infrastructure/xai/attention-visualizer.js.map +1 -1
  347. package/dist/infrastructure/xai/cot-visualizer.d.ts +6 -9
  348. package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
  349. package/dist/infrastructure/xai/cot-visualizer.js +6 -9
  350. package/dist/infrastructure/xai/cot-visualizer.js.map +1 -1
  351. package/dist/infrastructure/xai/decision-tree-log.d.ts +6 -10
  352. package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -1
  353. package/dist/infrastructure/xai/decision-tree-log.js +6 -10
  354. package/dist/infrastructure/xai/decision-tree-log.js.map +1 -1
  355. package/dist/infrastructure/xai/interactive-xai.d.ts +6 -8
  356. package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -1
  357. package/dist/infrastructure/xai/interactive-xai.js +6 -8
  358. package/dist/infrastructure/xai/interactive-xai.js.map +1 -1
  359. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +6 -9
  360. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -1
  361. package/dist/infrastructure/xai/uncertainty-quantifier.js +6 -9
  362. package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -1
  363. package/dist/monitoring.d.ts +1 -1
  364. package/dist/monitoring.d.ts.map +1 -1
  365. package/dist/monitoring.js +12 -9
  366. package/dist/monitoring.js.map +1 -1
  367. package/dist/parallel-processor.d.ts.map +1 -1
  368. package/dist/parallel-processor.js +124 -45
  369. package/dist/parallel-processor.js.map +1 -1
  370. package/dist/presentation/cli/commands/ask-command.d.ts +2 -0
  371. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  372. package/dist/presentation/cli/commands/ask-command.js +356 -87
  373. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  374. package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
  375. package/dist/presentation/cli/commands/config-command.js +22 -8
  376. package/dist/presentation/cli/commands/config-command.js.map +1 -1
  377. package/dist/presentation/cli/commands/decision-command.js +23 -6
  378. package/dist/presentation/cli/commands/decision-command.js.map +1 -1
  379. package/dist/presentation/cli/commands/docs-command.d.ts +14 -0
  380. package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
  381. package/dist/presentation/cli/commands/docs-command.js +25 -0
  382. package/dist/presentation/cli/commands/docs-command.js.map +1 -0
  383. package/dist/presentation/cli/commands/fix-command.d.ts +10 -0
  384. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
  385. package/dist/presentation/cli/commands/fix-command.js +94 -0
  386. package/dist/presentation/cli/commands/fix-command.js.map +1 -0
  387. package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
  388. package/dist/presentation/cli/commands/help-command.js +23 -1
  389. package/dist/presentation/cli/commands/help-command.js.map +1 -1
  390. package/dist/presentation/cli/commands/memory-command.d.ts +17 -0
  391. package/dist/presentation/cli/commands/memory-command.d.ts.map +1 -0
  392. package/dist/presentation/cli/commands/memory-command.js +252 -0
  393. package/dist/presentation/cli/commands/memory-command.js.map +1 -0
  394. package/dist/presentation/cli/commands/models-command.d.ts +13 -0
  395. package/dist/presentation/cli/commands/models-command.d.ts.map +1 -0
  396. package/dist/presentation/cli/commands/models-command.js +194 -0
  397. package/dist/presentation/cli/commands/models-command.js.map +1 -0
  398. package/dist/presentation/cli/commands/orchestrate-command.d.ts +2 -0
  399. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  400. package/dist/presentation/cli/commands/orchestrate-command.js +182 -14
  401. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  402. package/dist/presentation/cli/commands/plan-command.d.ts +2 -0
  403. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  404. package/dist/presentation/cli/commands/plan-command.js +212 -26
  405. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  406. package/dist/presentation/cli/commands/product-command.d.ts +14 -0
  407. package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
  408. package/dist/presentation/cli/commands/product-command.js +22 -0
  409. package/dist/presentation/cli/commands/product-command.js.map +1 -0
  410. package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
  411. package/dist/presentation/cli/commands/react-command.js +8 -2
  412. package/dist/presentation/cli/commands/react-command.js.map +1 -1
  413. package/dist/presentation/cli/commands/review-command.d.ts +14 -0
  414. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -0
  415. package/dist/presentation/cli/commands/review-command.js +173 -0
  416. package/dist/presentation/cli/commands/review-command.js.map +1 -0
  417. package/dist/presentation/cli/commands/run-command.d.ts +13 -0
  418. package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
  419. package/dist/presentation/cli/commands/run-command.js +188 -0
  420. package/dist/presentation/cli/commands/run-command.js.map +1 -0
  421. package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
  422. package/dist/presentation/cli/commands/setup-command.js +15 -0
  423. package/dist/presentation/cli/commands/setup-command.js.map +1 -1
  424. package/dist/presentation/cli/commands/smart-command.d.ts +3 -1
  425. package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
  426. package/dist/presentation/cli/commands/smart-command.js +165 -11
  427. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  428. package/dist/presentation/cli/commands/status-command.d.ts +14 -0
  429. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
  430. package/dist/presentation/cli/commands/status-command.js +171 -0
  431. package/dist/presentation/cli/commands/status-command.js.map +1 -0
  432. package/dist/presentation/cli/commands/suggest-command.d.ts +11 -0
  433. package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
  434. package/dist/presentation/cli/commands/suggest-command.js +138 -0
  435. package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
  436. package/dist/presentation/cli/error-display.d.ts.map +1 -1
  437. package/dist/presentation/cli/error-display.js +118 -17
  438. package/dist/presentation/cli/error-display.js.map +1 -1
  439. package/dist/search.d.ts.map +1 -1
  440. package/dist/search.js +6 -1
  441. package/dist/search.js.map +1 -1
  442. package/dist/session.d.ts +1 -0
  443. package/dist/session.d.ts.map +1 -1
  444. package/dist/session.js +69 -4
  445. package/dist/session.js.map +1 -1
  446. package/dist/tools/bash.d.ts.map +1 -1
  447. package/dist/tools/bash.js +3 -0
  448. package/dist/tools/bash.js.map +1 -1
  449. package/dist/tools/git-tool.js +7 -7
  450. package/dist/tools/git-tool.js.map +1 -1
  451. package/dist/ui.d.ts +11 -0
  452. package/dist/ui.d.ts.map +1 -1
  453. package/dist/ui.js +62 -6
  454. package/dist/ui.js.map +1 -1
  455. package/package.json +22 -4
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Infrastructure: Task Repository
3
+ * Task storage and retrieval using JSONL format
4
+ *
5
+ * Phase 1: v0.5.0-alpha
6
+ * See: .internal/ARCHITECTURE.md (internal docs)
7
+ */
8
+ import type { CodehereTask } from '../../domain/entities/task.js';
9
+ import { TaskStatus, TaskMode } from '../../domain/entities/task.js';
10
+ export interface TaskRepository {
11
+ create(task: CodehereTask): Promise<void>;
12
+ getById(id: string): Promise<CodehereTask | null>;
13
+ getByStatus(status: TaskStatus): Promise<CodehereTask[]>;
14
+ getByMode(mode: TaskMode): Promise<CodehereTask[]>;
15
+ getRecent(limit: number): Promise<CodehereTask[]>;
16
+ update(task: CodehereTask): Promise<void>;
17
+ getAll(): Promise<CodehereTask[]>;
18
+ }
19
+ /**
20
+ * JSONL-based task repository
21
+ * Stores tasks in .codehere/tasks.jsonl at codebase root
22
+ */
23
+ export declare class JsonlTaskRepository implements TaskRepository {
24
+ private tasksPath;
25
+ private tasksCache;
26
+ private cacheLoaded;
27
+ constructor(customPath?: string);
28
+ /**
29
+ * Load tasks from JSONL file into cache
30
+ * For duplicate IDs, keeps the latest version (by updatedAt)
31
+ * Optimized for large files with early exit on timeout
32
+ */
33
+ private loadTasks;
34
+ /**
35
+ * Create a new task
36
+ */
37
+ create(task: CodehereTask): Promise<void>;
38
+ /**
39
+ * Get task by ID (returns latest version if multiple exist)
40
+ */
41
+ getById(id: string): Promise<CodehereTask | null>;
42
+ /**
43
+ * Get tasks by status
44
+ */
45
+ getByStatus(status: TaskStatus): Promise<CodehereTask[]>;
46
+ /**
47
+ * Get tasks by mode
48
+ */
49
+ getByMode(mode: TaskMode): Promise<CodehereTask[]>;
50
+ /**
51
+ * Get recent tasks (latest updated first)
52
+ */
53
+ getRecent(limit?: number): Promise<CodehereTask[]>;
54
+ /**
55
+ * Get all tasks (latest version of each)
56
+ */
57
+ getAll(): Promise<CodehereTask[]>;
58
+ /**
59
+ * Update existing task
60
+ * Creates a new entry in JSONL (append-only)
61
+ */
62
+ update(task: CodehereTask): Promise<void>;
63
+ }
64
+ /**
65
+ * Get task repository instance
66
+ */
67
+ export declare function getTaskRepository(customPath?: string): TaskRepository;
68
+ //# sourceMappingURL=task-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-repository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/task-repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAGrE,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAClD,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACzD,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACnD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAClD,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,cAAc;IACxD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,UAAU,CAAwC;IAC1D,OAAO,CAAC,WAAW,CAAkB;gBAEzB,UAAU,CAAC,EAAE,MAAM;IA2B/B;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAmDjB;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB/C;;OAEG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAcvD;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAM9D;;OAEG;IACG,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAMxD;;OAEG;IACG,SAAS,CAAC,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAQ5D;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAKvC;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAuBhD;AAKD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,cAAc,CAKrE"}
@@ -0,0 +1,216 @@
1
+ /**
2
+ * Infrastructure: Task Repository
3
+ * Task storage and retrieval using JSONL format
4
+ *
5
+ * Phase 1: v0.5.0-alpha
6
+ * See: .internal/ARCHITECTURE.md (internal docs)
7
+ */
8
+ import { appendFileSync, readFileSync, existsSync, mkdirSync } from 'fs';
9
+ import { join, dirname } from 'path';
10
+ import { findCodebaseRoot } from '../../domain/services/codebase-detector.js';
11
+ /**
12
+ * JSONL-based task repository
13
+ * Stores tasks in .codehere/tasks.jsonl at codebase root
14
+ */
15
+ export class JsonlTaskRepository {
16
+ tasksPath;
17
+ tasksCache = new Map();
18
+ cacheLoaded = false;
19
+ constructor(customPath) {
20
+ if (customPath) {
21
+ this.tasksPath = customPath;
22
+ }
23
+ else {
24
+ // Use environment variable or detect from codebase root
25
+ const envPath = process.env.CODEHERE_TASKS_PATH;
26
+ if (envPath) {
27
+ this.tasksPath = envPath;
28
+ }
29
+ else {
30
+ // Detect codebase root and use .codehere/tasks.jsonl
31
+ const codebaseInfo = findCodebaseRoot(process.cwd());
32
+ const codebaseRoot = codebaseInfo?.rootPath || process.cwd();
33
+ const codehereDir = join(codebaseRoot, '.codehere');
34
+ // Ensure .codehere directory exists
35
+ if (!existsSync(codehereDir)) {
36
+ mkdirSync(codehereDir, { recursive: true });
37
+ }
38
+ this.tasksPath = join(codehereDir, 'tasks.jsonl');
39
+ }
40
+ }
41
+ // Ensure directory exists
42
+ const tasksDir = dirname(this.tasksPath);
43
+ if (!existsSync(tasksDir)) {
44
+ mkdirSync(tasksDir, { recursive: true });
45
+ }
46
+ }
47
+ /**
48
+ * Load tasks from JSONL file into cache
49
+ * For duplicate IDs, keeps the latest version (by updatedAt)
50
+ * Optimized for large files with early exit on timeout
51
+ */
52
+ loadTasks() {
53
+ if (this.cacheLoaded) {
54
+ return;
55
+ }
56
+ if (!existsSync(this.tasksPath)) {
57
+ this.cacheLoaded = true;
58
+ return;
59
+ }
60
+ try {
61
+ // Use streaming read for large files (limit to 10MB)
62
+ const { statSync } = require('fs');
63
+ const stats = statSync(this.tasksPath);
64
+ if (stats.size > 10 * 1024 * 1024) {
65
+ // File too large, use empty cache
66
+ this.cacheLoaded = true;
67
+ return;
68
+ }
69
+ const content = readFileSync(this.tasksPath, 'utf-8');
70
+ const lines = content.trim().split('\n').filter(line => line.trim());
71
+ // Limit processing to first 10000 lines to prevent timeout
72
+ const linesToProcess = lines.slice(0, 10000);
73
+ // Load all tasks, then keep only the latest version of each ID
74
+ const allTasks = [];
75
+ for (const line of linesToProcess) {
76
+ try {
77
+ const task = JSON.parse(line);
78
+ allTasks.push(task);
79
+ }
80
+ catch {
81
+ // Skip invalid lines
82
+ }
83
+ }
84
+ // Group by ID and keep latest version
85
+ const taskMap = new Map();
86
+ for (const task of allTasks) {
87
+ const existing = taskMap.get(task.id);
88
+ if (!existing || task.updatedAt > existing.updatedAt) {
89
+ taskMap.set(task.id, task);
90
+ }
91
+ }
92
+ this.tasksCache = taskMap;
93
+ this.cacheLoaded = true;
94
+ }
95
+ catch (error) {
96
+ // Silent failure - don't break user workflow
97
+ this.cacheLoaded = true;
98
+ // Don't log errors in production to avoid noise
99
+ }
100
+ }
101
+ /**
102
+ * Create a new task
103
+ */
104
+ async create(task) {
105
+ // Ensure cache is loaded
106
+ this.loadTasks();
107
+ // Set timestamps if not provided
108
+ const now = Date.now();
109
+ const taskToCreate = {
110
+ ...task,
111
+ createdAt: task.createdAt || now,
112
+ updatedAt: task.updatedAt || now,
113
+ };
114
+ // Add to cache
115
+ this.tasksCache.set(taskToCreate.id, taskToCreate);
116
+ // Append to JSONL file (append-only, immutable history)
117
+ try {
118
+ appendFileSync(this.tasksPath, JSON.stringify(taskToCreate) + '\n', 'utf-8');
119
+ }
120
+ catch (error) {
121
+ // Silent failure - remove from cache if write failed
122
+ this.tasksCache.delete(taskToCreate.id);
123
+ console.error('[TaskRepository] Failed to create task:', error);
124
+ throw error;
125
+ }
126
+ }
127
+ /**
128
+ * Get task by ID (returns latest version if multiple exist)
129
+ */
130
+ async getById(id) {
131
+ this.loadTasks();
132
+ // Load all tasks and find the latest version of this ID
133
+ const allTasks = Array.from(this.tasksCache.values());
134
+ const tasksWithId = allTasks.filter(task => task.id === id);
135
+ if (tasksWithId.length === 0) {
136
+ return null;
137
+ }
138
+ // Return the task with the latest updatedAt timestamp
139
+ return tasksWithId.reduce((latest, current) => {
140
+ return current.updatedAt > latest.updatedAt ? current : latest;
141
+ });
142
+ }
143
+ /**
144
+ * Get tasks by status
145
+ */
146
+ async getByStatus(status) {
147
+ this.loadTasks();
148
+ const tasks = Array.from(this.tasksCache.values());
149
+ return tasks.filter(task => task.status === status);
150
+ }
151
+ /**
152
+ * Get tasks by mode
153
+ */
154
+ async getByMode(mode) {
155
+ this.loadTasks();
156
+ const tasks = Array.from(this.tasksCache.values());
157
+ return tasks.filter(task => task.mode === mode);
158
+ }
159
+ /**
160
+ * Get recent tasks (latest updated first)
161
+ */
162
+ async getRecent(limit = 10) {
163
+ this.loadTasks();
164
+ const tasks = Array.from(this.tasksCache.values());
165
+ return tasks
166
+ .sort((a, b) => b.updatedAt - a.updatedAt)
167
+ .slice(0, limit);
168
+ }
169
+ /**
170
+ * Get all tasks (latest version of each)
171
+ */
172
+ async getAll() {
173
+ this.loadTasks();
174
+ return Array.from(this.tasksCache.values());
175
+ }
176
+ /**
177
+ * Update existing task
178
+ * Creates a new entry in JSONL (append-only)
179
+ */
180
+ async update(task) {
181
+ // Ensure cache is loaded
182
+ this.loadTasks();
183
+ // Update timestamp
184
+ const updatedTask = {
185
+ ...task,
186
+ updatedAt: Date.now(),
187
+ };
188
+ // Update cache
189
+ this.tasksCache.set(updatedTask.id, updatedTask);
190
+ // Append updated version to JSONL (append-only, immutable history)
191
+ try {
192
+ appendFileSync(this.tasksPath, JSON.stringify(updatedTask) + '\n', 'utf-8');
193
+ }
194
+ catch (error) {
195
+ // Revert cache if write failed
196
+ const original = await this.getById(task.id);
197
+ if (original) {
198
+ this.tasksCache.set(task.id, original);
199
+ }
200
+ console.error('[TaskRepository] Failed to update task:', error);
201
+ throw error;
202
+ }
203
+ }
204
+ }
205
+ // Singleton instance (lazy initialization with codebase detection)
206
+ let taskRepositoryInstance = null;
207
+ /**
208
+ * Get task repository instance
209
+ */
210
+ export function getTaskRepository(customPath) {
211
+ if (!taskRepositoryInstance || customPath) {
212
+ taskRepositoryInstance = new JsonlTaskRepository(customPath);
213
+ }
214
+ return taskRepositoryInstance;
215
+ }
216
+ //# sourceMappingURL=task-repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-repository.js","sourceRoot":"","sources":["../../../src/infrastructure/storage/task-repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAY9E;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IACtB,SAAS,CAAS;IAClB,UAAU,GAA8B,IAAI,GAAG,EAAE,CAAC;IAClD,WAAW,GAAY,KAAK,CAAC;IAErC,YAAY,UAAmB;QAC7B,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,wDAAwD;YACxD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;YAChD,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;YAC3B,CAAC;iBAAM,CAAC;gBACN,qDAAqD;gBACrD,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;gBACrD,MAAM,YAAY,GAAG,YAAY,EAAE,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;gBAC7D,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;gBACpD,oCAAoC;gBACpC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;oBAC7B,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC9C,CAAC;gBACD,IA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WAAW,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;QACjD,mEAAmE;QACnE,IAAI,CAAC;YACH,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,+BAA+B;YAC/B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC7C,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;YACzC,CAAC;YACD,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;YAChE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAED,mEAAmE;AACnE,IAAI,sBAAsB,GAA0B,IAAI,CAAC;AAEzD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAmB;IACnD,IAAI,CAAC,sBAAsB,IAAI,UAAU,EAAE,CAAC;QAC1C,sBAAsB,GAAG,IAAI,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,sBAAsB,CAAC;AAChC,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Infrastructure: Telemetry Service
3
+ * Privacy-first, opt-in telemetry for understanding usage patterns
4
+ *
5
+ * Principles:
6
+ * - Opt-in only (CODEHERE_TELEMETRY_ENABLED=true)
7
+ * - No code/content transmitted
8
+ * - Anonymized data only
9
+ * - Local-first (stores locally, syncs if enabled)
10
+ *
11
+ * Clean Architecture: Infrastructure Layer
12
+ */
13
+ export interface TelemetryEvent {
14
+ id: string;
15
+ timestamp: number;
16
+ eventType: 'install' | 'command' | 'error' | 'feature_use';
17
+ data: {
18
+ command?: string;
19
+ version?: string;
20
+ os?: string;
21
+ nodeVersion?: string;
22
+ errorType?: string;
23
+ feature?: string;
24
+ };
25
+ sessionId: string;
26
+ anonymousId: string;
27
+ }
28
+ export declare class TelemetryService {
29
+ private telemetryDir;
30
+ private eventsFile;
31
+ private configFile;
32
+ private enabled;
33
+ private anonymousId;
34
+ private sessionId;
35
+ constructor();
36
+ private findCodebaseRoot;
37
+ private loadConfig;
38
+ private generateAnonymousId;
39
+ private saveConfig;
40
+ /**
41
+ * Check if telemetry is enabled
42
+ */
43
+ isEnabled(): boolean;
44
+ /**
45
+ * Enable telemetry (opt-in)
46
+ */
47
+ enable(): void;
48
+ /**
49
+ * Disable telemetry
50
+ */
51
+ disable(): void;
52
+ /**
53
+ * Track an event
54
+ */
55
+ track(eventType: TelemetryEvent['eventType'], data?: TelemetryEvent['data']): void;
56
+ /**
57
+ * Track command usage
58
+ */
59
+ trackCommand(command: string): void;
60
+ /**
61
+ * Track error
62
+ */
63
+ trackError(errorType: string): void;
64
+ /**
65
+ * Track feature usage
66
+ */
67
+ trackFeature(feature: string): void;
68
+ /**
69
+ * Get telemetry status message
70
+ */
71
+ getStatusMessage(): string;
72
+ }
73
+ export declare function getTelemetryService(): TelemetryService;
74
+ //# sourceMappingURL=telemetry-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-service.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/telemetry/telemetry-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;IAC3D,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,SAAS,CAAc;;IAa/B,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,UAAU;IAsBlB,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,UAAU;IAYlB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,MAAM,IAAI,IAAI;IAUd;;OAEG;IACH,OAAO,IAAI,IAAI;IAKf;;OAEG;IACH,KAAK,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,EAAE,IAAI,GAAE,cAAc,CAAC,MAAM,CAAM,GAAG,IAAI;IA2BtF;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAInC;;OAEG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAInC;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAInC;;OAEG;IACH,gBAAgB,IAAI,MAAM;CAM3B;AAKD,wBAAgB,mBAAmB,IAAI,gBAAgB,CAKtD"}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Infrastructure: Telemetry Service
3
+ * Privacy-first, opt-in telemetry for understanding usage patterns
4
+ *
5
+ * Principles:
6
+ * - Opt-in only (CODEHERE_TELEMETRY_ENABLED=true)
7
+ * - No code/content transmitted
8
+ * - Anonymized data only
9
+ * - Local-first (stores locally, syncs if enabled)
10
+ *
11
+ * Clean Architecture: Infrastructure Layer
12
+ */
13
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync } from 'fs';
14
+ import { join, dirname } from 'path';
15
+ import { fileURLToPath } from 'url';
16
+ import { randomUUID } from 'crypto';
17
+ const __filename = fileURLToPath(import.meta.url);
18
+ const __dirname = dirname(__filename);
19
+ export class TelemetryService {
20
+ telemetryDir;
21
+ eventsFile;
22
+ configFile;
23
+ enabled = false;
24
+ anonymousId = '';
25
+ sessionId = '';
26
+ constructor() {
27
+ // Find codebase root
28
+ const codebaseRoot = this.findCodebaseRoot();
29
+ this.telemetryDir = join(codebaseRoot, '.codehere', 'telemetry');
30
+ this.eventsFile = join(this.telemetryDir, 'events.jsonl');
31
+ this.configFile = join(this.telemetryDir, 'config.json');
32
+ this.sessionId = randomUUID();
33
+ this.loadConfig();
34
+ }
35
+ findCodebaseRoot() {
36
+ let current = process.cwd();
37
+ while (current !== '/') {
38
+ if (existsSync(join(current, '.codehere'))) {
39
+ return current;
40
+ }
41
+ current = join(current, '..');
42
+ }
43
+ return process.cwd();
44
+ }
45
+ loadConfig() {
46
+ // Check environment variable first
47
+ const envEnabled = process.env.CODEHERE_TELEMETRY_ENABLED === 'true';
48
+ if (existsSync(this.configFile)) {
49
+ try {
50
+ const config = JSON.parse(readFileSync(this.configFile, 'utf-8'));
51
+ this.enabled = config.enabled || envEnabled;
52
+ this.anonymousId = config.anonymousId || this.generateAnonymousId();
53
+ }
54
+ catch {
55
+ this.enabled = envEnabled;
56
+ this.anonymousId = this.generateAnonymousId();
57
+ }
58
+ }
59
+ else {
60
+ this.enabled = envEnabled;
61
+ this.anonymousId = this.generateAnonymousId();
62
+ }
63
+ // Save config
64
+ this.saveConfig();
65
+ }
66
+ generateAnonymousId() {
67
+ // Generate a persistent anonymous ID (not tied to user identity)
68
+ return randomUUID();
69
+ }
70
+ saveConfig() {
71
+ if (!existsSync(this.telemetryDir)) {
72
+ mkdirSync(this.telemetryDir, { recursive: true });
73
+ }
74
+ writeFileSync(this.configFile, JSON.stringify({
75
+ enabled: this.enabled,
76
+ anonymousId: this.anonymousId,
77
+ enabledAt: this.enabled ? Date.now() : null,
78
+ }, null, 2));
79
+ }
80
+ /**
81
+ * Check if telemetry is enabled
82
+ */
83
+ isEnabled() {
84
+ return this.enabled;
85
+ }
86
+ /**
87
+ * Enable telemetry (opt-in)
88
+ */
89
+ enable() {
90
+ this.enabled = true;
91
+ this.saveConfig();
92
+ this.track('install', {
93
+ version: process.env.npm_package_version || 'unknown',
94
+ os: process.platform,
95
+ nodeVersion: process.version,
96
+ });
97
+ }
98
+ /**
99
+ * Disable telemetry
100
+ */
101
+ disable() {
102
+ this.enabled = false;
103
+ this.saveConfig();
104
+ }
105
+ /**
106
+ * Track an event
107
+ */
108
+ track(eventType, data = {}) {
109
+ if (!this.enabled) {
110
+ return;
111
+ }
112
+ const event = {
113
+ id: randomUUID(),
114
+ timestamp: Date.now(),
115
+ eventType,
116
+ data: {
117
+ ...data,
118
+ version: data.version || process.env.npm_package_version || 'unknown',
119
+ os: data.os || process.platform,
120
+ nodeVersion: data.nodeVersion || process.version,
121
+ },
122
+ sessionId: this.sessionId,
123
+ anonymousId: this.anonymousId,
124
+ };
125
+ // Write to local file
126
+ if (!existsSync(this.telemetryDir)) {
127
+ mkdirSync(this.telemetryDir, { recursive: true });
128
+ }
129
+ appendFileSync(this.eventsFile, JSON.stringify(event) + '\n');
130
+ }
131
+ /**
132
+ * Track command usage
133
+ */
134
+ trackCommand(command) {
135
+ this.track('command', { command });
136
+ }
137
+ /**
138
+ * Track error
139
+ */
140
+ trackError(errorType) {
141
+ this.track('error', { errorType });
142
+ }
143
+ /**
144
+ * Track feature usage
145
+ */
146
+ trackFeature(feature) {
147
+ this.track('feature_use', { feature });
148
+ }
149
+ /**
150
+ * Get telemetry status message
151
+ */
152
+ getStatusMessage() {
153
+ if (this.enabled) {
154
+ return 'Telemetry: Enabled (opt-in)';
155
+ }
156
+ return 'Telemetry: Disabled (set CODEHERE_TELEMETRY_ENABLED=true to enable)';
157
+ }
158
+ }
159
+ // Singleton instance
160
+ let telemetryService = null;
161
+ export function getTelemetryService() {
162
+ if (!telemetryService) {
163
+ telemetryService = new TelemetryService();
164
+ }
165
+ return telemetryService;
166
+ }
167
+ //# sourceMappingURL=telemetry-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-service.js","sourceRoot":"","sources":["../../../src/infrastructure/telemetry/telemetry-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAkBtC,MAAM,OAAO,gBAAgB;IACnB,YAAY,CAAS;IACrB,UAAU,CAAS;IACnB,UAAU,CAAS;IACnB,OAAO,GAAY,KAAK,CAAC;IACzB,WAAW,GAAW,EAAE,CAAC;IACzB,SAAS,GAAW,EAAE,CAAC;IAE/B;QACE,qBAAqB;QACrB,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QAC1D,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;QAEzD,IAAI,CAAC,SAAS,GAAG,UAAU,EAAE,CAAC;QAC9B,IAAI,CAAC,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E,CAAC;QACtB,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAC5C,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
@@ -90,8 +90,18 @@ export declare class BiDirectionalLearning {
90
90
  getLearnedPatterns(userId: string): LearningPattern[];
91
91
  /**
92
92
  * Apply learned preferences to code generation
93
+ * Task 6.2: Enhanced to apply learned patterns and preferences
93
94
  */
94
95
  applyPreferences(userId: string, code: string): string;
96
+ /**
97
+ * Task 6.2: Get learned patterns as prompt context for code generation
98
+ * Returns patterns formatted for inclusion in AI prompts
99
+ */
100
+ getPatternsAsPromptContext(userId: string, maxPatterns?: number): string;
101
+ /**
102
+ * Task 6.2: Get user preferences as prompt context for code generation
103
+ */
104
+ getPreferencesAsPromptContext(userId: string): string;
95
105
  /**
96
106
  * Get feedback history for user
97
107
  */
@@ -103,7 +113,19 @@ export declare class BiDirectionalLearning {
103
113
  }): UserFeedback[];
104
114
  private learnFromFeedback;
105
115
  private updatePreferences;
116
+ /**
117
+ * Task 6.2: Enhanced pattern extraction from edits
118
+ * Extracts meaningful patterns from code edits for learning
119
+ */
106
120
  private extractPattern;
121
+ /**
122
+ * Task 6.2: Detect indentation style
123
+ */
124
+ private detectIndentation;
125
+ /**
126
+ * Task 6.2: Detect naming convention changes
127
+ */
128
+ private detectNamingChange;
107
129
  private addLearningPattern;
108
130
  }
109
131
  //# sourceMappingURL=bi-directional-learning.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bi-directional-learning.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/bi-directional-learning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,mBAAmB,CAAC;AAC1G,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B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cAAc;IAQtB,OAAO,CAAC,kBAAkB;CAuB3B"}
1
+ {"version":3,"file":"bi-directional-learning.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/bi-directional-learning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,mBAAmB,CAAC;AAC1G,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,CAAC;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,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