codehere 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of codehere might be problematic. Click here for more details.

Files changed (405) hide show
  1. package/README.md +223 -42
  2. package/dist/application/agents/documentation-agent.d.ts +24 -0
  3. package/dist/application/agents/documentation-agent.d.ts.map +1 -0
  4. package/dist/application/agents/documentation-agent.js +399 -0
  5. package/dist/application/agents/documentation-agent.js.map +1 -0
  6. package/dist/application/agents/execution-agent.d.ts +11 -0
  7. package/dist/application/agents/execution-agent.d.ts.map +1 -1
  8. package/dist/application/agents/execution-agent.js +289 -80
  9. package/dist/application/agents/execution-agent.js.map +1 -1
  10. package/dist/application/agents/multi-agent-orchestrator.d.ts +4 -0
  11. package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
  12. package/dist/application/agents/multi-agent-orchestrator.js +86 -0
  13. package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
  14. package/dist/application/agents/planning-agent.d.ts +3 -0
  15. package/dist/application/agents/planning-agent.d.ts.map +1 -1
  16. package/dist/application/agents/planning-agent.js +132 -64
  17. package/dist/application/agents/planning-agent.js.map +1 -1
  18. package/dist/application/agents/product-requirements-agent.d.ts +21 -0
  19. package/dist/application/agents/product-requirements-agent.d.ts.map +1 -0
  20. package/dist/application/agents/product-requirements-agent.js +247 -0
  21. package/dist/application/agents/product-requirements-agent.js.map +1 -0
  22. package/dist/application/agents/validation-agent.d.ts +5 -1
  23. package/dist/application/agents/validation-agent.d.ts.map +1 -1
  24. package/dist/application/agents/validation-agent.js +156 -21
  25. package/dist/application/agents/validation-agent.js.map +1 -1
  26. package/dist/application/services/dependency-container.d.ts +25 -2
  27. package/dist/application/services/dependency-container.d.ts.map +1 -1
  28. package/dist/application/services/dependency-container.js +163 -1
  29. package/dist/application/services/dependency-container.js.map +1 -1
  30. package/dist/application/services/intelligent-router.d.ts +13 -0
  31. package/dist/application/services/intelligent-router.d.ts.map +1 -1
  32. package/dist/application/services/intelligent-router.js +300 -87
  33. package/dist/application/services/intelligent-router.js.map +1 -1
  34. package/dist/application/use-cases/ask-question-use-case.d.ts +31 -0
  35. package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
  36. package/dist/application/use-cases/ask-question-use-case.js +254 -55
  37. package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
  38. package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -1
  39. package/dist/application/use-cases/edit-file-use-case.js +86 -4
  40. package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
  41. package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
  42. package/dist/application/use-cases/planning-use-case.js +10 -1
  43. package/dist/application/use-cases/planning-use-case.js.map +1 -1
  44. package/dist/application/use-cases/react-orchestration-use-case.d.ts.map +1 -1
  45. package/dist/application/use-cases/react-orchestration-use-case.js +6 -2
  46. package/dist/application/use-cases/react-orchestration-use-case.js.map +1 -1
  47. package/dist/domain/entities/documentation.d.ts +35 -0
  48. package/dist/domain/entities/documentation.d.ts.map +1 -0
  49. package/dist/domain/entities/documentation.js +6 -0
  50. package/dist/domain/entities/documentation.js.map +1 -0
  51. package/dist/domain/entities/product-requirements.d.ts +50 -0
  52. package/dist/domain/entities/product-requirements.d.ts.map +1 -0
  53. package/dist/domain/entities/product-requirements.js +6 -0
  54. package/dist/domain/entities/product-requirements.js.map +1 -0
  55. package/dist/domain/entities/task.d.ts +152 -0
  56. package/dist/domain/entities/task.d.ts.map +1 -0
  57. package/dist/domain/entities/task.js +61 -0
  58. package/dist/domain/entities/task.js.map +1 -0
  59. package/dist/domain/interfaces/agent.interface.d.ts +15 -0
  60. package/dist/domain/interfaces/agent.interface.d.ts.map +1 -0
  61. package/dist/domain/interfaces/agent.interface.js +6 -0
  62. package/dist/domain/interfaces/agent.interface.js.map +1 -0
  63. package/dist/domain/services/environment-mode-manager.d.ts +18 -0
  64. package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
  65. package/dist/domain/services/environment-mode-manager.js +37 -0
  66. package/dist/domain/services/environment-mode-manager.js.map +1 -0
  67. package/dist/domain/services/react-loop.d.ts +8 -0
  68. package/dist/domain/services/react-loop.d.ts.map +1 -1
  69. package/dist/domain/services/react-loop.js +82 -6
  70. package/dist/domain/services/react-loop.js.map +1 -1
  71. package/dist/domain/services/risk-tier-detector.d.ts +18 -0
  72. package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
  73. package/dist/domain/services/risk-tier-detector.js +65 -0
  74. package/dist/domain/services/risk-tier-detector.js.map +1 -0
  75. package/dist/formatter.d.ts +2 -2
  76. package/dist/formatter.d.ts.map +1 -1
  77. package/dist/formatter.js +40 -20
  78. package/dist/formatter.js.map +1 -1
  79. package/dist/index.js +218 -125
  80. package/dist/index.js.map +1 -1
  81. package/dist/infrastructure/ai/cohere-ai-service.d.ts +3 -1
  82. package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
  83. package/dist/infrastructure/ai/cohere-ai-service.js +65 -5
  84. package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
  85. package/dist/infrastructure/ai/fake-ai-service.d.ts +22 -0
  86. package/dist/infrastructure/ai/fake-ai-service.d.ts.map +1 -0
  87. package/dist/infrastructure/ai/fake-ai-service.js +59 -0
  88. package/dist/infrastructure/ai/fake-ai-service.js.map +1 -0
  89. package/dist/infrastructure/ai/provider-ai-service.d.ts +59 -0
  90. package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -0
  91. package/dist/infrastructure/ai/provider-ai-service.js +477 -0
  92. package/dist/infrastructure/ai/provider-ai-service.js.map +1 -0
  93. package/dist/infrastructure/cache/embedding-cache.d.ts +13 -1
  94. package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -1
  95. package/dist/infrastructure/cache/embedding-cache.js +80 -9
  96. package/dist/infrastructure/cache/embedding-cache.js.map +1 -1
  97. package/dist/infrastructure/cache/query-result-cache.d.ts +68 -0
  98. package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -0
  99. package/dist/infrastructure/cache/query-result-cache.js +138 -0
  100. package/dist/infrastructure/cache/query-result-cache.js.map +1 -0
  101. package/dist/infrastructure/cache/response-cache.d.ts +86 -0
  102. package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
  103. package/dist/infrastructure/cache/response-cache.js +224 -0
  104. package/dist/infrastructure/cache/response-cache.js.map +1 -0
  105. package/dist/infrastructure/cache/security-scan-cache.d.ts +57 -0
  106. package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -0
  107. package/dist/infrastructure/cache/security-scan-cache.js +124 -0
  108. package/dist/infrastructure/cache/security-scan-cache.js.map +1 -0
  109. package/dist/infrastructure/completion/bash-completion.d.ts +8 -0
  110. package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -0
  111. package/dist/infrastructure/completion/bash-completion.js +101 -0
  112. package/dist/infrastructure/completion/bash-completion.js.map +1 -0
  113. package/dist/infrastructure/completion/completion-generator.d.ts +42 -0
  114. package/dist/infrastructure/completion/completion-generator.d.ts.map +1 -0
  115. package/dist/infrastructure/completion/completion-generator.js +184 -0
  116. package/dist/infrastructure/completion/completion-generator.js.map +1 -0
  117. package/dist/infrastructure/completion/fish-completion.d.ts +8 -0
  118. package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -0
  119. package/dist/infrastructure/completion/fish-completion.js +65 -0
  120. package/dist/infrastructure/completion/fish-completion.js.map +1 -0
  121. package/dist/infrastructure/completion/zsh-completion.d.ts +8 -0
  122. package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -0
  123. package/dist/infrastructure/completion/zsh-completion.js +85 -0
  124. package/dist/infrastructure/completion/zsh-completion.js.map +1 -0
  125. package/dist/infrastructure/context/context-compressor.d.ts +94 -0
  126. package/dist/infrastructure/context/context-compressor.d.ts.map +1 -0
  127. package/dist/infrastructure/context/context-compressor.js +329 -0
  128. package/dist/infrastructure/context/context-compressor.js.map +1 -0
  129. package/dist/infrastructure/context/conversation-context.d.ts +58 -0
  130. package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
  131. package/dist/infrastructure/context/conversation-context.js +170 -0
  132. package/dist/infrastructure/context/conversation-context.js.map +1 -0
  133. package/dist/infrastructure/context/session-manager.d.ts +26 -0
  134. package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
  135. package/dist/infrastructure/context/session-manager.js +98 -0
  136. package/dist/infrastructure/context/session-manager.js.map +1 -0
  137. package/dist/infrastructure/cost/cost-tracker.d.ts +1 -0
  138. package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
  139. package/dist/infrastructure/cost/cost-tracker.js +12 -5
  140. package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
  141. package/dist/infrastructure/governance/nist-ai-rmf.d.ts +6 -8
  142. package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -1
  143. package/dist/infrastructure/governance/nist-ai-rmf.js +6 -8
  144. package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -1
  145. package/dist/infrastructure/governance/policy-as-code.d.ts +6 -8
  146. package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -1
  147. package/dist/infrastructure/governance/policy-as-code.js +24 -11
  148. package/dist/infrastructure/governance/policy-as-code.js.map +1 -1
  149. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +7 -9
  150. package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -1
  151. package/dist/infrastructure/governance/prompt-to-code-lineage.js +7 -9
  152. package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -1
  153. package/dist/infrastructure/observability/execution-tracer.d.ts +5 -2
  154. package/dist/infrastructure/observability/execution-tracer.d.ts.map +1 -1
  155. package/dist/infrastructure/observability/execution-tracer.js +45 -8
  156. package/dist/infrastructure/observability/execution-tracer.js.map +1 -1
  157. package/dist/infrastructure/providers/cohere-provider.d.ts +39 -0
  158. package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -0
  159. package/dist/infrastructure/providers/cohere-provider.js +359 -0
  160. package/dist/infrastructure/providers/cohere-provider.js.map +1 -0
  161. package/dist/infrastructure/providers/fake-provider.d.ts +43 -0
  162. package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -0
  163. package/dist/infrastructure/providers/fake-provider.js +130 -0
  164. package/dist/infrastructure/providers/fake-provider.js.map +1 -0
  165. package/dist/infrastructure/providers/local-llm-provider.d.ts +49 -0
  166. package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -0
  167. package/dist/infrastructure/providers/local-llm-provider.js +330 -0
  168. package/dist/infrastructure/providers/local-llm-provider.js.map +1 -0
  169. package/dist/infrastructure/providers/model-config.types.d.ts +70 -0
  170. package/dist/infrastructure/providers/model-config.types.d.ts.map +1 -0
  171. package/dist/infrastructure/providers/model-config.types.js +9 -0
  172. package/dist/infrastructure/providers/model-config.types.js.map +1 -0
  173. package/dist/infrastructure/providers/model-provider.interface.d.ts +113 -0
  174. package/dist/infrastructure/providers/model-provider.interface.d.ts.map +1 -0
  175. package/dist/infrastructure/providers/model-provider.interface.js +8 -0
  176. package/dist/infrastructure/providers/model-provider.interface.js.map +1 -0
  177. package/dist/infrastructure/providers/openai-provider.d.ts +38 -0
  178. package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -0
  179. package/dist/infrastructure/providers/openai-provider.js +413 -0
  180. package/dist/infrastructure/providers/openai-provider.js.map +1 -0
  181. package/dist/infrastructure/providers/operation-provider-resolver.d.ts +48 -0
  182. package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
  183. package/dist/infrastructure/providers/operation-provider-resolver.js +105 -0
  184. package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -0
  185. package/dist/infrastructure/providers/provider-config-loader.d.ts +37 -0
  186. package/dist/infrastructure/providers/provider-config-loader.d.ts.map +1 -0
  187. package/dist/infrastructure/providers/provider-config-loader.js +120 -0
  188. package/dist/infrastructure/providers/provider-config-loader.js.map +1 -0
  189. package/dist/infrastructure/providers/provider-registry.d.ts +53 -0
  190. package/dist/infrastructure/providers/provider-registry.d.ts.map +1 -0
  191. package/dist/infrastructure/providers/provider-registry.js +88 -0
  192. package/dist/infrastructure/providers/provider-registry.js.map +1 -0
  193. package/dist/infrastructure/security/ai-sast-scanner.d.ts +4 -0
  194. package/dist/infrastructure/security/ai-sast-scanner.d.ts.map +1 -1
  195. package/dist/infrastructure/security/ai-sast-scanner.js +82 -4
  196. package/dist/infrastructure/security/ai-sast-scanner.js.map +1 -1
  197. package/dist/infrastructure/security/enhanced-security-gate.d.ts +2 -0
  198. package/dist/infrastructure/security/enhanced-security-gate.d.ts.map +1 -1
  199. package/dist/infrastructure/security/enhanced-security-gate.js +74 -15
  200. package/dist/infrastructure/security/enhanced-security-gate.js.map +1 -1
  201. package/dist/infrastructure/storage/plan-repository.d.ts +38 -0
  202. package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -0
  203. package/dist/infrastructure/storage/plan-repository.js +133 -0
  204. package/dist/infrastructure/storage/plan-repository.js.map +1 -0
  205. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +11 -0
  206. package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
  207. package/dist/infrastructure/storage/sqlite-embedding-repository.js +121 -6
  208. package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
  209. package/dist/infrastructure/storage/task-helpers.d.ts +58 -0
  210. package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
  211. package/dist/infrastructure/storage/task-helpers.js +157 -0
  212. package/dist/infrastructure/storage/task-helpers.js.map +1 -0
  213. package/dist/infrastructure/storage/task-repository.d.ts +67 -0
  214. package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
  215. package/dist/infrastructure/storage/task-repository.js +205 -0
  216. package/dist/infrastructure/storage/task-repository.js.map +1 -0
  217. package/dist/infrastructure/ux/bi-directional-learning.d.ts +22 -0
  218. package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -1
  219. package/dist/infrastructure/ux/bi-directional-learning.js +144 -7
  220. package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -1
  221. package/dist/infrastructure/ux/capability-boundaries.d.ts +50 -0
  222. package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
  223. package/dist/infrastructure/ux/capability-boundaries.js +167 -0
  224. package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
  225. package/dist/infrastructure/ux/comprehensive-formatter.d.ts +63 -0
  226. package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
  227. package/dist/infrastructure/ux/comprehensive-formatter.js +212 -0
  228. package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
  229. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +24 -0
  230. package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -0
  231. package/dist/infrastructure/ux/contextual-feature-discovery.js +144 -0
  232. package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -0
  233. package/dist/infrastructure/ux/expectation-management.d.ts +33 -0
  234. package/dist/infrastructure/ux/expectation-management.d.ts.map +1 -1
  235. package/dist/infrastructure/ux/expectation-management.js +138 -4
  236. package/dist/infrastructure/ux/expectation-management.js.map +1 -1
  237. package/dist/infrastructure/ux/feature-discovery.d.ts +47 -0
  238. package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -0
  239. package/dist/infrastructure/ux/feature-discovery.js +190 -0
  240. package/dist/infrastructure/ux/feature-discovery.js.map +1 -0
  241. package/dist/infrastructure/ux/feedback-prompt.d.ts +42 -0
  242. package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
  243. package/dist/infrastructure/ux/feedback-prompt.js +181 -0
  244. package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
  245. package/dist/infrastructure/ux/hitl-review-portal.d.ts +47 -0
  246. package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -0
  247. package/dist/infrastructure/ux/hitl-review-portal.js +228 -0
  248. package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -0
  249. package/dist/infrastructure/ux/hitl-validation.d.ts +35 -0
  250. package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -1
  251. package/dist/infrastructure/ux/hitl-validation.js +86 -0
  252. package/dist/infrastructure/ux/hitl-validation.js.map +1 -1
  253. package/dist/infrastructure/ux/progress-indicator.d.ts +55 -0
  254. package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -0
  255. package/dist/infrastructure/ux/progress-indicator.js +131 -0
  256. package/dist/infrastructure/ux/progress-indicator.js.map +1 -0
  257. package/dist/infrastructure/ux/progressive-disclosure.d.ts.map +1 -1
  258. package/dist/infrastructure/ux/progressive-disclosure.js +2 -1
  259. package/dist/infrastructure/ux/progressive-disclosure.js.map +1 -1
  260. package/dist/infrastructure/ux/proportional-friction.d.ts +73 -0
  261. package/dist/infrastructure/ux/proportional-friction.d.ts.map +1 -0
  262. package/dist/infrastructure/ux/proportional-friction.js +200 -0
  263. package/dist/infrastructure/ux/proportional-friction.js.map +1 -0
  264. package/dist/infrastructure/ux/review-checkpoint.d.ts +35 -0
  265. package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -0
  266. package/dist/infrastructure/ux/review-checkpoint.js +119 -0
  267. package/dist/infrastructure/ux/review-checkpoint.js.map +1 -0
  268. package/dist/infrastructure/ux/staged-feature-intro.d.ts +47 -0
  269. package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -0
  270. package/dist/infrastructure/ux/staged-feature-intro.js +144 -0
  271. package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -0
  272. package/dist/infrastructure/ux/syntax-highlighter.d.ts +21 -0
  273. package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -0
  274. package/dist/infrastructure/ux/syntax-highlighter.js +172 -0
  275. package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -0
  276. package/dist/infrastructure/validation/agent-feedback.d.ts +115 -0
  277. package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
  278. package/dist/infrastructure/validation/agent-feedback.js +227 -0
  279. package/dist/infrastructure/validation/agent-feedback.js.map +1 -0
  280. package/dist/infrastructure/validation/agent-validation-helper.d.ts +75 -0
  281. package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -0
  282. package/dist/infrastructure/validation/agent-validation-helper.js +88 -0
  283. package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -0
  284. package/dist/infrastructure/validation/feedback-stats.d.ts +99 -0
  285. package/dist/infrastructure/validation/feedback-stats.d.ts.map +1 -0
  286. package/dist/infrastructure/validation/feedback-stats.js +173 -0
  287. package/dist/infrastructure/validation/feedback-stats.js.map +1 -0
  288. package/dist/infrastructure/validation/review-handler.d.ts +54 -0
  289. package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
  290. package/dist/infrastructure/validation/review-handler.js +206 -0
  291. package/dist/infrastructure/validation/review-handler.js.map +1 -0
  292. package/dist/infrastructure/validation/summary-aggregator.d.ts +42 -0
  293. package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
  294. package/dist/infrastructure/validation/summary-aggregator.js +156 -0
  295. package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
  296. package/dist/infrastructure/validation/summary-extractor.d.ts +59 -0
  297. package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
  298. package/dist/infrastructure/validation/summary-extractor.js +102 -0
  299. package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
  300. package/dist/infrastructure/validation/trace-summary.d.ts +72 -0
  301. package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
  302. package/dist/infrastructure/validation/trace-summary.js +371 -0
  303. package/dist/infrastructure/validation/trace-summary.js.map +1 -0
  304. package/dist/infrastructure/validation/trust-config.d.ts +27 -0
  305. package/dist/infrastructure/validation/trust-config.d.ts.map +1 -0
  306. package/dist/infrastructure/validation/trust-config.js +113 -0
  307. package/dist/infrastructure/validation/trust-config.js.map +1 -0
  308. package/dist/infrastructure/xai/attention-visualizer.d.ts +6 -8
  309. package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -1
  310. package/dist/infrastructure/xai/attention-visualizer.js +6 -8
  311. package/dist/infrastructure/xai/attention-visualizer.js.map +1 -1
  312. package/dist/infrastructure/xai/cot-visualizer.d.ts +6 -8
  313. package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
  314. package/dist/infrastructure/xai/cot-visualizer.js +62 -18
  315. package/dist/infrastructure/xai/cot-visualizer.js.map +1 -1
  316. package/dist/infrastructure/xai/decision-tree-log.d.ts +6 -10
  317. package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -1
  318. package/dist/infrastructure/xai/decision-tree-log.js +6 -10
  319. package/dist/infrastructure/xai/decision-tree-log.js.map +1 -1
  320. package/dist/infrastructure/xai/interactive-xai.d.ts +6 -8
  321. package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -1
  322. package/dist/infrastructure/xai/interactive-xai.js +6 -8
  323. package/dist/infrastructure/xai/interactive-xai.js.map +1 -1
  324. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +6 -9
  325. package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -1
  326. package/dist/infrastructure/xai/uncertainty-quantifier.js +6 -9
  327. package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -1
  328. package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
  329. package/dist/presentation/cli/commands/ask-command.js +152 -13
  330. package/dist/presentation/cli/commands/ask-command.js.map +1 -1
  331. package/dist/presentation/cli/commands/docs-command.d.ts +12 -0
  332. package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
  333. package/dist/presentation/cli/commands/docs-command.js +196 -0
  334. package/dist/presentation/cli/commands/docs-command.js.map +1 -0
  335. package/dist/presentation/cli/commands/fix-command.d.ts +8 -0
  336. package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
  337. package/dist/presentation/cli/commands/fix-command.js +309 -0
  338. package/dist/presentation/cli/commands/fix-command.js.map +1 -0
  339. package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
  340. package/dist/presentation/cli/commands/help-command.js +2 -0
  341. package/dist/presentation/cli/commands/help-command.js.map +1 -1
  342. package/dist/presentation/cli/commands/orchestrate-command.d.ts +2 -0
  343. package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
  344. package/dist/presentation/cli/commands/orchestrate-command.js +88 -1
  345. package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
  346. package/dist/presentation/cli/commands/plan-command.d.ts +1 -0
  347. package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
  348. package/dist/presentation/cli/commands/plan-command.js +136 -7
  349. package/dist/presentation/cli/commands/plan-command.js.map +1 -1
  350. package/dist/presentation/cli/commands/product-command.d.ts +12 -0
  351. package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
  352. package/dist/presentation/cli/commands/product-command.js +188 -0
  353. package/dist/presentation/cli/commands/product-command.js.map +1 -0
  354. package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
  355. package/dist/presentation/cli/commands/react-command.js +98 -16
  356. package/dist/presentation/cli/commands/react-command.js.map +1 -1
  357. package/dist/presentation/cli/commands/review-command.d.ts +14 -0
  358. package/dist/presentation/cli/commands/review-command.d.ts.map +1 -0
  359. package/dist/presentation/cli/commands/review-command.js +22 -0
  360. package/dist/presentation/cli/commands/review-command.js.map +1 -0
  361. package/dist/presentation/cli/commands/run-command.d.ts +15 -0
  362. package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
  363. package/dist/presentation/cli/commands/run-command.js +29 -0
  364. package/dist/presentation/cli/commands/run-command.js.map +1 -0
  365. package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
  366. package/dist/presentation/cli/commands/setup-command.js +67 -12
  367. package/dist/presentation/cli/commands/setup-command.js.map +1 -1
  368. package/dist/presentation/cli/commands/smart-command.d.ts +3 -1
  369. package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
  370. package/dist/presentation/cli/commands/smart-command.js +227 -23
  371. package/dist/presentation/cli/commands/smart-command.js.map +1 -1
  372. package/dist/presentation/cli/commands/status-command.d.ts +11 -0
  373. package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
  374. package/dist/presentation/cli/commands/status-command.js +176 -0
  375. package/dist/presentation/cli/commands/status-command.js.map +1 -0
  376. package/dist/presentation/cli/commands/suggest-command.d.ts +13 -0
  377. package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
  378. package/dist/presentation/cli/commands/suggest-command.js +25 -0
  379. package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
  380. package/dist/presentation/cli/commands/trace-command.d.ts.map +1 -1
  381. package/dist/presentation/cli/commands/trace-command.js +9 -5
  382. package/dist/presentation/cli/commands/trace-command.js.map +1 -1
  383. package/dist/presentation/cli/commands/undo-command.js +15 -6
  384. package/dist/presentation/cli/commands/undo-command.js.map +1 -1
  385. package/dist/presentation/cli/error-display.d.ts +2 -0
  386. package/dist/presentation/cli/error-display.d.ts.map +1 -1
  387. package/dist/presentation/cli/error-display.js +220 -2
  388. package/dist/presentation/cli/error-display.js.map +1 -1
  389. package/dist/presentation/cli/keyboard-shortcuts.d.ts +27 -0
  390. package/dist/presentation/cli/keyboard-shortcuts.d.ts.map +1 -0
  391. package/dist/presentation/cli/keyboard-shortcuts.js +77 -0
  392. package/dist/presentation/cli/keyboard-shortcuts.js.map +1 -0
  393. package/dist/session.d.ts.map +1 -1
  394. package/dist/session.js +39 -2
  395. package/dist/session.js.map +1 -1
  396. package/dist/ui.d.ts.map +1 -1
  397. package/dist/ui.js +8 -5
  398. package/dist/ui.js.map +1 -1
  399. package/dist/utils/version.js +2 -2
  400. package/dist/verification/backup.d.ts.map +1 -1
  401. package/dist/verification/backup.js +24 -3
  402. package/dist/verification/backup.js.map +1 -1
  403. package/dist/verification/compiler.js +47 -12
  404. package/dist/verification/compiler.js.map +1 -1
  405. package/package.json +10 -2
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Infrastructure: Proportional Friction Enhancement
3
+ * Task 5.2: Higher friction for high-risk actions, lower friction for safe operations
4
+ *
5
+ * Features:
6
+ * - User-configurable friction levels
7
+ * - Risk-proportional friction calculation
8
+ * - Consistent application across operations
9
+ */
10
+ import { AppropriateFriction } from './appropriate-friction.js';
11
+ import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
12
+ import { join } from 'path';
13
+ /**
14
+ * Enhanced Proportional Friction System
15
+ * Extends AppropriateFriction with user-configurable proportional scaling
16
+ */
17
+ export class ProportionalFriction extends AppropriateFriction {
18
+ config;
19
+ configPath;
20
+ constructor(configPath) {
21
+ super();
22
+ this.configPath = configPath || join(process.cwd(), 'data', 'friction-config.json');
23
+ this.config = this.loadConfiguration();
24
+ }
25
+ /**
26
+ * Get friction point adjusted for user preferences
27
+ * Scales friction level based on user configuration and risk
28
+ */
29
+ getProportionalFriction(operation, context) {
30
+ const baseFriction = this.needsFriction(operation, context);
31
+ if (!baseFriction) {
32
+ return null; // No friction needed
33
+ }
34
+ // Adjust friction level based on user preference
35
+ const adjustedLevel = this.adjustFrictionLevel(baseFriction.level, context.riskLevel || 'medium', this.config);
36
+ // Adjust confirmation requirements based on preference
37
+ const requiresConfirmation = this.shouldRequireConfirmation(baseFriction.requiresExplicitConfirmation, adjustedLevel, this.config);
38
+ // Adjust timeout based on preference
39
+ const timeout = this.adjustTimeout(baseFriction.timeout, adjustedLevel, this.config);
40
+ return {
41
+ ...baseFriction,
42
+ level: adjustedLevel,
43
+ requiresExplicitConfirmation: requiresConfirmation,
44
+ timeout: timeout,
45
+ };
46
+ }
47
+ /**
48
+ * Adjust friction level based on user preference
49
+ */
50
+ adjustFrictionLevel(baseLevel, riskLevel, config) {
51
+ // For critical operations, always use heavy friction regardless of preference
52
+ if (riskLevel === 'critical') {
53
+ return 'heavy';
54
+ }
55
+ switch (config.preference) {
56
+ case 'minimal':
57
+ // Reduce friction levels
58
+ if (baseLevel === 'heavy')
59
+ return 'moderate';
60
+ if (baseLevel === 'moderate')
61
+ return 'light';
62
+ if (baseLevel === 'light')
63
+ return 'none';
64
+ return baseLevel;
65
+ case 'strict':
66
+ // Increase friction levels
67
+ if (baseLevel === 'light')
68
+ return 'moderate';
69
+ if (baseLevel === 'moderate')
70
+ return 'heavy';
71
+ if (baseLevel === 'none' && riskLevel !== 'low')
72
+ return 'light';
73
+ return baseLevel;
74
+ case 'balanced':
75
+ default:
76
+ // Use base level as-is (default behavior)
77
+ return baseLevel;
78
+ }
79
+ }
80
+ /**
81
+ * Determine if explicit confirmation should be required
82
+ */
83
+ shouldRequireConfirmation(baseRequirement, frictionLevel, config) {
84
+ // Minimal preference allows auto-proceed for moderate friction
85
+ if (config.preference === 'minimal' && config.allowAutoProceed) {
86
+ if (frictionLevel === 'light' || frictionLevel === 'moderate') {
87
+ return false; // Allow auto-proceed
88
+ }
89
+ }
90
+ // Strict preference always requires confirmation for any friction
91
+ if (config.preference === 'strict') {
92
+ return frictionLevel !== 'none';
93
+ }
94
+ // Balanced: Use base requirement
95
+ return baseRequirement;
96
+ }
97
+ /**
98
+ * Adjust timeout based on user preference
99
+ */
100
+ adjustTimeout(baseTimeout, frictionLevel, config) {
101
+ if (!baseTimeout) {
102
+ return undefined; // No timeout
103
+ }
104
+ // Minimal: Shorter timeout
105
+ if (config.preference === 'minimal') {
106
+ return Math.max(1000, baseTimeout * 0.5); // 50% of base timeout
107
+ }
108
+ // Strict: Longer timeout
109
+ if (config.preference === 'strict') {
110
+ return baseTimeout * 2; // 200% of base timeout
111
+ }
112
+ // Balanced: Use base timeout
113
+ return baseTimeout;
114
+ }
115
+ /**
116
+ * Update friction configuration
117
+ */
118
+ updateConfiguration(config) {
119
+ this.config = {
120
+ ...this.config,
121
+ ...config,
122
+ };
123
+ this.saveConfiguration();
124
+ }
125
+ /**
126
+ * Get current configuration
127
+ */
128
+ getConfiguration() {
129
+ return { ...this.config };
130
+ }
131
+ /**
132
+ * Set user preference
133
+ */
134
+ setPreference(preference) {
135
+ this.config.preference = preference;
136
+ this.saveConfiguration();
137
+ }
138
+ /**
139
+ * Calculate friction intensity score (0-1)
140
+ * Higher score = more friction
141
+ */
142
+ calculateFrictionScore(riskLevel, isDestructive, affectsMultipleFiles, modifiesSecuritySensitiveCode, uncertainty) {
143
+ let score = 0;
144
+ // Risk level contribution (40%)
145
+ const riskScores = { low: 0.1, medium: 0.3, high: 0.6, critical: 1.0 };
146
+ score += riskScores[riskLevel] * 0.4;
147
+ // Destructive operation (20%)
148
+ if (isDestructive)
149
+ score += 0.2;
150
+ // Multi-file impact (15%)
151
+ if (affectsMultipleFiles)
152
+ score += 0.15;
153
+ // Security-sensitive (20%)
154
+ if (modifiesSecuritySensitiveCode)
155
+ score += 0.2;
156
+ // Uncertainty (5%)
157
+ score += Math.min(uncertainty, 1.0) * 0.05;
158
+ // Apply user preference scaling
159
+ const preferenceScale = {
160
+ minimal: 0.7, // 30% reduction
161
+ balanced: 1.0, // No change
162
+ strict: 1.3, // 30% increase
163
+ };
164
+ score *= preferenceScale[this.config.preference];
165
+ return Math.min(score, 1.0); // Cap at 1.0
166
+ }
167
+ // Configuration persistence
168
+ loadConfiguration() {
169
+ try {
170
+ if (existsSync(this.configPath)) {
171
+ const data = JSON.parse(readFileSync(this.configPath, 'utf-8'));
172
+ return {
173
+ preference: data.preference || 'balanced',
174
+ allowAutoProceed: data.allowAutoProceed ?? true,
175
+ customThresholds: data.customThresholds,
176
+ };
177
+ }
178
+ }
179
+ catch {
180
+ // Use defaults if config doesn't exist or can't be read
181
+ }
182
+ return {
183
+ preference: 'balanced',
184
+ allowAutoProceed: true,
185
+ };
186
+ }
187
+ saveConfiguration() {
188
+ try {
189
+ const configDir = join(this.configPath, '..');
190
+ if (!existsSync(configDir)) {
191
+ mkdirSync(configDir, { recursive: true });
192
+ }
193
+ writeFileSync(this.configPath, JSON.stringify(this.config, null, 2));
194
+ }
195
+ catch {
196
+ // Silently fail - configuration is optional
197
+ }
198
+ }
199
+ }
200
+ //# sourceMappingURL=proportional-friction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proportional-friction.js","sourceRoot":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D;QAC1D,CAAC;QAED,OAAO;YACL,UAAU,EAAE,UAAU;YACtB,gBAAgB,EAAE,IAAI;SACvB,CAAC;IACJ,CAAC;IAEO,iBAAiB;QACvB,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAC9C,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC3B,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5C,CAAC;YACD,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACvE,CAAC;QAAC,MAAM,CAAC;YACP,4CAA4C;QAC9C,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Review Checkpoint UI
3
+ * Shows summary before applying edits - Task 5.1
4
+ */
5
+ export interface EditSummary {
6
+ filepath: string;
7
+ linesAdded: number;
8
+ linesRemoved: number;
9
+ linesChanged: number;
10
+ diff?: string;
11
+ }
12
+ export interface ReviewCheckpointInfo {
13
+ filesToModify: EditSummary[];
14
+ securityScanPassed: boolean;
15
+ compilationValid: boolean;
16
+ riskLevel: 'low' | 'medium' | 'high' | 'critical';
17
+ uncertainty?: number;
18
+ }
19
+ /**
20
+ * Display review checkpoint before applying edits
21
+ */
22
+ export declare function displayReviewCheckpoint(info: ReviewCheckpointInfo): void;
23
+ /**
24
+ * Calculate diff summary from old and new content
25
+ */
26
+ export declare function calculateDiffSummary(oldContent: string, newContent: string): {
27
+ linesAdded: number;
28
+ linesRemoved: number;
29
+ linesChanged: number;
30
+ };
31
+ /**
32
+ * Format edit summary for display
33
+ */
34
+ export declare function formatEditSummary(summary: EditSummary): string;
35
+ //# sourceMappingURL=review-checkpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-checkpoint.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/review-checkpoint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,WAAW,EAAE,CAAC;IAC7B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAyExE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAwCpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAc9D"}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Review Checkpoint UI
3
+ * Shows summary before applying edits - Task 5.1
4
+ */
5
+ import { colors, separator, newline, success, warning, error, createTable, } from '../../ui.js';
6
+ /**
7
+ * Display review checkpoint before applying edits
8
+ */
9
+ export function displayReviewCheckpoint(info) {
10
+ newline();
11
+ console.log(separator('═', 80));
12
+ console.log(colors.bold('📝 Review Changes'));
13
+ console.log(separator('═', 80));
14
+ newline();
15
+ // Files summary
16
+ console.log(colors.bold(`Files to modify: ${info.filesToModify.length}`));
17
+ newline();
18
+ // File details table
19
+ const fileRows = info.filesToModify.map(file => [
20
+ file.filepath,
21
+ `${file.linesAdded} added, ${file.linesRemoved} removed`,
22
+ file.linesChanged > 0 ? `${file.linesChanged} changed` : '-',
23
+ ]);
24
+ const fileTable = createTable(['File', 'Changes', 'Modified Lines'], fileRows);
25
+ console.log(fileTable.toString());
26
+ newline();
27
+ // Status indicators
28
+ console.log(colors.bold('Status:'));
29
+ const statusRows = [
30
+ [
31
+ 'Security Scan',
32
+ info.securityScanPassed ? success('✓ Passed') : error('✗ Failed'),
33
+ ],
34
+ [
35
+ 'Compilation',
36
+ info.compilationValid ? success('✓ Valid') : error('✗ Invalid'),
37
+ ],
38
+ ];
39
+ const statusTable = createTable(['Check', 'Status'], statusRows);
40
+ console.log(statusTable.toString());
41
+ newline();
42
+ // Risk level indicator
43
+ const riskColors = {
44
+ low: colors.green,
45
+ medium: colors.yellow,
46
+ high: colors.yellow,
47
+ critical: colors.red,
48
+ };
49
+ const riskLabels = {
50
+ low: 'Low Risk',
51
+ medium: 'Medium Risk',
52
+ high: 'High Risk',
53
+ critical: 'Critical Risk',
54
+ };
55
+ console.log(colors.bold('Risk Level: ') +
56
+ riskColors[info.riskLevel](riskLabels[info.riskLevel]));
57
+ if (info.uncertainty && info.uncertainty > 0.5) {
58
+ const percent = (info.uncertainty * 100).toFixed(0);
59
+ console.log(warning(`⚠️ Uncertainty: ${percent}% - Please verify output carefully`));
60
+ }
61
+ newline();
62
+ console.log(separator('═', 80));
63
+ newline();
64
+ }
65
+ /**
66
+ * Calculate diff summary from old and new content
67
+ */
68
+ export function calculateDiffSummary(oldContent, newContent) {
69
+ const oldLines = oldContent.split('\n');
70
+ const newLines = newContent.split('\n');
71
+ let linesAdded = 0;
72
+ let linesRemoved = 0;
73
+ let linesChanged = 0;
74
+ // Simple line-based diff calculation
75
+ const oldSet = new Set(oldLines);
76
+ const newSet = new Set(newLines);
77
+ // Count added lines (in new but not in old)
78
+ for (const line of newLines) {
79
+ if (!oldSet.has(line)) {
80
+ linesAdded++;
81
+ }
82
+ }
83
+ // Count removed lines (in old but not in new)
84
+ for (const line of oldLines) {
85
+ if (!newSet.has(line)) {
86
+ linesRemoved++;
87
+ }
88
+ }
89
+ // Changed lines = lines that exist in both but at different positions
90
+ // Simplified: count lines that are in both but position differs
91
+ const minLength = Math.min(oldLines.length, newLines.length);
92
+ for (let i = 0; i < minLength; i++) {
93
+ if (oldLines[i] !== newLines[i] && oldSet.has(newLines[i])) {
94
+ linesChanged++;
95
+ }
96
+ }
97
+ return {
98
+ linesAdded,
99
+ linesRemoved,
100
+ linesChanged,
101
+ };
102
+ }
103
+ /**
104
+ * Format edit summary for display
105
+ */
106
+ export function formatEditSummary(summary) {
107
+ const changes = [];
108
+ if (summary.linesAdded > 0) {
109
+ changes.push(`${summary.linesAdded} added`);
110
+ }
111
+ if (summary.linesRemoved > 0) {
112
+ changes.push(`${summary.linesRemoved} removed`);
113
+ }
114
+ if (summary.linesChanged > 0) {
115
+ changes.push(`${summary.linesChanged} changed`);
116
+ }
117
+ return changes.length > 0 ? changes.join(', ') : 'No changes';
118
+ }
119
+ //# sourceMappingURL=review-checkpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-checkpoint.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/review-checkpoint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,MAAM,EACN,SAAS,EACT,OAAO,EAEP,OAAO,EACP,OAAO,EACP,KAAK,EAEL,WAAW,GACZ,MAAM,aAAa,CAAC;AAkBrB;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAA0B;IAChE,OAAO,EAAE,CAAC;IACV,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EA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AC9C,CAAC;IACD,IAAI,OAAO,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,YAAY,UAAU,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,OAAO,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,YAAY,UAAU,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;AAChE,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Infrastructure: Staged Feature Introduction
3
+ *
4
+ * UI utilities for Progressive Disclosure integration in CLI commands
5
+ * Task 2.3: Show feature levels and gate features based on user experience
6
+ */
7
+ import { ProgressiveDisclosure, type UserLevel, type FeatureCapability } from './progressive-disclosure.js';
8
+ /**
9
+ * Display feature level indicator
10
+ */
11
+ export declare function displayFeatureLevel(capability: FeatureCapability): string;
12
+ /**
13
+ * Display user level indicator
14
+ */
15
+ export declare function displayUserLevel(level: UserLevel): string;
16
+ /**
17
+ * Display feature gating message when feature is not available
18
+ */
19
+ export declare function displayFeatureGatingMessage(featureId: string, featureName: string, reason: string, suggestedLevel?: UserLevel, currentLevel?: UserLevel): void;
20
+ /**
21
+ * Display feature availability message
22
+ */
23
+ export declare function displayFeatureAvailability(featureName: string, capability: FeatureCapability, userLevel: UserLevel): void;
24
+ /**
25
+ * Display upgrade notification when user levels up
26
+ */
27
+ export declare function displayLevelUpNotification(oldLevel: UserLevel, newLevel: UserLevel, newFeatures: Array<{
28
+ name: string;
29
+ capability: FeatureCapability;
30
+ }>): void;
31
+ /**
32
+ * Check if feature is available and show appropriate message
33
+ */
34
+ export declare function checkFeatureAccess(progressiveDisclosure: ProgressiveDisclosure, userId: string, featureId: string): {
35
+ available: boolean;
36
+ shouldContinue: boolean;
37
+ };
38
+ /**
39
+ * Get features summary for user
40
+ */
41
+ export declare function getFeaturesSummary(progressiveDisclosure: ProgressiveDisclosure, userId: string): {
42
+ userLevel: UserLevel;
43
+ totalFeatures: number;
44
+ availableFeatures: number;
45
+ nextLevelFeatures: number;
46
+ };
47
+ //# sourceMappingURL=staged-feature-intro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staged-feature-intro.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/staged-feature-intro.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,qBAAqB,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE5G;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAmBzE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAUzD;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,cAAc,CAAC,EAAE,SAAS,EAC1B,YAAY,CAAC,EAAE,SAAS,GACvB,IAAI,CAuBN;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,iBAAiB,EAC7B,SAAS,EAAE,SAAS,GACnB,IAAI,CAQN;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,SAAS,EACnB,WAAW,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,iBAAiB,CAAA;CAAE,CAAC,GAClE,IAAI,CAqBN;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,qBAAqB,EAAE,qBAAqB,EAC5C,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAkCjD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,qBAAqB,EAAE,qBAAqB,EAC5C,MAAM,EAAE,MAAM,GACb;IACD,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAuBA"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Infrastructure: Staged Feature Introduction
3
+ *
4
+ * UI utilities for Progressive Disclosure integration in CLI commands
5
+ * Task 2.3: Show feature levels and gate features based on user experience
6
+ */
7
+ import { colors, separator } from '../../ui.js';
8
+ /**
9
+ * Display feature level indicator
10
+ */
11
+ export function displayFeatureLevel(capability) {
12
+ const levelColors = {
13
+ basic: colors.green,
14
+ standard: colors.blue,
15
+ advanced: colors.yellow,
16
+ experimental: colors.magenta,
17
+ };
18
+ const levelLabels = {
19
+ basic: 'Basic',
20
+ standard: 'Standard',
21
+ advanced: 'Advanced',
22
+ experimental: 'Experimental',
23
+ };
24
+ const colorFn = levelColors[capability] || colors.gray;
25
+ const label = levelLabels[capability] || capability;
26
+ return colorFn(`[${label}]`);
27
+ }
28
+ /**
29
+ * Display user level indicator
30
+ */
31
+ export function displayUserLevel(level) {
32
+ const levelColors = {
33
+ beginner: colors.cyan,
34
+ intermediate: colors.blue,
35
+ advanced: colors.yellow,
36
+ expert: colors.magenta,
37
+ };
38
+ const colorFn = levelColors[level] || colors.gray;
39
+ return colorFn(level.charAt(0).toUpperCase() + level.slice(1));
40
+ }
41
+ /**
42
+ * Display feature gating message when feature is not available
43
+ */
44
+ export function displayFeatureGatingMessage(featureId, featureName, reason, suggestedLevel, currentLevel) {
45
+ console.log('');
46
+ console.log(separator('═', 80));
47
+ console.log(colors.yellow(`⚠️ Feature Unavailable: ${featureName}`));
48
+ console.log(separator('═', 80));
49
+ console.log('');
50
+ console.log(colors.dim(`Reason: ${reason}`));
51
+ if (suggestedLevel && currentLevel) {
52
+ console.log('');
53
+ console.log(colors.bold('Upgrade Path:'));
54
+ console.log(` Current Level: ${displayUserLevel(currentLevel)}`);
55
+ console.log(` Required Level: ${displayUserLevel(suggestedLevel)}`);
56
+ console.log('');
57
+ console.log(colors.dim('Keep using Codehere to unlock more features!'));
58
+ console.log(colors.dim(` • Use basic features to progress to intermediate`));
59
+ console.log(colors.dim(` • Explore new capabilities to advance your level`));
60
+ }
61
+ console.log('');
62
+ console.log(separator('═', 80));
63
+ console.log('');
64
+ }
65
+ /**
66
+ * Display feature availability message
67
+ */
68
+ export function displayFeatureAvailability(featureName, capability, userLevel) {
69
+ const levelBadge = displayFeatureLevel(capability);
70
+ const userBadge = displayUserLevel(userLevel);
71
+ // Only show for non-basic features to reduce noise
72
+ if (capability !== 'basic') {
73
+ console.log(colors.dim(`${levelBadge} Feature: ${featureName} (${userBadge} level)`));
74
+ }
75
+ }
76
+ /**
77
+ * Display upgrade notification when user levels up
78
+ */
79
+ export function displayLevelUpNotification(oldLevel, newLevel, newFeatures) {
80
+ console.log('');
81
+ console.log(separator('═', 80));
82
+ console.log(colors.green(`🎉 Level Up! You're now ${displayUserLevel(newLevel)}`));
83
+ console.log(separator('═', 80));
84
+ console.log('');
85
+ if (newFeatures.length > 0) {
86
+ console.log(colors.bold('New Features Unlocked:'));
87
+ console.log('');
88
+ newFeatures.forEach(feature => {
89
+ const badge = displayFeatureLevel(feature.capability);
90
+ console.log(` ${badge} ${feature.name}`);
91
+ });
92
+ console.log('');
93
+ }
94
+ console.log(colors.dim('Keep exploring to unlock even more advanced capabilities!'));
95
+ console.log('');
96
+ console.log(separator('═', 80));
97
+ console.log('');
98
+ }
99
+ /**
100
+ * Check if feature is available and show appropriate message
101
+ */
102
+ export function checkFeatureAccess(progressiveDisclosure, userId, featureId) {
103
+ const check = progressiveDisclosure.shouldShowFeature(userId, featureId);
104
+ if (!check.show) {
105
+ const profile = progressiveDisclosure.getUserProfile(userId);
106
+ // Get feature from available features to find name
107
+ const availableFeatures = progressiveDisclosure.getAvailableFeatures(userId);
108
+ const allFeatures = [...availableFeatures];
109
+ const unavailableFeatures = progressiveDisclosure.getNextSuggestedFeatures(userId, 100);
110
+ const feature = [...allFeatures, ...unavailableFeatures].find(f => f.featureId === featureId);
111
+ if (feature) {
112
+ displayFeatureGatingMessage(featureId, feature.featureName, check.reason || 'Feature not available', check.suggestedLevel, profile.level);
113
+ }
114
+ else {
115
+ // Fallback if feature not found
116
+ displayFeatureGatingMessage(featureId, featureId.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase()), check.reason || 'Feature not available', check.suggestedLevel, profile.level);
117
+ }
118
+ return { available: false, shouldContinue: false };
119
+ }
120
+ return { available: true, shouldContinue: true };
121
+ }
122
+ /**
123
+ * Get features summary for user
124
+ */
125
+ export function getFeaturesSummary(progressiveDisclosure, userId) {
126
+ const profile = progressiveDisclosure.getUserProfile(userId);
127
+ const available = progressiveDisclosure.getAvailableFeatures(userId);
128
+ const allFeatures = Array.from(progressiveDisclosure.featureRegistry?.values() || []);
129
+ // Count features for next level
130
+ const levelOrder = ['beginner', 'intermediate', 'advanced', 'expert'];
131
+ const currentIndex = levelOrder.indexOf(profile.level);
132
+ const nextLevel = currentIndex < levelOrder.length - 1 ? levelOrder[currentIndex + 1] : null;
133
+ let nextLevelFeatures = 0;
134
+ if (nextLevel) {
135
+ nextLevelFeatures = allFeatures.filter((f) => f.requiredLevel === nextLevel).length;
136
+ }
137
+ return {
138
+ userLevel: profile.level,
139
+ totalFeatures: allFeatures.length,
140
+ availableFeatures: available.length,
141
+ nextLevelFeatures,
142
+ };
143
+ }
144
+ //# sourceMappingURL=staged-feature-intro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staged-feature-intro.js","sourceRoot":"","sources":["../../../src/infrastructure/ux/staged-feature-intro.ts"],"names":[],"mappings":"AAAA;;;;;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,CAAC,CAAC,aAAa,KAAK,SAAS,CAC1C,CAAC,MAAM,CAAC;IACX,CAAC;IAED,OAAO;QACL,SAAS,EAAE,OAAO,CAAC,KAAK;QACxB,aAAa,EAAE,WAAW,CAAC,MAAM;QACjC,iBAAiB,EAAE,SAAS,CAAC,MAAM;QACnC,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Syntax Highlighter for Terminal
3
+ * Provides basic syntax highlighting for code snippets using chalk
4
+ *
5
+ * Lightweight implementation - no heavy dependencies
6
+ * Supports: TypeScript, JavaScript, Python, JSON, YAML, Markdown, Shell
7
+ */
8
+ export type SupportedLanguage = 'typescript' | 'javascript' | 'python' | 'json' | 'yaml' | 'markdown' | 'shell' | 'bash' | 'text';
9
+ /**
10
+ * Detect language from file extension
11
+ */
12
+ export declare function detectLanguage(filepath: string): SupportedLanguage;
13
+ /**
14
+ * Highlight code based on language
15
+ */
16
+ export declare function highlightCode(code: string, language?: SupportedLanguage | string): string;
17
+ /**
18
+ * Format code block with syntax highlighting
19
+ */
20
+ export declare function formatCodeBlockWithHighlight(code: string, language?: string, filepath?: string): string;
21
+ //# sourceMappingURL=syntax-highlighter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntax-highlighter.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/syntax-highlighter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,MAAM,iBAAiB,GACzB,YAAY,GACZ,YAAY,GACZ,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,MAAM,GACN,MAAM,CAAC;AAEX;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAoBlE;AAsKD;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAsCzF;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAyBR"}