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
@@ -2,171 +2,90 @@
2
2
  * Syntax Highlighter for Terminal
3
3
  * Provides basic syntax highlighting for code snippets using chalk
4
4
  *
5
- * Lightweight implementation - no heavy dependencies
6
- * Supports: TypeScript, JavaScript, Python, JSON, YAML, Markdown, Shell
5
+ * Phase 1: v0.5.0-alpha.0
7
6
  */
8
7
  import { colors } from '../../ui.js';
9
8
  /**
10
9
  * Detect language from file extension
11
10
  */
12
11
  export function detectLanguage(filepath) {
13
- const ext = filepath.split('.').pop()?.toLowerCase() || '';
14
- const languageMap = {
15
- 'ts': 'typescript',
16
- 'tsx': 'typescript',
17
- 'js': 'javascript',
18
- 'jsx': 'javascript',
19
- 'mjs': 'javascript',
20
- 'cjs': 'javascript',
21
- 'py': 'python',
22
- 'json': 'json',
23
- 'yaml': 'yaml',
24
- 'yml': 'yaml',
25
- 'md': 'markdown',
26
- 'sh': 'shell',
27
- 'bash': 'bash',
28
- };
29
- return languageMap[ext] || 'text';
30
- }
31
- /**
32
- * Highlight TypeScript/JavaScript code
33
- */
34
- function highlightTypeScript(code) {
35
- const lines = code.split('\n');
36
- return lines.map(line => {
37
- let highlighted = line;
38
- // Keywords (const, let, var, function, class, interface, type, etc.)
39
- highlighted = highlighted.replace(/\b(const|let|var|function|class|interface|type|enum|namespace|import|export|from|as|default|extends|implements|public|private|protected|static|readonly|async|await|return|if|else|for|while|switch|case|break|continue|try|catch|finally|throw|new|this|super|typeof|instanceof|in|of)\b/g, (match) => colors.magenta(match));
40
- // Strings (single, double, template literals)
41
- highlighted = highlighted.replace(/(['"`])((?:\\.|(?!\1)[^\\])*?)\1/g, (match) => colors.green(match));
42
- // Numbers
43
- highlighted = highlighted.replace(/\b(\d+\.?\d*)\b/g, (match) => colors.yellow(match));
44
- // Comments
45
- highlighted = highlighted.replace(/(\/\/.*$|\/\*[\s\S]*?\*\/)/gm, (match) => colors.dim(match));
46
- // Function/class names (before opening paren)
47
- highlighted = highlighted.replace(/\b([A-Z][a-zA-Z0-9]*)\s*(?=\()/g, (match) => colors.cyan(match.trim()));
48
- return highlighted;
49
- }).join('\n');
50
- }
51
- /**
52
- * Highlight Python code
53
- */
54
- function highlightPython(code) {
55
- const lines = code.split('\n');
56
- return lines.map(line => {
57
- let highlighted = line;
58
- // Keywords
59
- highlighted = highlighted.replace(/\b(def|class|if|elif|else|for|while|try|except|finally|with|import|from|as|return|yield|lambda|pass|break|continue|raise|assert|and|or|not|in|is|None|True|False)\b/g, (match) => colors.magenta(match));
60
- // Strings
61
- highlighted = highlighted.replace(/(['"])((?:\\.|(?!\1)[^\\])*?)\1/g, (match) => colors.green(match));
62
- // Numbers
63
- highlighted = highlighted.replace(/\b(\d+\.?\d*)\b/g, (match) => colors.yellow(match));
64
- // Comments
65
- highlighted = highlighted.replace(/(#.*$)/gm, (match) => colors.dim(match));
66
- // Function/class names
67
- highlighted = highlighted.replace(/\b(def|class)\s+([a-zA-Z_][a-zA-Z0-9_]*)/g, (match, keyword, name) => colors.magenta(keyword) + ' ' + colors.cyan(name));
68
- return highlighted;
69
- }).join('\n');
70
- }
71
- /**
72
- * Highlight JSON code
73
- */
74
- function highlightJSON(code) {
75
- const lines = code.split('\n');
76
- return lines.map(line => {
77
- let highlighted = line;
78
- // Keys (before colon)
79
- highlighted = highlighted.replace(/"([^"]+)":/g, (match, key) => colors.green(`"${key}"`) + colors.dim(':'));
80
- // Strings
81
- highlighted = highlighted.replace(/"([^"]+)"/g, (match, value) => {
82
- // Don't highlight keys again
83
- if (match.includes(':'))
84
- return match;
85
- return colors.green(match);
86
- });
87
- // Numbers
88
- highlighted = highlighted.replace(/\b(\d+\.?\d*)\b/g, (match) => colors.yellow(match));
89
- // Booleans/null
90
- highlighted = highlighted.replace(/\b(true|false|null)\b/g, (match) => colors.magenta(match));
91
- return highlighted;
92
- }).join('\n');
93
- }
94
- /**
95
- * Highlight Shell/Bash code
96
- */
97
- function highlightShell(code) {
98
- const lines = code.split('\n');
99
- return lines.map(line => {
100
- let highlighted = line;
101
- // Commands (first word)
102
- highlighted = highlighted.replace(/^(\s*)([a-zA-Z_][a-zA-Z0-9_-]*)\s/, (match, indent, cmd) => indent + colors.cyan(cmd) + ' ');
103
- // Variables
104
- highlighted = highlighted.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g, (match) => colors.yellow(match));
105
- // Strings
106
- highlighted = highlighted.replace(/(['"])((?:\\.|(?!\1)[^\\])*?)\1/g, (match) => colors.green(match));
107
- // Comments
108
- highlighted = highlighted.replace(/(#.*$)/gm, (match) => colors.dim(match));
109
- return highlighted;
110
- }).join('\n');
12
+ const ext = filepath.split('.').pop()?.toLowerCase();
13
+ switch (ext) {
14
+ case 'ts':
15
+ case 'tsx':
16
+ return 'typescript';
17
+ case 'js':
18
+ case 'jsx':
19
+ return 'javascript';
20
+ case 'py':
21
+ return 'python';
22
+ case 'json':
23
+ return 'json';
24
+ case 'yaml':
25
+ case 'yml':
26
+ return 'yaml';
27
+ case 'md':
28
+ return 'markdown';
29
+ case 'sh':
30
+ case 'bash':
31
+ return 'shell';
32
+ default:
33
+ return 'text';
34
+ }
111
35
  }
112
36
  /**
113
37
  * Highlight code based on language
114
38
  */
115
39
  export function highlightCode(code, language) {
116
- if (!code)
117
- return '';
118
- const lang = (language || 'text');
119
- // Check if terminal supports colors
120
- if (!process.stdout.isTTY || process.env.NO_COLOR) {
121
- return code; // Return unhighlighted if colors disabled
40
+ if (!language || language === 'text') {
41
+ return code;
122
42
  }
123
- switch (lang) {
124
- case 'typescript':
125
- case 'javascript':
126
- return highlightTypeScript(code);
127
- case 'python':
128
- return highlightPython(code);
129
- case 'json':
130
- return highlightJSON(code);
131
- case 'shell':
132
- case 'bash':
133
- return highlightShell(code);
134
- case 'yaml':
135
- case 'markdown':
136
- case 'text':
137
- default:
138
- // Basic highlighting for other languages
139
- return code.split('\n').map(line => {
140
- // Highlight comments
141
- let highlighted = line.replace(/(#.*$)/gm, (match) => colors.dim(match));
142
- // Highlight strings
143
- highlighted = highlighted.replace(/(['"])((?:\\.|(?!\1)[^\\])*?)\1/g, (match) => colors.green(match));
144
- return highlighted;
145
- }).join('\n');
43
+ // Basic keyword highlighting (minimal implementation)
44
+ const keywords = {
45
+ typescript: [
46
+ /\b(const|let|var|function|class|interface|type|enum|import|export|async|await|return|if|else|for|while|try|catch|throw)\b/g,
47
+ /\b(true|false|null|undefined)\b/g,
48
+ /(["'`])(?:(?=(\\?))\2.)*?\1/g, // Strings
49
+ /\/\/.*$/gm, // Comments
50
+ /\/\*[\s\S]*?\*\//g, // Block comments
51
+ ],
52
+ javascript: [
53
+ /\b(const|let|var|function|class|async|await|return|if|else|for|while|try|catch|throw)\b/g,
54
+ /\b(true|false|null|undefined)\b/g,
55
+ /(["'`])(?:(?=(\\?))\2.)*?\1/g,
56
+ /\/\/.*$/gm,
57
+ /\/\*[\s\S]*?\*\//g,
58
+ ],
59
+ python: [
60
+ /\b(def|class|import|from|if|else|elif|for|while|try|except|return|True|False|None)\b/g,
61
+ /(["'`])(?:(?=(\\?))\2.)*?\1/g,
62
+ /#.*$/gm,
63
+ ],
64
+ };
65
+ const lang = language.toLowerCase();
66
+ const patterns = keywords[lang] || [];
67
+ let highlighted = code;
68
+ for (const pattern of patterns) {
69
+ highlighted = highlighted.replace(pattern, (match) => {
70
+ if (pattern.source.includes('string')) {
71
+ return colors.cyan(match);
72
+ }
73
+ else if (pattern.source.includes('comment')) {
74
+ return colors.gray(match);
75
+ }
76
+ else {
77
+ return colors.yellow(match);
78
+ }
79
+ });
146
80
  }
81
+ return highlighted;
147
82
  }
148
83
  /**
149
84
  * Format code block with syntax highlighting
150
85
  */
151
86
  export function formatCodeBlockWithHighlight(code, language, filepath) {
152
- const detectedLang = filepath ? detectLanguage(filepath) : (language || 'text');
153
- const highlighted = highlightCode(code, detectedLang);
154
- const lines = highlighted.split('\n');
155
- const maxWidth = process.stdout.columns || 80;
156
- const indent = ' ';
157
- let output = colors.dim('┌─ Code');
158
- if (detectedLang !== 'text') {
159
- output += colors.dim(` (${detectedLang})`);
160
- }
161
- output += colors.dim(' ─'.repeat(Math.max(0, Math.floor((maxWidth - 20) / 2))) + '┐\n');
162
- for (const line of lines) {
163
- // Truncate very long lines
164
- const displayLine = line.length > maxWidth - 10
165
- ? line.substring(0, maxWidth - 13) + '...'
166
- : line;
167
- output += indent + displayLine + '\n';
168
- }
169
- output += colors.dim('└' + '─'.repeat(Math.max(0, maxWidth - 4)) + '┘');
170
- return output;
87
+ const lang = language || (filepath ? detectLanguage(filepath) : 'text');
88
+ const highlighted = highlightCode(code, lang);
89
+ return `\n${colors.dim('```' + lang)}\n${highlighted}\n${colors.dim('```')}\n`;
171
90
  }
172
91
  //# sourceMappingURL=syntax-highlighter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"syntax-highlighter.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/syntax-highlighter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAarC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAE3D,MAAM,WAAW,GAAsC;QACrD,IAAI,EAAE,YAAY;QAClB,KAAK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E,CAAC;QAC/B,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACnD,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACtC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC;iBAAM,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC9C,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC;iBAAM,CAAC;gBACN,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAAY,EAAE,QAAiB,EAAE,QAAiB;IAC7F,MAAM,IAAI,GAAG,QAAQ,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxE,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAE9C,OAAO,KAAK,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,WAAW,KAAK,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;AACjF,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Agent Feedback
3
+ * Records and manages feedback about agent operations
4
+ *
5
+ * Phase 1: v0.5.0-alpha.0
6
+ */
7
+ export interface FeedbackRecord {
8
+ runId: string;
9
+ agentName: string;
10
+ operation: string;
11
+ query?: string;
12
+ outcome: 'success' | 'failure' | 'cancelled' | 'partial';
13
+ userAction?: 'approved' | 'rejected' | 'not_required' | 'cancelled';
14
+ filesChanged?: string[];
15
+ filesCreated?: string[];
16
+ filesDeleted?: string[];
17
+ errors?: string[];
18
+ warnings?: string[];
19
+ validationChecks?: any[];
20
+ metrics?: Record<string, any>;
21
+ timestamp?: number;
22
+ }
23
+ /**
24
+ * Agent Feedback Manager
25
+ */
26
+ declare class AgentFeedbackManager {
27
+ private feedbackRecords;
28
+ private readonly maxRecords;
29
+ /**
30
+ * Record feedback for an agent operation
31
+ */
32
+ recordFeedback(feedback: FeedbackRecord): void;
33
+ /**
34
+ * Get feedback records for an agent
35
+ */
36
+ getFeedbackForAgent(agentName: string, limit?: number): FeedbackRecord[];
37
+ /**
38
+ * Get all feedback records
39
+ */
40
+ getAllFeedback(limit?: number): FeedbackRecord[];
41
+ }
42
+ export declare const agentFeedbackManager: AgentFeedbackManager;
43
+ /**
44
+ * AgentFeedback class (kept for backward compatibility)
45
+ */
46
+ export declare class AgentFeedback {
47
+ data: FeedbackRecord;
48
+ constructor(data: FeedbackRecord);
49
+ }
50
+ export {};
51
+ //# sourceMappingURL=agent-feedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-feedback.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-feedback.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IACzD,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,WAAW,CAAC;IACpE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,cAAM,oBAAoB;IACxB,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IAEnC;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAiB9C;;OAEG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,cAAc,EAAE;IAO5E;;OAEG;IACH,cAAc,CAAC,KAAK,GAAE,MAAY,GAAG,cAAc,EAAE;CAGtD;AAED,eAAO,MAAM,oBAAoB,sBAA6B,CAAC;AAE/D;;GAEG;AACH,qBAAa,aAAa;IACL,IAAI,EAAE,cAAc;gBAApB,IAAI,EAAE,cAAc;CACxC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Agent Feedback
3
+ * Records and manages feedback about agent operations
4
+ *
5
+ * Phase 1: v0.5.0-alpha.0
6
+ */
7
+ /**
8
+ * Agent Feedback Manager
9
+ */
10
+ class AgentFeedbackManager {
11
+ feedbackRecords = [];
12
+ maxRecords = 1000;
13
+ /**
14
+ * Record feedback for an agent operation
15
+ */
16
+ recordFeedback(feedback) {
17
+ const record = {
18
+ ...feedback,
19
+ timestamp: feedback.timestamp || Date.now(),
20
+ };
21
+ this.feedbackRecords.push(record);
22
+ // Trim old records if too many
23
+ if (this.feedbackRecords.length > this.maxRecords) {
24
+ this.feedbackRecords = this.feedbackRecords.slice(-this.maxRecords);
25
+ }
26
+ // In alpha, feedback is stored in memory only
27
+ // Can be enhanced later to persist to disk
28
+ }
29
+ /**
30
+ * Get feedback records for an agent
31
+ */
32
+ getFeedbackForAgent(agentName, limit = 10) {
33
+ return this.feedbackRecords
34
+ .filter(r => r.agentName === agentName)
35
+ .slice(-limit)
36
+ .reverse();
37
+ }
38
+ /**
39
+ * Get all feedback records
40
+ */
41
+ getAllFeedback(limit = 100) {
42
+ return this.feedbackRecords.slice(-limit).reverse();
43
+ }
44
+ }
45
+ export const agentFeedbackManager = new AgentFeedbackManager();
46
+ /**
47
+ * AgentFeedback class (kept for backward compatibility)
48
+ */
49
+ export class AgentFeedback {
50
+ data;
51
+ constructor(data) {
52
+ this.data = data;
53
+ }
54
+ }
55
+ //# sourceMappingURL=agent-feedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-feedback.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-feedback.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmBH;;GAEG;AACH,MAAM,oBAAoB;IAChB,eAAe,GAAqB,EAAE,CAAC;IAC9B,UAAU,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,cAAc,CAAC,QAAwB;QACrC,MAAM,MAAM,GAAmB;YAC7B,GAAG,QAAQ;YACX,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE;SAC5C,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAElC,+BAA+B;QAC/B,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAClD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtE,CAAC;QAED,8CAA8C;QAC9C,2CAA2C;IAC7C,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,SAAiB,EAAE,QAAgB,EAAE;QACvD,OAAO,IAAI,CAAC,eAAe;aACxB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;aACtC,KAAK,CAAC,CAAC,KAAK,CAAC;aACb,OAAO,EAAE,CAAC;IACf,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,QAAgB,GAAG;QAChC,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IACtD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAE/D;;GAEG;AACH,MAAM,OAAO,aAAa;IACL;IAAnB,YAAmB,IAAoB;QAApB,SAAI,GAAJ,IAAI,CAAgB;IAAG,CAAC;CAC5C"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Agent Validation Helper
3
+ * Validates agent outputs and checks trust scores
4
+ *
5
+ * Phase 1: v0.5.0-alpha.0
6
+ */
7
+ import { TraceSummary } from './trace-summary.js';
8
+ export interface ValidationResult {
9
+ passed: boolean;
10
+ issues?: string[];
11
+ warnings?: string[];
12
+ score?: number;
13
+ summary?: TraceSummary;
14
+ feedbackId?: string | null;
15
+ runId?: string | null;
16
+ }
17
+ export interface TrustCheckResult {
18
+ passed: boolean;
19
+ trustScore?: number;
20
+ threshold?: number;
21
+ message?: string;
22
+ }
23
+ export interface ValidationContext {
24
+ agentName: string;
25
+ operation: string;
26
+ startTime: number;
27
+ metadata?: Record<string, any>;
28
+ }
29
+ export interface TraceData {
30
+ operationType: string;
31
+ operationName: string;
32
+ input?: any;
33
+ output?: any;
34
+ error?: Error;
35
+ metadata?: Record<string, any>;
36
+ }
37
+ /**
38
+ * Agent validation helper
39
+ */
40
+ export declare const agentValidationHelper: {
41
+ /**
42
+ * Start an agent operation and return validation context
43
+ */
44
+ startAgentOperation(agentName: string, operation: string, metadata?: Record<string, any>): ValidationContext;
45
+ /**
46
+ * Complete an agent operation and return validation result
47
+ */
48
+ completeAgentOperation(context: ValidationContext, result: Record<string, any> | null, options?: {
49
+ outcome?: "success" | "failure" | "partial_success";
50
+ validationChecks?: Array<{
51
+ check: string;
52
+ passed: boolean;
53
+ message?: string;
54
+ }>;
55
+ filesChanged?: string[];
56
+ filesCreated?: string[];
57
+ filesDeleted?: string[];
58
+ errors?: any[];
59
+ warnings?: any[];
60
+ [key: string]: any;
61
+ }): Promise<ValidationResult>;
62
+ /**
63
+ * Trace an operation step
64
+ */
65
+ trace(data: TraceData): void;
66
+ /**
67
+ * Validate agent output
68
+ */
69
+ validate(output: any, context?: any): ValidationResult;
70
+ /**
71
+ * Check trust score for an agent
72
+ */
73
+ checkTrust(agentName: string, operation: string): TrustCheckResult;
74
+ };
75
+ //# sourceMappingURL=agent-validation-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-validation-helper.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-validation-helper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAyB,MAAM,oBAAoB,CAAC;AAIzE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACh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5
+ * Phase 1: v0.5.0-alpha.0
6
+ */
7
+ import { TraceSummary } from './trace-summary.js';
8
+ import { executionTracer } from '../observability/execution-tracer.js';
9
+ import { randomUUID } from 'crypto';
10
+ /**
11
+ * Agent validation helper
12
+ */
13
+ export const agentValidationHelper = {
14
+ /**
15
+ * Start an agent operation and return validation context
16
+ */
17
+ startAgentOperation(agentName, operation, metadata) {
18
+ return {
19
+ agentName,
20
+ operation,
21
+ startTime: Date.now(),
22
+ metadata,
23
+ };
24
+ },
25
+ /**
26
+ * Complete an agent operation and return validation result
27
+ */
28
+ async completeAgentOperation(context, result, options) {
29
+ const endTime = Date.now();
30
+ const duration = endTime - context.startTime;
31
+ const opts = options || {};
32
+ // Basic validation
33
+ const issues = [];
34
+ const warnings = [];
35
+ // Check validation checks
36
+ if (opts.validationChecks) {
37
+ for (const check of opts.validationChecks) {
38
+ if (!check.passed) {
39
+ issues.push(check.message || check.check);
40
+ }
41
+ }
42
+ }
43
+ // Check errors
44
+ if (opts.errors && opts.errors.length > 0) {
45
+ issues.push(...opts.errors.map((e) => typeof e === 'string' ? e : e.message || String(e)));
46
+ }
47
+ // Check warnings
48
+ if (opts.warnings && opts.warnings.length > 0) {
49
+ warnings.push(...opts.warnings.map((w) => typeof w === 'string' ? w : w.message || String(w)));
50
+ }
51
+ // Check outcome
52
+ if (opts.outcome === 'failure') {
53
+ issues.push('Operation failed');
54
+ }
55
+ else if (opts.outcome === 'partial_success') {
56
+ warnings.push('Operation partially succeeded');
57
+ }
58
+ // Check overallSuccess in result
59
+ if (result && result.overallSuccess === false) {
60
+ issues.push('Overall operation was not successful');
61
+ }
62
+ // Get runId from execution tracer
63
+ const runId = executionTracer.getCurrentRunId();
64
+ // Generate feedbackId
65
+ const feedbackId = randomUUID();
66
+ // Collect files affected
67
+ const filesAffected = [];
68
+ if (opts.filesChanged)
69
+ filesAffected.push(...opts.filesChanged);
70
+ if (opts.filesCreated)
71
+ filesAffected.push(...opts.filesCreated);
72
+ if (opts.filesDeleted)
73
+ filesAffected.push(...opts.filesDeleted);
74
+ // Create trace summary
75
+ const summaryData = {
76
+ runId: runId || `run-${Date.now()}`,
77
+ agentName: context.agentName,
78
+ operation: context.operation,
79
+ startTime: context.startTime,
80
+ endTime,
81
+ success: issues.length === 0,
82
+ filesAffected: filesAffected.length > 0 ? filesAffected : undefined,
83
+ error: issues.length > 0 ? issues.join('; ') : undefined,
84
+ metadata: {
85
+ ...context.metadata,
86
+ duration,
87
+ validationChecks: opts.validationChecks?.length || 0,
88
+ },
89
+ };
90
+ const summary = new TraceSummary(summaryData);
91
+ return {
92
+ passed: issues.length === 0,
93
+ issues: issues.length > 0 ? issues : undefined,
94
+ warnings: warnings.length > 0 ? warnings : undefined,
95
+ score: issues.length === 0 ? 1.0 : Math.max(0, 1.0 - (issues.length * 0.2)),
96
+ summary,
97
+ feedbackId,
98
+ runId,
99
+ };
100
+ },
101
+ /**
102
+ * Trace an operation step
103
+ */
104
+ trace(data) {
105
+ // In alpha, tracing is a no-op
106
+ // Can be enhanced later to log to execution tracer
107
+ },
108
+ /**
109
+ * Validate agent output
110
+ */
111
+ validate(output, context) {
112
+ // Basic validation - can be enhanced later
113
+ if (!output) {
114
+ return {
115
+ passed: false,
116
+ issues: ['Output is empty'],
117
+ };
118
+ }
119
+ return {
120
+ passed: true,
121
+ score: 1.0,
122
+ };
123
+ },
124
+ /**
125
+ * Check trust score for an agent
126
+ */
127
+ checkTrust(agentName, operation) {
128
+ // In alpha, default to passing
129
+ // Can be enhanced later with actual trust score tracking
130
+ return {
131
+ passed: true,
132
+ trustScore: 1.0,
133
+ threshold: 0.7,
134
+ };
135
+ },
136
+ };
137
+ //# sourceMappingURL=agent-validation-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-validation-helper.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-validation-helper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAyB,MAAM,oBAAoB,CAAC;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