codehere 0.2.0 → 0.4.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 (405) hide show
  1. package/README.md +223 -42
  2. package/dist/application/agents/documentation-agent.d.ts +24 -0
  3. package/dist/application/agents/documentation-agent.d.ts.map +1 -0
  4. package/dist/application/agents/documentation-agent.js +399 -0
  5. package/dist/application/agents/documentation-agent.js.map +1 -0
  6. package/dist/application/agents/execution-agent.d.ts +11 -0
  7. package/dist/application/agents/execution-agent.d.ts.map +1 -1
  8. package/dist/application/agents/execution-agent.js +289 -80
  9. package/dist/application/agents/execution-agent.js.map +1 -1
  10. package/dist/application/agents/multi-agent-orchestrator.d.ts +4 -0
  11. package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
  12. package/dist/application/agents/multi-agent-orchestrator.js +86 -0
  13. package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
  14. package/dist/application/agents/planning-agent.d.ts +3 -0
  15. package/dist/application/agents/planning-agent.d.ts.map +1 -1
  16. package/dist/application/agents/planning-agent.js +132 -64
  17. package/dist/application/agents/planning-agent.js.map +1 -1
  18. package/dist/application/agents/product-requirements-agent.d.ts +21 -0
  19. package/dist/application/agents/product-requirements-agent.d.ts.map +1 -0
  20. package/dist/application/agents/product-requirements-agent.js +247 -0
  21. package/dist/application/agents/product-requirements-agent.js.map +1 -0
  22. package/dist/application/agents/validation-agent.d.ts +5 -1
  23. package/dist/application/agents/validation-agent.d.ts.map +1 -1
  24. package/dist/application/agents/validation-agent.js +156 -21
  25. package/dist/application/agents/validation-agent.js.map +1 -1
  26. package/dist/application/services/dependency-container.d.ts +25 -2
  27. package/dist/application/services/dependency-container.d.ts.map +1 -1
  28. package/dist/application/services/dependency-container.js +163 -1
  29. package/dist/application/services/dependency-container.js.map +1 -1
  30. package/dist/application/services/intelligent-router.d.ts +13 -0
  31. package/dist/application/services/intelligent-router.d.ts.map +1 -1
  32. package/dist/application/services/intelligent-router.js +300 -87
  33. package/dist/application/services/intelligent-router.js.map +1 -1
  34. package/dist/application/use-cases/ask-question-use-case.d.ts +31 -0
  35. package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
  36. package/dist/application/use-cases/ask-question-use-case.js +254 -55
  37. package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
  38. package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -1
  39. package/dist/application/use-cases/edit-file-use-case.js +86 -4
  40. package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
  41. package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
  42. package/dist/application/use-cases/planning-use-case.js +10 -1
  43. package/dist/application/use-cases/planning-use-case.js.map +1 -1
  44. package/dist/application/use-cases/react-orchestration-use-case.d.ts.map +1 -1
  45. package/dist/application/use-cases/react-orchestration-use-case.js +6 -2
  46. package/dist/application/use-cases/react-orchestration-use-case.js.map +1 -1
  47. package/dist/domain/entities/documentation.d.ts +35 -0
  48. package/dist/domain/entities/documentation.d.ts.map +1 -0
  49. package/dist/domain/entities/documentation.js +6 -0
  50. package/dist/domain/entities/documentation.js.map +1 -0
  51. package/dist/domain/entities/product-requirements.d.ts +50 -0
  52. package/dist/domain/entities/product-requirements.d.ts.map +1 -0
  53. package/dist/domain/entities/product-requirements.js +6 -0
  54. package/dist/domain/entities/product-requirements.js.map +1 -0
  55. package/dist/domain/entities/task.d.ts +152 -0
  56. package/dist/domain/entities/task.d.ts.map +1 -0
  57. package/dist/domain/entities/task.js +61 -0
  58. package/dist/domain/entities/task.js.map +1 -0
  59. package/dist/domain/interfaces/agent.interface.d.ts +15 -0
  60. package/dist/domain/interfaces/agent.interface.d.ts.map +1 -0
  61. package/dist/domain/interfaces/agent.interface.js +6 -0
  62. package/dist/domain/interfaces/agent.interface.js.map +1 -0
  63. package/dist/domain/services/environment-mode-manager.d.ts +18 -0
  64. package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
  65. package/dist/domain/services/environment-mode-manager.js +37 -0
  66. package/dist/domain/services/environment-mode-manager.js.map +1 -0
  67. package/dist/domain/services/react-loop.d.ts +8 -0
  68. package/dist/domain/services/react-loop.d.ts.map +1 -1
  69. package/dist/domain/services/react-loop.js +82 -6
  70. package/dist/domain/services/react-loop.js.map +1 -1
  71. package/dist/domain/services/risk-tier-detector.d.ts +18 -0
  72. package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
  73. package/dist/domain/services/risk-tier-detector.js +65 -0
  74. package/dist/domain/services/risk-tier-detector.js.map +1 -0
  75. package/dist/formatter.d.ts +2 -2
  76. package/dist/formatter.d.ts.map +1 -1
  77. package/dist/formatter.js +40 -20
  78. package/dist/formatter.js.map +1 -1
  79. package/dist/index.js +218 -125
  80. package/dist/index.js.map +1 -1
  81. package/dist/infrastructure/ai/cohere-ai-service.d.ts +3 -1
  82. package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
  83. package/dist/infrastructure/ai/cohere-ai-service.js +65 -5
  84. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
  85. package/dist/infrastructure/ai/fake-ai-service.d.ts +22 -0
  86. package/dist/infrastructure/ai/fake-ai-service.d.ts.map +1 -0
  87. package/dist/infrastructure/ai/fake-ai-service.js +59 -0
  88. package/dist/infrastructure/ai/fake-ai-service.js.map +1 -0
  89. package/dist/infrastructure/ai/provider-ai-service.d.ts +59 -0
  90. package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -0
  91. package/dist/infrastructure/ai/provider-ai-service.js +477 -0
  92. package/dist/infrastructure/ai/provider-ai-service.js.map +1 -0
  93. package/dist/infrastructure/cache/embedding-cache.d.ts +13 -1
  94. package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -1
  95. package/dist/infrastructure/cache/embedding-cache.js +80 -9
  96. package/dist/infrastructure/cache/embedding-cache.js.map +1 -1
  97. package/dist/infrastructure/cache/query-result-cache.d.ts +68 -0
  98. package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -0
  99. package/dist/infrastructure/cache/query-result-cache.js +138 -0
  100. package/dist/infrastructure/cache/query-result-cache.js.map +1 -0
  101. package/dist/infrastructure/cache/response-cache.d.ts +86 -0
  102. package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
  103. package/dist/infrastructure/cache/response-cache.js +224 -0
  104. package/dist/infrastructure/cache/response-cache.js.map +1 -0
  105. package/dist/infrastructure/cache/security-scan-cache.d.ts +57 -0
  106. package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -0
  107. package/dist/infrastructure/cache/security-scan-cache.js +124 -0
  108. package/dist/infrastructure/cache/security-scan-cache.js.map +1 -0
  109. package/dist/infrastructure/completion/bash-completion.d.ts +8 -0
  110. package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -0
  111. package/dist/infrastructure/completion/bash-completion.js +101 -0
  112. package/dist/infrastructure/completion/bash-completion.js.map +1 -0
  113. package/dist/infrastructure/completion/completion-generator.d.ts +42 -0
  114. package/dist/infrastructure/completion/completion-generator.d.ts.map +1 -0
  115. package/dist/infrastructure/completion/completion-generator.js +184 -0
  116. package/dist/infrastructure/completion/completion-generator.js.map +1 -0
  117. package/dist/infrastructure/completion/fish-completion.d.ts +8 -0
  118. package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -0
  119. package/dist/infrastructure/completion/fish-completion.js +65 -0
  120. package/dist/infrastructure/completion/fish-completion.js.map +1 -0
  121. package/dist/infrastructure/completion/zsh-completion.d.ts +8 -0
  122. package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -0
  123. package/dist/infrastructure/completion/zsh-completion.js +85 -0
  124. package/dist/infrastructure/completion/zsh-completion.js.map +1 -0
  125. package/dist/infrastructure/context/context-compressor.d.ts +94 -0
  126. package/dist/infrastructure/context/context-compressor.d.ts.map +1 -0
  127. package/dist/infrastructure/context/context-compressor.js +329 -0
  128. package/dist/infrastructure/context/context-compressor.js.map +1 -0
  129. package/dist/infrastructure/context/conversation-context.d.ts +58 -0
  130. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
  131. package/dist/infrastructure/context/conversation-context.js +170 -0
  132. package/dist/infrastructure/context/conversation-context.js.map +1 -0
  133. package/dist/infrastructure/context/session-manager.d.ts +26 -0
  134. package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
  135. package/dist/infrastructure/context/session-manager.js +98 -0
  136. package/dist/infrastructure/context/session-manager.js.map +1 -0
  137. package/dist/infrastructure/cost/cost-tracker.d.ts +1 -0
  138. package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
  139. package/dist/infrastructure/cost/cost-tracker.js +12 -5
  140. package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
  141. package/dist/infrastructure/governance/nist-ai-rmf.d.ts +6 -8
  142. package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -1
  143. package/dist/infrastructure/governance/nist-ai-rmf.js +6 -8
  144. package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -1
  145. package/dist/infrastructure/governance/policy-as-code.d.ts +6 -8
  146. package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -1
  147. package/dist/infrastructure/governance/policy-as-code.js +24 -11
  148. package/dist/infrastructure/governance/policy-as-code.js.map +1 -1
  149. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +7 -9
  150. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -1
  151. package/dist/infrastructure/governance/prompt-to-code-lineage.js +7 -9
  152. package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -1
  153. package/dist/infrastructure/observability/execution-tracer.d.ts +5 -2
  154. package/dist/infrastructure/observability/execution-tracer.d.ts.map +1 -1
  155. package/dist/infrastructure/observability/execution-tracer.js +45 -8
  156. package/dist/infrastructure/observability/execution-tracer.js.map +1 -1
  157. package/dist/infrastructure/providers/cohere-provider.d.ts +39 -0
  158. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -0
  159. package/dist/infrastructure/providers/cohere-provider.js +359 -0
  160. package/dist/infrastructure/providers/cohere-provider.js.map +1 -0
  161. package/dist/infrastructure/providers/fake-provider.d.ts +43 -0
  162. package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -0
  163. package/dist/infrastructure/providers/fake-provider.js +130 -0
  164. package/dist/infrastructure/providers/fake-provider.js.map +1 -0
  165. package/dist/infrastructure/providers/local-llm-provider.d.ts +49 -0
  166. package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -0
  167. package/dist/infrastructure/providers/local-llm-provider.js +330 -0
  168. package/dist/infrastructure/providers/local-llm-provider.js.map +1 -0
  169. package/dist/infrastructure/providers/model-config.types.d.ts +70 -0
  170. package/dist/infrastructure/providers/model-config.types.d.ts.map +1 -0
  171. package/dist/infrastructure/providers/model-config.types.js +9 -0
  172. package/dist/infrastructure/providers/model-config.types.js.map +1 -0
  173. package/dist/infrastructure/providers/model-provider.interface.d.ts +113 -0
  174. package/dist/infrastructure/providers/model-provider.interface.d.ts.map +1 -0
  175. package/dist/infrastructure/providers/model-provider.interface.js +8 -0
  176. package/dist/infrastructure/providers/model-provider.interface.js.map +1 -0
  177. package/dist/infrastructure/providers/openai-provider.d.ts +38 -0
  178. package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -0
  179. package/dist/infrastructure/providers/openai-provider.js +413 -0
  180. package/dist/infrastructure/providers/openai-provider.js.map +1 -0
  181. package/dist/infrastructure/providers/operation-provider-resolver.d.ts +48 -0
  182. package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
  183. package/dist/infrastructure/providers/operation-provider-resolver.js +105 -0
  184. package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -0
  185. package/dist/infrastructure/providers/provider-config-loader.d.ts +37 -0
  186. package/dist/infrastructure/providers/provider-config-loader.d.ts.map +1 -0
  187. package/dist/infrastructure/providers/provider-config-loader.js +120 -0
  188. package/dist/infrastructure/providers/provider-config-loader.js.map +1 -0
  189. package/dist/infrastructure/providers/provider-registry.d.ts +53 -0
  190. package/dist/infrastructure/providers/provider-registry.d.ts.map +1 -0
  191. package/dist/infrastructure/providers/provider-registry.js +88 -0
  192. package/dist/infrastructure/providers/provider-registry.js.map +1 -0
  193. package/dist/infrastructure/security/ai-sast-scanner.d.ts +4 -0
  194. package/dist/infrastructure/security/ai-sast-scanner.d.ts.map +1 -1
  195. package/dist/infrastructure/security/ai-sast-scanner.js +82 -4
  196. package/dist/infrastructure/security/ai-sast-scanner.js.map +1 -1
  197. package/dist/infrastructure/security/enhanced-security-gate.d.ts +2 -0
  198. package/dist/infrastructure/security/enhanced-security-gate.d.ts.map +1 -1
  199. package/dist/infrastructure/security/enhanced-security-gate.js +74 -15
  200. package/dist/infrastructure/security/enhanced-security-gate.js.map +1 -1
  201. package/dist/infrastructure/storage/plan-repository.d.ts +38 -0
  202. package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -0
  203. package/dist/infrastructure/storage/plan-repository.js +133 -0
  204. package/dist/infrastructure/storage/plan-repository.js.map +1 -0
  205. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +11 -0
  206. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
  207. package/dist/infrastructure/storage/sqlite-embedding-repository.js +121 -6
  208. package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
  209. package/dist/infrastructure/storage/task-helpers.d.ts +58 -0
  210. package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
  211. package/dist/infrastructure/storage/task-helpers.js +157 -0
  212. package/dist/infrastructure/storage/task-helpers.js.map +1 -0
  213. package/dist/infrastructure/storage/task-repository.d.ts +67 -0
  214. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
  215. package/dist/infrastructure/storage/task-repository.js +205 -0
  216. package/dist/infrastructure/storage/task-repository.js.map +1 -0
  217. package/dist/infrastructure/ux/bi-directional-learning.d.ts +22 -0
  218. package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -1
  219. package/dist/infrastructure/ux/bi-directional-learning.js +144 -7
  220. package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -1
  221. package/dist/infrastructure/ux/capability-boundaries.d.ts +50 -0
  222. package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
  223. package/dist/infrastructure/ux/capability-boundaries.js +167 -0
  224. package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
  225. package/dist/infrastructure/ux/comprehensive-formatter.d.ts +63 -0
  226. package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
  227. package/dist/infrastructure/ux/comprehensive-formatter.js +212 -0
  228. package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
  229. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +24 -0
  230. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -0
  231. package/dist/infrastructure/ux/contextual-feature-discovery.js +144 -0
  232. package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -0
  233. package/dist/infrastructure/ux/expectation-management.d.ts +33 -0
  234. package/dist/infrastructure/ux/expectation-management.d.ts.map +1 -1
  235. package/dist/infrastructure/ux/expectation-management.js +138 -4
  236. package/dist/infrastructure/ux/expectation-management.js.map +1 -1
  237. package/dist/infrastructure/ux/feature-discovery.d.ts +47 -0
  238. package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -0
  239. package/dist/infrastructure/ux/feature-discovery.js +190 -0
  240. package/dist/infrastructure/ux/feature-discovery.js.map +1 -0
  241. package/dist/infrastructure/ux/feedback-prompt.d.ts +42 -0
  242. package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
  243. package/dist/infrastructure/ux/feedback-prompt.js +181 -0
  244. package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
  245. package/dist/infrastructure/ux/hitl-review-portal.d.ts +47 -0
  246. package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -0
  247. package/dist/infrastructure/ux/hitl-review-portal.js +228 -0
  248. package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -0
  249. package/dist/infrastructure/ux/hitl-validation.d.ts +35 -0
  250. package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -1
  251. package/dist/infrastructure/ux/hitl-validation.js +86 -0
  252. package/dist/infrastructure/ux/hitl-validation.js.map +1 -1
  253. package/dist/infrastructure/ux/progress-indicator.d.ts +55 -0
  254. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -0
  255. package/dist/infrastructure/ux/progress-indicator.js +131 -0
  256. package/dist/infrastructure/ux/progress-indicator.js.map +1 -0
  257. package/dist/infrastructure/ux/progressive-disclosure.d.ts.map +1 -1
  258. package/dist/infrastructure/ux/progressive-disclosure.js +2 -1
  259. package/dist/infrastructure/ux/progressive-disclosure.js.map +1 -1
  260. package/dist/infrastructure/ux/proportional-friction.d.ts +73 -0
  261. package/dist/infrastructure/ux/proportional-friction.d.ts.map +1 -0
  262. package/dist/infrastructure/ux/proportional-friction.js +200 -0
  263. package/dist/infrastructure/ux/proportional-friction.js.map +1 -0
  264. package/dist/infrastructure/ux/review-checkpoint.d.ts +35 -0
  265. package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -0
  266. package/dist/infrastructure/ux/review-checkpoint.js +119 -0
  267. package/dist/infrastructure/ux/review-checkpoint.js.map +1 -0
  268. package/dist/infrastructure/ux/staged-feature-intro.d.ts +47 -0
  269. package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -0
  270. package/dist/infrastructure/ux/staged-feature-intro.js +144 -0
  271. package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -0
  272. package/dist/infrastructure/ux/syntax-highlighter.d.ts +21 -0
  273. package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -0
  274. package/dist/infrastructure/ux/syntax-highlighter.js +172 -0
  275. package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -0
  276. package/dist/infrastructure/validation/agent-feedback.d.ts +115 -0
  277. package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
  278. package/dist/infrastructure/validation/agent-feedback.js +227 -0
  279. package/dist/infrastructure/validation/agent-feedback.js.map +1 -0
  280. package/dist/infrastructure/validation/agent-validation-helper.d.ts +75 -0
  281. package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -0
  282. package/dist/infrastructure/validation/agent-validation-helper.js +88 -0
  283. package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -0
  284. package/dist/infrastructure/validation/feedback-stats.d.ts +99 -0
  285. package/dist/infrastructure/validation/feedback-stats.d.ts.map +1 -0
  286. package/dist/infrastructure/validation/feedback-stats.js +173 -0
  287. package/dist/infrastructure/validation/feedback-stats.js.map +1 -0
  288. package/dist/infrastructure/validation/review-handler.d.ts +54 -0
  289. package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
  290. package/dist/infrastructure/validation/review-handler.js +206 -0
  291. package/dist/infrastructure/validation/review-handler.js.map +1 -0
  292. package/dist/infrastructure/validation/summary-aggregator.d.ts +42 -0
  293. package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
  294. package/dist/infrastructure/validation/summary-aggregator.js +156 -0
  295. package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
  296. package/dist/infrastructure/validation/summary-extractor.d.ts +59 -0
  297. package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
  298. package/dist/infrastructure/validation/summary-extractor.js +102 -0
  299. package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
  300. package/dist/infrastructure/validation/trace-summary.d.ts +72 -0
  301. package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
  302. package/dist/infrastructure/validation/trace-summary.js +371 -0
  303. package/dist/infrastructure/validation/trace-summary.js.map +1 -0
  304. package/dist/infrastructure/validation/trust-config.d.ts +27 -0
  305. package/dist/infrastructure/validation/trust-config.d.ts.map +1 -0
  306. package/dist/infrastructure/validation/trust-config.js +113 -0
  307. package/dist/infrastructure/validation/trust-config.js.map +1 -0
  308. package/dist/infrastructure/xai/attention-visualizer.d.ts +6 -8
  309. package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -1
  310. package/dist/infrastructure/xai/attention-visualizer.js +6 -8
  311. package/dist/infrastructure/xai/attention-visualizer.js.map +1 -1
  312. package/dist/infrastructure/xai/cot-visualizer.d.ts +6 -8
  313. package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
  314. package/dist/infrastructure/xai/cot-visualizer.js +62 -18
  315. package/dist/infrastructure/xai/cot-visualizer.js.map +1 -1
  316. package/dist/infrastructure/xai/decision-tree-log.d.ts +6 -10
  317. package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -1
  318. package/dist/infrastructure/xai/decision-tree-log.js +6 -10
  319. package/dist/infrastructure/xai/decision-tree-log.js.map +1 -1
  320. package/dist/infrastructure/xai/interactive-xai.d.ts +6 -8
  321. package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -1
  322. package/dist/infrastructure/xai/interactive-xai.js +6 -8
  323. package/dist/infrastructure/xai/interactive-xai.js.map +1 -1
  324. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +6 -9
  325. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -1
  326. package/dist/infrastructure/xai/uncertainty-quantifier.js +6 -9
  327. package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -1
  328. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  329. package/dist/presentation/cli/commands/ask-command.js +152 -13
  330. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  331. package/dist/presentation/cli/commands/docs-command.d.ts +12 -0
  332. package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
  333. package/dist/presentation/cli/commands/docs-command.js +196 -0
  334. package/dist/presentation/cli/commands/docs-command.js.map +1 -0
  335. package/dist/presentation/cli/commands/fix-command.d.ts +8 -0
  336. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
  337. package/dist/presentation/cli/commands/fix-command.js +309 -0
  338. package/dist/presentation/cli/commands/fix-command.js.map +1 -0
  339. package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
  340. package/dist/presentation/cli/commands/help-command.js +2 -0
  341. package/dist/presentation/cli/commands/help-command.js.map +1 -1
  342. package/dist/presentation/cli/commands/orchestrate-command.d.ts +2 -0
  343. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  344. package/dist/presentation/cli/commands/orchestrate-command.js +88 -1
  345. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  346. package/dist/presentation/cli/commands/plan-command.d.ts +1 -0
  347. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  348. package/dist/presentation/cli/commands/plan-command.js +136 -7
  349. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  350. package/dist/presentation/cli/commands/product-command.d.ts +12 -0
  351. package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
  352. package/dist/presentation/cli/commands/product-command.js +188 -0
  353. package/dist/presentation/cli/commands/product-command.js.map +1 -0
  354. package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
  355. package/dist/presentation/cli/commands/react-command.js +98 -16
  356. package/dist/presentation/cli/commands/react-command.js.map +1 -1
  357. package/dist/presentation/cli/commands/review-command.d.ts +14 -0
  358. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -0
  359. package/dist/presentation/cli/commands/review-command.js +22 -0
  360. package/dist/presentation/cli/commands/review-command.js.map +1 -0
  361. package/dist/presentation/cli/commands/run-command.d.ts +15 -0
  362. package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
  363. package/dist/presentation/cli/commands/run-command.js +29 -0
  364. package/dist/presentation/cli/commands/run-command.js.map +1 -0
  365. package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
  366. package/dist/presentation/cli/commands/setup-command.js +67 -12
  367. package/dist/presentation/cli/commands/setup-command.js.map +1 -1
  368. package/dist/presentation/cli/commands/smart-command.d.ts +3 -1
  369. package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
  370. package/dist/presentation/cli/commands/smart-command.js +227 -23
  371. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  372. package/dist/presentation/cli/commands/status-command.d.ts +11 -0
  373. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
  374. package/dist/presentation/cli/commands/status-command.js +176 -0
  375. package/dist/presentation/cli/commands/status-command.js.map +1 -0
  376. package/dist/presentation/cli/commands/suggest-command.d.ts +13 -0
  377. package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
  378. package/dist/presentation/cli/commands/suggest-command.js +25 -0
  379. package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
  380. package/dist/presentation/cli/commands/trace-command.d.ts.map +1 -1
  381. package/dist/presentation/cli/commands/trace-command.js +9 -5
  382. package/dist/presentation/cli/commands/trace-command.js.map +1 -1
  383. package/dist/presentation/cli/commands/undo-command.js +15 -6
  384. package/dist/presentation/cli/commands/undo-command.js.map +1 -1
  385. package/dist/presentation/cli/error-display.d.ts +2 -0
  386. package/dist/presentation/cli/error-display.d.ts.map +1 -1
  387. package/dist/presentation/cli/error-display.js +220 -2
  388. package/dist/presentation/cli/error-display.js.map +1 -1
  389. package/dist/presentation/cli/keyboard-shortcuts.d.ts +27 -0
  390. package/dist/presentation/cli/keyboard-shortcuts.d.ts.map +1 -0
  391. package/dist/presentation/cli/keyboard-shortcuts.js +77 -0
  392. package/dist/presentation/cli/keyboard-shortcuts.js.map +1 -0
  393. package/dist/session.d.ts.map +1 -1
  394. package/dist/session.js +39 -2
  395. package/dist/session.js.map +1 -1
  396. package/dist/ui.d.ts.map +1 -1
  397. package/dist/ui.js +8 -5
  398. package/dist/ui.js.map +1 -1
  399. package/dist/utils/version.js +2 -2
  400. package/dist/verification/backup.d.ts.map +1 -1
  401. package/dist/verification/backup.js +24 -3
  402. package/dist/verification/backup.js.map +1 -1
  403. package/dist/verification/compiler.js +47 -12
  404. package/dist/verification/compiler.js.map +1 -1
  405. package/package.json +10 -2
