codehere 0.3.0 → 0.5.0-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +329 -65
  3. package/dist/application/agents/documentation-agent.d.ts +24 -0
  4. package/dist/application/agents/documentation-agent.d.ts.map +1 -0
  5. package/dist/application/agents/documentation-agent.js +399 -0
  6. package/dist/application/agents/documentation-agent.js.map +1 -0
  7. package/dist/application/agents/execution-agent.d.ts +11 -0
  8. package/dist/application/agents/execution-agent.d.ts.map +1 -1
  9. package/dist/application/agents/execution-agent.js +289 -80
  10. package/dist/application/agents/execution-agent.js.map +1 -1
  11. package/dist/application/agents/multi-agent-orchestrator.d.ts +4 -0
  12. package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
  13. package/dist/application/agents/multi-agent-orchestrator.js +95 -2
  14. package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
  15. package/dist/application/agents/planning-agent.d.ts +3 -0
  16. package/dist/application/agents/planning-agent.d.ts.map +1 -1
  17. package/dist/application/agents/planning-agent.js +151 -71
  18. package/dist/application/agents/planning-agent.js.map +1 -1
  19. package/dist/application/agents/product-requirements-agent.d.ts +21 -0
  20. package/dist/application/agents/product-requirements-agent.d.ts.map +1 -0
  21. package/dist/application/agents/product-requirements-agent.js +247 -0
  22. package/dist/application/agents/product-requirements-agent.js.map +1 -0
  23. package/dist/application/agents/validation-agent.d.ts +5 -1
  24. package/dist/application/agents/validation-agent.d.ts.map +1 -1
  25. package/dist/application/agents/validation-agent.js +156 -21
  26. package/dist/application/agents/validation-agent.js.map +1 -1
  27. package/dist/application/reasoning/multi-model-planning-strategy.d.ts +21 -0
  28. package/dist/application/reasoning/multi-model-planning-strategy.d.ts.map +1 -0
  29. package/dist/application/reasoning/multi-model-planning-strategy.js +158 -0
  30. package/dist/application/reasoning/multi-model-planning-strategy.js.map +1 -0
  31. package/dist/application/reasoning/reasoning-config.d.ts +15 -0
  32. package/dist/application/reasoning/reasoning-config.d.ts.map +1 -0
  33. package/dist/application/reasoning/reasoning-config.js +50 -0
  34. package/dist/application/reasoning/reasoning-config.js.map +1 -0
  35. package/dist/application/reasoning/reasoning-orchestrator.d.ts +18 -0
  36. package/dist/application/reasoning/reasoning-orchestrator.d.ts.map +1 -0
  37. package/dist/application/reasoning/reasoning-orchestrator.js +170 -0
  38. package/dist/application/reasoning/reasoning-orchestrator.js.map +1 -0
  39. package/dist/application/reasoning/reasoning-strategy.interface.d.ts +24 -0
  40. package/dist/application/reasoning/reasoning-strategy.interface.d.ts.map +1 -0
  41. package/dist/application/reasoning/reasoning-strategy.interface.js +6 -0
  42. package/dist/application/reasoning/reasoning-strategy.interface.js.map +1 -0
  43. package/dist/application/reasoning/role-provider-resolver.d.ts +36 -0
  44. package/dist/application/reasoning/role-provider-resolver.d.ts.map +1 -0
  45. package/dist/application/reasoning/role-provider-resolver.js +74 -0
  46. package/dist/application/reasoning/role-provider-resolver.js.map +1 -0
  47. package/dist/application/reasoning/simple-planning-strategy.d.ts +22 -0
  48. package/dist/application/reasoning/simple-planning-strategy.d.ts.map +1 -0
  49. package/dist/application/reasoning/simple-planning-strategy.js +217 -0
  50. package/dist/application/reasoning/simple-planning-strategy.js.map +1 -0
  51. package/dist/application/reasoning/types.d.ts +65 -0
  52. package/dist/application/reasoning/types.d.ts.map +1 -0
  53. package/dist/application/reasoning/types.js +6 -0
  54. package/dist/application/reasoning/types.js.map +1 -0
  55. package/dist/application/reasoning/validator-strategy.d.ts +56 -0
  56. package/dist/application/reasoning/validator-strategy.d.ts.map +1 -0
  57. package/dist/application/reasoning/validator-strategy.js +103 -0
  58. package/dist/application/reasoning/validator-strategy.js.map +1 -0
  59. package/dist/application/services/dependency-container.d.ts +46 -2
  60. package/dist/application/services/dependency-container.d.ts.map +1 -1
  61. package/dist/application/services/dependency-container.js +198 -8
  62. package/dist/application/services/dependency-container.js.map +1 -1
  63. package/dist/application/services/intelligent-router.d.ts +19 -0
  64. package/dist/application/services/intelligent-router.d.ts.map +1 -1
  65. package/dist/application/services/intelligent-router.js +393 -91
  66. package/dist/application/services/intelligent-router.js.map +1 -1
  67. package/dist/application/use-cases/ask-question-use-case.d.ts +20 -0
  68. package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
  69. package/dist/application/use-cases/ask-question-use-case.js +129 -49
  70. package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
  71. package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -1
  72. package/dist/application/use-cases/edit-file-use-case.js +16 -1
  73. package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
  74. package/dist/application/use-cases/planning-use-case.d.ts +14 -1
  75. package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
  76. package/dist/application/use-cases/planning-use-case.js +109 -2
  77. package/dist/application/use-cases/planning-use-case.js.map +1 -1
  78. package/dist/domain/entities/documentation.d.ts +35 -0
  79. package/dist/domain/entities/documentation.d.ts.map +1 -0
  80. package/dist/domain/entities/documentation.js +6 -0
  81. package/dist/domain/entities/documentation.js.map +1 -0
  82. package/dist/domain/entities/memory.d.ts.map +1 -1
  83. package/dist/domain/entities/product-requirements.d.ts +50 -0
  84. package/dist/domain/entities/product-requirements.d.ts.map +1 -0
  85. package/dist/domain/entities/product-requirements.js +6 -0
  86. package/dist/domain/entities/product-requirements.js.map +1 -0
  87. package/dist/domain/entities/task.d.ts +152 -0
  88. package/dist/domain/entities/task.d.ts.map +1 -0
  89. package/dist/domain/entities/task.js +61 -0
  90. package/dist/domain/entities/task.js.map +1 -0
  91. package/dist/domain/errors/embeddings-not-found-error.d.ts +9 -0
  92. package/dist/domain/errors/embeddings-not-found-error.d.ts.map +1 -0
  93. package/dist/domain/errors/embeddings-not-found-error.js +13 -0
  94. package/dist/domain/errors/embeddings-not-found-error.js.map +1 -0
  95. package/dist/domain/interfaces/agent.interface.d.ts +15 -0
  96. package/dist/domain/interfaces/agent.interface.d.ts.map +1 -0
  97. package/dist/domain/interfaces/agent.interface.js +6 -0
  98. package/dist/domain/interfaces/agent.interface.js.map +1 -0
  99. package/dist/domain/interfaces/embedding-repository.interface.d.ts +5 -0
  100. package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -1
  101. package/dist/domain/services/environment-mode-manager.d.ts +12 -0
  102. package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
  103. package/dist/domain/services/environment-mode-manager.js +22 -0
  104. package/dist/domain/services/environment-mode-manager.js.map +1 -0
  105. package/dist/domain/services/query-intent-classifier.d.ts.map +1 -1
  106. package/dist/domain/services/query-intent-classifier.js +20 -1
  107. package/dist/domain/services/query-intent-classifier.js.map +1 -1
  108. package/dist/domain/services/risk-tier-detector.d.ts +17 -0
  109. package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
  110. package/dist/domain/services/risk-tier-detector.js +78 -0
  111. package/dist/domain/services/risk-tier-detector.js.map +1 -0
  112. package/dist/embed.d.ts.map +1 -1
  113. package/dist/embed.js +18 -8
  114. package/dist/embed.js.map +1 -1
  115. package/dist/formatter.d.ts.map +1 -1
  116. package/dist/formatter.js +10 -3
  117. package/dist/formatter.js.map +1 -1
  118. package/dist/index.js +494 -167
  119. package/dist/index.js.map +1 -1
  120. package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
  121. package/dist/infrastructure/ai/cohere-ai-service.js +19 -6
  122. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
  123. package/dist/infrastructure/ai/fake-ai-service.d.ts +22 -0
  124. package/dist/infrastructure/ai/fake-ai-service.d.ts.map +1 -0
  125. package/dist/infrastructure/ai/fake-ai-service.js +59 -0
  126. package/dist/infrastructure/ai/fake-ai-service.js.map +1 -0
  127. package/dist/infrastructure/ai/provider-ai-service.d.ts +59 -0
  128. package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -0
  129. package/dist/infrastructure/ai/provider-ai-service.js +477 -0
  130. package/dist/infrastructure/ai/provider-ai-service.js.map +1 -0
  131. package/dist/infrastructure/cache/embedding-cache.d.ts +13 -1
  132. package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -1
  133. package/dist/infrastructure/cache/embedding-cache.js +80 -9
  134. package/dist/infrastructure/cache/embedding-cache.js.map +1 -1
  135. package/dist/infrastructure/cache/query-result-cache.d.ts +14 -55
  136. package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -1
  137. package/dist/infrastructure/cache/query-result-cache.js +40 -112
  138. package/dist/infrastructure/cache/query-result-cache.js.map +1 -1
  139. package/dist/infrastructure/cache/response-cache.d.ts +18 -0
  140. package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
  141. package/dist/infrastructure/cache/response-cache.js +48 -0
  142. package/dist/infrastructure/cache/response-cache.js.map +1 -0
  143. package/dist/infrastructure/cache/security-scan-cache.d.ts +8 -49
  144. package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -1
  145. package/dist/infrastructure/cache/security-scan-cache.js +25 -102
  146. package/dist/infrastructure/cache/security-scan-cache.js.map +1 -1
  147. package/dist/infrastructure/completion/bash-completion.d.ts +2 -3
  148. package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -1
  149. package/dist/infrastructure/completion/bash-completion.js +11 -87
  150. package/dist/infrastructure/completion/bash-completion.js.map +1 -1
  151. package/dist/infrastructure/completion/fish-completion.d.ts +2 -3
  152. package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -1
  153. package/dist/infrastructure/completion/fish-completion.js +15 -58
  154. package/dist/infrastructure/completion/fish-completion.js.map +1 -1
  155. package/dist/infrastructure/completion/zsh-completion.d.ts +2 -3
  156. package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -1
  157. package/dist/infrastructure/completion/zsh-completion.js +18 -73
  158. package/dist/infrastructure/completion/zsh-completion.js.map +1 -1
  159. package/dist/infrastructure/config/config-manager.d.ts +10 -0
  160. package/dist/infrastructure/config/config-manager.d.ts.map +1 -1
  161. package/dist/infrastructure/config/config-manager.js +13 -2
  162. package/dist/infrastructure/config/config-manager.js.map +1 -1
  163. package/dist/infrastructure/context/conversation-context.d.ts +54 -0
  164. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
  165. package/dist/infrastructure/context/conversation-context.js +129 -0
  166. package/dist/infrastructure/context/conversation-context.js.map +1 -0
  167. package/dist/infrastructure/context/session-manager.d.ts +42 -0
  168. package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
  169. package/dist/infrastructure/context/session-manager.js +94 -0
  170. package/dist/infrastructure/context/session-manager.js.map +1 -0
  171. package/dist/infrastructure/cost/cost-tracker.d.ts +1 -0
  172. package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
  173. package/dist/infrastructure/cost/cost-tracker.js +12 -5
  174. package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
  175. package/dist/infrastructure/governance/nist-ai-rmf.d.ts +6 -8
  176. package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -1
  177. package/dist/infrastructure/governance/nist-ai-rmf.js +6 -8
  178. package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -1
  179. package/dist/infrastructure/governance/policy-as-code.d.ts +6 -8
  180. package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -1
  181. package/dist/infrastructure/governance/policy-as-code.js +6 -8
  182. package/dist/infrastructure/governance/policy-as-code.js.map +1 -1
  183. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +7 -9
  184. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -1
  185. package/dist/infrastructure/governance/prompt-to-code-lineage.js +7 -9
  186. package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -1
  187. package/dist/infrastructure/protocols/a2a-metadata.js +1 -1
  188. package/dist/infrastructure/protocols/mcp-oauth.js +1 -1
  189. package/dist/infrastructure/providers/cohere-provider.d.ts +39 -0
  190. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -0
  191. package/dist/infrastructure/providers/cohere-provider.js +444 -0
  192. package/dist/infrastructure/providers/cohere-provider.js.map +1 -0
  193. package/dist/infrastructure/providers/fake-provider.d.ts +43 -0
  194. package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -0
  195. package/dist/infrastructure/providers/fake-provider.js +130 -0
  196. package/dist/infrastructure/providers/fake-provider.js.map +1 -0
  197. package/dist/infrastructure/providers/local-llm-provider.d.ts +49 -0
  198. package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -0
  199. package/dist/infrastructure/providers/local-llm-provider.js +330 -0
  200. package/dist/infrastructure/providers/local-llm-provider.js.map +1 -0
  201. package/dist/infrastructure/providers/model-config.types.d.ts +70 -0
  202. package/dist/infrastructure/providers/model-config.types.d.ts.map +1 -0
  203. package/dist/infrastructure/providers/model-config.types.js +9 -0
  204. package/dist/infrastructure/providers/model-config.types.js.map +1 -0
  205. package/dist/infrastructure/providers/model-provider.interface.d.ts +113 -0
  206. package/dist/infrastructure/providers/model-provider.interface.d.ts.map +1 -0
  207. package/dist/infrastructure/providers/model-provider.interface.js +8 -0
  208. package/dist/infrastructure/providers/model-provider.interface.js.map +1 -0
  209. package/dist/infrastructure/providers/openai-provider.d.ts +38 -0
  210. package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -0
  211. package/dist/infrastructure/providers/openai-provider.js +413 -0
  212. package/dist/infrastructure/providers/openai-provider.js.map +1 -0
  213. package/dist/infrastructure/providers/openrouter-provider.d.ts +42 -0
  214. package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -0
  215. package/dist/infrastructure/providers/openrouter-provider.js +401 -0
  216. package/dist/infrastructure/providers/openrouter-provider.js.map +1 -0
  217. package/dist/infrastructure/providers/operation-provider-resolver.d.ts +48 -0
  218. package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
  219. package/dist/infrastructure/providers/operation-provider-resolver.js +131 -0
  220. package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -0
  221. package/dist/infrastructure/providers/provider-config-loader.d.ts +37 -0
  222. package/dist/infrastructure/providers/provider-config-loader.d.ts.map +1 -0
  223. package/dist/infrastructure/providers/provider-config-loader.js +120 -0
  224. package/dist/infrastructure/providers/provider-config-loader.js.map +1 -0
  225. package/dist/infrastructure/providers/provider-registry.d.ts +53 -0
  226. package/dist/infrastructure/providers/provider-registry.d.ts.map +1 -0
  227. package/dist/infrastructure/providers/provider-registry.js +88 -0
  228. package/dist/infrastructure/providers/provider-registry.js.map +1 -0
  229. package/dist/infrastructure/security/input-validator.d.ts.map +1 -1
  230. package/dist/infrastructure/security/input-validator.js +19 -6
  231. package/dist/infrastructure/security/input-validator.js.map +1 -1
  232. package/dist/infrastructure/serialization/toon-serializer.d.ts +45 -0
  233. package/dist/infrastructure/serialization/toon-serializer.d.ts.map +1 -0
  234. package/dist/infrastructure/serialization/toon-serializer.js +119 -0
  235. package/dist/infrastructure/serialization/toon-serializer.js.map +1 -0
  236. package/dist/infrastructure/storage/embeddings-path.d.ts +18 -0
  237. package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -0
  238. package/dist/infrastructure/storage/embeddings-path.js +37 -0
  239. package/dist/infrastructure/storage/embeddings-path.js.map +1 -0
  240. package/dist/infrastructure/storage/plan-repository.d.ts +2 -0
  241. package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
  242. package/dist/infrastructure/storage/plan-repository.js +36 -73
  243. package/dist/infrastructure/storage/plan-repository.js.map +1 -1
  244. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +10 -1
  245. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
  246. package/dist/infrastructure/storage/sqlite-embedding-repository.js +37 -3
  247. package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
  248. package/dist/infrastructure/storage/task-helpers.d.ts +69 -0
  249. package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
  250. package/dist/infrastructure/storage/task-helpers.js +197 -0
  251. package/dist/infrastructure/storage/task-helpers.js.map +1 -0
  252. package/dist/infrastructure/storage/task-repository.d.ts +68 -0
  253. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
  254. package/dist/infrastructure/storage/task-repository.js +216 -0
  255. package/dist/infrastructure/storage/task-repository.js.map +1 -0
  256. package/dist/infrastructure/telemetry/telemetry-service.d.ts +74 -0
  257. package/dist/infrastructure/telemetry/telemetry-service.d.ts.map +1 -0
  258. package/dist/infrastructure/telemetry/telemetry-service.js +167 -0
  259. package/dist/infrastructure/telemetry/telemetry-service.js.map +1 -0
  260. package/dist/infrastructure/ux/bi-directional-learning.d.ts +22 -0
  261. package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -1
  262. package/dist/infrastructure/ux/bi-directional-learning.js +144 -7
  263. package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -1
  264. package/dist/infrastructure/ux/capability-boundaries.d.ts +22 -0
  265. package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
  266. package/dist/infrastructure/ux/capability-boundaries.js +42 -0
  267. package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
  268. package/dist/infrastructure/ux/comprehensive-formatter.d.ts +21 -0
  269. package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
  270. package/dist/infrastructure/ux/comprehensive-formatter.js +117 -0
  271. package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
  272. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +5 -18
  273. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -1
  274. package/dist/infrastructure/ux/contextual-feature-discovery.js +5 -139
  275. package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -1
  276. package/dist/infrastructure/ux/feature-discovery.d.ts +3 -33
  277. package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -1
  278. package/dist/infrastructure/ux/feature-discovery.js +5 -181
  279. package/dist/infrastructure/ux/feature-discovery.js.map +1 -1
  280. package/dist/infrastructure/ux/feedback-prompt.d.ts +26 -0
  281. package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
  282. package/dist/infrastructure/ux/feedback-prompt.js +45 -0
  283. package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
  284. package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -1
  285. package/dist/infrastructure/ux/hitl-review-portal.js +4 -1
  286. package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -1
  287. package/dist/infrastructure/ux/hitl-validation.d.ts +35 -0
  288. package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -1
  289. package/dist/infrastructure/ux/hitl-validation.js +86 -0
  290. package/dist/infrastructure/ux/hitl-validation.js.map +1 -1
  291. package/dist/infrastructure/ux/progress-indicator.d.ts +5 -6
  292. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
  293. package/dist/infrastructure/ux/progress-indicator.js +36 -41
  294. package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
  295. package/dist/infrastructure/ux/proportional-friction.d.ts +73 -0
  296. package/dist/infrastructure/ux/proportional-friction.d.ts.map +1 -0
  297. package/dist/infrastructure/ux/proportional-friction.js +200 -0
  298. package/dist/infrastructure/ux/proportional-friction.js.map +1 -0
  299. package/dist/infrastructure/ux/review-checkpoint.d.ts +3 -1
  300. package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -1
  301. package/dist/infrastructure/ux/review-checkpoint.js +33 -80
  302. package/dist/infrastructure/ux/review-checkpoint.js.map +1 -1
  303. package/dist/infrastructure/ux/staged-feature-intro.d.ts +14 -39
  304. package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -1
  305. package/dist/infrastructure/ux/staged-feature-intro.js +12 -132
  306. package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -1
  307. package/dist/infrastructure/ux/syntax-highlighter.d.ts +1 -2
  308. package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -1
  309. package/dist/infrastructure/ux/syntax-highlighter.js +67 -148
  310. package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -1
  311. package/dist/infrastructure/validation/agent-feedback.d.ts +51 -0
  312. package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
  313. package/dist/infrastructure/validation/agent-feedback.js +55 -0
  314. package/dist/infrastructure/validation/agent-feedback.js.map +1 -0
  315. package/dist/infrastructure/validation/agent-validation-helper.d.ts +75 -0
  316. package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -0
  317. package/dist/infrastructure/validation/agent-validation-helper.js +137 -0
  318. package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -0
  319. package/dist/infrastructure/validation/feedback-stats.d.ts +99 -0
  320. package/dist/infrastructure/validation/feedback-stats.d.ts.map +1 -0
  321. package/dist/infrastructure/validation/feedback-stats.js +173 -0
  322. package/dist/infrastructure/validation/feedback-stats.js.map +1 -0
  323. package/dist/infrastructure/validation/review-handler.d.ts +26 -0
  324. package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
  325. package/dist/infrastructure/validation/review-handler.js +40 -0
  326. package/dist/infrastructure/validation/review-handler.js.map +1 -0
  327. package/dist/infrastructure/validation/summary-aggregator.d.ts +45 -0
  328. package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
  329. package/dist/infrastructure/validation/summary-aggregator.js +70 -0
  330. package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
  331. package/dist/infrastructure/validation/summary-extractor.d.ts +24 -0
  332. package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
  333. package/dist/infrastructure/validation/summary-extractor.js +45 -0
  334. package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
  335. package/dist/infrastructure/validation/trace-summary.d.ts +45 -0
  336. package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
  337. package/dist/infrastructure/validation/trace-summary.js +52 -0
  338. package/dist/infrastructure/validation/trace-summary.js.map +1 -0
  339. package/dist/infrastructure/validation/trust-config.d.ts +27 -0
  340. package/dist/infrastructure/validation/trust-config.d.ts.map +1 -0
  341. package/dist/infrastructure/validation/trust-config.js +113 -0
  342. package/dist/infrastructure/validation/trust-config.js.map +1 -0
  343. package/dist/infrastructure/xai/attention-visualizer.d.ts +6 -8
  344. package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -1
  345. package/dist/infrastructure/xai/attention-visualizer.js +6 -8
  346. package/dist/infrastructure/xai/attention-visualizer.js.map +1 -1
  347. package/dist/infrastructure/xai/cot-visualizer.d.ts +6 -9
  348. package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
  349. package/dist/infrastructure/xai/cot-visualizer.js +6 -9
  350. package/dist/infrastructure/xai/cot-visualizer.js.map +1 -1
  351. package/dist/infrastructure/xai/decision-tree-log.d.ts +6 -10
  352. package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -1
  353. package/dist/infrastructure/xai/decision-tree-log.js +6 -10
  354. package/dist/infrastructure/xai/decision-tree-log.js.map +1 -1
  355. package/dist/infrastructure/xai/interactive-xai.d.ts +6 -8
  356. package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -1
  357. package/dist/infrastructure/xai/interactive-xai.js +6 -8
  358. package/dist/infrastructure/xai/interactive-xai.js.map +1 -1
  359. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +6 -9
  360. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -1
  361. package/dist/infrastructure/xai/uncertainty-quantifier.js +6 -9
  362. package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -1
  363. package/dist/monitoring.d.ts +1 -1
  364. package/dist/monitoring.d.ts.map +1 -1
  365. package/dist/monitoring.js +12 -9
  366. package/dist/monitoring.js.map +1 -1
  367. package/dist/parallel-processor.d.ts.map +1 -1
  368. package/dist/parallel-processor.js +124 -45
  369. package/dist/parallel-processor.js.map +1 -1
  370. package/dist/presentation/cli/commands/ask-command.d.ts +2 -0
  371. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  372. package/dist/presentation/cli/commands/ask-command.js +356 -87
  373. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  374. package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
  375. package/dist/presentation/cli/commands/config-command.js +22 -8
  376. package/dist/presentation/cli/commands/config-command.js.map +1 -1
  377. package/dist/presentation/cli/commands/decision-command.js +23 -6
  378. package/dist/presentation/cli/commands/decision-command.js.map +1 -1
  379. package/dist/presentation/cli/commands/docs-command.d.ts +14 -0
  380. package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
  381. package/dist/presentation/cli/commands/docs-command.js +25 -0
  382. package/dist/presentation/cli/commands/docs-command.js.map +1 -0
  383. package/dist/presentation/cli/commands/fix-command.d.ts +10 -0
  384. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
  385. package/dist/presentation/cli/commands/fix-command.js +94 -0
  386. package/dist/presentation/cli/commands/fix-command.js.map +1 -0
  387. package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
  388. package/dist/presentation/cli/commands/help-command.js +23 -1
  389. package/dist/presentation/cli/commands/help-command.js.map +1 -1
  390. package/dist/presentation/cli/commands/memory-command.d.ts +17 -0
  391. package/dist/presentation/cli/commands/memory-command.d.ts.map +1 -0
  392. package/dist/presentation/cli/commands/memory-command.js +252 -0
  393. package/dist/presentation/cli/commands/memory-command.js.map +1 -0
  394. package/dist/presentation/cli/commands/models-command.d.ts +13 -0
  395. package/dist/presentation/cli/commands/models-command.d.ts.map +1 -0
  396. package/dist/presentation/cli/commands/models-command.js +194 -0
  397. package/dist/presentation/cli/commands/models-command.js.map +1 -0
  398. package/dist/presentation/cli/commands/orchestrate-command.d.ts +2 -0
  399. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  400. package/dist/presentation/cli/commands/orchestrate-command.js +182 -14
  401. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  402. package/dist/presentation/cli/commands/plan-command.d.ts +2 -0
  403. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  404. package/dist/presentation/cli/commands/plan-command.js +212 -26
  405. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  406. package/dist/presentation/cli/commands/product-command.d.ts +14 -0
  407. package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
  408. package/dist/presentation/cli/commands/product-command.js +22 -0
  409. package/dist/presentation/cli/commands/product-command.js.map +1 -0
  410. package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
  411. package/dist/presentation/cli/commands/react-command.js +8 -2
  412. package/dist/presentation/cli/commands/react-command.js.map +1 -1
  413. package/dist/presentation/cli/commands/review-command.d.ts +14 -0
  414. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -0
  415. package/dist/presentation/cli/commands/review-command.js +173 -0
  416. package/dist/presentation/cli/commands/review-command.js.map +1 -0
  417. package/dist/presentation/cli/commands/run-command.d.ts +13 -0
  418. package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
  419. package/dist/presentation/cli/commands/run-command.js +188 -0
  420. package/dist/presentation/cli/commands/run-command.js.map +1 -0
  421. package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
  422. package/dist/presentation/cli/commands/setup-command.js +15 -0
  423. package/dist/presentation/cli/commands/setup-command.js.map +1 -1
  424. package/dist/presentation/cli/commands/smart-command.d.ts +3 -1
  425. package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
  426. package/dist/presentation/cli/commands/smart-command.js +165 -11
  427. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  428. package/dist/presentation/cli/commands/status-command.d.ts +14 -0
  429. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
  430. package/dist/presentation/cli/commands/status-command.js +171 -0
  431. package/dist/presentation/cli/commands/status-command.js.map +1 -0
  432. package/dist/presentation/cli/commands/suggest-command.d.ts +11 -0
  433. package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
  434. package/dist/presentation/cli/commands/suggest-command.js +138 -0
  435. package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
  436. package/dist/presentation/cli/error-display.d.ts.map +1 -1
  437. package/dist/presentation/cli/error-display.js +118 -17
  438. package/dist/presentation/cli/error-display.js.map +1 -1
  439. package/dist/search.d.ts.map +1 -1
  440. package/dist/search.js +6 -1
  441. package/dist/search.js.map +1 -1
  442. package/dist/session.d.ts +1 -0
  443. package/dist/session.d.ts.map +1 -1
  444. package/dist/session.js +69 -4
  445. package/dist/session.js.map +1 -1
  446. package/dist/tools/bash.d.ts.map +1 -1
  447. package/dist/tools/bash.js +3 -0
  448. package/dist/tools/bash.js.map +1 -1
  449. package/dist/tools/git-tool.js +7 -7
  450. package/dist/tools/git-tool.js.map +1 -1
  451. package/dist/ui.d.ts +11 -0
  452. package/dist/ui.d.ts.map +1 -1
  453. package/dist/ui.js +62 -6
  454. package/dist/ui.js.map +1 -1
  455. package/package.json +22 -4
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Multi-Model Planning Strategy
3
+ * Implements two-stage planning pipeline: planner + optional validator
4
+ */
5
+ import { SimplePlanningStrategy } from './simple-planning-strategy.js';
6
+ import { SimpleValidatorStrategy } from './validator-strategy.js';
7
+ import { RoleProviderResolver } from './role-provider-resolver.js';
8
+ import { ProviderAIService } from '../../infrastructure/ai/provider-ai-service.js';
9
+ import { randomUUID } from 'crypto';
10
+ /**
11
+ * Multi-model planning strategy
12
+ * Uses planner role for initial plan, validator role for validation (if configured)
13
+ */
14
+ export class MultiModelPlanningStrategy {
15
+ defaultAIService;
16
+ plannerStrategy;
17
+ validatorStrategy = null;
18
+ roleResolver;
19
+ constructor(defaultAIService, roleResolver) {
20
+ this.defaultAIService = defaultAIService;
21
+ this.roleResolver = roleResolver || new RoleProviderResolver();
22
+ // Create planner strategy with planner provider
23
+ const plannerProvider = this.roleResolver.resolveRoleProvider('planner');
24
+ const plannerAIService = new ProviderAIService(plannerProvider);
25
+ this.plannerStrategy = new SimplePlanningStrategy(plannerAIService);
26
+ // Create validator strategy if validator role is configured
27
+ if (this.roleResolver.isRoleConfigured('validator')) {
28
+ try {
29
+ const validatorProvider = this.roleResolver.resolveRoleProvider('validator');
30
+ const validatorAIService = new ProviderAIService(validatorProvider);
31
+ this.validatorStrategy = new SimpleValidatorStrategy(validatorAIService);
32
+ }
33
+ catch (error) {
34
+ // Validator provider resolution failed - continue without validator
35
+ console.warn('[MultiModelPlanningStrategy] Validator provider resolution failed, continuing without validator:', error instanceof Error ? error.message : String(error));
36
+ }
37
+ }
38
+ }
39
+ async executePlanning(context) {
40
+ const startTime = Date.now();
41
+ const traceId = randomUUID();
42
+ // Stage 1: Planner
43
+ const plannerStepId = randomUUID();
44
+ const plannerStartTime = Date.now();
45
+ // Resolve planner provider before execution
46
+ let plannerProvider;
47
+ try {
48
+ plannerProvider = this.roleResolver.resolveRoleProvider('planner');
49
+ }
50
+ catch (error) {
51
+ throw new Error(`Planner provider resolution failed: ${error instanceof Error ? error.message : String(error)}`);
52
+ }
53
+ let plannerResult;
54
+ try {
55
+ plannerResult = await this.plannerStrategy.executePlanning(context);
56
+ }
57
+ catch (error) {
58
+ // Planner failure - rethrow to trigger fallback
59
+ throw new Error(`Planner step failed: ${error instanceof Error ? error.message : String(error)}`);
60
+ }
61
+ const plannerDuration = Date.now() - plannerStartTime;
62
+ const plannerStep = {
63
+ id: plannerStepId,
64
+ role: 'planner',
65
+ input: context.goal,
66
+ output: JSON.stringify(plannerResult.plan),
67
+ timestamp: plannerStartTime,
68
+ duration: plannerDuration,
69
+ metadata: {
70
+ provider: plannerProvider.name,
71
+ providerId: plannerProvider.id,
72
+ },
73
+ };
74
+ // Stage 2: Validator (optional)
75
+ let validatedPlan = plannerResult.plan;
76
+ let validatorStep = null;
77
+ if (this.validatorStrategy) {
78
+ const validatorStepId = randomUUID();
79
+ const validatorStartTime = Date.now();
80
+ let validatorProvider = null;
81
+ try {
82
+ validatorProvider = this.roleResolver.resolveRoleProvider('validator');
83
+ }
84
+ catch (error) {
85
+ // Validator provider resolution failed - skip validation
86
+ console.warn('[MultiModelPlanningStrategy] Validator provider resolution failed, skipping validation:', error instanceof Error ? error.message : String(error));
87
+ }
88
+ if (validatorProvider) {
89
+ try {
90
+ const validationResult = await this.validatorStrategy.validatePlan(plannerResult.plan, {
91
+ goal: context.goal,
92
+ reflections: context.reflections,
93
+ memories: context.memories,
94
+ context: context.context,
95
+ });
96
+ validatedPlan = validationResult.plan;
97
+ const validatorDuration = Date.now() - validatorStartTime;
98
+ validatorStep = {
99
+ id: validatorStepId,
100
+ role: 'validator',
101
+ input: JSON.stringify(plannerResult.plan),
102
+ output: JSON.stringify({
103
+ isValid: validationResult.isValid,
104
+ warnings: validationResult.warnings,
105
+ risks: validationResult.risks,
106
+ }),
107
+ timestamp: validatorStartTime,
108
+ duration: validatorDuration,
109
+ metadata: {
110
+ provider: validatorProvider.name,
111
+ providerId: validatorProvider.id,
112
+ isValid: validationResult.isValid,
113
+ warningsCount: validationResult.warnings?.length || 0,
114
+ risksCount: validationResult.risks?.length || 0,
115
+ },
116
+ };
117
+ }
118
+ catch (error) {
119
+ // Validator failure - use planner result but log the failure
120
+ console.warn('[MultiModelPlanningStrategy] Validator step failed, using planner result:', error instanceof Error ? error.message : String(error));
121
+ validatorStep = {
122
+ id: validatorStepId,
123
+ role: 'validator',
124
+ input: JSON.stringify(plannerResult.plan),
125
+ output: 'Validation failed',
126
+ timestamp: validatorStartTime,
127
+ duration: Date.now() - validatorStartTime,
128
+ metadata: {
129
+ provider: validatorProvider.name,
130
+ providerId: validatorProvider.id,
131
+ error: error instanceof Error ? error.message : String(error),
132
+ },
133
+ };
134
+ }
135
+ }
136
+ }
137
+ // Build combined trace
138
+ const steps = [plannerStep];
139
+ if (validatorStep) {
140
+ steps.push(validatorStep);
141
+ }
142
+ const totalDuration = Date.now() - startTime;
143
+ const trace = {
144
+ id: traceId,
145
+ steps,
146
+ summary: `Multi-model plan: ${steps.length} step(s) (planner${validatorStep ? ' + validator' : ''})`,
147
+ metadata: {
148
+ totalDuration,
149
+ totalTokens: steps.reduce((sum, step) => sum + (step.tokenUsage?.inputTokens || 0) + (step.tokenUsage?.outputTokens || 0), 0),
150
+ },
151
+ };
152
+ return {
153
+ plan: validatedPlan,
154
+ trace,
155
+ };
156
+ }
157
+ }
158
+ //# sourceMappingURL=multi-model-planning-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-model-planning-strategy.js","sourceRoot":"","sources":["../../../src/application/reasoning/multi-model-planning-strategy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAA2B,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAsB,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;GAGG;AACH,MAAM,OAAO,0BAA0B;IAM3B;IALF,eAAe,CAAyB;IACxC,iBAAiB,GAA8B,IAAI,CAAC;IACpD,YAAY,CAAuB;IAE3C,YACU,gBAA4B,EACpC,YAAmC;QAD3B,qBAAgB,GAAhB,gBAAgB,CAAY;QAGpC,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,oBAAoB,EAAE,CAAC;QAE/D,gDAAgD;QAChD,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACzE,MAAM,gBAAgB,GAAG,IAAI,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAChE,IAAI,CAAC,eAAe,GAAG,IAAI,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;QAEpE,4DAA4D;QAC5D,IAAI,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,CAAC;YACpD,IAAI,CAAC;gBACH,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;gBAC7E,MAAM,kBAAkB,GAAG,IAAI,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;gBACpE,IAAI,CAAC,iBAAiB,G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reasoning layer is enabled
7
+ * Priority: Environment variable > Config file > Default (false)
8
+ */
9
+ export declare function isReasoningEnabled(): boolean;
10
+ /**
11
+ * Check if multi-model reasoning is enabled
12
+ * Requires reasoning.enabled = true AND reasoning.multiModel.enabled = true
13
+ */
14
+ export declare function isMultiModelEnabled(): boolean;
15
+ //# sourceMappingURL=reasoning-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning-config.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAgB5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAmB7C"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Reasoning Configuration Helper
3
+ * Checks reasoning layer configuration (enabled, multi-model mode, etc.)
4
+ */
5
+ import { ConfigManager } from '../../infrastructure/config/config-manager.js';
6
+ /**
7
+ * Check if reasoning layer is enabled
8
+ * Priority: Environment variable > Config file > Default (false)
9
+ */
10
+ export function isReasoningEnabled() {
11
+ // Check environment variable first
12
+ const envEnabled = process.env.CODEHERE_REASONING_ENABLED;
13
+ if (envEnabled !== undefined) {
14
+ return envEnabled === '1' || envEnabled.toLowerCase() === 'true';
15
+ }
16
+ // Check config file
17
+ try {
18
+ const configManager = new ConfigManager();
19
+ const reasoningConfig = configManager.get('reasoning');
20
+ return reasoningConfig?.enabled === true;
21
+ }
22
+ catch (error) {
23
+ // If config not available, default to false
24
+ return false;
25
+ }
26
+ }
27
+ /**
28
+ * Check if multi-model reasoning is enabled
29
+ * Requires reasoning.enabled = true AND reasoning.multiModel.enabled = true
30
+ */
31
+ export function isMultiModelEnabled() {
32
+ if (!isReasoningEnabled()) {
33
+ return false;
34
+ }
35
+ // Check environment variable first
36
+ const envMultiModel = process.env.CODEHERE_REASONING_MULTI_MODEL;
37
+ if (envMultiModel !== undefined) {
38
+ return envMultiModel === '1' || envMultiModel.toLowerCase() === 'true';
39
+ }
40
+ // Check config file
41
+ try {
42
+ const configManager = new ConfigManager();
43
+ const reasoningConfig = configManager.get('reasoning');
44
+ return reasoningConfig?.multiModel?.enabled === true;
45
+ }
46
+ catch (error) {
47
+ return false;
48
+ }
49
+ }
50
+ //# sourceMappingURL=reasoning-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning-config.js","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAE9E;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,mCAAmC;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC1D,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,UAAU,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;IACnE,CAAC;IAED,oBAAoB;IACpB,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;QAC1C,MAAM,eAAe,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACvD,OAAO,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,4CAA4C;QAC5C,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,mCAAmC;IACnC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;IACjE,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,aAAa,KAAK,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;IACzE,CAAC;IAED,oBAAoB;IACpB,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;QAC1C,MAAM,eAAe,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACvD,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Reasoning Orchestrator
3
+ * Coordinates reasoning strategies and provides unified interface
4
+ */
5
+ import type { IReasoningStrategy, PlanningResult } from './reasoning-strategy.interface.js';
6
+ import type { PlanningInputContext } from './types.js';
7
+ import type { ExecutionTracer } from '../../infrastructure/observability/execution-tracer.js';
8
+ export interface IReasoningOrchestrator {
9
+ planWithReasoning(context: PlanningInputContext): Promise<PlanningResult>;
10
+ }
11
+ export declare class ReasoningOrchestrator implements IReasoningOrchestrator {
12
+ private strategy;
13
+ private tracer?;
14
+ private providerName?;
15
+ constructor(strategy: IReasoningStrategy, tracer?: ExecutionTracer | undefined, providerName?: string | undefined);
16
+ planWithReasoning(context: PlanningInputContext): Promise<PlanningResult>;
17
+ }
18
+ //# sourceMappingURL=reasoning-orchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning-orchestrator.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-orchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAE9F,MAAM,WAAW,sBAAsB;IACrC,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC3E;AAED,qBAAa,qBAAsB,YAAW,sBAAsB;IAEhE,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM,CAAC;IACf,OAAO,CAAC,YAAY,CAAC;gBAFb,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,CAAC,EAAE,eAAe,YAAA,EACxB,YAAY,CAAC,EAAE,MAAM,YAAA;IAGzB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;CAkKhF"}
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Reasoning Orchestrator
3
+ * Coordinates reasoning strategies and provides unified interface
4
+ */
5
+ export class ReasoningOrchestrator {
6
+ strategy;
7
+ tracer;
8
+ providerName;
9
+ constructor(strategy, tracer, providerName) {
10
+ this.strategy = strategy;
11
+ this.tracer = tracer;
12
+ this.providerName = providerName;
13
+ }
14
+ async planWithReasoning(context) {
15
+ const runId = this.tracer?.getCurrentRunId();
16
+ const startTime = Date.now();
17
+ // Trace start event
18
+ const traceId = this.tracer?.trace({
19
+ operationType: 'plan_generation',
20
+ operationName: 'reasoning_orchestrator_plan_start',
21
+ input: {
22
+ goal: context.goal,
23
+ planningMode: context.planningMode,
24
+ },
25
+ metadata: {
26
+ reasoningEnabled: true,
27
+ role: 'planner',
28
+ providerName: this.providerName || 'unknown',
29
+ startTime,
30
+ },
31
+ });
32
+ try {
33
+ const result = await this.strategy.executePlanning(context);
34
+ // Trace completion with metrics
35
+ const endTime = Date.now();
36
+ const totalDuration = endTime - startTime;
37
+ if (this.tracer && traceId) {
38
+ // Trace each reasoning step with role-specific events
39
+ result.trace.steps.forEach((step, idx) => {
40
+ const stepProviderName = step.metadata?.provider || this.providerName || 'unknown';
41
+ // Trace role start event
42
+ this.tracer.trace({
43
+ operationType: 'llm_call',
44
+ operationName: 'reasoning_role_start',
45
+ input: {
46
+ stepId: step.id,
47
+ role: step.role,
48
+ inputLength: step.input.length,
49
+ },
50
+ metadata: {
51
+ reasoningEnabled: true,
52
+ role: step.role,
53
+ stepIndex: idx,
54
+ providerName: stepProviderName,
55
+ },
56
+ });
57
+ // Trace role end event
58
+ this.tracer.trace({
59
+ operationType: 'llm_call',
60
+ operationName: 'reasoning_role_end',
61
+ input: {
62
+ stepId: step.id,
63
+ role: step.role,
64
+ inputLength: step.input.length,
65
+ },
66
+ output: {
67
+ outputLength: step.output.length,
68
+ },
69
+ duration: step.duration,
70
+ metadata: {
71
+ reasoningEnabled: true,
72
+ role: step.role,
73
+ stepIndex: idx,
74
+ inputTokens: step.tokenUsage?.inputTokens,
75
+ outputTokens: step.tokenUsage?.outputTokens,
76
+ providerName: stepProviderName,
77
+ durationMs: step.duration,
78
+ success: true,
79
+ },
80
+ });
81
+ });
82
+ // Trace overall orchestration end event
83
+ this.tracer.trace({
84
+ operationType: 'plan_generation',
85
+ operationName: 'reasoning_orchestrator_plan_end',
86
+ input: {
87
+ goal: context.goal,
88
+ planningMode: context.planningMode,
89
+ },
90
+ output: {
91
+ planId: result.plan.id,
92
+ subPlansCount: result.plan.subPlans.length,
93
+ traceId: result.trace.id,
94
+ stepsCount: result.trace.steps.length,
95
+ success: true,
96
+ },
97
+ duration: totalDuration,
98
+ metadata: {
99
+ reasoningEnabled: true,
100
+ totalDuration: result.trace.metadata?.totalDuration,
101
+ totalTokens: result.trace.metadata?.totalTokens,
102
+ role: 'planner',
103
+ providerName: this.providerName || 'unknown',
104
+ durationMs: totalDuration,
105
+ startTime,
106
+ endTime,
107
+ },
108
+ });
109
+ }
110
+ return result;
111
+ }
112
+ catch (error) {
113
+ // Trace error event
114
+ const endTime = Date.now();
115
+ const totalDuration = endTime - startTime;
116
+ if (this.tracer && traceId) {
117
+ // Trace role error event
118
+ const roleErrorTrace = {
119
+ operationType: 'plan_generation',
120
+ operationName: 'reasoning_role_error',
121
+ input: {
122
+ goal: context.goal,
123
+ planningMode: context.planningMode,
124
+ },
125
+ error: {
126
+ message: error instanceof Error ? error.message : String(error),
127
+ stack: error instanceof Error ? error.stack : undefined,
128
+ },
129
+ duration: totalDuration,
130
+ metadata: {
131
+ reasoningEnabled: true,
132
+ role: 'planner',
133
+ providerName: this.providerName || 'unknown',
134
+ durationMs: totalDuration,
135
+ startTime,
136
+ endTime,
137
+ success: false,
138
+ },
139
+ };
140
+ this.tracer.trace(roleErrorTrace);
141
+ // Also trace overall orchestration error
142
+ const errorTrace = {
143
+ operationType: 'plan_generation',
144
+ operationName: 'reasoning_orchestrator_plan_error',
145
+ input: {
146
+ goal: context.goal,
147
+ planningMode: context.planningMode,
148
+ },
149
+ error: {
150
+ message: error instanceof Error ? error.message : String(error),
151
+ stack: error instanceof Error ? error.stack : undefined,
152
+ },
153
+ duration: totalDuration,
154
+ metadata: {
155
+ reasoningEnabled: true,
156
+ role: 'planner',
157
+ providerName: this.providerName || 'unknown',
158
+ durationMs: totalDuration,
159
+ startTime,
160
+ endTime,
161
+ success: false,
162
+ },
163
+ };
164
+ this.tracer.trace(errorTrace);
165
+ }
166
+ throw error;
167
+ }
168
+ }
169
+ }
170
+ //# sourceMappingURL=reasoning-orchestrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning-orchestrator.js","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-orchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,OAAO,qBAAqB;IAEtB;IACA;IACA;IAHV,YACU,QAA4B,EAC5B,MAAwB,EACxB,YAAqB;QAFrB,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,WAAM,GAAN,MAAM,CAAkB;QACxB,iBAAY,GAAZ,YAAY,CAAS;IAC5B,CAAC;IAEJ,KAAK,CAAC,iBAAiB,CAAC,OAA6B;QACnD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC;QAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,oBAAoB;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,MAA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ACf;iBACF,CAAC;gBACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;gBAElC,yCAAyC;gBACzC,MAAM,UAAU,GAAQ;oBACtB,aAAa,EAAE,iBAAiB;oBAChC,aAAa,EAAE,mCAAmC;oBAClD,KAAK,EAAE;wBACL,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,YAAY,EAAE,OAAO,CAAC,YAAY;qBACnC;oBACD,KAAK,EAAE;wBACL,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;wBAC/D,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;qBACxD;oBACD,QAAQ,EAAE,aAAa;oBACvB,QAAQ,EAAE;wBACR,gBAAgB,EAAE,IAAI;wBACtB,IAAI,EAAE,SAAS;wBACf,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,SAAS;wBAC5C,UAAU,EAAE,aAAa;wBACzB,SAAS;wBACT,OAAO;wBACP,OAAO,EAAE,KAAK;qBACf;iBACF,CAAC;gBACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAChC,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Reasoning Strategy Interface
3
+ * Defines how reasoning is executed for different use cases
4
+ */
5
+ import type { ReasoningTrace, PlanningInputContext } from './types.js';
6
+ import type { Plan } from '../../domain/entities/plan.js';
7
+ /**
8
+ * Planning result from reasoning strategy
9
+ */
10
+ export interface PlanningResult {
11
+ plan: Plan;
12
+ trace: ReasoningTrace;
13
+ }
14
+ /**
15
+ * Reasoning strategy interface
16
+ * Different strategies can implement different reasoning patterns
17
+ */
18
+ export interface IReasoningStrategy {
19
+ /**
20
+ * Execute planning with structured reasoning
21
+ */
22
+ executePlanning(context: PlanningInputContext): Promise<PlanningResult>;
23
+ }
24
+ //# sourceMappingURL=reasoning-strategy.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning-strategy.interface.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-strategy.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,cAAc,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACzE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Reasoning Strategy Interface
3
+ * Defines how reasoning is executed for different use cases
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=reasoning-strategy.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning-strategy.interface.js","sourceRoot":"","sources":["../../../src/application/reasoning/reasoning-strategy.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Role-Aware Provider Resolver
3
+ * Resolves providers for reasoning roles (planner, validator)
4
+ * Falls back to OperationProviderResolver if role not configured
5
+ */
6
+ import type { IModelProvider } from '../../infrastructure/providers/model-provider.interface.js';
7
+ import { ProviderRegistry } from '../../infrastructure/providers/provider-registry.js';
8
+ import { OperationProviderResolver } from '../../infrastructure/providers/operation-provider-resolver.js';
9
+ import { ConfigManager } from '../../infrastructure/config/config-manager.js';
10
+ export type ReasoningRole = 'planner' | 'validator';
11
+ /**
12
+ * Resolve provider for a reasoning role
13
+ * Priority:
14
+ * 1. reasoning.multiModel.roles[role] if multiModel.enabled = true
15
+ * 2. OperationProviderResolver for 'chat' operation
16
+ * 3. Default provider
17
+ */
18
+ export declare class RoleProviderResolver {
19
+ private configManager;
20
+ private providerRegistry;
21
+ private operationResolver;
22
+ constructor(configManager?: ConfigManager, providerRegistry?: ProviderRegistry, operationResolver?: OperationProviderResolver);
23
+ /**
24
+ * Resolve provider for a reasoning role
25
+ */
26
+ resolveRoleProvider(role: ReasoningRole): IModelProvider;
27
+ /**
28
+ * Check if multi-model reasoning is enabled
29
+ */
30
+ isMultiModelEnabled(): boolean;
31
+ /**
32
+ * Check if a specific role is configured
33
+ */
34
+ isRoleConfigured(role: ReasoningRole): boolean;
35
+ }
36
+ //# sourceMappingURL=role-provider-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role-provider-resolver.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/role-provider-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAsB,MAAM,+DAA+D,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAE9E,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpD;;;;;;GAMG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,iBAAiB,CAA4B;gBAGnD,aAAa,CAAC,EAAE,aAAa,EAC7B,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,iBAAiB,CAAC,EAAE,yBAAyB;IAW/C;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,cAAc;IA4BxD;;OAEG;IACH,mBAAmB,IAAI,OAAO;IAK9B;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAS/C"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Role-Aware Provider Resolver
3
+ * Resolves providers for reasoning roles (planner, validator)
4
+ * Falls back to OperationProviderResolver if role not configured
5
+ */
6
+ import { ProviderRegistry } from '../../infrastructure/providers/provider-registry.js';
7
+ import { OperationProviderResolver } from '../../infrastructure/providers/operation-provider-resolver.js';
8
+ import { ConfigManager } from '../../infrastructure/config/config-manager.js';
9
+ /**
10
+ * Resolve provider for a reasoning role
11
+ * Priority:
12
+ * 1. reasoning.multiModel.roles[role] if multiModel.enabled = true
13
+ * 2. OperationProviderResolver for 'chat' operation
14
+ * 3. Default provider
15
+ */
16
+ export class RoleProviderResolver {
17
+ configManager;
18
+ providerRegistry;
19
+ operationResolver;
20
+ constructor(configManager, providerRegistry, operationResolver) {
21
+ this.configManager = configManager || new ConfigManager();
22
+ this.providerRegistry = providerRegistry || ProviderRegistry.getInstance();
23
+ this.operationResolver = operationResolver || new OperationProviderResolver(this.providerRegistry, null, null);
24
+ }
25
+ /**
26
+ * Resolve provider for a reasoning role
27
+ */
28
+ resolveRoleProvider(role) {
29
+ // Check if multi-model is enabled
30
+ const reasoningConfig = this.configManager.get('reasoning');
31
+ const multiModelEnabled = reasoningConfig?.multiModel?.enabled === true;
32
+ if (multiModelEnabled) {
33
+ // Try role-specific provider
34
+ const roleProviderId = reasoningConfig?.multiModel?.roles?.[role];
35
+ if (roleProviderId) {
36
+ const provider = this.providerRegistry.get(roleProviderId);
37
+ if (provider) {
38
+ return provider;
39
+ }
40
+ // Invalid provider name - log warning and fall through
41
+ console.warn(`[RoleProviderResolver] Provider '${roleProviderId}' not found for role '${role}', falling back to operation resolver`);
42
+ }
43
+ }
44
+ // Fallback to OperationProviderResolver for 'chat' operation
45
+ // (planning uses chat operation)
46
+ try {
47
+ return this.operationResolver.resolveProvider('chat');
48
+ }
49
+ catch (error) {
50
+ // Final fallback to default provider
51
+ return this.providerRegistry.getDefault();
52
+ }
53
+ }
54
+ /**
55
+ * Check if multi-model reasoning is enabled
56
+ */
57
+ isMultiModelEnabled() {
58
+ const reasoningConfig = this.configManager.get('reasoning');
59
+ return reasoningConfig?.multiModel?.enabled === true;
60
+ }
61
+ /**
62
+ * Check if a specific role is configured
63
+ */
64
+ isRoleConfigured(role) {
65
+ const reasoningConfig = this.configManager.get('reasoning');
66
+ const multiModelEnabled = reasoningConfig?.multiModel?.enabled === true;
67
+ if (!multiModelEnabled) {
68
+ return false;
69
+ }
70
+ const roleProviderId = reasoningConfig?.multiModel?.roles?.[role];
71
+ return !!roleProviderId && !!this.providerRegistry.get(roleProviderId);
72
+ }
73
+ }
74
+ //# sourceMappingURL=role-provider-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role-provider-resolver.js","sourceRoot":"","sources":["../../../src/application/reasoning/role-provider-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAsB,MAAM,+DAA+D,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAI9E;;;;;;GAMG;AACH,MAAM,OAAO,oBAAoB;IACvB,aAAa,CAAgB;IAC7B,gBAAgB,CAAmB;IACnC,iBAAiB,CAA4B;IAErD,YACE,aAA6B,EAC7B,gBAAmC,EACnC,iBAA6C;QAE7C,IAAI,CAAC,aAAa,GAAG,aAAa,IAAI,IAAI,aAAa,EAAE,CAAC;QAC1D,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,IAAI,gBAAgB,CAAC,WAAW,EAAE,CAAC;QAC3E,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,IAAI,IAAI,yBAAyB,CACzE,IAAI,CAAC,gBAAgB,EACrB,IAAI,EACJ,IAAI,CACL,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,IAA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,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,cAAc,GAAG,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC;QAClE,OAAO,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACzE,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Simple Planning Strategy
3
+ * Wraps current planning behavior into structured reasoning trace
4
+ * Behaviorally equivalent to current PlanningUseCase, but structured
5
+ */
6
+ import type { IReasoningStrategy, PlanningResult } from './reasoning-strategy.interface.js';
7
+ import type { PlanningInputContext } from './types.js';
8
+ import type { IAIService } from '../../domain/interfaces/ai-service.interface.js';
9
+ export declare class SimplePlanningStrategy implements IReasoningStrategy {
10
+ private aiService;
11
+ constructor(aiService: IAIService);
12
+ executePlanning(context: PlanningInputContext): Promise<PlanningResult>;
13
+ /**
14
+ * Build planning prompt (reuses logic from PlanningUseCase)
15
+ */
16
+ private buildPlanningPrompt;
17
+ /**
18
+ * Parse plan from AI response (reuses logic from PlanningAgent)
19
+ */
20
+ private parsePlanFromResponse;
21
+ }
22
+ //# sourceMappingURL=simple-planning-strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simple-planning-strategy.d.ts","sourceRoot":"","sources":["../../../src/application/reasoning/simple-planning-strategy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,KAAK,EAAE,oBAAoB,EAAiC,MAAM,YAAY,CAAC;AAEtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAIlF,qBAAa,sBAAuB,YAAW,kBAAkB;IACnD,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,UAAU;IAEnC,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IA0E7E;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA+D3B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CA6E9B"}