codehere 0.3.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.
Files changed (297) 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 +3 -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 +22 -2
  27. package/dist/application/services/dependency-container.d.ts.map +1 -1
  28. package/dist/application/services/dependency-container.js +144 -6
  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 +19 -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 +125 -46
  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 +16 -1
  40. package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
  41. package/dist/domain/entities/documentation.d.ts +35 -0
  42. package/dist/domain/entities/documentation.d.ts.map +1 -0
  43. package/dist/domain/entities/documentation.js +6 -0
  44. package/dist/domain/entities/documentation.js.map +1 -0
  45. package/dist/domain/entities/product-requirements.d.ts +50 -0
  46. package/dist/domain/entities/product-requirements.d.ts.map +1 -0
  47. package/dist/domain/entities/product-requirements.js +6 -0
  48. package/dist/domain/entities/product-requirements.js.map +1 -0
  49. package/dist/domain/entities/task.d.ts +152 -0
  50. package/dist/domain/entities/task.d.ts.map +1 -0
  51. package/dist/domain/entities/task.js +61 -0
  52. package/dist/domain/entities/task.js.map +1 -0
  53. package/dist/domain/interfaces/agent.interface.d.ts +15 -0
  54. package/dist/domain/interfaces/agent.interface.d.ts.map +1 -0
  55. package/dist/domain/interfaces/agent.interface.js +6 -0
  56. package/dist/domain/interfaces/agent.interface.js.map +1 -0
  57. package/dist/domain/services/environment-mode-manager.d.ts +18 -0
  58. package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
  59. package/dist/domain/services/environment-mode-manager.js +37 -0
  60. package/dist/domain/services/environment-mode-manager.js.map +1 -0
  61. package/dist/domain/services/risk-tier-detector.d.ts +18 -0
  62. package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
  63. package/dist/domain/services/risk-tier-detector.js +65 -0
  64. package/dist/domain/services/risk-tier-detector.js.map +1 -0
  65. package/dist/formatter.d.ts.map +1 -1
  66. package/dist/formatter.js +10 -3
  67. package/dist/formatter.js.map +1 -1
  68. package/dist/index.js +103 -129
  69. package/dist/index.js.map +1 -1
  70. package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
  71. package/dist/infrastructure/ai/cohere-ai-service.js +15 -2
  72. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
  73. package/dist/infrastructure/ai/fake-ai-service.d.ts +22 -0
  74. package/dist/infrastructure/ai/fake-ai-service.d.ts.map +1 -0
  75. package/dist/infrastructure/ai/fake-ai-service.js +59 -0
  76. package/dist/infrastructure/ai/fake-ai-service.js.map +1 -0
  77. package/dist/infrastructure/ai/provider-ai-service.d.ts +59 -0
  78. package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -0
  79. package/dist/infrastructure/ai/provider-ai-service.js +477 -0
  80. package/dist/infrastructure/ai/provider-ai-service.js.map +1 -0
  81. package/dist/infrastructure/cache/embedding-cache.d.ts +13 -1
  82. package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -1
  83. package/dist/infrastructure/cache/embedding-cache.js +80 -9
  84. package/dist/infrastructure/cache/embedding-cache.js.map +1 -1
  85. package/dist/infrastructure/cache/response-cache.d.ts +86 -0
  86. package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
  87. package/dist/infrastructure/cache/response-cache.js +224 -0
  88. package/dist/infrastructure/cache/response-cache.js.map +1 -0
  89. package/dist/infrastructure/context/conversation-context.d.ts +58 -0
  90. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
  91. package/dist/infrastructure/context/conversation-context.js +170 -0
  92. package/dist/infrastructure/context/conversation-context.js.map +1 -0
  93. package/dist/infrastructure/context/session-manager.d.ts +26 -0
  94. package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
  95. package/dist/infrastructure/context/session-manager.js +98 -0
  96. package/dist/infrastructure/context/session-manager.js.map +1 -0
  97. package/dist/infrastructure/cost/cost-tracker.d.ts +1 -0
  98. package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
  99. package/dist/infrastructure/cost/cost-tracker.js +12 -5
  100. package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
  101. package/dist/infrastructure/governance/nist-ai-rmf.d.ts +6 -8
  102. package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -1
  103. package/dist/infrastructure/governance/nist-ai-rmf.js +6 -8
  104. package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -1
  105. package/dist/infrastructure/governance/policy-as-code.d.ts +6 -8
  106. package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -1
  107. package/dist/infrastructure/governance/policy-as-code.js +6 -8
  108. package/dist/infrastructure/governance/policy-as-code.js.map +1 -1
  109. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +7 -9
  110. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -1
  111. package/dist/infrastructure/governance/prompt-to-code-lineage.js +7 -9
  112. package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -1
  113. package/dist/infrastructure/providers/cohere-provider.d.ts +39 -0
  114. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -0
  115. package/dist/infrastructure/providers/cohere-provider.js +359 -0
  116. package/dist/infrastructure/providers/cohere-provider.js.map +1 -0
  117. package/dist/infrastructure/providers/fake-provider.d.ts +43 -0
  118. package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -0
  119. package/dist/infrastructure/providers/fake-provider.js +130 -0
  120. package/dist/infrastructure/providers/fake-provider.js.map +1 -0
  121. package/dist/infrastructure/providers/local-llm-provider.d.ts +49 -0
  122. package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -0
  123. package/dist/infrastructure/providers/local-llm-provider.js +330 -0
  124. package/dist/infrastructure/providers/local-llm-provider.js.map +1 -0
  125. package/dist/infrastructure/providers/model-config.types.d.ts +70 -0
  126. package/dist/infrastructure/providers/model-config.types.d.ts.map +1 -0
  127. package/dist/infrastructure/providers/model-config.types.js +9 -0
  128. package/dist/infrastructure/providers/model-config.types.js.map +1 -0
  129. package/dist/infrastructure/providers/model-provider.interface.d.ts +113 -0
  130. package/dist/infrastructure/providers/model-provider.interface.d.ts.map +1 -0
  131. package/dist/infrastructure/providers/model-provider.interface.js +8 -0
  132. package/dist/infrastructure/providers/model-provider.interface.js.map +1 -0
  133. package/dist/infrastructure/providers/openai-provider.d.ts +38 -0
  134. package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -0
  135. package/dist/infrastructure/providers/openai-provider.js +413 -0
  136. package/dist/infrastructure/providers/openai-provider.js.map +1 -0
  137. package/dist/infrastructure/providers/operation-provider-resolver.d.ts +48 -0
  138. package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
  139. package/dist/infrastructure/providers/operation-provider-resolver.js +105 -0
  140. package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -0
  141. package/dist/infrastructure/providers/provider-config-loader.d.ts +37 -0
  142. package/dist/infrastructure/providers/provider-config-loader.d.ts.map +1 -0
  143. package/dist/infrastructure/providers/provider-config-loader.js +120 -0
  144. package/dist/infrastructure/providers/provider-config-loader.js.map +1 -0
  145. package/dist/infrastructure/providers/provider-registry.d.ts +53 -0
  146. package/dist/infrastructure/providers/provider-registry.d.ts.map +1 -0
  147. package/dist/infrastructure/providers/provider-registry.js +88 -0
  148. package/dist/infrastructure/providers/provider-registry.js.map +1 -0
  149. package/dist/infrastructure/storage/task-helpers.d.ts +58 -0
  150. package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
  151. package/dist/infrastructure/storage/task-helpers.js +157 -0
  152. package/dist/infrastructure/storage/task-helpers.js.map +1 -0
  153. package/dist/infrastructure/storage/task-repository.d.ts +67 -0
  154. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
  155. package/dist/infrastructure/storage/task-repository.js +205 -0
  156. package/dist/infrastructure/storage/task-repository.js.map +1 -0
  157. package/dist/infrastructure/ux/bi-directional-learning.d.ts +22 -0
  158. package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -1
  159. package/dist/infrastructure/ux/bi-directional-learning.js +144 -7
  160. package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -1
  161. package/dist/infrastructure/ux/capability-boundaries.d.ts +50 -0
  162. package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
  163. package/dist/infrastructure/ux/capability-boundaries.js +167 -0
  164. package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
  165. package/dist/infrastructure/ux/comprehensive-formatter.d.ts +63 -0
  166. package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
  167. package/dist/infrastructure/ux/comprehensive-formatter.js +212 -0
  168. package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
  169. package/dist/infrastructure/ux/feedback-prompt.d.ts +42 -0
  170. package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
  171. package/dist/infrastructure/ux/feedback-prompt.js +181 -0
  172. package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
  173. package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -1
  174. package/dist/infrastructure/ux/hitl-review-portal.js +4 -1
  175. package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -1
  176. package/dist/infrastructure/ux/hitl-validation.d.ts +35 -0
  177. package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -1
  178. package/dist/infrastructure/ux/hitl-validation.js +86 -0
  179. package/dist/infrastructure/ux/hitl-validation.js.map +1 -1
  180. package/dist/infrastructure/ux/progress-indicator.d.ts +2 -1
  181. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
  182. package/dist/infrastructure/ux/progress-indicator.js +13 -3
  183. package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
  184. package/dist/infrastructure/ux/proportional-friction.d.ts +73 -0
  185. package/dist/infrastructure/ux/proportional-friction.d.ts.map +1 -0
  186. package/dist/infrastructure/ux/proportional-friction.js +200 -0
  187. package/dist/infrastructure/ux/proportional-friction.js.map +1 -0
  188. package/dist/infrastructure/validation/agent-feedback.d.ts +115 -0
  189. package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
  190. package/dist/infrastructure/validation/agent-feedback.js +227 -0
  191. package/dist/infrastructure/validation/agent-feedback.js.map +1 -0
  192. package/dist/infrastructure/validation/agent-validation-helper.d.ts +75 -0
  193. package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -0
  194. package/dist/infrastructure/validation/agent-validation-helper.js +88 -0
  195. package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -0
  196. package/dist/infrastructure/validation/feedback-stats.d.ts +99 -0
  197. package/dist/infrastructure/validation/feedback-stats.d.ts.map +1 -0
  198. package/dist/infrastructure/validation/feedback-stats.js +173 -0
  199. package/dist/infrastructure/validation/feedback-stats.js.map +1 -0
  200. package/dist/infrastructure/validation/review-handler.d.ts +54 -0
  201. package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
  202. package/dist/infrastructure/validation/review-handler.js +206 -0
  203. package/dist/infrastructure/validation/review-handler.js.map +1 -0
  204. package/dist/infrastructure/validation/summary-aggregator.d.ts +42 -0
  205. package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
  206. package/dist/infrastructure/validation/summary-aggregator.js +156 -0
  207. package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
  208. package/dist/infrastructure/validation/summary-extractor.d.ts +59 -0
  209. package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
  210. package/dist/infrastructure/validation/summary-extractor.js +102 -0
  211. package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
  212. package/dist/infrastructure/validation/trace-summary.d.ts +72 -0
  213. package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
  214. package/dist/infrastructure/validation/trace-summary.js +371 -0
  215. package/dist/infrastructure/validation/trace-summary.js.map +1 -0
  216. package/dist/infrastructure/validation/trust-config.d.ts +27 -0
  217. package/dist/infrastructure/validation/trust-config.d.ts.map +1 -0
  218. package/dist/infrastructure/validation/trust-config.js +113 -0
  219. package/dist/infrastructure/validation/trust-config.js.map +1 -0
  220. package/dist/infrastructure/xai/attention-visualizer.d.ts +6 -8
  221. package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -1
  222. package/dist/infrastructure/xai/attention-visualizer.js +6 -8
  223. package/dist/infrastructure/xai/attention-visualizer.js.map +1 -1
  224. package/dist/infrastructure/xai/cot-visualizer.d.ts +6 -9
  225. package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
  226. package/dist/infrastructure/xai/cot-visualizer.js +6 -9
  227. package/dist/infrastructure/xai/cot-visualizer.js.map +1 -1
  228. package/dist/infrastructure/xai/decision-tree-log.d.ts +6 -10
  229. package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -1
  230. package/dist/infrastructure/xai/decision-tree-log.js +6 -10
  231. package/dist/infrastructure/xai/decision-tree-log.js.map +1 -1
  232. package/dist/infrastructure/xai/interactive-xai.d.ts +6 -8
  233. package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -1
  234. package/dist/infrastructure/xai/interactive-xai.js +6 -8
  235. package/dist/infrastructure/xai/interactive-xai.js.map +1 -1
  236. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +6 -9
  237. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -1
  238. package/dist/infrastructure/xai/uncertainty-quantifier.js +6 -9
  239. package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -1
  240. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  241. package/dist/presentation/cli/commands/ask-command.js +84 -2
  242. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  243. package/dist/presentation/cli/commands/docs-command.d.ts +12 -0
  244. package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
  245. package/dist/presentation/cli/commands/docs-command.js +196 -0
  246. package/dist/presentation/cli/commands/docs-command.js.map +1 -0
  247. package/dist/presentation/cli/commands/fix-command.d.ts +8 -0
  248. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
  249. package/dist/presentation/cli/commands/fix-command.js +309 -0
  250. package/dist/presentation/cli/commands/fix-command.js.map +1 -0
  251. package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
  252. package/dist/presentation/cli/commands/help-command.js +2 -0
  253. package/dist/presentation/cli/commands/help-command.js.map +1 -1
  254. package/dist/presentation/cli/commands/orchestrate-command.d.ts +1 -0
  255. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  256. package/dist/presentation/cli/commands/orchestrate-command.js +53 -0
  257. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  258. package/dist/presentation/cli/commands/plan-command.d.ts +1 -0
  259. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  260. package/dist/presentation/cli/commands/plan-command.js +80 -3
  261. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  262. package/dist/presentation/cli/commands/product-command.d.ts +12 -0
  263. package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
  264. package/dist/presentation/cli/commands/product-command.js +188 -0
  265. package/dist/presentation/cli/commands/product-command.js.map +1 -0
  266. package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
  267. package/dist/presentation/cli/commands/react-command.js +3 -1
  268. package/dist/presentation/cli/commands/react-command.js.map +1 -1
  269. package/dist/presentation/cli/commands/review-command.d.ts +14 -0
  270. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -0
  271. package/dist/presentation/cli/commands/review-command.js +22 -0
  272. package/dist/presentation/cli/commands/review-command.js.map +1 -0
  273. package/dist/presentation/cli/commands/run-command.d.ts +15 -0
  274. package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
  275. package/dist/presentation/cli/commands/run-command.js +29 -0
  276. package/dist/presentation/cli/commands/run-command.js.map +1 -0
  277. package/dist/presentation/cli/commands/smart-command.d.ts +3 -1
  278. package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
  279. package/dist/presentation/cli/commands/smart-command.js +92 -6
  280. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  281. package/dist/presentation/cli/commands/status-command.d.ts +11 -0
  282. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
  283. package/dist/presentation/cli/commands/status-command.js +176 -0
  284. package/dist/presentation/cli/commands/status-command.js.map +1 -0
  285. package/dist/presentation/cli/commands/suggest-command.d.ts +13 -0
  286. package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
  287. package/dist/presentation/cli/commands/suggest-command.js +25 -0
  288. package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
  289. package/dist/presentation/cli/error-display.d.ts.map +1 -1
  290. package/dist/presentation/cli/error-display.js +43 -0
  291. package/dist/presentation/cli/error-display.js.map +1 -1
  292. package/dist/session.js +19 -2
  293. package/dist/session.js.map +1 -1
  294. package/dist/ui.d.ts.map +1 -1
  295. package/dist/ui.js +8 -5
  296. package/dist/ui.js.map +1 -1
  297. package/package.json +10 -2