@@ -4,6 +4,8 @@
4
4
  */
5
5
  import { MemoryRetriever } from '../../domain/services/memory-retriever.js';
6
6
  import { getEmbeddingCache } from '../../infrastructure/cache/embedding-cache.js';
7
+ import { getQueryResultCache } from '../../infrastructure/cache/query-result-cache.js';
8
+ import { getResponseCache } from '../../infrastructure/cache/response-cache.js';
7
9
  export class AskQuestionUseCase {
8
10
  embeddingRepository;
9
11
  aiService;
@@ -11,6 +13,8 @@ export class AskQuestionUseCase {
11
13
  uncertaintyQuantifier;
12
14
  memoryRetriever;
13
15
  embeddingCache = getEmbeddingCache();
16
+ queryResultCache = getQueryResultCache();
17
+ responseCache = getResponseCache();
14
18
  constructor(embeddingRepository, aiService, memoryRepository, uncertaintyQuantifier) {
15
19
  this.embeddingRepository = embeddingRepository;
16
20
  this.aiService = aiService;
@@ -19,10 +23,61 @@ export class AskQuestionUseCase {
19
23
  this.memoryRetriever = new MemoryRetriever();
20
24
  }
21
25
  async execute(request) {
26
+ // 0. Check if query is git-related and use git tool directly
27
+ const gitKeywords = ['git', 'modified', 'changed', 'status', 'commit', 'branch', 'diff', 'staged', 'untracked'];
28
+ const isGitQuery = gitKeywords.some(keyword => request.query.toLowerCase().includes(keyword));
29
+ if (isGitQuery) {
30
+ try {
31
+ const { GitTool } = await import('../../tools/git-tool.js');
32
+ // Use process.cwd() for working directory (request doesn't have context property)
33
+ const gitTool = new GitTool(process.cwd());
34
+ // Check if it's a git repository first
35
+ const isRepo = await gitTool.isRepository();
36
+ if (!isRepo) {
37
+ return {
38
+ answer: 'This directory is not a Git repository. Initialize a Git repository first with `git init`.',
39
+ chunks: [],
40
+ memories: [],
41
+ };
42
+ }
43
+ const gitStatus = await gitTool.status();
44
+ // Format git status response
45
+ let gitAnswer = `Git Repository Status:\n`;
46
+ gitAnswer += `Branch: ${gitStatus.branch}\n\n`;
47
+ if (gitStatus.modified.length > 0) {
48
+ gitAnswer += `Modified files:\n${gitStatus.modified.map(f => ` - ${f}`).join('\n')}\n\n`;
49
+ }
50
+ if (gitStatus.staged.length > 0) {
51
+ gitAnswer += `Staged files:\n${gitStatus.staged.map(f => ` - ${f}`).join('\n')}\n\n`;
52
+ }
53
+ if (gitStatus.untracked.length > 0) {
54
+ gitAnswer += `Untracked files:\n${gitStatus.untracked.map(f => ` - ${f}`).join('\n')}\n\n`;
55
+ }
56
+ if (gitStatus.modified.length === 0 && gitStatus.staged.length === 0 && gitStatus.untracked.length === 0) {
57
+ gitAnswer += `No changes detected. Working directory is clean.`;
58
+ }
59
+ return {
60
+ answer: gitAnswer,
61
+ chunks: [],
62
+ memories: [],
63
+ };
64
+ }
65
+ catch (error) {
66
+ // Fallback to regular search if git tool fails
67
+ // Log error for debugging but don't show to user
68
+ const errorMessage = error instanceof Error ? error.message : String(error);
69
+ console.warn('[AskQuestionUseCase] Git tool failed, falling back to regular search:', errorMessage);
70
+ // Continue to regular search flow below
71
+ }
72
+ }
22
73
  // 1. Generate query embedding using search_query input type (better matching!)
23
74
  // Performance: Check cache first to avoid redundant API calls
75
+ const embeddingStart = Date.now();
24
76
  let queryEmbedding = this.embeddingCache.get(request.query);
77
+ const embeddingCacheTime = Date.now() - embeddingStart;
78
+ let embeddingGenTime = 0;
25
79
  if (!queryEmbedding) {
80
+ const genStart = Date.now();
26
81
  // Use embedQuery if available, fallback to embed for backward compatibility
27
82
  if ('embedQuery' in this.aiService && typeof this.aiService.embedQuery === 'function') {
28
83
  const embedding = await this.aiService.embedQuery(request.query);
@@ -35,6 +90,7 @@ export class AskQuestionUseCase {
35
90
  }
36
91
  queryEmbedding = embedding;
37
92
  }
93
+ embeddingGenTime = Date.now() - genStart;
38
94
  if (!queryEmbedding) {
39
95
  throw new Error('Failed to generate query embedding');
40
96
  }
@@ -49,72 +105,159 @@ export class AskQuestionUseCase {
49
105
  // OPTIMIZATION: For simple queries, reduce operations and skip memory if not needed
50
106
  const isSimpleQuery = this.isSimpleQuery(request.query);
51
107
  // AGGRESSIVE OPTIMIZATION: For simple queries, use minimal operations
108
+ // OPTIMIZATION: Reduce initial search limit to reduce processing time
52
109
  const initialLimit = isSimpleQuery
53
110
  ? 3 // Only need top 3 chunks for simple queries (fast!)
54
- : Math.min((request.maxResults || 15) * 2, 50); // Get 2x candidates for reranking
55
- // Run code search and memory retrieval in parallel (skip memory for simple queries)
56
- const [initialChunks, allMemories] = await Promise.all([
57
- // Code search - minimal for simple queries
58
- this.embeddingRepository.searchWithEmbedding(queryEmbedding, initialLimit),
59
- // Memory retrieval: Skip for simple queries to save time (they don't need context)
60
- !isSimpleQuery && this.memoryRepository && queryEmbedding
61
- ? this.memoryRepository.retrieve(request.query, 10).catch(() => []) // Graceful fallback
62
- : Promise.resolve([]),
63
- ]);
111
+ : Math.min((request.maxResults || 8) * 2, 20); // Reduced from 50 to 20 for faster search
112
+ // Check query result cache first (performance optimization)
113
+ const cachedResults = this.queryResultCache.get(request.query, initialLimit);
114
+ let initialChunks;
115
+ let allMemories = [];
116
+ let searchTime = 0; // Performance metrics
117
+ let rerankTime = 0; // Performance metrics
118
+ // Show progress indicator for search (if not cached and operation >2s expected)
119
+ let searchProgress = null;
120
+ if (!cachedResults && !isSimpleQuery) {
121
+ try {
122
+ const { createEmbeddingSearchProgress } = await import('../../infrastructure/ux/progress-indicator.js');
123
+ // Estimate total chunks (we don't know exact count, so use spinner)
124
+ searchProgress = createEmbeddingSearchProgress(0); // 0 = use spinner
125
+ searchProgress.start({ message: 'Searching codebase...' });
126
+ }
127
+ catch {
128
+ // Progress indicator not critical, continue without it
129
+ }
130
+ }
131
+ if (cachedResults) {
132
+ // Cache hit - use cached results
133
+ this.queryResultCache.recordHit();
134
+ initialChunks = cachedResults;
135
+ // Still retrieve memories in parallel (if not simple query)
136
+ if (!isSimpleQuery && this.memoryRepository && queryEmbedding) {
137
+ allMemories = await this.memoryRepository.retrieve(request.query, 10).catch(() => []);
138
+ }
139
+ }
140
+ else {
141
+ // Cache miss - perform search
142
+ this.queryResultCache.recordMiss();
143
+ // Run code search and memory retrieval in parallel (skip memory for simple queries)
144
+ const searchStart = Date.now();
145
+ const results = await Promise.all([
146
+ // Code search - minimal for simple queries
147
+ this.embeddingRepository.searchWithEmbedding(queryEmbedding, initialLimit),
148
+ // Memory retrieval: Skip for simple queries to save time (they don't need context)
149
+ !isSimpleQuery && this.memoryRepository && queryEmbedding
150
+ ? this.memoryRepository.retrieve(request.query, 10).catch(() => []) // Graceful fallback
151
+ : Promise.resolve([]),
152
+ ]);
153
+ searchTime = Date.now() - searchStart;
154
+ initialChunks = results[0];
155
+ allMemories = results[1];
156
+ // Cache the results for future use
157
+ this.queryResultCache.set(request.query, initialLimit, initialChunks);
158
+ // Stop progress indicator
159
+ if (searchProgress) {
160
+ searchProgress.stop(true, `Found ${initialChunks.length} chunks`);
161
+ }
162
+ }
64
163
  if (initialChunks.length === 0) {
65
164
  return {
66
165
  answer: 'No relevant code found. Please run "codehere index" first.',
67
166
  chunks: [],
68
167
  };
69
168
  }
70
- // 3. Rerank: Use Cohere Rerank API to improve precision (precision phase)
169
+ // 3. PARALLEL EXECUTION: Rerank + Memory Processing (Story 1: Parallel Context Processing)
170
+ // OPTIMIZATION: These operations are independent and can run in parallel
71
171
  // OPTIMIZATION: Skip rerank for simple queries to improve speed
72
172
  let chunks = initialChunks;
173
+ let memories = [];
73
174
  // For simple queries, use minimal chunks (top 3) for fastest response
175
+ // Story 2: Optimized execution path - reduced context window, minimal processing
74
176
  if (isSimpleQuery) {
75
177
  chunks = initialChunks.slice(0, 3); // Top 3 for simple queries (aggressive optimization)
76
- }
77
- else if (!isSimpleQuery && initialChunks.length > 5) {
78
- // Only rerank for complex queries or when we have many results
79
- try {
80
- const documents = initialChunks.map((chunk) => chunk.content);
81
- const rerankResults = await this.aiService.rerank(request.query, documents, request.maxResults || 15);
82
- // Reorder chunks based on rerank scores
83
- chunks = rerankResults.map((result) => {
84
- const chunk = initialChunks[result.index];
85
- // Update score with rerank relevance score
86
- return {
87
- ...chunk,
88
- score: result.relevanceScore,
89
- };
90
- });
91
- }
92
- catch (error) {
93
- // Fallback to initial results if rerank fails
94
- console.warn('Rerank API failed, using initial results:', error instanceof Error ? error.message : String(error));
95
- chunks = initialChunks.slice(0, request.maxResults || 15);
178
+ // Process memories synchronously for simple queries (minimal processing, already fast)
179
+ if (allMemories.length > 0 && queryEmbedding) {
180
+ memories = this.memoryRetriever.retrieve(allMemories, queryEmbedding, 3); // Minimal for simple queries
96
181
  }
97
182
  }
98
183
  else {
99
- // For simple queries, just take top results without reranking
100
- chunks = initialChunks.slice(0, request.maxResults || 15);
101
- }
102
- // 4. Process memories: Reuse the same query embedding (already computed and cached)
103
- let memories = [];
104
- if (allMemories.length > 0 && queryEmbedding) {
105
- // Reuse the same query embedding (no need to recompute)
106
- const relevantMemories = this.memoryRetriever.retrieve(allMemories, queryEmbedding, 5);
107
- memories = relevantMemories;
184
+ // For complex queries: Parallelize rerank + memory processing
185
+ const documents = initialChunks.map((chunk) => chunk.content);
186
+ // Run rerank and memory processing in parallel (they're independent)
187
+ // OPTIMIZATION: Reduce maxResults for complex queries to reduce AI Chat latency
188
+ // Target: 8 chunks max (down from 15) to reduce context window by ~47%
189
+ const maxChunksForAI = Math.min(request.maxResults || 8, 8); // Aggressive: max 8 chunks
190
+ const rerankStart = Date.now();
191
+ const [rerankResults, processedMemories] = await Promise.all([
192
+ // Rerank operation (only if we have enough results)
193
+ initialChunks.length > 5
194
+ ? this.aiService.rerank(request.query, documents, maxChunksForAI)
195
+ .then(results => results.map((result) => {
196
+ const chunk = initialChunks[result.index];
197
+ return {
198
+ ...chunk,
199
+ score: result.relevanceScore,
200
+ };
201
+ }))
202
+ .catch((error) => {
203
+ // Fallback to initial results if rerank fails
204
+ console.warn('Rerank API failed, using initial results:', error instanceof Error ? error.message : String(error));
205
+ return initialChunks.slice(0, maxChunksForAI);
206
+ })
207
+ : Promise.resolve(initialChunks.slice(0, maxChunksForAI)),
208
+ // Memory processing (reuse query embedding, no recomputation needed)
209
+ allMemories.length > 0 && queryEmbedding
210
+ ? Promise.resolve(this.memoryRetriever.retrieve(allMemories, queryEmbedding, 5))
211
+ : Promise.resolve([]),
212
+ ]);
213
+ rerankTime = Date.now() - rerankStart;
214
+ chunks = rerankResults;
215
+ memories = processedMemories;
108
216
  }
217
+ // 3. Pass conversation history through context chunks (metadata) for AI service
218
+ const chunksWithHistory = request.conversationHistory && request.conversationHistory.length > 0
219
+ ? chunks.map((chunk, idx) => {
220
+ if (idx === 0) {
221
+ // Attach conversation history to first chunk as metadata
222
+ return {
223
+ ...chunk,
224
+ conversationHistory: request.conversationHistory,
225
+ };
226
+ }
227
+ return chunk;
228
+ })
229
+ : chunks;
109
230
  // 3. Generate AI response with context (with optional streaming)
110
- let answer;
111
- if (request.streamHandler && 'chatStream' in this.aiService && typeof this.aiService.chatStream === 'function') {
112
- // Use streaming if available
113
- answer = await this.aiService.chatStream(request.query, chunks, memories, request.streamHandler);
231
+ // OPTIMIZATION: Check response cache first to avoid redundant AI calls
232
+ const contextHash = this.responseCache.generateContextHash(chunks);
233
+ let answer = '';
234
+ let chatTime = 0;
235
+ let wasResponseCached = false;
236
+ // Check cache (skip for streaming as it's real-time)
237
+ if (!request.streamHandler) {
238
+ const cachedAnswer = this.responseCache.get(request.query, contextHash, true);
239
+ if (cachedAnswer) {
240
+ answer = cachedAnswer;
241
+ wasResponseCached = true;
242
+ chatTime = 0; // Cache hit = instant
243
+ }
114
244
  }
115
- else {
116
- // Fallback to regular chat
117
- answer = await this.aiService.chat(request.query, chunks, memories);
245
+ // If not cached, call AI service
246
+ if (!wasResponseCached) {
247
+ const chatStart = Date.now();
248
+ if (request.streamHandler && 'chatStream' in this.aiService && typeof this.aiService.chatStream === 'function') {
249
+ // Use streaming if available
250
+ answer = await this.aiService.chatStream(request.query, chunksWithHistory, memories, request.streamHandler);
251
+ }
252
+ else {
253
+ // Fallback to regular chat
254
+ answer = await this.aiService.chat(request.query, chunksWithHistory, memories);
255
+ }
256
+ chatTime = Date.now() - chatStart;
257
+ // Cache the response for future use
258
+ if (answer && !request.streamHandler) {
259
+ this.responseCache.set(request.query, answer, contextHash);
260
+ }
118
261
  }
119
262
  // 4. Estimate tokens (rough: 1 token ≈ 4 characters)
120
263
  const tokenEstimate = chunks.reduce((sum, chunk) => sum + Math.ceil(chunk.content.length / 4), 0);
@@ -123,28 +266,84 @@ export class AskQuestionUseCase {
123
266
  if (this.uncertaintyQuantifier && answer) {
124
267
  uncertainty = await this.uncertaintyQuantifier.quantifyUncertainty(request.query, answer, { chunks });
125
268
  }
269
+ // Get cache statistics
270
+ const cacheStats = this.queryResultCache.getStats();
271
+ const wasCacheHit = cachedResults !== null;
272
+ // Get compression metrics from execution tracer if available
273
+ let compressionMetrics;
274
+ try {
275
+ const { executionTracer } = await import('../../infrastructure/observability/execution-tracer.js');
276
+ const runId = executionTracer.getCurrentRunId();
277
+ if (runId) {
278
+ // Get the current run to find compression trace
279
+ const currentRun = executionTracer.currentRun;
280
+ if (currentRun) {
281
+ const compressionTrace = currentRun.traces.find((t) => t.operationType === 'context_compression' && t.operationName === 'compress_context');
282
+ if (compressionTrace && compressionTrace.output) {
283
+ compressionMetrics = {
284
+ originalTokens: compressionTrace.output.originalTokens || 0,
285
+ compressedTokens: compressionTrace.output.compressedTokens || 0,
286
+ reductionPercent: compressionTrace.output.reductionPercent || 0,
287
+ };
288
+ }
289
+ }
290
+ }
291
+ }
292
+ catch {
293
+ // Execution tracer not available, skip compression metrics
294
+ }
295
+ // Calculate total time
296
+ const totalTime = Date.now() - request.__startTime || 0;
126
297
  return {
127
298
  answer,
128
299
  chunks,
129
300
  memories,
130
301
  tokenEstimate,
131
302
  uncertainty, // XAI Foundation - Uncertainty quantification for transparency
303
+ cacheHit: wasCacheHit,
304
+ performanceMetrics: {
305
+ embeddingCacheTime,
306
+ embeddingGenTime,
307
+ searchTime: cachedResults ? 0 : searchTime,
308
+ rerankTime: isSimpleQuery ? 0 : rerankTime,
309
+ chatTime,
310
+ totalTime,
311
+ },
312
+ cacheStats: {
313
+ hitRate: cacheStats.hitRate,
314
+ totalHits: cacheStats.totalHits,
315
+ totalMisses: cacheStats.totalMisses,
316
+ },
317
+ compressionMetrics, // Context compression metrics (P1)
132
318
  };
133
319
  }
134
320
  /**
135
321
  * Check if query is simple (short, question-like, single intent)
136
322
  * Simple queries can skip rerank for better performance
137
323
  */
324
+ /**
325
+ * Check if query is simple (short, question-like, single intent)
326
+ * Story 2: Enhanced detection with improved accuracy (target: >90%)
327
+ * Simple queries can skip rerank for better performance
328
+ */
138
329
  isSimpleQuery(query) {
139
- const lower = query.toLowerCase();
140
- // Simple if:
141
- // 1. Short query (< 50 chars)
142
- // 2. Question-like (starts with what/where/how/why/when/who/which/is/are/does/do/can/could)
143
- // 3. Single sentence (no "and", "also", "then", etc.)
330
+ const lower = query.toLowerCase().trim();
331
+ // Enhanced detection patterns (Story 2: Query Simplification)
332
+ // 1. Short query (< 50 chars) - primary indicator
144
333
  const isShort = query.length < 50;
145
- const isQuestion = /^(what|where|how|why|when|who|which|is|are|does|do|can|could|will|would|explain|describe|tell|show|find|locate|search)/i.test(query);
146
- const isSingleIntent = !/(and|also|then|next|first|second|finally|multiple|several|steps)/i.test(lower);
147
- return isShort && isQuestion && isSingleIntent;
334
+ // 2. Question-like patterns (expanded list for better accuracy)
335
+ const questionPatterns = /^(what|where|how|why|when|who|which|is|are|does|do|can|could|will|would|explain|describe|tell|show|find|locate|search|where|what's|what is|how to|how do|how does)/i;
336
+ const isQuestion = questionPatterns.test(lower);
337
+ // 3. Single intent indicators (no complex conjunctions)
338
+ const complexIndicators = /(and|also|then|next|first|second|finally|multiple|several|steps|after|before|while|during|create|implement|add|modify|refactor|change|update|delete|remove)/i;
339
+ const isSingleIntent = !complexIndicators.test(lower);
340
+ // 4. Simple structure (no nested clauses, no semicolons, no colons for lists)
341
+ const hasComplexStructure = /[;:]|\(|\)|\[|\]/.test(query);
342
+ // 5. No code-specific keywords (indicates need for code analysis)
343
+ const codeKeywords = /(function|class|interface|type|import|export|const|let|var|async|await|return|if|else|for|while|try|catch)/i;
344
+ const hasCodeKeywords = codeKeywords.test(lower);
345
+ // Simple query if: short + question-like + single intent + no complex structure + no code keywords
346
+ return isShort && isQuestion && isSingleIntent && !hasComplexStructure && !hasCodeKeywords;
148
347
  }
149
348
  }
150
349
  //# sourceMappingURL=ask-question-use-case.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ask-question-use-case.js","sourceRoot":"","sources":["../../../src/application/use-cases/ask-question-use-case.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAmBlF,MAAM,OAAO,kBAAkB;IAKnB;IACA;IACA;IACA;IAPF,eAAe,CAAkB;IACjC,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAE7C,YACU,mBAAyC,EACzC,SAAqB,EACrB,gBAAoC,EACpC,qBAA6C;QAH7C,wBAAmB,GAAnB,mBAAmB,CAAsB;QACzC,cAAS,GAAT,SAAS,CAAY;QACrB,qBAAgB,GAAhB,gBAAgB,CAAoB;QACpC,0BAAqB,GAArB,qBAAqB,CAAwB;QAErD,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAA2B;QACvC,+EAA+E;QAC/E,8DAA8D;QAC9D,IAAI,cAAc,GAAoB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE7E,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,4EAA4E;YAC5E,IAAI,YAAY,IAAI,IAAI,CAAC,SAAS,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;gBACtF,MAAM,SAAS,GAAG,MAAO,IAAI,CAAC,SAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC1E,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,C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QAAQ,CAAC,CAAC;QACtE,CAAC;QAED,qDAAqD;QACrD,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CACjC,CAAC,GAAW,EAAE,KAAgB,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,EAC5E,CAAC,CACF,CAAC;QAEF,4FAA4F;QAC5F,IAAI,WAA0C,CAAC;QAC/C,IAAI,IAAI,CAAC,qBAAqB,IAAI,MAAM,EAAE,CAAC;YACzC,WAAW,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,CAChE,OAAO,CAAC,KAAK,EACb,MAAM,EACN,EAAE,MAAM,EAAE,CACX,CAAC;QACJ,CAAC;QAED,OAAO;YACL,MAAM;YACN,MAAM;YACN,QAAQ;YACR,aAAa;YACb,WAAW,EAAE,+DAA+D;SAC7E,CAAC;IACJ,CAAC;IAED;;;OAGG;IACK,aAAa,CAAC,KAAa;QACjC,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAElC,aAAa;QACb,8BAA8B;QAC9B,4FAA4F;QAC5F,sDAAsD;QACtD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;QAClC,MAAM,UAAU,GAAG,yHAAyH,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzJ,MAAM,cAAc,GAAG,CAAC,mEAAmE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAExG,OAAO,OAAO,IAAI,UAAU,IAAI,cAAc,CAAC;IACjD,CAAC;CACF"}
1
+ {"version":3,"file":"ask-question-use-case.js","sourceRoot":"","sources":["../../../src/application/use-cases/ask-question-use-case.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,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,CAAC,EAAE,qBAAqB,YAAA,EAAE,2CAA2C;IAC1F,aAAa,CAAC,EAAE,aAAa,YAAA,EAAE,kCAAkC;IACjE,mBAAmB,CAAC,EAAE,mBAAmB,YAAA,EAAE,4CAA4C;IACvF,SAAS,CAAC,EAAE,SAAS,YAAA,EAAE,kDAAkD;IACzE,YAAY,CAAC,EAAE,YAAY,YAAA;IAG/B,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA+mBlE;;OAEG;YACW,UAAU;YA4FV,SAAS;IAYvB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAqC1B;;OAEG;IACH,OAAO,CAAC,WAAW;IAiBnB;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAkB7B"}
@@ -192,10 +192,30 @@ export class EditFileUseCase {
192
192
  metadata: { riskLevel: updatedRiskLevel },
193
193
  }, rootNodeId);
194
194
  }
195
- // Generate edit
195
+ // Generate edit (with progress indicator for better UX)
196
196
  let diff;
197
197
  try {
198
- diff = await this.aiService.generateEdit(currentContent, request.instruction, request.filepath);
198
+ // Show progress indicator for code generation (can take 20-30s)
199
+ const { createSpinner } = await import('../../ui.js');
200
+ const codeGenSpinner = createSpinner('Generating code changes...');
201
+ codeGenSpinner.start();
202
+ // Task 6.2: Include learned patterns and preferences in code generation
203
+ let enhancedInstruction = request.instruction;
204
+ if (this.biDirectionalLearning) {
205
+ const userId = process.env.USER || 'default-user';
206
+ const patternsContext = this.biDirectionalLearning.getPatternsAsPromptContext(userId, 3);
207
+ const preferencesContext = this.biDirectionalLearning.getPreferencesAsPromptContext(userId);
208
+ if (patternsContext || preferencesContext) {
209
+ const contextParts = [];
210
+ if (preferencesContext)
211
+ contextParts.push(preferencesContext);
212
+ if (patternsContext)
213
+ contextParts.push(patternsContext);
214
+ enhancedInstruction = `${request.instruction}\n\n${contextParts.join('\n\n')}`;
215
+ }
216
+ }
217
+ diff = await this.aiService.generateEdit(currentContent, enhancedInstruction, request.filepath);
218
+ codeGenSpinner.stop();
199
219
  console.log(`[EditFileUseCase] Generated diff length: ${diff.length} chars`);
200
220
  if (diff.length > 0) {
201
221
  console.log(`[EditFileUseCase] Diff preview: ${diff.substring(0, 200)}...`);
@@ -235,13 +255,19 @@ export class EditFileUseCase {
235
255
  // Comprehensive security scan - before verification
236
256
  // RESEARCH CONTEXT: 45% AI code has flaws, 35% license issues, provider bias risk
237
257
  // Use Enhanced Security Gate if available (all scanners), fallback to SAST only
258
+ let securityResult = null; // Will be set by security scan
238
259
  if (this.enhancedSecurityGate) {
260
+ // Show progress indicator for security scanning (can take 10-15s)
261
+ const { createSpinner } = await import('../../ui.js');
262
+ const securitySpinner = createSpinner('Scanning for security vulnerabilities...');
263
+ securitySpinner.start();
239
264
  // Comprehensive scan: SAST + License + Provider Bias + Uncertainty
240
- const securityResult = await this.enhancedSecurityGate.scan(request.filepath, newContent, request.instruction, { query: request.instruction });
265
+ securityResult = await this.enhancedSecurityGate.scan(request.filepath, newContent, request.instruction, { query: request.instruction });
266
+ securitySpinner.stop();
241
267
  if (!securityResult.passed) {
242
268
  const errorMessages = [
243
269
  ...securityResult.errors,
244
- ...securityResult.warnings.map(w => `Warning: ${w}`),
270
+ ...securityResult.warnings.map((w) => `Warning: ${w}`),
245
271
  ];
246
272
  return {
247
273
  success: false,
@@ -302,6 +328,12 @@ export class EditFileUseCase {
302
328
  }
303
329
  // Policy-as-Code: Evaluate policies before proceeding (Enterprise Governance)
304
330
  if (this.policyAsCode) {
331
+ // Debug: Log security findings before policy evaluation
332
+ const criticalHighFindings = securityResult.sast.findings.filter((f) => f.severity === 'critical' || f.severity === 'high');
333
+ console.log(`[EditFileUseCase] Security scan: ${securityResult.sast.findings.length} total findings, ${criticalHighFindings.length} critical/high`);
334
+ if (criticalHighFindings.length > 0) {
335
+ console.log(`[EditFileUseCase] Critical/High findings:`, criticalHighFindings.map((f) => `${f.severity}: ${f.category} - ${f.description}`).join('; '));
336
+ }
305
337
  const policyEvaluation = await this.policyAsCode.evaluate({
306
338
  filepath: request.filepath,
307
339
  code: newContent,
@@ -311,6 +343,16 @@ export class EditFileUseCase {
311
343
  providerBiasFindings: securityResult.providerBias.findings,
312
344
  uncertainty: securityResult.uncertainty,
313
345
  });
346
+ // Debug: Log policy evaluation results
347
+ console.log(`[EditFileUseCase] Policy evaluation: ${policyEvaluation.results.length} rules evaluated, ${policyEvaluation.blockingRules.length} blocking`);
348
+ policyEvaluation.results.forEach((result) => {
349
+ if (!result.passed) {
350
+ console.log(`[EditFileUseCase] Policy rule "${result.ruleName}": ${result.message}`);
351
+ if (result.evidence) {
352
+ console.log(`[EditFileUseCase] Evidence:`, JSON.stringify(result.evidence, null, 2));
353
+ }
354
+ }
355
+ });
314
356
  if (!policyEvaluation.passed && policyEvaluation.blockingRules.length > 0) {
315
357
  const blockingRule = policyEvaluation.blockingRules[0];
316
358
  console.error(`[EditFileUseCase] Policy violation: ${blockingRule.ruleName} - ${blockingRule.message}`);
@@ -410,12 +452,52 @@ export class EditFileUseCase {
410
452
  }
411
453
  }
412
454
  }
455
+ // Review Checkpoint: Show summary before applying edits (Task 5.1)
456
+ // Display review checkpoint with diff summary, security status, and risk level
457
+ const { displayReviewCheckpoint, calculateDiffSummary } = await import('../../infrastructure/ux/review-checkpoint.js');
458
+ const diffSummary = calculateDiffSummary(currentContent, newContent);
459
+ // Determine risk level for review checkpoint
460
+ let reviewRiskLevel = 'medium';
461
+ if (securityResult) {
462
+ if (securityResult.errors && securityResult.errors.length > 0) {
463
+ reviewRiskLevel = 'critical';
464
+ }
465
+ else if (securityResult.warnings && securityResult.warnings.length > 0) {
466
+ reviewRiskLevel = 'high';
467
+ }
468
+ else {
469
+ reviewRiskLevel = 'low';
470
+ }
471
+ }
472
+ const reviewInfo = {
473
+ filesToModify: [{
474
+ filepath: request.filepath,
475
+ linesAdded: diffSummary.linesAdded,
476
+ linesRemoved: diffSummary.linesRemoved,
477
+ linesChanged: diffSummary.linesChanged,
478
+ }],
479
+ securityScanPassed: securityResult?.passed ?? true,
480
+ compilationValid: true, // Will be verified after write
481
+ riskLevel: reviewRiskLevel,
482
+ uncertainty: securityResult?.uncertainty?.combined?.value,
483
+ };
484
+ displayReviewCheckpoint(reviewInfo);
413
485
  // Verify if verification service available
414
486
  let verification;
415
487
  if (this.verificationService) {
416
488
  console.log(`[EditFileUseCase] Writing file and verifying...`);
417
489
  writeFileSync(fullPath, newContent, 'utf-8');
490
+ // Show progress indicator for verification (can take 5-10s)
491
+ const { createSpinner } = await import('../../ui.js');
492
+ const verificationSpinner = createSpinner('Verifying code compilation...');
493
+ verificationSpinner.start();
418
494
  verification = await this.verificationService.verify(fullPath);
495
+ if (verification.success) {
496
+ verificationSpinner.succeed('Verification passed');
497
+ }
498
+ else {
499
+ verificationSpinner.fail('Verification failed');
500
+ }
419
501
  console.log(`[EditFileUseCase] Verification result: success=${verification.success}, compiled=${verification.compiled}, testsPassed=${verification.testsPassed}`);
420
502
  if (verification.errors && verification.errors.length > 0) {
421
503
  console.error(`[EditFileUseCase] Verification errors: ${verification.errors.join('; ')}`);