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
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024
3
+ Copyright (c) 2025
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # codehere
2
2
 
3
- > Enterprise-grade AI coding assistant with local embeddings and semantic search
3
+ > **Status:** v0.5 Solo Dev Alpha CLI agent focused on solo developer workflows and safe editing with review gates.
4
+
5
+ > A governed, measurable AI coding OS that plans, edits, validates, and measures its own reliability. Every change is traceable, reviewable, and scored – so you can trust it on real code.
6
+
7
+ Codehere is a multi-agent coding system designed for **solo developers working on their own repositories**. Unlike simple AI assistants, Codehere orchestrates specialized agents (Planning, Execution, Validation) to handle complex tasks while maintaining full transparency and control through review gates and trust metrics.
8
+
9
+ **v0.5 Scope**: Single developer, single repository, local workflows. Not yet validated for team/enterprise use.
10
+
11
+ **📖 [Documentation →](docs/GETTING_STARTED.md)**
4
12
 
5
13
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)](https://www.typescriptlang.org/)
6
14
  [![Node.js](https://img.shields.io/badge/Node.js-18+-green)](https://nodejs.org/)
@@ -22,9 +30,13 @@ npm install -g .
22
30
  codehere --version
23
31
  ```
24
32
 
25
- **Option 2: Install from npm (after publishing)**
33
+ **Option 2: Install from npm**
26
34
  ```bash
35
+ # Stable version
27
36
  npm install -g codehere
37
+
38
+ # Latest alpha (includes OpenRouter & enhanced local LLM)
39
+ npm install -g codehere@alpha
28
40
  ```
29
41
 
30
42
  Once installed globally, you can use `codehere` from any directory in your terminal.
@@ -50,19 +62,69 @@ codehere index
50
62
  codehere "How does authentication work?"
51
63
  ```
52
64
 
65
+ ### Switching Providers
66
+
67
+ Codehere supports multiple AI providers. By default, it uses **Cohere** (no configuration needed).
68
+
69
+ **Quick Options:**
70
+
71
+ **Default (Cohere):**
72
+ ```bash
73
+ export COHERE_API_KEY=your-key
74
+ codehere status
75
+ ```
76
+
77
+ **OpenAI:**
78
+ ```bash
79
+ export CODEHERE_AI_PROVIDER=openai
80
+ export CODEHERE_OPENAI_API_KEY=sk-...
81
+ codehere status
82
+ ```
83
+
84
+ **OpenRouter (400+ Models):**
85
+ ```bash
86
+ export CODEHERE_AI_PROVIDER=openrouter
87
+ export OPENROUTER_API_KEY=sk-or-v1-...
88
+ codehere status
89
+ ```
90
+
91
+ **Local LLM (Ollama, LM Studio):**
92
+ ```bash
93
+ export CODEHERE_AI_PROVIDER=local
94
+ export CODEHERE_LOCAL_BASE_URL=http://localhost:11434
95
+ codehere status
96
+ ```
97
+
98
+ **Fake Mode (Testing/Demo):**
99
+ ```bash
100
+ export CODEHERE_FAKE_AI=1
101
+ codehere status # No API calls, deterministic outputs
102
+ ```
103
+
104
+ **Per-Operation Routing:**
105
+
106
+ Create `.codehere/providers.json` to route different operations to different providers. See [docs/PROVIDERS_QUICKSTART.md](docs/PROVIDERS_QUICKSTART.md) for complete setup guide.
107
+
108
+ **📖 [Complete Provider Guide →](docs/PROVIDERS_QUICKSTART.md)**
109
+
53
110
  **Using Codehere:**
54
111
 
55
112
  ```bash
56
113
  # Natural language queries (unified command)
57
114
  codehere "explain this function"
58
- codehere "add error handling to src/utils.ts"
59
- codehere "refactor user service to use dependency injection"
115
+ codehere "add error handling to src/utils.ts" --review
116
+ codehere "refactor user service to use dependency injection" --review
60
117
 
61
118
  # Or use explicit commands
62
119
  codehere ask "How does authentication work?"
63
120
  codehere explain src/utils.ts
64
121
  codehere plan "implement user authentication system"
65
- codehere orchestrate "add comprehensive logging"
122
+ codehere orchestrate "add comprehensive logging" --review
123
+
124
+ # Validation Mode: Review before applying changes
125
+ codehere fix src/utils.ts "Add error handling" --review
126
+ codehere orchestrate "Add authentication" --review
127
+ codehere plan "Refactor to DI" --execute --review
66
128
 
67
129
  # Manage configuration
68
130
  codehere config # Show current configuration
@@ -74,57 +136,229 @@ codehere --help
74
136
  codehere help <command>
75
137
  ```
76
138
 
139
+ > **💡 Tip**: Use `--review` on destructive operations (edit, orchestrate, plan --execute) to see summaries and approve changes before they're applied. This builds trust and prevents mistakes.
140
+
141
+ ### 🔍 Validation Mode & Trust Scores
142
+
143
+ Validation Mode makes every agent operation traceable, reviewable, and measurable. Use `--review` to pause before applying changes, review structured summaries, and approve or reject. Every operation generates feedback that feeds into trust scores.
144
+
145
+ **How it works:**
146
+ - Run commands with `--review` to enable feedback capture
147
+ - Review summaries show files changed, validation checks, and risk assessment
148
+ - Feedback is stored locally in `data/feedback/agent-feedback.jsonl`
149
+ - Trust scores are computed per agent: `(approved_success_runs / total_runs) × 100`
150
+
151
+ **Example:**
152
+ ```bash
153
+ # Enable review & feedback capture
154
+ CODEHERE_AUTO_APPROVE=true codehere fix src/file.ts "add input validation" --review
155
+
156
+ # View trust scores
157
+ npm run analyze:feedback
158
+ codehere status
159
+ ```
160
+
161
+ **Optional:** Configure minimum trust thresholds via `config/trust-config.json` to highlight agents that need more validation (warnings only, non-blocking).
162
+
163
+ **For CI/dashboards:** Export trust and feedback stats as JSON:
164
+ - `npm run analyze:feedback -- --json`
165
+ - `codehere status --json`
166
+
167
+ **For CI gates:** Enforce minimum trust scores:
168
+ - `npm run check:trust` - Fails if any agent is below its configured threshold
169
+
170
+ **📖 [Complete Guide →](docs/VALIDATION_MODE.md)**
171
+
172
+ ### 💬 Feedback Collection
173
+
174
+ Codehere collects feedback after operations to improve responses. In interactive mode, you'll see a prompt asking for feedback. In non-interactive mode (scripts, CI), you can provide feedback via environment variables:
175
+
176
+ ```bash
177
+ # Positive feedback (thumbs up)
178
+ CODEHERE_FEEDBACK=y codehere ask "What is main?"
179
+
180
+ # Negative feedback (thumbs down)
181
+ CODEHERE_FEEDBACK=n codehere ask "What is main?"
182
+
183
+ # Request refinement with message
184
+ CODEHERE_FEEDBACK=r CODEHERE_FEEDBACK_MESSAGE="Add more examples" codehere ask "What is main?"
185
+
186
+ # Alternative values
187
+ CODEHERE_FEEDBACK=positive codehere ask "What is main?"
188
+ CODEHERE_FEEDBACK=negative codehere ask "What is main?"
189
+ CODEHERE_FEEDBACK=yes codehere ask "What is main?"
190
+ CODEHERE_FEEDBACK=no codehere ask "What is main?"
191
+ ```
192
+
193
+ **Environment Variables:**
194
+ - `CODEHERE_FEEDBACK`: `y`/`yes`/`positive` (thumbs up), `n`/`no`/`negative` (thumbs down), `r`/`refine`/`refinement` (request refinement)
195
+ - `CODEHERE_FEEDBACK_MESSAGE`: Optional message for refinement requests
196
+
77
197
  ## ✨ Features
78
198
 
79
- ### 🧠 Semantic Code Search
80
- - Builds local embedding index using Cohere's embedding API
81
- - Uses cosine similarity to find relevant code chunks
82
- - Enhanced context with file relationships and dependencies
199
+ ### 🎯 Why Codehere vs Other Coding Agents?
200
+
201
+ - **Safe Editing with Review Gates**: Unlike agents that apply changes immediately, Codehere uses `--review` to pause, show summaries, and request approval before modifying files. **This is the strongest differentiator in v0.5.**
202
+ - **Automatic Backup & Rollback**: Every edit creates a backup. On failure, automatic rollback ensures your repo stays consistent.
203
+ - **Trust Scores & Analytics**: Every agent run is scored. Run `npm run analyze:feedback` to see which agents are most reliable in your workflow
204
+ - **Full Traceability**: Every operation generates a structured TraceSummary showing files changed, reasoning steps, validation checks, and risk assessment
205
+ - **Privacy-First Feedback**: All feedback stored locally in JSONL. No telemetry. Opt-out available. Your data stays yours
206
+
207
+ ## What's Stable (Ready to Use)
208
+
209
+ These capabilities have been validated through comprehensive testing (Pack A, Real Repo, Pack B):
210
+
211
+ ### 🧠 Autonomous Planning
212
+ - **Command**: `codehere plan "Implement X" --json`
213
+ - **Status**: ✅ Stable
214
+ - **What it does**: Generates structured task plans with hierarchical sub-plans, complexity assessment, and JSON export
215
+
216
+ ### 🔍 Semantic Code Search & Understanding
217
+ - **Commands**:
218
+ - `codehere index` (may fail on 30K+ file repos - see limitations)
219
+ - `codehere ask "How does X work?" --json`
220
+ - `codehere explain path/to/file.ts`
221
+ - **Status**: ✅ Stable
222
+ - **What it does**: Uses semantic search + AST-aware explanations to answer questions about your codebase
223
+
224
+ ### ✏️ Safe Code Editing with Review Gates
225
+ - **Command**: `codehere fix path/to/file.ts "Change spec" --review`
226
+ - **Status**: ✅ Stable (Key Differentiator)
227
+ - **What it does**:
228
+ - Shows review summary before applying changes
229
+ - Creates automatic backup
230
+ - Runs verification checks
231
+ - Automatic rollback on failure
232
+
233
+ ### 💬 Natural Language Interface
234
+ - **Command**: `codehere "What files handle user authentication?"`
235
+ - **Status**: ✅ Stable
236
+ - **What it does**: Intelligently routes queries to planning, search, or editing workflows
237
+
238
+ ### 📦 JSON-First Automation
239
+ - **Commands**: All main commands support `--json` flag
240
+ - **Status**: ✅ Stable
241
+ - **What it does**: Returns stable, machine-readable JSON schemas for scripts and tooling
242
+
243
+ ### 📊 Operation History
244
+ - **Command**: `codehere memory --list --json`
245
+ - **Status**: ✅ Stable (for operation history)
246
+ - **What it does**: Provides structured operation history with JSON export
247
+ - **Note**: This is **operation history**, not full long-term conversational memory
248
+
249
+ ## Beta / Experimental Features
250
+
251
+ These features exist and work, but behavior quality is not guaranteed:
252
+
253
+ ### 🤖 Multi-Agent Orchestration
254
+ - **Command**: `codehere orchestrate "Add feature X" --json`
255
+ - **Status**: 🟡 Beta
256
+ - **What works**: JSON schema is stable (`plan`, `execution`, `validation`, `provider` always present)
257
+ - **Limitation**: Content quality depends on provider and is experimental. Fields may be `null` for some providers.
258
+
259
+ ### 🔁 ReAct-Style Reasoning
260
+ - **Command**: `codehere react "Solve problem X"`
261
+ - **Status**: 🟡 Experimental
262
+ - **What works**: Executes Thought/Action/Observation loops
263
+ - **Limitation**: Not hardened for all repo sizes. Use with caution on large/complex codebases.
264
+
265
+ ### 🛡️ Validation Mode & Review Gates
266
+
267
+ - **`--review` Flag**: Pause before applying changes, review structured summaries, approve or reject
268
+ - **TraceSummary Generation**: Every agent run produces a detailed summary (files, steps, checks, metrics, risk)
269
+ - **Composite Summaries**: Multi-agent operations merge all agent summaries into one reviewable report
270
+ - **Risk Assessment**: Automatic risk level calculation (low/medium/high/critical) with clear reasons
271
+ - **Environment Controls**: `CODEHERE_AUTO_APPROVE=true` for CI/CD, `CODEHERE_FEEDBACK_OPT_OUT=true` for privacy
272
+
273
+ ### 📊 Trust & Reliability Metrics
274
+
275
+ - **Agent Feedback Analytics**: Run `npm run analyze:feedback` to see trust scores, success rates, and operation breakdowns
276
+ - **Trust Score Calculation**: `(approved_success_runs / total_runs) × 100` – measurable agent reliability
277
+ - **Outcome Tracking**: Success, failure, partial_success, cancelled, error – complete visibility
278
+ - **User Action Tracking**: Approved, rejected, modified – understand how users interact with agents
279
+
280
+ ### 🧠 Semantic Code Search & Context
83
281
 
84
- ### 🤖 AI-Powered Assistance
282
+ - Builds local embedding index using Cohere's embedding API
283
+ - Enhanced context with file relationships and dependencies (15+ chunks)
85
284
  - Context-aware responses using retrieved code
86
- - Natural language code explanations
87
- - Intelligent code editing with unified diff generation
88
- - Enhanced context understanding (15+ chunks)
89
-
90
- ### 🛡️ Enterprise Safety
91
- - **Line limit enforcement** - Maximum 50 lines changed per edit
92
- - **Restricted folders** - Protect critical directories (infra/, billing/)
93
- - **Single-file edits** - Prevent accidental multi-file changes
94
- - **Audit logging** - Every operation logged to JSONL
95
-
96
- ### 🔧 Enterprise Reliability
97
- - **Automatic error recovery** - Retry with exponential backoff
98
- - **Circuit breaker** - Protects against API failures
99
- - **Health monitoring** - System health checks and metrics
100
- - **24/7 operation ready** - Robust error handling
101
-
102
- ### 📦 Production Ready
103
- - Fully tested end-to-end
104
- - TypeScript for type safety
105
- - SQLite for local vector storage
106
- - Comprehensive error handling
285
+ - Natural language code explanations and intelligent editing
286
+
287
+ ### 🔒 Security & Privacy
288
+
289
+ - **Local-first**: All embeddings and feedback stored locally in SQLite
290
+ - **No code transmission**: Only chunks sent to API for embedding, never full files
291
+ - **Audit trail**: Complete JSONL logging of all operations
292
+ - **Policy enforcement**: Line limits, restricted folders, single-file safety checks
293
+ - **Privacy controls**: Opt-out available, anonymization by default
294
+
295
+ ### 🔧 Reliability Features
296
+
297
+ - **Automatic error recovery**: Retry with exponential backoff
298
+ - **Circuit breaker**: Protects against API failures
299
+ - **Health monitoring**: System health checks and metrics
300
+ - **Robust error handling**: Graceful degradation and recovery
301
+
302
+ **Note**: v0.5 targets solo dev workflows. Enterprise-grade reliability guarantees are not yet validated. See limitations section below.
107
303
 
108
304
  ## 🏗️ Architecture
109
305
 
306
+ ### Multi-Agent System
307
+
110
308
  ```
111
- ┌─────────────┐
112
- CLI Tool
113
- └──────┬──────┘
114
-
115
- ├─→ Index: Scan → Chunk → Embed → Store (SQLite)
116
- ├─→ Ask: Query → Embed → Search (15 chunks) → Chat
117
- ├─→ Explain: Read → Chat
118
- ├─→ Fix: Read → Generate Diff → Policy Check → Apply
119
- └─→ Health: System Status → Metrics
309
+ ┌─────────────────────────────────────────────────┐
310
+ Intelligent Router
311
+ │ (Routes queries to appropriate workflow) │
312
+ └───────────────┬─────────────────────────────────┘
313
+
314
+ ┌───────────┼───────────┐
315
+ │ │ │
316
+ ┌───▼───┐ ┌───▼────┐ ┌───▼──────────────┐
317
+ Simple│ │ ReAct │ │ Multi-Agent │
318
+ │ Work │ │ Agent │ │ Orchestrator │
319
+ └───────┘ └────────┘ └──────┬───────────┘
320
+
321
+ ┌──────────┼──────────┐
322
+ │ │ │
323
+ ┌───────▼──┐ ┌───▼──────┐ ┌▼────────────┐
324
+ │ Planning │ │Execution │ │ Validation │
325
+ │ Agent │→ │ Agent │→ │ Agent │
326
+ └──────────┘ └──────────┘ └─────────────┘
327
+ │ │ │
328
+ └──────────┼──────────┘
329
+
330
+ ┌──────────▼──────────┐
331
+ │ Composite Summary │
332
+ │ + Review Gate │
333
+ │ + AgentFeedback │
334
+ └─────────────────────┘
120
335
  ```
121
336
 
337
+ ### Core Components
338
+
339
+ - **Intelligent Router**: Analyzes query intent, selects optimal workflow
340
+ - **Planning Agent**: Creates hierarchical plans with risk assessment
341
+ - **Execution Agent**: Executes plans, tracks changes, handles rollbacks
342
+ - **Validation Agent**: Compiles, tests, analyzes quality
343
+ - **Multi-Agent Orchestrator**: Coordinates all agents, creates unified run context
344
+ - **Validation Layer**: TraceSummary generation, AgentFeedback recording, review handler
345
+
346
+ ### Data Flow
347
+
348
+ 1. **Query** → Router determines intent
349
+ 2. **Planning** → Agent creates plan with complexity tracking
350
+ 3. **Execution** → Agent executes with file change tracking
351
+ 4. **Validation** → Agent runs checks with pass/fail tracking
352
+ 5. **Summary** → Composite summary aggregated from all agents
353
+ 6. **Review** → User reviews summary, approves/rejects
354
+ 7. **Feedback** → Outcome recorded to local JSONL, trust scores updated
355
+
122
356
  **Tech Stack:**
123
357
  - **TypeScript** - Type-safe development
124
- - **Cohere AI** - Embeddings and chat completion
125
- - **SQL.js** - In-memory SQLite for vector storage
358
+ - **Cohere AI** - Embeddings, chat completion, reranking
359
+ - **SQLite** - Local vector storage and feedback persistence
126
360
  - **Commander.js** - CLI interface
127
- - **Tiktoken** - Token counting and chunking
361
+ - **Clean Architecture** - Domain, application, infrastructure layers
128
362
 
129
363
  ## 📊 Performance
130
364
 
@@ -133,36 +367,40 @@ codehere help <command>
133
367
  - **Chat:** ~2-5 seconds per query
134
368
  - **Storage:** ~13KB per chunk (1024-dim embeddings)
135
369
 
370
+ ## 🎯 Trust & Reliability Dashboard
371
+
372
+ Codehere measures and reports its own reliability. Every operation with `--review` generates feedback that feeds into trust scores.
373
+
374
+ ### Run Analytics
375
+
376
+ ```bash
377
+ npm run analyze:feedback
378
+ ```
379
+
380
+ Shows trust scores per agent, success rates, and operation breakdowns. See `docs/VALIDATION_MODE_USAGE_GUIDE.md` for details.
381
+
136
382
  ## 🔒 Security & Privacy
137
383
 
138
- - **Local-first:** All embeddings stored locally in SQLite
139
- - **No code transmission:** Only chunks sent to API for embedding
140
- - **Audit trail:** Complete JSONL logging of all operations
141
- - **Policy enforcement:** Multiple safety checks before applying changes
384
+ - **Local-first storage:** All embeddings and feedback stored locally in SQLite – nothing leaves your machine
385
+ - **No code transmission:** Only chunks sent to API for embedding, never full files
386
+ - **Privacy-first feedback:** All AgentFeedback stored locally in `data/feedback/agent-feedback.jsonl`. No telemetry. Opt out with `CODEHERE_FEEDBACK_OPT_OUT=true`
387
+ - **Audit trail:** Complete JSONL logging of all operations with full traceability
388
+ - **Policy enforcement:** Line limits, restricted folders, single-file safety checks
389
+ - **Review gates:** Explicit approval required before applying destructive changes
142
390
 
143
- ## 📈 Use Cases
391
+ ## 📈 Use Cases (v0.5 Solo Dev Alpha)
144
392
 
145
- Codehere helps developers, teams, and enterprises in many ways:
393
+ Codehere helps **solo developers** working on their own repositories:
146
394
 
147
- ### For Developers
395
+ ### For Solo Developers
148
396
  - **Onboard faster**: Understand new codebases in hours, not days
149
397
  - **Debug smarter**: AI-powered reasoning to find root causes
150
- - **Refactor safely**: Automatic verification and rollback
398
+ - **Refactor safely**: Automatic verification and rollback with review gates
151
399
  - **Learn continuously**: Get explanations of any code
400
+ - **Plan work**: Generate structured task plans with JSON export
401
+ - **Safe editing**: Review gates, backup, and automatic rollback on failure
152
402
 
153
- ### For Teams
154
- - **Better documentation**: Auto-generate accurate, up-to-date docs
155
- - **Faster code reviews**: AI-assisted review catches issues early
156
- - **Consistent patterns**: Learn and apply team conventions automatically
157
- - **Knowledge sharing**: Preserve and share patterns across projects
158
-
159
- ### For Enterprises
160
- - **Secure by default**: Built-in security scanning and audit trails
161
- - **Privacy-first**: Local processing, code never leaves your machine
162
- - **Productivity metrics**: Track ROI and developer productivity
163
- - **Organizational memory**: Build knowledge that survives team changes
164
-
165
- **See [docs/USE_CASES.md](../docs/USE_CASES.md) for detailed scenarios and examples.**
403
+ **Note**: v0.5 is not yet validated for team workflows, enterprise use, or multi-repo orchestration.
166
404
 
167
405
  ## 🧪 Testing
168
406
 
@@ -224,6 +462,32 @@ MIT License - see [LICENSE](LICENSE) for details.
224
462
 
225
463
  Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
226
464
 
465
+ ## Known Limitations (v0.5 Solo Dev Alpha)
466
+
467
+ ### 🧱 Large Repos Indexing
468
+ - **Issue**: Full `codehere index` can hit heap/memory limits on very large codebases (~30–40k+ files)
469
+ - **Impact**: You may not be able to fully index very large repositories
470
+ - **Workaround**: Semantic search still works with partial/cached results. You don't need full indexing for most operations.
471
+
472
+ ### 🧠 Memory Scope
473
+ - **Issue**: `codehere memory --list --json` provides **operation history**, not full long-term conversational memory
474
+ - **Impact**: No strong guarantees around cross-session, long-horizon memory semantics
475
+ - **What you get**: Structured operation history with JSON export for tooling
476
+ - **What you don't get**: "Remembers everything you say forever" - that's not v0.5
477
+
478
+ ### 👥 Not Enterprise-Ready
479
+ - **Issue**: v0.5 targets **solo devs on single repos**
480
+ - **Impact**: No guarantees (yet) for:
481
+ - Team workflows
482
+ - Multi-repo orchestration
483
+ - Governance/audit requirements
484
+ - Production CI/CD reliability guarantees
485
+
486
+ ### 🤖 Orchestration Behavior
487
+ - **Issue**: Multi-agent orchestration JSON schema is stable, but content quality depends on provider
488
+ - **Impact**: `plan`, `execution`, `validation` fields may be `null` for some providers
489
+ - **Workaround**: Check JSON structure - if fields are `null`, orchestration didn't produce rich content (expected for fake provider, may vary for real providers)
490
+
227
491
  ---
228
492
 
229
- **Built with ❤️ for developers who want AI assistance without sacrificing control.**
493
+ **Built with ❤️ for solo developers who want AI assistance without sacrificing control.**
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Application Agent: Documentation Agent
3
+ * Generates and maintains documentation (README, API docs)
4
+ */
5
+ import type { IAIService } from '../../domain/interfaces/ai-service.interface.js';
6
+ import type { MemoryStreamService } from '../../infrastructure/storage/memory-stream-service.js';
7
+ import type { IAgent } from '../../domain/interfaces/agent.interface.js';
8
+ import type { DocumentationRequest, DocumentationResponse } from '../../domain/entities/documentation.js';
9
+ export declare class DocumentationAgent implements IAgent<DocumentationRequest, DocumentationResponse> {
10
+ private aiService;
11
+ private memoryStream?;
12
+ private cwd;
13
+ name: string;
14
+ type: "non-engineering";
15
+ constructor(aiService: IAIService, memoryStream?: MemoryStreamService | undefined, cwd?: string);
16
+ execute(request: DocumentationRequest): Promise<DocumentationResponse>;
17
+ private generateREADME;
18
+ private generateAPIDocs;
19
+ private analyzeFolderStructure;
20
+ private findSourceFiles;
21
+ private buildReadmePrompt;
22
+ private buildAPIDocsContent;
23
+ }
24
+ //# sourceMappingURL=documentation-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentation-agent.d.ts","sourceRoot":"","sources":["../../../src/application/agents/documentation-agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AACjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,wCAAwC,CAAC;AAOhD,qBAAa,kBAAmB,YAAW,MAAM,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;IAK1F,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,GAAG;IANb,IAAI,SAAyB;IAC7B,IAAI,EAAG,iBAAiB,CAAU;gBAGxB,SAAS,EAAE,UAAU,EACrB,YAAY,CAAC,EAAE,mBAAmB,YAAA,EAClC,GAAG,GAAE,MAAsB;IAG/B,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;YAuD9D,cAAc;YA2Gd,eAAe;IAgG7B,OAAO,CAAC,sBAAsB;IAwC9B,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,iBAAiB;YA2BX,mBAAmB;CA6DlC"}