package/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # codehere
2
2
 
3
- > Enterprise-grade AI coding assistant with local embeddings and semantic search
3
+ > 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.
4
+
5
+ Codehere is a multi-agent coding system designed for solo developers and small teams. 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.
6
+
7
+ **πŸ“– [Documentation β†’](docs/OVERVIEW.md)** | **πŸ—ΊοΈ [Roadmap β†’](docs/ROADMAP.md)**
4
8
 
5
9
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)](https://www.typescriptlang.org/)
6
10
  [![Node.js](https://img.shields.io/badge/Node.js-18+-green)](https://nodejs.org/)
@@ -50,19 +54,62 @@ codehere index
50
54
  codehere "How does authentication work?"
51
55
  ```
52
56
 
57
+ ### Switching Providers
58
+
59
+ Codehere supports multiple AI providers. By default, it uses **Cohere** (no configuration needed).
60
+
61
+ **Quick Options:**
62
+
63
+ **Default (Cohere):**
64
+ ```bash
65
+ export COHERE_API_KEY=your-key
66
+ codehere status
67
+ ```
68
+
69
+ **OpenAI:**
70
+ ```bash
71
+ export CODEHERE_AI_PROVIDER=openai
72
+ export CODEHERE_OPENAI_API_KEY=sk-...
73
+ codehere status
74
+ ```
75
+
76
+ **Local LLM (Ollama, LM Studio):**
77
+ ```bash
78
+ export CODEHERE_AI_PROVIDER=local
79
+ export CODEHERE_LOCAL_BASE_URL=http://localhost:11434
80
+ codehere status
81
+ ```
82
+
83
+ **Fake Mode (Testing/Demo):**
84
+ ```bash
85
+ export CODEHERE_FAKE_AI=1
86
+ codehere status # No API calls, deterministic outputs
87
+ ```
88
+
89
+ **Per-Operation Routing:**
90
+
91
+ Create `.codehere/providers.json` to route different operations to different providers. See [docs/PROVIDERS_QUICKSTART.md](docs/PROVIDERS_QUICKSTART.md) for complete setup guide.
92
+
93
+ **πŸ“– [Complete Provider Guide β†’](docs/PROVIDERS_QUICKSTART.md)**
94
+
53
95
  **Using Codehere:**
54
96
 
55
97
  ```bash
56
98
  # Natural language queries (unified command)
57
99
  codehere "explain this function"
58
- codehere "add error handling to src/utils.ts"
59
- codehere "refactor user service to use dependency injection"
100
+ codehere "add error handling to src/utils.ts" --review
101
+ codehere "refactor user service to use dependency injection" --review
60
102
 
61
103
  # Or use explicit commands
62
104
  codehere ask "How does authentication work?"
63
105
  codehere explain src/utils.ts
64
106
  codehere plan "implement user authentication system"
65
- codehere orchestrate "add comprehensive logging"
107
+ codehere orchestrate "add comprehensive logging" --review
108
+
109
+ # Validation Mode: Review before applying changes
110
+ codehere fix src/utils.ts "Add error handling" --review
111
+ codehere orchestrate "Add authentication" --review
112
+ codehere plan "Refactor to DI" --execute --review
66
113
 
67
114
  # Manage configuration
68
115
  codehere config # Show current configuration
@@ -74,57 +121,177 @@ codehere --help
74
121
  codehere help <command>
75
122
  ```
76
123
 
124
+ > **πŸ’‘ 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.
125
+
126
+ ### πŸ” Validation Mode & Trust Scores
127
+
128
+ 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.
129
+
130
+ **How it works:**
131
+ - Run commands with `--review` to enable feedback capture
132
+ - Review summaries show files changed, validation checks, and risk assessment
133
+ - Feedback is stored locally in `data/feedback/agent-feedback.jsonl`
134
+ - Trust scores are computed per agent: `(approved_success_runs / total_runs) Γ— 100`
135
+
136
+ **Example:**
137
+ ```bash
138
+ # Enable review & feedback capture
139
+ CODEHERE_AUTO_APPROVE=true codehere fix src/file.ts "add input validation" --review
140
+
141
+ # View trust scores
142
+ npm run analyze:feedback
143
+ codehere status
144
+ ```
145
+
146
+ **Optional:** Configure minimum trust thresholds via `config/trust-config.json` to highlight agents that need more validation (warnings only, non-blocking).
147
+
148
+ **For CI/dashboards:** Export trust and feedback stats as JSON:
149
+ - `npm run analyze:feedback -- --json`
150
+ - `codehere status --json`
151
+
152
+ **For CI gates:** Enforce minimum trust scores:
153
+ - `npm run check:trust` - Fails if any agent is below its configured threshold
154
+
155
+ **πŸ“– [Complete Guide β†’](docs/VALIDATION_MODE.md)**
156
+
157
+ ### πŸ’¬ Feedback Collection
158
+
159
+ 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:
160
+
161
+ ```bash
162
+ # Positive feedback (thumbs up)
163
+ CODEHERE_FEEDBACK=y codehere ask "What is main?"
164
+
165
+ # Negative feedback (thumbs down)
166
+ CODEHERE_FEEDBACK=n codehere ask "What is main?"
167
+
168
+ # Request refinement with message
169
+ CODEHERE_FEEDBACK=r CODEHERE_FEEDBACK_MESSAGE="Add more examples" codehere ask "What is main?"
170
+
171
+ # Alternative values
172
+ CODEHERE_FEEDBACK=positive codehere ask "What is main?"
173
+ CODEHERE_FEEDBACK=negative codehere ask "What is main?"
174
+ CODEHERE_FEEDBACK=yes codehere ask "What is main?"
175
+ CODEHERE_FEEDBACK=no codehere ask "What is main?"
176
+ ```
177
+
178
+ **Environment Variables:**
179
+ - `CODEHERE_FEEDBACK`: `y`/`yes`/`positive` (thumbs up), `n`/`no`/`negative` (thumbs down), `r`/`refine`/`refinement` (request refinement)
180
+ - `CODEHERE_FEEDBACK_MESSAGE`: Optional message for refinement requests
181
+
77
182
  ## ✨ Features
78
183
 
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
184
+ ### 🎯 Why Codehere vs Other Coding Agents?
185
+
186
+ - **Explicit Review Gates**: Unlike agents that apply changes immediately, Codehere uses `--review` to pause, show summaries, and request approval before modifying files
187
+ - **Trust Scores & Analytics**: Every agent run is scored. Run `npm run analyze:feedback` to see which agents are most reliable in your workflow
188
+ - **Full Traceability**: Every operation generates a structured TraceSummary showing files changed, reasoning steps, validation checks, and risk assessment
189
+ - **Governed Multi-Agent System**: Specialized agents (Planning, Execution, Validation) work together with full instrumentation – not a black box
190
+ - **Privacy-First Feedback**: All feedback stored locally in JSONL. No telemetry. Opt-out available. Your data stays yours
191
+
192
+ ### πŸ€– Multi-Agent Orchestration
193
+
194
+ - **Planning Agent**: Breaks complex tasks into hierarchical sub-plans with risk assessment
195
+ - **Execution Agent**: Executes plans step-by-step, tracks file changes, handles rollbacks
196
+ - **Validation Agent**: Runs compilation checks, tests, and quality analysis before completion
197
+ - **Intelligent Router**: Automatically selects the right workflow (simple, ReAct, or multi-agent) based on query complexity
198
+ - **Multi-Agent Orchestrator**: Coordinates all agents, aggregates summaries, provides unified traceability
199
+
200
+ ### πŸ›‘οΈ Validation Mode & Review Gates
201
+
202
+ - **`--review` Flag**: Pause before applying changes, review structured summaries, approve or reject
203
+ - **TraceSummary Generation**: Every agent run produces a detailed summary (files, steps, checks, metrics, risk)
204
+ - **Composite Summaries**: Multi-agent operations merge all agent summaries into one reviewable report
205
+ - **Risk Assessment**: Automatic risk level calculation (low/medium/high/critical) with clear reasons
206
+ - **Environment Controls**: `CODEHERE_AUTO_APPROVE=true` for CI/CD, `CODEHERE_FEEDBACK_OPT_OUT=true` for privacy
207
+
208
+ ### πŸ“Š Trust & Reliability Metrics
83
209
 
84
- ### πŸ€– AI-Powered Assistance
210
+ - **Agent Feedback Analytics**: Run `npm run analyze:feedback` to see trust scores, success rates, and operation breakdowns
211
+ - **Trust Score Calculation**: `(approved_success_runs / total_runs) Γ— 100` – measurable agent reliability
212
+ - **Outcome Tracking**: Success, failure, partial_success, cancelled, error – complete visibility
213
+ - **User Action Tracking**: Approved, rejected, modified – understand how users interact with agents
214
+
215
+ ### 🧠 Semantic Code Search & Context
216
+
217
+ - Builds local embedding index using Cohere's embedding API
218
+ - Enhanced context with file relationships and dependencies (15+ chunks)
85
219
  - 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)
220
+ - Natural language code explanations and intelligent editing
221
+
222
+ ### πŸ”’ Security & Privacy
89
223
 
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
224
+ - **Local-first**: All embeddings and feedback stored locally in SQLite
225
+ - **No code transmission**: Only chunks sent to API for embedding, never full files
226
+ - **Audit trail**: Complete JSONL logging of all operations
227
+ - **Policy enforcement**: Line limits, restricted folders, single-file safety checks
228
+ - **Privacy controls**: Opt-out available, anonymization by default
95
229
 
96
230
  ### πŸ”§ 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
231
 
102
- ### πŸ“¦ Production Ready
103
- - Fully tested end-to-end
104
- - TypeScript for type safety
105
- - SQLite for local vector storage
106
- - Comprehensive error handling
232
+ - **Automatic error recovery**: Retry with exponential backoff
233
+ - **Circuit breaker**: Protects against API failures
234
+ - **Health monitoring**: System health checks and metrics
235
+ - **24/7 operation ready**: Robust error handling and graceful degradation
107
236
 
108
237
  ## πŸ—οΈ Architecture
109
238
 
239
+ ### Multi-Agent System
240
+
110
241
  ```
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
242
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
243
+ β”‚ Intelligent Router β”‚
244
+ β”‚ (Routes queries to appropriate workflow) β”‚
245
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
246
+ β”‚
247
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
248
+ β”‚ β”‚ β”‚
249
+ β”Œβ”€β”€β”€β–Όβ”€β”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
250
+ β”‚ Simpleβ”‚ β”‚ ReAct β”‚ β”‚ Multi-Agent β”‚
251
+ β”‚ Work β”‚ β”‚ Agent β”‚ β”‚ Orchestrator β”‚
252
+ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
253
+ β”‚
254
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
255
+ β”‚ β”‚ β”‚
256
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
257
+ β”‚ Planning β”‚ β”‚Execution β”‚ β”‚ Validation β”‚
258
+ β”‚ Agent β”‚β†’ β”‚ Agent β”‚β†’ β”‚ Agent β”‚
259
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
260
+ β”‚ β”‚ β”‚
261
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
262
+ β”‚
263
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
264
+ β”‚ Composite Summary β”‚
265
+ β”‚ + Review Gate β”‚
266
+ β”‚ + AgentFeedback β”‚
267
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
120
268
  ```
121
269
 
270
+ ### Core Components
271
+
272
+ - **Intelligent Router**: Analyzes query intent, selects optimal workflow
273
+ - **Planning Agent**: Creates hierarchical plans with risk assessment
274
+ - **Execution Agent**: Executes plans, tracks changes, handles rollbacks
275
+ - **Validation Agent**: Compiles, tests, analyzes quality
276
+ - **Multi-Agent Orchestrator**: Coordinates all agents, creates unified run context
277
+ - **Validation Layer**: TraceSummary generation, AgentFeedback recording, review handler
278
+
279
+ ### Data Flow
280
+
281
+ 1. **Query** β†’ Router determines intent
282
+ 2. **Planning** β†’ Agent creates plan with complexity tracking
283
+ 3. **Execution** β†’ Agent executes with file change tracking
284
+ 4. **Validation** β†’ Agent runs checks with pass/fail tracking
285
+ 5. **Summary** β†’ Composite summary aggregated from all agents
286
+ 6. **Review** β†’ User reviews summary, approves/rejects
287
+ 7. **Feedback** β†’ Outcome recorded to local JSONL, trust scores updated
288
+
122
289
  **Tech Stack:**
123
290
  - **TypeScript** - Type-safe development
124
- - **Cohere AI** - Embeddings and chat completion
125
- - **SQL.js** - In-memory SQLite for vector storage
291
+ - **Cohere AI** - Embeddings, chat completion, reranking
292
+ - **SQLite** - Local vector storage and feedback persistence
126
293
  - **Commander.js** - CLI interface
127
- - **Tiktoken** - Token counting and chunking
294
+ - **Clean Architecture** - Domain, application, infrastructure layers
128
295
 
129
296
  ## πŸ“Š Performance
130
297
 
@@ -133,12 +300,26 @@ codehere help <command>
133
300
  - **Chat:** ~2-5 seconds per query
134
301
  - **Storage:** ~13KB per chunk (1024-dim embeddings)
135
302
 
303
+ ## 🎯 Trust & Reliability Dashboard
304
+
305
+ Codehere measures and reports its own reliability. Every operation with `--review` generates feedback that feeds into trust scores.
306
+
307
+ ### Run Analytics
308
+
309
+ ```bash
310
+ npm run analyze:feedback
311
+ ```
312
+
313
+ Shows trust scores per agent, success rates, and operation breakdowns. See `docs/VALIDATION_MODE_USAGE_GUIDE.md` for details.
314
+
136
315
  ## πŸ”’ Security & Privacy
137
316
 
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
317
+ - **Local-first storage:** All embeddings and feedback stored locally in SQLite – nothing leaves your machine
318
+ - **No code transmission:** Only chunks sent to API for embedding, never full files
319
+ - **Privacy-first feedback:** All AgentFeedback stored locally in `data/feedback/agent-feedback.jsonl`. No telemetry. Opt out with `CODEHERE_FEEDBACK_OPT_OUT=true`
320
+ - **Audit trail:** Complete JSONL logging of all operations with full traceability
321
+ - **Policy enforcement:** Line limits, restricted folders, single-file safety checks
322
+ - **Review gates:** Explicit approval required before applying destructive changes
142
323
 
143
324
  ## πŸ“ˆ Use Cases
144
325
 
@@ -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"}