codeseeker 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1380) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +388 -0
  3. package/bin/codeseeker.js +171 -0
  4. package/dist/cli/analyzers/change-analyzer.d.ts +7 -0
  5. package/dist/cli/analyzers/change-analyzer.d.ts.map +1 -0
  6. package/dist/cli/analyzers/change-analyzer.js +22 -0
  7. package/dist/cli/analyzers/change-analyzer.js.map +1 -0
  8. package/dist/cli/analyzers/configuration-analyzer.d.ts +7 -0
  9. package/dist/cli/analyzers/configuration-analyzer.d.ts.map +1 -0
  10. package/dist/cli/analyzers/configuration-analyzer.js +67 -0
  11. package/dist/cli/analyzers/configuration-analyzer.js.map +1 -0
  12. package/dist/cli/analyzers/documentation-analyzer.d.ts +7 -0
  13. package/dist/cli/analyzers/documentation-analyzer.d.ts.map +1 -0
  14. package/dist/cli/analyzers/documentation-analyzer.js +59 -0
  15. package/dist/cli/analyzers/documentation-analyzer.js.map +1 -0
  16. package/dist/cli/analyzers/project-structure-analyzer.d.ts +7 -0
  17. package/dist/cli/analyzers/project-structure-analyzer.d.ts.map +1 -0
  18. package/dist/cli/analyzers/project-structure-analyzer.js +68 -0
  19. package/dist/cli/analyzers/project-structure-analyzer.js.map +1 -0
  20. package/dist/cli/codemind-workflow-orchestrator.d.ts +19 -0
  21. package/dist/cli/codemind-workflow-orchestrator.d.ts.map +1 -0
  22. package/dist/cli/codemind-workflow-orchestrator.js +26 -0
  23. package/dist/cli/codemind-workflow-orchestrator.js.map +1 -0
  24. package/dist/cli/codeseeker-cli.d.ts +156 -0
  25. package/dist/cli/codeseeker-cli.d.ts.map +1 -0
  26. package/dist/cli/codeseeker-cli.js +937 -0
  27. package/dist/cli/codeseeker-cli.js.map +1 -0
  28. package/dist/cli/codeseeker-workflow-orchestrator.d.ts +19 -0
  29. package/dist/cli/codeseeker-workflow-orchestrator.d.ts.map +1 -0
  30. package/dist/cli/codeseeker-workflow-orchestrator.js +26 -0
  31. package/dist/cli/codeseeker-workflow-orchestrator.js.map +1 -0
  32. package/dist/cli/commands/base-command-handler.d.ts +31 -0
  33. package/dist/cli/commands/base-command-handler.d.ts.map +1 -0
  34. package/dist/cli/commands/base-command-handler.js +110 -0
  35. package/dist/cli/commands/base-command-handler.js.map +1 -0
  36. package/dist/cli/commands/command-context.d.ts +27 -0
  37. package/dist/cli/commands/command-context.d.ts.map +1 -0
  38. package/dist/cli/commands/command-context.js +8 -0
  39. package/dist/cli/commands/command-context.js.map +1 -0
  40. package/dist/cli/commands/command-router.d.ts +135 -0
  41. package/dist/cli/commands/command-router.d.ts.map +1 -0
  42. package/dist/cli/commands/command-router.js +497 -0
  43. package/dist/cli/commands/command-router.js.map +1 -0
  44. package/dist/cli/commands/handlers/analyze-command-handler.d.ts +99 -0
  45. package/dist/cli/commands/handlers/analyze-command-handler.d.ts.map +1 -0
  46. package/dist/cli/commands/handlers/analyze-command-handler.js +704 -0
  47. package/dist/cli/commands/handlers/analyze-command-handler.js.map +1 -0
  48. package/dist/cli/commands/handlers/dedup-command-handler.d.ts +10 -0
  49. package/dist/cli/commands/handlers/dedup-command-handler.d.ts.map +1 -0
  50. package/dist/cli/commands/handlers/dedup-command-handler.js +19 -0
  51. package/dist/cli/commands/handlers/dedup-command-handler.js.map +1 -0
  52. package/dist/cli/commands/handlers/docs-command-handler.d.ts +10 -0
  53. package/dist/cli/commands/handlers/docs-command-handler.d.ts.map +1 -0
  54. package/dist/cli/commands/handlers/docs-command-handler.js +19 -0
  55. package/dist/cli/commands/handlers/docs-command-handler.js.map +1 -0
  56. package/dist/cli/commands/handlers/infrastructure-setup-handler.d.ts +21 -0
  57. package/dist/cli/commands/handlers/infrastructure-setup-handler.d.ts.map +1 -0
  58. package/dist/cli/commands/handlers/infrastructure-setup-handler.js +71 -0
  59. package/dist/cli/commands/handlers/infrastructure-setup-handler.js.map +1 -0
  60. package/dist/cli/commands/handlers/install-command-handler.d.ts +80 -0
  61. package/dist/cli/commands/handlers/install-command-handler.d.ts.map +1 -0
  62. package/dist/cli/commands/handlers/install-command-handler.js +466 -0
  63. package/dist/cli/commands/handlers/install-command-handler.js.map +1 -0
  64. package/dist/cli/commands/handlers/instructions-command-handler.d.ts +10 -0
  65. package/dist/cli/commands/handlers/instructions-command-handler.d.ts.map +1 -0
  66. package/dist/cli/commands/handlers/instructions-command-handler.js +19 -0
  67. package/dist/cli/commands/handlers/instructions-command-handler.js.map +1 -0
  68. package/dist/cli/commands/handlers/project-command-handler.d.ts +42 -0
  69. package/dist/cli/commands/handlers/project-command-handler.d.ts.map +1 -0
  70. package/dist/cli/commands/handlers/project-command-handler.js +257 -0
  71. package/dist/cli/commands/handlers/project-command-handler.js.map +1 -0
  72. package/dist/cli/commands/handlers/search-command-handler.d.ts +50 -0
  73. package/dist/cli/commands/handlers/search-command-handler.d.ts.map +1 -0
  74. package/dist/cli/commands/handlers/search-command-handler.js +500 -0
  75. package/dist/cli/commands/handlers/search-command-handler.js.map +1 -0
  76. package/dist/cli/commands/handlers/setup-command-handler.d.ts +103 -0
  77. package/dist/cli/commands/handlers/setup-command-handler.d.ts.map +1 -0
  78. package/dist/cli/commands/handlers/setup-command-handler.js +1135 -0
  79. package/dist/cli/commands/handlers/setup-command-handler.js.map +1 -0
  80. package/dist/cli/commands/handlers/solid-command-handler.d.ts +10 -0
  81. package/dist/cli/commands/handlers/solid-command-handler.d.ts.map +1 -0
  82. package/dist/cli/commands/handlers/solid-command-handler.js +19 -0
  83. package/dist/cli/commands/handlers/solid-command-handler.js.map +1 -0
  84. package/dist/cli/commands/handlers/sync-command-handler.d.ts +10 -0
  85. package/dist/cli/commands/handlers/sync-command-handler.d.ts.map +1 -0
  86. package/dist/cli/commands/handlers/sync-command-handler.js +19 -0
  87. package/dist/cli/commands/handlers/sync-command-handler.js.map +1 -0
  88. package/dist/cli/commands/handlers/synonyms-command-handler.d.ts +23 -0
  89. package/dist/cli/commands/handlers/synonyms-command-handler.d.ts.map +1 -0
  90. package/dist/cli/commands/handlers/synonyms-command-handler.js +201 -0
  91. package/dist/cli/commands/handlers/synonyms-command-handler.js.map +1 -0
  92. package/dist/cli/commands/handlers/watcher-command-handler.d.ts +10 -0
  93. package/dist/cli/commands/handlers/watcher-command-handler.d.ts.map +1 -0
  94. package/dist/cli/commands/handlers/watcher-command-handler.js +19 -0
  95. package/dist/cli/commands/handlers/watcher-command-handler.js.map +1 -0
  96. package/dist/cli/commands/reconcile.d.ts +8 -0
  97. package/dist/cli/commands/reconcile.d.ts.map +1 -0
  98. package/dist/cli/commands/reconcile.js +220 -0
  99. package/dist/cli/commands/reconcile.js.map +1 -0
  100. package/dist/cli/commands/semantic-search.d.ts +8 -0
  101. package/dist/cli/commands/semantic-search.d.ts.map +1 -0
  102. package/dist/cli/commands/semantic-search.js +219 -0
  103. package/dist/cli/commands/semantic-search.js.map +1 -0
  104. package/dist/cli/commands/services/claude-intent-analyzer.d.ts +109 -0
  105. package/dist/cli/commands/services/claude-intent-analyzer.d.ts.map +1 -0
  106. package/dist/cli/commands/services/claude-intent-analyzer.js +405 -0
  107. package/dist/cli/commands/services/claude-intent-analyzer.js.map +1 -0
  108. package/dist/cli/commands/services/context-aware-clarification-service.d.ts +99 -0
  109. package/dist/cli/commands/services/context-aware-clarification-service.d.ts.map +1 -0
  110. package/dist/cli/commands/services/context-aware-clarification-service.js +414 -0
  111. package/dist/cli/commands/services/context-aware-clarification-service.js.map +1 -0
  112. package/dist/cli/commands/services/context-builder.d.ts +90 -0
  113. package/dist/cli/commands/services/context-builder.d.ts.map +1 -0
  114. package/dist/cli/commands/services/context-builder.js +330 -0
  115. package/dist/cli/commands/services/context-builder.js.map +1 -0
  116. package/dist/cli/commands/services/graph-analysis-service.d.ts +157 -0
  117. package/dist/cli/commands/services/graph-analysis-service.d.ts.map +1 -0
  118. package/dist/cli/commands/services/graph-analysis-service.js +722 -0
  119. package/dist/cli/commands/services/graph-analysis-service.js.map +1 -0
  120. package/dist/cli/commands/services/natural-language-processor.d.ts +41 -0
  121. package/dist/cli/commands/services/natural-language-processor.d.ts.map +1 -0
  122. package/dist/cli/commands/services/natural-language-processor.js +77 -0
  123. package/dist/cli/commands/services/natural-language-processor.js.map +1 -0
  124. package/dist/cli/commands/services/search-quality-metrics.d.ts +85 -0
  125. package/dist/cli/commands/services/search-quality-metrics.d.ts.map +1 -0
  126. package/dist/cli/commands/services/search-quality-metrics.js +214 -0
  127. package/dist/cli/commands/services/search-quality-metrics.js.map +1 -0
  128. package/dist/cli/commands/services/semantic-search-orchestrator.d.ts +85 -0
  129. package/dist/cli/commands/services/semantic-search-orchestrator.d.ts.map +1 -0
  130. package/dist/cli/commands/services/semantic-search-orchestrator.js +331 -0
  131. package/dist/cli/commands/services/semantic-search-orchestrator.js.map +1 -0
  132. package/dist/cli/commands/services/task-decomposition-service.d.ts +114 -0
  133. package/dist/cli/commands/services/task-decomposition-service.d.ts.map +1 -0
  134. package/dist/cli/commands/services/task-decomposition-service.js +364 -0
  135. package/dist/cli/commands/services/task-decomposition-service.js.map +1 -0
  136. package/dist/cli/commands/services/unified-query-analyzer.d.ts +75 -0
  137. package/dist/cli/commands/services/unified-query-analyzer.d.ts.map +1 -0
  138. package/dist/cli/commands/services/unified-query-analyzer.js +282 -0
  139. package/dist/cli/commands/services/unified-query-analyzer.js.map +1 -0
  140. package/dist/cli/commands/services/user-interaction-service.d.ts +326 -0
  141. package/dist/cli/commands/services/user-interaction-service.d.ts.map +1 -0
  142. package/dist/cli/commands/services/user-interaction-service.js +1987 -0
  143. package/dist/cli/commands/services/user-interaction-service.js.map +1 -0
  144. package/dist/cli/commands/services/workflow-orchestrator.d.ts +171 -0
  145. package/dist/cli/commands/services/workflow-orchestrator.d.ts.map +1 -0
  146. package/dist/cli/commands/services/workflow-orchestrator.js +660 -0
  147. package/dist/cli/commands/services/workflow-orchestrator.js.map +1 -0
  148. package/dist/cli/context-optimizer.d.ts +96 -0
  149. package/dist/cli/context-optimizer.d.ts.map +1 -0
  150. package/dist/cli/context-optimizer.js +582 -0
  151. package/dist/cli/context-optimizer.js.map +1 -0
  152. package/dist/cli/features/code-graph/graph-builder.d.ts +119 -0
  153. package/dist/cli/features/code-graph/graph-builder.d.ts.map +1 -0
  154. package/dist/cli/features/code-graph/graph-builder.js +532 -0
  155. package/dist/cli/features/code-graph/graph-builder.js.map +1 -0
  156. package/dist/cli/features/compilation/verifier.d.ts +69 -0
  157. package/dist/cli/features/compilation/verifier.d.ts.map +1 -0
  158. package/dist/cli/features/compilation/verifier.js +431 -0
  159. package/dist/cli/features/compilation/verifier.js.map +1 -0
  160. package/dist/cli/features/database/database-documentation-generator.d.ts +103 -0
  161. package/dist/cli/features/database/database-documentation-generator.d.ts.map +1 -0
  162. package/dist/cli/features/database/database-documentation-generator.js +386 -0
  163. package/dist/cli/features/database/database-documentation-generator.js.map +1 -0
  164. package/dist/cli/features/database/database-schema-tool.d.ts +160 -0
  165. package/dist/cli/features/database/database-schema-tool.d.ts.map +1 -0
  166. package/dist/cli/features/database/database-schema-tool.js +437 -0
  167. package/dist/cli/features/database/database-schema-tool.js.map +1 -0
  168. package/dist/cli/features/documentation/map-analyzer.d.ts +95 -0
  169. package/dist/cli/features/documentation/map-analyzer.d.ts.map +1 -0
  170. package/dist/cli/features/documentation/map-analyzer.js +320 -0
  171. package/dist/cli/features/documentation/map-analyzer.js.map +1 -0
  172. package/dist/cli/features/duplication/detector.d.ts +28 -0
  173. package/dist/cli/features/duplication/detector.d.ts.map +1 -0
  174. package/dist/cli/features/duplication/detector.js +228 -0
  175. package/dist/cli/features/duplication/detector.js.map +1 -0
  176. package/dist/cli/features/duplication/interfaces/index.d.ts +134 -0
  177. package/dist/cli/features/duplication/interfaces/index.d.ts.map +1 -0
  178. package/dist/cli/features/duplication/interfaces/index.js +31 -0
  179. package/dist/cli/features/duplication/interfaces/index.js.map +1 -0
  180. package/dist/cli/features/duplication/services/duplication-detection-service.d.ts +27 -0
  181. package/dist/cli/features/duplication/services/duplication-detection-service.d.ts.map +1 -0
  182. package/dist/cli/features/duplication/services/duplication-detection-service.js +316 -0
  183. package/dist/cli/features/duplication/services/duplication-detection-service.js.map +1 -0
  184. package/dist/cli/features/duplication/services/file-analysis-service.d.ts +24 -0
  185. package/dist/cli/features/duplication/services/file-analysis-service.d.ts.map +1 -0
  186. package/dist/cli/features/duplication/services/file-analysis-service.js +340 -0
  187. package/dist/cli/features/duplication/services/file-analysis-service.js.map +1 -0
  188. package/dist/cli/features/duplication/services/refactoring-advisor-service.d.ts +33 -0
  189. package/dist/cli/features/duplication/services/refactoring-advisor-service.d.ts.map +1 -0
  190. package/dist/cli/features/duplication/services/refactoring-advisor-service.js +378 -0
  191. package/dist/cli/features/duplication/services/refactoring-advisor-service.js.map +1 -0
  192. package/dist/cli/features/duplication/services/statistics-service.d.ts +24 -0
  193. package/dist/cli/features/duplication/services/statistics-service.d.ts.map +1 -0
  194. package/dist/cli/features/duplication/services/statistics-service.js +285 -0
  195. package/dist/cli/features/duplication/services/statistics-service.js.map +1 -0
  196. package/dist/cli/features/semantic-graph/semantic-graph-tool.d.ts +38 -0
  197. package/dist/cli/features/semantic-graph/semantic-graph-tool.d.ts.map +1 -0
  198. package/dist/cli/features/semantic-graph/semantic-graph-tool.js +340 -0
  199. package/dist/cli/features/semantic-graph/semantic-graph-tool.js.map +1 -0
  200. package/dist/cli/features/solid-principles/analyzer.d.ts +40 -0
  201. package/dist/cli/features/solid-principles/analyzer.d.ts.map +1 -0
  202. package/dist/cli/features/solid-principles/analyzer.js +163 -0
  203. package/dist/cli/features/solid-principles/analyzer.js.map +1 -0
  204. package/dist/cli/features/tree-navigation/navigator.d.ts +23 -0
  205. package/dist/cli/features/tree-navigation/navigator.d.ts.map +1 -0
  206. package/dist/cli/features/tree-navigation/navigator.js +94 -0
  207. package/dist/cli/features/tree-navigation/navigator.js.map +1 -0
  208. package/dist/cli/git/change-detector.d.ts +61 -0
  209. package/dist/cli/git/change-detector.d.ts.map +1 -0
  210. package/dist/cli/git/change-detector.js +380 -0
  211. package/dist/cli/git/change-detector.js.map +1 -0
  212. package/dist/cli/git/git-commit-utils.d.ts +12 -0
  213. package/dist/cli/git/git-commit-utils.d.ts.map +1 -0
  214. package/dist/cli/git/git-commit-utils.js +210 -0
  215. package/dist/cli/git/git-commit-utils.js.map +1 -0
  216. package/dist/cli/git/git-database-utils.d.ts +10 -0
  217. package/dist/cli/git/git-database-utils.d.ts.map +1 -0
  218. package/dist/cli/git/git-database-utils.js +105 -0
  219. package/dist/cli/git/git-database-utils.js.map +1 -0
  220. package/dist/cli/git/git-integration.d.ts +53 -0
  221. package/dist/cli/git/git-integration.d.ts.map +1 -0
  222. package/dist/cli/git/git-integration.js +152 -0
  223. package/dist/cli/git/git-integration.js.map +1 -0
  224. package/dist/cli/git/in-memory-git-store.d.ts +10 -0
  225. package/dist/cli/git/in-memory-git-store.d.ts.map +1 -0
  226. package/dist/cli/git/in-memory-git-store.js +35 -0
  227. package/dist/cli/git/in-memory-git-store.js.map +1 -0
  228. package/dist/cli/git/interfaces.d.ts +82 -0
  229. package/dist/cli/git/interfaces.d.ts.map +1 -0
  230. package/dist/cli/git/interfaces.js +7 -0
  231. package/dist/cli/git/interfaces.js.map +1 -0
  232. package/dist/cli/git/services/git-analysis-service.d.ts +21 -0
  233. package/dist/cli/git/services/git-analysis-service.d.ts.map +1 -0
  234. package/dist/cli/git/services/git-analysis-service.js +169 -0
  235. package/dist/cli/git/services/git-analysis-service.js.map +1 -0
  236. package/dist/cli/git/services/git-autocommit-service.d.ts +19 -0
  237. package/dist/cli/git/services/git-autocommit-service.d.ts.map +1 -0
  238. package/dist/cli/git/services/git-autocommit-service.js +205 -0
  239. package/dist/cli/git/services/git-autocommit-service.js.map +1 -0
  240. package/dist/cli/git/services/git-database-service.d.ts +23 -0
  241. package/dist/cli/git/services/git-database-service.d.ts.map +1 -0
  242. package/dist/cli/git/services/git-database-service.js +255 -0
  243. package/dist/cli/git/services/git-database-service.js.map +1 -0
  244. package/dist/cli/git/services/git-operations-service.d.ts +22 -0
  245. package/dist/cli/git/services/git-operations-service.d.ts.map +1 -0
  246. package/dist/cli/git/services/git-operations-service.js +237 -0
  247. package/dist/cli/git/services/git-operations-service.js.map +1 -0
  248. package/dist/cli/integration/context-builder.d.ts +8 -0
  249. package/dist/cli/integration/context-builder.d.ts.map +1 -0
  250. package/dist/cli/integration/context-builder.js +103 -0
  251. package/dist/cli/integration/context-builder.js.map +1 -0
  252. package/dist/cli/integration/knowledge-base-updater.d.ts +12 -0
  253. package/dist/cli/integration/knowledge-base-updater.d.ts.map +1 -0
  254. package/dist/cli/integration/knowledge-base-updater.js +156 -0
  255. package/dist/cli/integration/knowledge-base-updater.js.map +1 -0
  256. package/dist/cli/integration/result-improver.d.ts +7 -0
  257. package/dist/cli/integration/result-improver.d.ts.map +1 -0
  258. package/dist/cli/integration/result-improver.js +26 -0
  259. package/dist/cli/integration/result-improver.js.map +1 -0
  260. package/dist/cli/integration/result-integrator.d.ts +7 -0
  261. package/dist/cli/integration/result-integrator.d.ts.map +1 -0
  262. package/dist/cli/integration/result-integrator.js +31 -0
  263. package/dist/cli/integration/result-integrator.js.map +1 -0
  264. package/dist/cli/integration/task-decomposer.d.ts +10 -0
  265. package/dist/cli/integration/task-decomposer.d.ts.map +1 -0
  266. package/dist/cli/integration/task-decomposer.js +32 -0
  267. package/dist/cli/integration/task-decomposer.js.map +1 -0
  268. package/dist/cli/integration/task-executor.d.ts +12 -0
  269. package/dist/cli/integration/task-executor.d.ts.map +1 -0
  270. package/dist/cli/integration/task-executor.js +76 -0
  271. package/dist/cli/integration/task-executor.js.map +1 -0
  272. package/dist/cli/knowledge/analyzers/interfaces.d.ts +55 -0
  273. package/dist/cli/knowledge/analyzers/interfaces.d.ts.map +1 -0
  274. package/dist/cli/knowledge/analyzers/interfaces.js +8 -0
  275. package/dist/cli/knowledge/analyzers/interfaces.js.map +1 -0
  276. package/dist/cli/knowledge/analyzers/semantic-analyzer.d.ts +27 -0
  277. package/dist/cli/knowledge/analyzers/semantic-analyzer.d.ts.map +1 -0
  278. package/dist/cli/knowledge/analyzers/semantic-analyzer.js +227 -0
  279. package/dist/cli/knowledge/analyzers/semantic-analyzer.js.map +1 -0
  280. package/dist/cli/knowledge/analyzers/services/ast-analysis-service.d.ts +23 -0
  281. package/dist/cli/knowledge/analyzers/services/ast-analysis-service.d.ts.map +1 -0
  282. package/dist/cli/knowledge/analyzers/services/ast-analysis-service.js +137 -0
  283. package/dist/cli/knowledge/analyzers/services/ast-analysis-service.js.map +1 -0
  284. package/dist/cli/knowledge/analyzers/services/file-discovery-service.d.ts +15 -0
  285. package/dist/cli/knowledge/analyzers/services/file-discovery-service.d.ts.map +1 -0
  286. package/dist/cli/knowledge/analyzers/services/file-discovery-service.js +110 -0
  287. package/dist/cli/knowledge/analyzers/services/file-discovery-service.js.map +1 -0
  288. package/dist/cli/knowledge/analyzers/services/pattern-detection-service.d.ts +21 -0
  289. package/dist/cli/knowledge/analyzers/services/pattern-detection-service.d.ts.map +1 -0
  290. package/dist/cli/knowledge/analyzers/services/pattern-detection-service.js +190 -0
  291. package/dist/cli/knowledge/analyzers/services/pattern-detection-service.js.map +1 -0
  292. package/dist/cli/knowledge/graph/knowledge-graph.d.ts +109 -0
  293. package/dist/cli/knowledge/graph/knowledge-graph.d.ts.map +1 -0
  294. package/dist/cli/knowledge/graph/knowledge-graph.js +281 -0
  295. package/dist/cli/knowledge/graph/knowledge-graph.js.map +1 -0
  296. package/dist/cli/knowledge/graph/managers/graph-mutation-manager.d.ts +69 -0
  297. package/dist/cli/knowledge/graph/managers/graph-mutation-manager.d.ts.map +1 -0
  298. package/dist/cli/knowledge/graph/managers/graph-mutation-manager.js +445 -0
  299. package/dist/cli/knowledge/graph/managers/graph-mutation-manager.js.map +1 -0
  300. package/dist/cli/knowledge/graph/managers/graph-query-manager.d.ts +86 -0
  301. package/dist/cli/knowledge/graph/managers/graph-query-manager.d.ts.map +1 -0
  302. package/dist/cli/knowledge/graph/managers/graph-query-manager.js +306 -0
  303. package/dist/cli/knowledge/graph/managers/graph-query-manager.js.map +1 -0
  304. package/dist/cli/knowledge/graph/managers/graph-state-manager.d.ts +70 -0
  305. package/dist/cli/knowledge/graph/managers/graph-state-manager.d.ts.map +1 -0
  306. package/dist/cli/knowledge/graph/managers/graph-state-manager.js +249 -0
  307. package/dist/cli/knowledge/graph/managers/graph-state-manager.js.map +1 -0
  308. package/dist/cli/knowledge/graph/managers/graph-traversal-manager.d.ts +72 -0
  309. package/dist/cli/knowledge/graph/managers/graph-traversal-manager.d.ts.map +1 -0
  310. package/dist/cli/knowledge/graph/managers/graph-traversal-manager.js +414 -0
  311. package/dist/cli/knowledge/graph/managers/graph-traversal-manager.js.map +1 -0
  312. package/dist/cli/knowledge/graph/services/architectural-insight-detector.d.ts +43 -0
  313. package/dist/cli/knowledge/graph/services/architectural-insight-detector.d.ts.map +1 -0
  314. package/dist/cli/knowledge/graph/services/architectural-insight-detector.js +536 -0
  315. package/dist/cli/knowledge/graph/services/architectural-insight-detector.js.map +1 -0
  316. package/dist/cli/knowledge/graph/services/graph-analyzer.d.ts +24 -0
  317. package/dist/cli/knowledge/graph/services/graph-analyzer.d.ts.map +1 -0
  318. package/dist/cli/knowledge/graph/services/graph-analyzer.js +262 -0
  319. package/dist/cli/knowledge/graph/services/graph-analyzer.js.map +1 -0
  320. package/dist/cli/knowledge/graph/services/graph-database-service.d.ts +61 -0
  321. package/dist/cli/knowledge/graph/services/graph-database-service.d.ts.map +1 -0
  322. package/dist/cli/knowledge/graph/services/graph-database-service.js +593 -0
  323. package/dist/cli/knowledge/graph/services/graph-database-service.js.map +1 -0
  324. package/dist/cli/knowledge/graph/services/graph-utility-service.d.ts +41 -0
  325. package/dist/cli/knowledge/graph/services/graph-utility-service.d.ts.map +1 -0
  326. package/dist/cli/knowledge/graph/services/graph-utility-service.js +208 -0
  327. package/dist/cli/knowledge/graph/services/graph-utility-service.js.map +1 -0
  328. package/dist/cli/knowledge/graph/types.d.ts +272 -0
  329. package/dist/cli/knowledge/graph/types.d.ts.map +1 -0
  330. package/dist/cli/knowledge/graph/types.js +127 -0
  331. package/dist/cli/knowledge/graph/types.js.map +1 -0
  332. package/dist/cli/knowledge/repository/knowledge-repository.d.ts +121 -0
  333. package/dist/cli/knowledge/repository/knowledge-repository.d.ts.map +1 -0
  334. package/dist/cli/knowledge/repository/knowledge-repository.js +642 -0
  335. package/dist/cli/knowledge/repository/knowledge-repository.js.map +1 -0
  336. package/dist/cli/managers/claude-code-forwarder.d.ts +68 -0
  337. package/dist/cli/managers/claude-code-forwarder.d.ts.map +1 -0
  338. package/dist/cli/managers/claude-code-forwarder.js +214 -0
  339. package/dist/cli/managers/claude-code-forwarder.js.map +1 -0
  340. package/dist/cli/managers/command-processor.d.ts +75 -0
  341. package/dist/cli/managers/command-processor.d.ts.map +1 -0
  342. package/dist/cli/managers/command-processor.js +117 -0
  343. package/dist/cli/managers/command-processor.js.map +1 -0
  344. package/dist/cli/managers/database-manager.d.ts +147 -0
  345. package/dist/cli/managers/database-manager.d.ts.map +1 -0
  346. package/dist/cli/managers/database-manager.js +218 -0
  347. package/dist/cli/managers/database-manager.js.map +1 -0
  348. package/dist/cli/managers/interrupt-manager.d.ts +75 -0
  349. package/dist/cli/managers/interrupt-manager.d.ts.map +1 -0
  350. package/dist/cli/managers/interrupt-manager.js +197 -0
  351. package/dist/cli/managers/interrupt-manager.js.map +1 -0
  352. package/dist/cli/managers/project-manager.d.ts +82 -0
  353. package/dist/cli/managers/project-manager.d.ts.map +1 -0
  354. package/dist/cli/managers/project-manager.js +257 -0
  355. package/dist/cli/managers/project-manager.js.map +1 -0
  356. package/dist/cli/managers/user-interface.d.ts +74 -0
  357. package/dist/cli/managers/user-interface.d.ts.map +1 -0
  358. package/dist/cli/managers/user-interface.js +529 -0
  359. package/dist/cli/managers/user-interface.js.map +1 -0
  360. package/dist/cli/managers/workflow-orchestration-adapter.d.ts +24 -0
  361. package/dist/cli/managers/workflow-orchestration-adapter.d.ts.map +1 -0
  362. package/dist/cli/managers/workflow-orchestration-adapter.js +136 -0
  363. package/dist/cli/managers/workflow-orchestration-adapter.js.map +1 -0
  364. package/dist/cli/orchestration/cli-orchestrator.d.ts +92 -0
  365. package/dist/cli/orchestration/cli-orchestrator.d.ts.map +1 -0
  366. package/dist/cli/orchestration/cli-orchestrator.js +195 -0
  367. package/dist/cli/orchestration/cli-orchestrator.js.map +1 -0
  368. package/dist/cli/quality/compilation-checker.d.ts +13 -0
  369. package/dist/cli/quality/compilation-checker.d.ts.map +1 -0
  370. package/dist/cli/quality/compilation-checker.js +78 -0
  371. package/dist/cli/quality/compilation-checker.js.map +1 -0
  372. package/dist/cli/quality/interfaces/index.d.ts +104 -0
  373. package/dist/cli/quality/interfaces/index.d.ts.map +1 -0
  374. package/dist/cli/quality/interfaces/index.js +7 -0
  375. package/dist/cli/quality/interfaces/index.js.map +1 -0
  376. package/dist/cli/quality/interfaces.d.ts +79 -0
  377. package/dist/cli/quality/interfaces.d.ts.map +1 -0
  378. package/dist/cli/quality/interfaces.js +7 -0
  379. package/dist/cli/quality/interfaces.js.map +1 -0
  380. package/dist/cli/quality/quality-orchestrator.d.ts +19 -0
  381. package/dist/cli/quality/quality-orchestrator.d.ts.map +1 -0
  382. package/dist/cli/quality/quality-orchestrator.js +109 -0
  383. package/dist/cli/quality/quality-orchestrator.js.map +1 -0
  384. package/dist/cli/quality/services/architecture-service.d.ts +17 -0
  385. package/dist/cli/quality/services/architecture-service.d.ts.map +1 -0
  386. package/dist/cli/quality/services/architecture-service.js +267 -0
  387. package/dist/cli/quality/services/architecture-service.js.map +1 -0
  388. package/dist/cli/quality/services/compilation-service.d.ts +16 -0
  389. package/dist/cli/quality/services/compilation-service.d.ts.map +1 -0
  390. package/dist/cli/quality/services/compilation-service.js +177 -0
  391. package/dist/cli/quality/services/compilation-service.js.map +1 -0
  392. package/dist/cli/quality/services/quality-score-calculator.d.ts +12 -0
  393. package/dist/cli/quality/services/quality-score-calculator.d.ts.map +1 -0
  394. package/dist/cli/quality/services/quality-score-calculator.js +120 -0
  395. package/dist/cli/quality/services/quality-score-calculator.js.map +1 -0
  396. package/dist/cli/quality/services/security-service.d.ts +15 -0
  397. package/dist/cli/quality/services/security-service.d.ts.map +1 -0
  398. package/dist/cli/quality/services/security-service.js +214 -0
  399. package/dist/cli/quality/services/security-service.js.map +1 -0
  400. package/dist/cli/quality/services/testing-service.d.ts +19 -0
  401. package/dist/cli/quality/services/testing-service.d.ts.map +1 -0
  402. package/dist/cli/quality/services/testing-service.js +251 -0
  403. package/dist/cli/quality/services/testing-service.js.map +1 -0
  404. package/dist/cli/quality/test-runner.d.ts +15 -0
  405. package/dist/cli/quality/test-runner.d.ts.map +1 -0
  406. package/dist/cli/quality/test-runner.js +148 -0
  407. package/dist/cli/quality/test-runner.js.map +1 -0
  408. package/dist/cli/quality-checker.d.ts +41 -0
  409. package/dist/cli/quality-checker.d.ts.map +1 -0
  410. package/dist/cli/quality-checker.js +216 -0
  411. package/dist/cli/quality-checker.js.map +1 -0
  412. package/dist/cli/scripts/start-tool-api.d.ts +7 -0
  413. package/dist/cli/scripts/start-tool-api.d.ts.map +1 -0
  414. package/dist/cli/scripts/start-tool-api.js +44 -0
  415. package/dist/cli/scripts/start-tool-api.js.map +1 -0
  416. package/dist/cli/services/analysis/coding-patterns-analyzer.d.ts +78 -0
  417. package/dist/cli/services/analysis/coding-patterns-analyzer.d.ts.map +1 -0
  418. package/dist/cli/services/analysis/coding-patterns-analyzer.js +588 -0
  419. package/dist/cli/services/analysis/coding-patterns-analyzer.js.map +1 -0
  420. package/dist/cli/services/analysis/coding-standards-generator.d.ts +66 -0
  421. package/dist/cli/services/analysis/coding-standards-generator.d.ts.map +1 -0
  422. package/dist/cli/services/analysis/coding-standards-generator.js +223 -0
  423. package/dist/cli/services/analysis/coding-standards-generator.js.map +1 -0
  424. package/dist/cli/services/analysis/deduplication/code-consolidation-handler.d.ts +70 -0
  425. package/dist/cli/services/analysis/deduplication/code-consolidation-handler.d.ts.map +1 -0
  426. package/dist/cli/services/analysis/deduplication/code-consolidation-handler.js +326 -0
  427. package/dist/cli/services/analysis/deduplication/code-consolidation-handler.js.map +1 -0
  428. package/dist/cli/services/analysis/deduplication/dedup-detector.d.ts +77 -0
  429. package/dist/cli/services/analysis/deduplication/dedup-detector.d.ts.map +1 -0
  430. package/dist/cli/services/analysis/deduplication/dedup-detector.js +302 -0
  431. package/dist/cli/services/analysis/deduplication/dedup-detector.js.map +1 -0
  432. package/dist/cli/services/analysis/deduplication/deduplication-service.d.ts +107 -0
  433. package/dist/cli/services/analysis/deduplication/deduplication-service.d.ts.map +1 -0
  434. package/dist/cli/services/analysis/deduplication/deduplication-service.js +380 -0
  435. package/dist/cli/services/analysis/deduplication/deduplication-service.js.map +1 -0
  436. package/dist/cli/services/analysis/deduplication/duplicate-code-detector.d.ts +100 -0
  437. package/dist/cli/services/analysis/deduplication/duplicate-code-detector.d.ts.map +1 -0
  438. package/dist/cli/services/analysis/deduplication/duplicate-code-detector.js +406 -0
  439. package/dist/cli/services/analysis/deduplication/duplicate-code-detector.js.map +1 -0
  440. package/dist/cli/services/analysis/deduplication/hash-change-detector.d.ts +57 -0
  441. package/dist/cli/services/analysis/deduplication/hash-change-detector.d.ts.map +1 -0
  442. package/dist/cli/services/analysis/deduplication/hash-change-detector.js +185 -0
  443. package/dist/cli/services/analysis/deduplication/hash-change-detector.js.map +1 -0
  444. package/dist/cli/services/analysis/solid/solid-analyzer-service.d.ts +87 -0
  445. package/dist/cli/services/analysis/solid/solid-analyzer-service.d.ts.map +1 -0
  446. package/dist/cli/services/analysis/solid/solid-analyzer-service.js +426 -0
  447. package/dist/cli/services/analysis/solid/solid-analyzer-service.js.map +1 -0
  448. package/dist/cli/services/analysis/user-intentions/assumption-detector.d.ts +76 -0
  449. package/dist/cli/services/analysis/user-intentions/assumption-detector.d.ts.map +1 -0
  450. package/dist/cli/services/analysis/user-intentions/assumption-detector.js +394 -0
  451. package/dist/cli/services/analysis/user-intentions/assumption-detector.js.map +1 -0
  452. package/dist/cli/services/analysis/user-intentions/intent-analyzer.d.ts +41 -0
  453. package/dist/cli/services/analysis/user-intentions/intent-analyzer.d.ts.map +1 -0
  454. package/dist/cli/services/analysis/user-intentions/intent-analyzer.js +257 -0
  455. package/dist/cli/services/analysis/user-intentions/intent-analyzer.js.map +1 -0
  456. package/dist/cli/services/analysis/user-intentions/intention-clarification-service.d.ts +73 -0
  457. package/dist/cli/services/analysis/user-intentions/intention-clarification-service.d.ts.map +1 -0
  458. package/dist/cli/services/analysis/user-intentions/intention-clarification-service.js +246 -0
  459. package/dist/cli/services/analysis/user-intentions/intention-clarification-service.js.map +1 -0
  460. package/dist/cli/services/analysis/user-intentions/llm-intention-detector.d.ts +64 -0
  461. package/dist/cli/services/analysis/user-intentions/llm-intention-detector.d.ts.map +1 -0
  462. package/dist/cli/services/analysis/user-intentions/llm-intention-detector.js +269 -0
  463. package/dist/cli/services/analysis/user-intentions/llm-intention-detector.js.map +1 -0
  464. package/dist/cli/services/analysis/user-intentions/user-clarification-service.d.ts +52 -0
  465. package/dist/cli/services/analysis/user-intentions/user-clarification-service.d.ts.map +1 -0
  466. package/dist/cli/services/analysis/user-intentions/user-clarification-service.js +239 -0
  467. package/dist/cli/services/analysis/user-intentions/user-clarification-service.js.map +1 -0
  468. package/dist/cli/services/claude/claude-code-executor.d.ts +37 -0
  469. package/dist/cli/services/claude/claude-code-executor.d.ts.map +1 -0
  470. package/dist/cli/services/claude/claude-code-executor.js +190 -0
  471. package/dist/cli/services/claude/claude-code-executor.js.map +1 -0
  472. package/dist/cli/services/data/code-parsing/file-parser.d.ts +27 -0
  473. package/dist/cli/services/data/code-parsing/file-parser.d.ts.map +1 -0
  474. package/dist/cli/services/data/code-parsing/file-parser.js +336 -0
  475. package/dist/cli/services/data/code-parsing/file-parser.js.map +1 -0
  476. package/dist/cli/services/data/code-parsing/interfaces/index.d.ts +102 -0
  477. package/dist/cli/services/data/code-parsing/interfaces/index.d.ts.map +1 -0
  478. package/dist/cli/services/data/code-parsing/interfaces/index.js +7 -0
  479. package/dist/cli/services/data/code-parsing/interfaces/index.js.map +1 -0
  480. package/dist/cli/services/data/code-parsing/interfaces.d.ts +77 -0
  481. package/dist/cli/services/data/code-parsing/interfaces.d.ts.map +1 -0
  482. package/dist/cli/services/data/code-parsing/interfaces.js +7 -0
  483. package/dist/cli/services/data/code-parsing/interfaces.js.map +1 -0
  484. package/dist/cli/services/data/code-parsing/relationship-analyzer.d.ts +13 -0
  485. package/dist/cli/services/data/code-parsing/relationship-analyzer.d.ts.map +1 -0
  486. package/dist/cli/services/data/code-parsing/relationship-analyzer.js +118 -0
  487. package/dist/cli/services/data/code-parsing/relationship-analyzer.js.map +1 -0
  488. package/dist/cli/services/data/code-parsing/services/file-parsing-service.d.ts +21 -0
  489. package/dist/cli/services/data/code-parsing/services/file-parsing-service.d.ts.map +1 -0
  490. package/dist/cli/services/data/code-parsing/services/file-parsing-service.js +394 -0
  491. package/dist/cli/services/data/code-parsing/services/file-parsing-service.js.map +1 -0
  492. package/dist/cli/services/data/code-parsing/services/graph-population-service.d.ts +21 -0
  493. package/dist/cli/services/data/code-parsing/services/graph-population-service.d.ts.map +1 -0
  494. package/dist/cli/services/data/code-parsing/services/graph-population-service.js +426 -0
  495. package/dist/cli/services/data/code-parsing/services/graph-population-service.js.map +1 -0
  496. package/dist/cli/services/data/code-parsing/services/project-structure-service.d.ts +33 -0
  497. package/dist/cli/services/data/code-parsing/services/project-structure-service.d.ts.map +1 -0
  498. package/dist/cli/services/data/code-parsing/services/project-structure-service.js +310 -0
  499. package/dist/cli/services/data/code-parsing/services/project-structure-service.js.map +1 -0
  500. package/dist/cli/services/data/code-relationship-parser.d.ts +58 -0
  501. package/dist/cli/services/data/code-relationship-parser.d.ts.map +1 -0
  502. package/dist/cli/services/data/code-relationship-parser.js +204 -0
  503. package/dist/cli/services/data/code-relationship-parser.js.map +1 -0
  504. package/dist/cli/services/data/content-processing/content-processor.d.ts +141 -0
  505. package/dist/cli/services/data/content-processing/content-processor.d.ts.map +1 -0
  506. package/dist/cli/services/data/content-processing/content-processor.js +661 -0
  507. package/dist/cli/services/data/content-processing/content-processor.js.map +1 -0
  508. package/dist/cli/services/data/database/postgresql-initializer.d.ts +67 -0
  509. package/dist/cli/services/data/database/postgresql-initializer.d.ts.map +1 -0
  510. package/dist/cli/services/data/database/postgresql-initializer.js +612 -0
  511. package/dist/cli/services/data/database/postgresql-initializer.js.map +1 -0
  512. package/dist/cli/services/data/documentation-service.d.ts +123 -0
  513. package/dist/cli/services/data/documentation-service.d.ts.map +1 -0
  514. package/dist/cli/services/data/documentation-service.js +531 -0
  515. package/dist/cli/services/data/documentation-service.js.map +1 -0
  516. package/dist/cli/services/data/embedding/embedding-service.d.ts +67 -0
  517. package/dist/cli/services/data/embedding/embedding-service.d.ts.map +1 -0
  518. package/dist/cli/services/data/embedding/embedding-service.js +258 -0
  519. package/dist/cli/services/data/embedding/embedding-service.js.map +1 -0
  520. package/dist/cli/services/data/embedding/interfaces.d.ts +104 -0
  521. package/dist/cli/services/data/embedding/interfaces.d.ts.map +1 -0
  522. package/dist/cli/services/data/embedding/interfaces.js +8 -0
  523. package/dist/cli/services/data/embedding/interfaces.js.map +1 -0
  524. package/dist/cli/services/data/embedding/providers/local-provider.d.ts +15 -0
  525. package/dist/cli/services/data/embedding/providers/local-provider.d.ts.map +1 -0
  526. package/dist/cli/services/data/embedding/providers/local-provider.js +99 -0
  527. package/dist/cli/services/data/embedding/providers/local-provider.js.map +1 -0
  528. package/dist/cli/services/data/embedding/providers/openai-provider.d.ts +16 -0
  529. package/dist/cli/services/data/embedding/providers/openai-provider.d.ts.map +1 -0
  530. package/dist/cli/services/data/embedding/providers/openai-provider.js +70 -0
  531. package/dist/cli/services/data/embedding/providers/openai-provider.js.map +1 -0
  532. package/dist/cli/services/data/embedding/providers/xenova-provider.d.ts +17 -0
  533. package/dist/cli/services/data/embedding/providers/xenova-provider.d.ts.map +1 -0
  534. package/dist/cli/services/data/embedding/providers/xenova-provider.js +95 -0
  535. package/dist/cli/services/data/embedding/providers/xenova-provider.js.map +1 -0
  536. package/dist/cli/services/data/embedding/services/file-processor.d.ts +20 -0
  537. package/dist/cli/services/data/embedding/services/file-processor.d.ts.map +1 -0
  538. package/dist/cli/services/data/embedding/services/file-processor.js +306 -0
  539. package/dist/cli/services/data/embedding/services/file-processor.js.map +1 -0
  540. package/dist/cli/services/data/semantic-graph/builders/node-builder.d.ts +54 -0
  541. package/dist/cli/services/data/semantic-graph/builders/node-builder.d.ts.map +1 -0
  542. package/dist/cli/services/data/semantic-graph/builders/node-builder.js +209 -0
  543. package/dist/cli/services/data/semantic-graph/builders/node-builder.js.map +1 -0
  544. package/dist/cli/services/data/semantic-graph/builders/relationship-builder.d.ts +61 -0
  545. package/dist/cli/services/data/semantic-graph/builders/relationship-builder.d.ts.map +1 -0
  546. package/dist/cli/services/data/semantic-graph/builders/relationship-builder.js +316 -0
  547. package/dist/cli/services/data/semantic-graph/builders/relationship-builder.js.map +1 -0
  548. package/dist/cli/services/data/semantic-graph/claude-code-proxy.d.ts +43 -0
  549. package/dist/cli/services/data/semantic-graph/claude-code-proxy.d.ts.map +1 -0
  550. package/dist/cli/services/data/semantic-graph/claude-code-proxy.js +296 -0
  551. package/dist/cli/services/data/semantic-graph/claude-code-proxy.js.map +1 -0
  552. package/dist/cli/services/data/semantic-graph/code-relationship-orchestrator.d.ts +63 -0
  553. package/dist/cli/services/data/semantic-graph/code-relationship-orchestrator.d.ts.map +1 -0
  554. package/dist/cli/services/data/semantic-graph/code-relationship-orchestrator.js +340 -0
  555. package/dist/cli/services/data/semantic-graph/code-relationship-orchestrator.js.map +1 -0
  556. package/dist/cli/services/data/semantic-graph/interfaces/index.d.ts +134 -0
  557. package/dist/cli/services/data/semantic-graph/interfaces/index.d.ts.map +1 -0
  558. package/dist/cli/services/data/semantic-graph/interfaces/index.js +7 -0
  559. package/dist/cli/services/data/semantic-graph/interfaces/index.js.map +1 -0
  560. package/dist/cli/services/data/semantic-graph/language-detector.d.ts +60 -0
  561. package/dist/cli/services/data/semantic-graph/language-detector.d.ts.map +1 -0
  562. package/dist/cli/services/data/semantic-graph/language-detector.js +345 -0
  563. package/dist/cli/services/data/semantic-graph/language-detector.js.map +1 -0
  564. package/dist/cli/services/data/semantic-graph/neo4j-graph-storage.d.ts +68 -0
  565. package/dist/cli/services/data/semantic-graph/neo4j-graph-storage.d.ts.map +1 -0
  566. package/dist/cli/services/data/semantic-graph/neo4j-graph-storage.js +298 -0
  567. package/dist/cli/services/data/semantic-graph/neo4j-graph-storage.js.map +1 -0
  568. package/dist/cli/services/data/semantic-graph/parsers/csharp-parser.d.ts +19 -0
  569. package/dist/cli/services/data/semantic-graph/parsers/csharp-parser.d.ts.map +1 -0
  570. package/dist/cli/services/data/semantic-graph/parsers/csharp-parser.js +220 -0
  571. package/dist/cli/services/data/semantic-graph/parsers/csharp-parser.js.map +1 -0
  572. package/dist/cli/services/data/semantic-graph/parsers/generic-parser.d.ts +20 -0
  573. package/dist/cli/services/data/semantic-graph/parsers/generic-parser.d.ts.map +1 -0
  574. package/dist/cli/services/data/semantic-graph/parsers/generic-parser.js +193 -0
  575. package/dist/cli/services/data/semantic-graph/parsers/generic-parser.js.map +1 -0
  576. package/dist/cli/services/data/semantic-graph/parsers/go-parser.d.ts +20 -0
  577. package/dist/cli/services/data/semantic-graph/parsers/go-parser.d.ts.map +1 -0
  578. package/dist/cli/services/data/semantic-graph/parsers/go-parser.js +192 -0
  579. package/dist/cli/services/data/semantic-graph/parsers/go-parser.js.map +1 -0
  580. package/dist/cli/services/data/semantic-graph/parsers/ilanguage-parser.d.ts +71 -0
  581. package/dist/cli/services/data/semantic-graph/parsers/ilanguage-parser.d.ts.map +1 -0
  582. package/dist/cli/services/data/semantic-graph/parsers/ilanguage-parser.js +35 -0
  583. package/dist/cli/services/data/semantic-graph/parsers/ilanguage-parser.js.map +1 -0
  584. package/dist/cli/services/data/semantic-graph/parsers/java-parser.d.ts +18 -0
  585. package/dist/cli/services/data/semantic-graph/parsers/java-parser.d.ts.map +1 -0
  586. package/dist/cli/services/data/semantic-graph/parsers/java-parser.js +164 -0
  587. package/dist/cli/services/data/semantic-graph/parsers/java-parser.js.map +1 -0
  588. package/dist/cli/services/data/semantic-graph/parsers/python-parser.d.ts +15 -0
  589. package/dist/cli/services/data/semantic-graph/parsers/python-parser.d.ts.map +1 -0
  590. package/dist/cli/services/data/semantic-graph/parsers/python-parser.js +172 -0
  591. package/dist/cli/services/data/semantic-graph/parsers/python-parser.js.map +1 -0
  592. package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-java-parser.d.ts +26 -0
  593. package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-java-parser.d.ts.map +1 -0
  594. package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-java-parser.js +312 -0
  595. package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-java-parser.js.map +1 -0
  596. package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-python-parser.d.ts +29 -0
  597. package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-python-parser.d.ts.map +1 -0
  598. package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-python-parser.js +346 -0
  599. package/dist/cli/services/data/semantic-graph/parsers/tree-sitter-python-parser.js.map +1 -0
  600. package/dist/cli/services/data/semantic-graph/parsers/typescript-parser.d.ts +19 -0
  601. package/dist/cli/services/data/semantic-graph/parsers/typescript-parser.d.ts.map +1 -0
  602. package/dist/cli/services/data/semantic-graph/parsers/typescript-parser.js +258 -0
  603. package/dist/cli/services/data/semantic-graph/parsers/typescript-parser.js.map +1 -0
  604. package/dist/cli/services/data/semantic-graph/processors/index.d.ts +24 -0
  605. package/dist/cli/services/data/semantic-graph/processors/index.d.ts.map +1 -0
  606. package/dist/cli/services/data/semantic-graph/processors/index.js +153 -0
  607. package/dist/cli/services/data/semantic-graph/processors/index.js.map +1 -0
  608. package/dist/cli/services/data/semantic-graph/semantic-graph.d.ts +75 -0
  609. package/dist/cli/services/data/semantic-graph/semantic-graph.d.ts.map +1 -0
  610. package/dist/cli/services/data/semantic-graph/semantic-graph.js +191 -0
  611. package/dist/cli/services/data/semantic-graph/semantic-graph.js.map +1 -0
  612. package/dist/cli/services/data/semantic-graph/services/file-processing-service.d.ts +29 -0
  613. package/dist/cli/services/data/semantic-graph/services/file-processing-service.d.ts.map +1 -0
  614. package/dist/cli/services/data/semantic-graph/services/file-processing-service.js +175 -0
  615. package/dist/cli/services/data/semantic-graph/services/file-processing-service.js.map +1 -0
  616. package/dist/cli/services/data/semantic-graph/services/graph-query-service.d.ts +34 -0
  617. package/dist/cli/services/data/semantic-graph/services/graph-query-service.d.ts.map +1 -0
  618. package/dist/cli/services/data/semantic-graph/services/graph-query-service.js +285 -0
  619. package/dist/cli/services/data/semantic-graph/services/graph-query-service.js.map +1 -0
  620. package/dist/cli/services/data/semantic-graph/services/graph-storage-service.d.ts +35 -0
  621. package/dist/cli/services/data/semantic-graph/services/graph-storage-service.d.ts.map +1 -0
  622. package/dist/cli/services/data/semantic-graph/services/graph-storage-service.js +321 -0
  623. package/dist/cli/services/data/semantic-graph/services/graph-storage-service.js.map +1 -0
  624. package/dist/cli/services/data/semantic-graph/tree-sitter-semantic-builder.d.ts +85 -0
  625. package/dist/cli/services/data/semantic-graph/tree-sitter-semantic-builder.d.ts.map +1 -0
  626. package/dist/cli/services/data/semantic-graph/tree-sitter-semantic-builder.js +375 -0
  627. package/dist/cli/services/data/semantic-graph/tree-sitter-semantic-builder.js.map +1 -0
  628. package/dist/cli/services/integration/codemind-instruction-service.d.ts +76 -0
  629. package/dist/cli/services/integration/codemind-instruction-service.d.ts.map +1 -0
  630. package/dist/cli/services/integration/codemind-instruction-service.js +331 -0
  631. package/dist/cli/services/integration/codemind-instruction-service.js.map +1 -0
  632. package/dist/cli/services/integration/codeseeker-instruction-service.d.ts +82 -0
  633. package/dist/cli/services/integration/codeseeker-instruction-service.d.ts.map +1 -0
  634. package/dist/cli/services/integration/codeseeker-instruction-service.js +372 -0
  635. package/dist/cli/services/integration/codeseeker-instruction-service.js.map +1 -0
  636. package/dist/cli/services/integration/workflow-integration/claude-context-enhancer.d.ts +135 -0
  637. package/dist/cli/services/integration/workflow-integration/claude-context-enhancer.d.ts.map +1 -0
  638. package/dist/cli/services/integration/workflow-integration/claude-context-enhancer.js +298 -0
  639. package/dist/cli/services/integration/workflow-integration/claude-context-enhancer.js.map +1 -0
  640. package/dist/cli/services/llm/claude-llm-executor.d.ts +84 -0
  641. package/dist/cli/services/llm/claude-llm-executor.d.ts.map +1 -0
  642. package/dist/cli/services/llm/claude-llm-executor.js +448 -0
  643. package/dist/cli/services/llm/claude-llm-executor.js.map +1 -0
  644. package/dist/cli/services/llm/index.d.ts +41 -0
  645. package/dist/cli/services/llm/index.d.ts.map +1 -0
  646. package/dist/cli/services/llm/index.js +53 -0
  647. package/dist/cli/services/llm/index.js.map +1 -0
  648. package/dist/cli/services/llm/interfaces/index.d.ts +211 -0
  649. package/dist/cli/services/llm/interfaces/index.d.ts.map +1 -0
  650. package/dist/cli/services/llm/interfaces/index.js +15 -0
  651. package/dist/cli/services/llm/interfaces/index.js.map +1 -0
  652. package/dist/cli/services/llm/llm-executor-registry.d.ts +118 -0
  653. package/dist/cli/services/llm/llm-executor-registry.d.ts.map +1 -0
  654. package/dist/cli/services/llm/llm-executor-registry.js +226 -0
  655. package/dist/cli/services/llm/llm-executor-registry.js.map +1 -0
  656. package/dist/cli/services/llm/mock-llm-executor.d.ts +118 -0
  657. package/dist/cli/services/llm/mock-llm-executor.d.ts.map +1 -0
  658. package/dist/cli/services/llm/mock-llm-executor.js +324 -0
  659. package/dist/cli/services/llm/mock-llm-executor.js.map +1 -0
  660. package/dist/cli/services/monitoring/file-scanning/configurable-exclusion-filter.d.ts +49 -0
  661. package/dist/cli/services/monitoring/file-scanning/configurable-exclusion-filter.d.ts.map +1 -0
  662. package/dist/cli/services/monitoring/file-scanning/configurable-exclusion-filter.js +172 -0
  663. package/dist/cli/services/monitoring/file-scanning/configurable-exclusion-filter.js.map +1 -0
  664. package/dist/cli/services/monitoring/file-scanning/directory-scanner.d.ts +12 -0
  665. package/dist/cli/services/monitoring/file-scanning/directory-scanner.d.ts.map +1 -0
  666. package/dist/cli/services/monitoring/file-scanning/directory-scanner.js +126 -0
  667. package/dist/cli/services/monitoring/file-scanning/directory-scanner.js.map +1 -0
  668. package/dist/cli/services/monitoring/file-scanning/file-scanner-interfaces.d.ts +33 -0
  669. package/dist/cli/services/monitoring/file-scanning/file-scanner-interfaces.d.ts.map +1 -0
  670. package/dist/cli/services/monitoring/file-scanning/file-scanner-interfaces.js +7 -0
  671. package/dist/cli/services/monitoring/file-scanning/file-scanner-interfaces.js.map +1 -0
  672. package/dist/cli/services/monitoring/file-scanning/file-type-detector.d.ts +17 -0
  673. package/dist/cli/services/monitoring/file-scanning/file-type-detector.d.ts.map +1 -0
  674. package/dist/cli/services/monitoring/file-scanning/file-type-detector.js +109 -0
  675. package/dist/cli/services/monitoring/file-scanning/file-type-detector.js.map +1 -0
  676. package/dist/cli/services/monitoring/file-scanning/index.d.ts +10 -0
  677. package/dist/cli/services/monitoring/file-scanning/index.d.ts.map +1 -0
  678. package/dist/cli/services/monitoring/file-scanning/index.js +34 -0
  679. package/dist/cli/services/monitoring/file-scanning/index.js.map +1 -0
  680. package/dist/cli/services/monitoring/file-scanning/project-file-scanner.d.ts +31 -0
  681. package/dist/cli/services/monitoring/file-scanning/project-file-scanner.d.ts.map +1 -0
  682. package/dist/cli/services/monitoring/file-scanning/project-file-scanner.js +52 -0
  683. package/dist/cli/services/monitoring/file-scanning/project-file-scanner.js.map +1 -0
  684. package/dist/cli/services/monitoring/file-watcher-service.d.ts +82 -0
  685. package/dist/cli/services/monitoring/file-watcher-service.d.ts.map +1 -0
  686. package/dist/cli/services/monitoring/file-watcher-service.js +314 -0
  687. package/dist/cli/services/monitoring/file-watcher-service.js.map +1 -0
  688. package/dist/cli/services/monitoring/initialization/initialization-status-tracker.d.ts +72 -0
  689. package/dist/cli/services/monitoring/initialization/initialization-status-tracker.d.ts.map +1 -0
  690. package/dist/cli/services/monitoring/initialization/initialization-status-tracker.js +242 -0
  691. package/dist/cli/services/monitoring/initialization/initialization-status-tracker.js.map +1 -0
  692. package/dist/cli/services/platform-detector.d.ts +41 -0
  693. package/dist/cli/services/platform-detector.d.ts.map +1 -0
  694. package/dist/cli/services/platform-detector.js +302 -0
  695. package/dist/cli/services/platform-detector.js.map +1 -0
  696. package/dist/cli/services/project/language-manager.d.ts +16 -0
  697. package/dist/cli/services/project/language-manager.d.ts.map +1 -0
  698. package/dist/cli/services/project/language-manager.js +149 -0
  699. package/dist/cli/services/project/language-manager.js.map +1 -0
  700. package/dist/cli/services/project/language-support-service.d.ts +63 -0
  701. package/dist/cli/services/project/language-support-service.d.ts.map +1 -0
  702. package/dist/cli/services/project/language-support-service.js +357 -0
  703. package/dist/cli/services/project/language-support-service.js.map +1 -0
  704. package/dist/cli/services/project/project-detector.d.ts +10 -0
  705. package/dist/cli/services/project/project-detector.d.ts.map +1 -0
  706. package/dist/cli/services/project/project-detector.js +92 -0
  707. package/dist/cli/services/project/project-detector.js.map +1 -0
  708. package/dist/cli/services/project/project-registry.d.ts +16 -0
  709. package/dist/cli/services/project/project-registry.d.ts.map +1 -0
  710. package/dist/cli/services/project/project-registry.js +103 -0
  711. package/dist/cli/services/project/project-registry.js.map +1 -0
  712. package/dist/cli/services/project-identity-service.d.ts +87 -0
  713. package/dist/cli/services/project-identity-service.d.ts.map +1 -0
  714. package/dist/cli/services/project-identity-service.js +332 -0
  715. package/dist/cli/services/project-identity-service.js.map +1 -0
  716. package/dist/cli/services/search/content-chunker.d.ts +23 -0
  717. package/dist/cli/services/search/content-chunker.d.ts.map +1 -0
  718. package/dist/cli/services/search/content-chunker.js +265 -0
  719. package/dist/cli/services/search/content-chunker.js.map +1 -0
  720. package/dist/cli/services/search/embedding-generator-adapter.d.ts +17 -0
  721. package/dist/cli/services/search/embedding-generator-adapter.d.ts.map +1 -0
  722. package/dist/cli/services/search/embedding-generator-adapter.js +61 -0
  723. package/dist/cli/services/search/embedding-generator-adapter.js.map +1 -0
  724. package/dist/cli/services/search/search-index-storage.d.ts +22 -0
  725. package/dist/cli/services/search/search-index-storage.d.ts.map +1 -0
  726. package/dist/cli/services/search/search-index-storage.js +154 -0
  727. package/dist/cli/services/search/search-index-storage.js.map +1 -0
  728. package/dist/cli/services/search/search-query-processor.d.ts +16 -0
  729. package/dist/cli/services/search/search-query-processor.d.ts.map +1 -0
  730. package/dist/cli/services/search/search-query-processor.js +125 -0
  731. package/dist/cli/services/search/search-query-processor.js.map +1 -0
  732. package/dist/cli/services/search/semantic-search.d.ts +86 -0
  733. package/dist/cli/services/search/semantic-search.d.ts.map +1 -0
  734. package/dist/cli/services/search/semantic-search.js +300 -0
  735. package/dist/cli/services/search/semantic-search.js.map +1 -0
  736. package/dist/cli/services/setup/container-detector.d.ts +15 -0
  737. package/dist/cli/services/setup/container-detector.d.ts.map +1 -0
  738. package/dist/cli/services/setup/container-detector.js +175 -0
  739. package/dist/cli/services/setup/container-detector.js.map +1 -0
  740. package/dist/cli/services/setup/container-manager.d.ts +14 -0
  741. package/dist/cli/services/setup/container-manager.d.ts.map +1 -0
  742. package/dist/cli/services/setup/container-manager.js +147 -0
  743. package/dist/cli/services/setup/container-manager.js.map +1 -0
  744. package/dist/cli/services/setup/database-initializer.d.ts +24 -0
  745. package/dist/cli/services/setup/database-initializer.d.ts.map +1 -0
  746. package/dist/cli/services/setup/database-initializer.js +291 -0
  747. package/dist/cli/services/setup/database-initializer.js.map +1 -0
  748. package/dist/cli/services/setup/interfaces/setup-interfaces.d.ts +72 -0
  749. package/dist/cli/services/setup/interfaces/setup-interfaces.d.ts.map +1 -0
  750. package/dist/cli/services/setup/interfaces/setup-interfaces.js +7 -0
  751. package/dist/cli/services/setup/interfaces/setup-interfaces.js.map +1 -0
  752. package/dist/cli/services/setup/prerequisite-checker.d.ts +10 -0
  753. package/dist/cli/services/setup/prerequisite-checker.d.ts.map +1 -0
  754. package/dist/cli/services/setup/prerequisite-checker.js +119 -0
  755. package/dist/cli/services/setup/prerequisite-checker.js.map +1 -0
  756. package/dist/cli/services/setup/setup-orchestrator.d.ts +27 -0
  757. package/dist/cli/services/setup/setup-orchestrator.d.ts.map +1 -0
  758. package/dist/cli/services/setup/setup-orchestrator.js +230 -0
  759. package/dist/cli/services/setup/setup-orchestrator.js.map +1 -0
  760. package/dist/cli/services/setup/setup-reporter.d.ts +14 -0
  761. package/dist/cli/services/setup/setup-reporter.d.ts.map +1 -0
  762. package/dist/cli/services/setup/setup-reporter.js +143 -0
  763. package/dist/cli/services/setup/setup-reporter.js.map +1 -0
  764. package/dist/cli/services/setup/setup-service-factory.d.ts +19 -0
  765. package/dist/cli/services/setup/setup-service-factory.d.ts.map +1 -0
  766. package/dist/cli/services/setup/setup-service-factory.js +43 -0
  767. package/dist/cli/services/setup/setup-service-factory.js.map +1 -0
  768. package/dist/cli/services/setup/unified-database-initializer.d.ts +61 -0
  769. package/dist/cli/services/setup/unified-database-initializer.d.ts.map +1 -0
  770. package/dist/cli/services/setup/unified-database-initializer.js +264 -0
  771. package/dist/cli/services/setup/unified-database-initializer.js.map +1 -0
  772. package/dist/cli/task-splitter.d.ts +59 -0
  773. package/dist/cli/task-splitter.d.ts.map +1 -0
  774. package/dist/cli/task-splitter.js +556 -0
  775. package/dist/cli/task-splitter.js.map +1 -0
  776. package/dist/cli/tools/context-optimizer-tool.d.ts +25 -0
  777. package/dist/cli/tools/context-optimizer-tool.d.ts.map +1 -0
  778. package/dist/cli/tools/context-optimizer-tool.js +169 -0
  779. package/dist/cli/tools/context-optimizer-tool.js.map +1 -0
  780. package/dist/cli/ui/theme.d.ts +148 -0
  781. package/dist/cli/ui/theme.d.ts.map +1 -0
  782. package/dist/cli/ui/theme.js +302 -0
  783. package/dist/cli/ui/theme.js.map +1 -0
  784. package/dist/cli/ui/welcome-display.d.ts +20 -0
  785. package/dist/cli/ui/welcome-display.d.ts.map +1 -0
  786. package/dist/cli/ui/welcome-display.js +50 -0
  787. package/dist/cli/ui/welcome-display.js.map +1 -0
  788. package/dist/cli/workflow/interfaces/index.d.ts +191 -0
  789. package/dist/cli/workflow/interfaces/index.d.ts.map +1 -0
  790. package/dist/cli/workflow/interfaces/index.js +7 -0
  791. package/dist/cli/workflow/interfaces/index.js.map +1 -0
  792. package/dist/cli/workflow/services/context-gathering-service.d.ts +23 -0
  793. package/dist/cli/workflow/services/context-gathering-service.d.ts.map +1 -0
  794. package/dist/cli/workflow/services/context-gathering-service.js +145 -0
  795. package/dist/cli/workflow/services/context-gathering-service.js.map +1 -0
  796. package/dist/cli/workflow/services/database-sync-service.d.ts +63 -0
  797. package/dist/cli/workflow/services/database-sync-service.d.ts.map +1 -0
  798. package/dist/cli/workflow/services/database-sync-service.js +250 -0
  799. package/dist/cli/workflow/services/database-sync-service.js.map +1 -0
  800. package/dist/cli/workflow/services/git-workflow-service.d.ts +29 -0
  801. package/dist/cli/workflow/services/git-workflow-service.d.ts.map +1 -0
  802. package/dist/cli/workflow/services/git-workflow-service.js +226 -0
  803. package/dist/cli/workflow/services/git-workflow-service.js.map +1 -0
  804. package/dist/cli/workflow/services/intent-analysis-service.d.ts +20 -0
  805. package/dist/cli/workflow/services/intent-analysis-service.d.ts.map +1 -0
  806. package/dist/cli/workflow/services/intent-analysis-service.js +137 -0
  807. package/dist/cli/workflow/services/intent-analysis-service.js.map +1 -0
  808. package/dist/cli/workflow/services/quality-assurance-service.d.ts +41 -0
  809. package/dist/cli/workflow/services/quality-assurance-service.d.ts.map +1 -0
  810. package/dist/cli/workflow/services/quality-assurance-service.js +341 -0
  811. package/dist/cli/workflow/services/quality-assurance-service.js.map +1 -0
  812. package/dist/cli/workflow/services/task-orchestration-service.d.ts +31 -0
  813. package/dist/cli/workflow/services/task-orchestration-service.d.ts.map +1 -0
  814. package/dist/cli/workflow/services/task-orchestration-service.js +254 -0
  815. package/dist/cli/workflow/services/task-orchestration-service.js.map +1 -0
  816. package/dist/cli/workflow/workflow-orchestrator.d.ts +47 -0
  817. package/dist/cli/workflow/workflow-orchestrator.d.ts.map +1 -0
  818. package/dist/cli/workflow/workflow-orchestrator.js +248 -0
  819. package/dist/cli/workflow/workflow-orchestrator.js.map +1 -0
  820. package/dist/config/database-config.d.ts +40 -0
  821. package/dist/config/database-config.d.ts.map +1 -0
  822. package/dist/config/database-config.js +192 -0
  823. package/dist/config/database-config.js.map +1 -0
  824. package/dist/core/factories/command-service-factory.d.ts +26 -0
  825. package/dist/core/factories/command-service-factory.d.ts.map +1 -0
  826. package/dist/core/factories/command-service-factory.js +72 -0
  827. package/dist/core/factories/command-service-factory.js.map +1 -0
  828. package/dist/core/factories/error-factory.d.ts +19 -0
  829. package/dist/core/factories/error-factory.d.ts.map +1 -0
  830. package/dist/core/factories/error-factory.js +100 -0
  831. package/dist/core/factories/error-factory.js.map +1 -0
  832. package/dist/core/factories/error-handling-factory.d.ts +33 -0
  833. package/dist/core/factories/error-handling-factory.d.ts.map +1 -0
  834. package/dist/core/factories/error-handling-factory.js +59 -0
  835. package/dist/core/factories/error-handling-factory.js.map +1 -0
  836. package/dist/core/factories/project-service-factory.d.ts +38 -0
  837. package/dist/core/factories/project-service-factory.d.ts.map +1 -0
  838. package/dist/core/factories/project-service-factory.js +66 -0
  839. package/dist/core/factories/project-service-factory.js.map +1 -0
  840. package/dist/core/factories/search-service-factory.d.ts +42 -0
  841. package/dist/core/factories/search-service-factory.d.ts.map +1 -0
  842. package/dist/core/factories/search-service-factory.js +76 -0
  843. package/dist/core/factories/search-service-factory.js.map +1 -0
  844. package/dist/core/interfaces/command-interfaces.d.ts +82 -0
  845. package/dist/core/interfaces/command-interfaces.d.ts.map +1 -0
  846. package/dist/core/interfaces/command-interfaces.js +7 -0
  847. package/dist/core/interfaces/command-interfaces.js.map +1 -0
  848. package/dist/core/interfaces/error-interfaces.d.ts +95 -0
  849. package/dist/core/interfaces/error-interfaces.d.ts.map +1 -0
  850. package/dist/core/interfaces/error-interfaces.js +8 -0
  851. package/dist/core/interfaces/error-interfaces.js.map +1 -0
  852. package/dist/core/interfaces/orchestrator-interfaces.d.ts +62 -0
  853. package/dist/core/interfaces/orchestrator-interfaces.d.ts.map +1 -0
  854. package/dist/core/interfaces/orchestrator-interfaces.js +8 -0
  855. package/dist/core/interfaces/orchestrator-interfaces.js.map +1 -0
  856. package/dist/core/interfaces/project-interfaces.d.ts +57 -0
  857. package/dist/core/interfaces/project-interfaces.d.ts.map +1 -0
  858. package/dist/core/interfaces/project-interfaces.js +7 -0
  859. package/dist/core/interfaces/project-interfaces.js.map +1 -0
  860. package/dist/core/interfaces/search-interfaces.d.ts +76 -0
  861. package/dist/core/interfaces/search-interfaces.d.ts.map +1 -0
  862. package/dist/core/interfaces/search-interfaces.js +6 -0
  863. package/dist/core/interfaces/search-interfaces.js.map +1 -0
  864. package/dist/core/interfaces.d.ts +109 -0
  865. package/dist/core/interfaces.d.ts.map +1 -0
  866. package/dist/core/interfaces.js +6 -0
  867. package/dist/core/interfaces.js.map +1 -0
  868. package/dist/core/services/error-handler.d.ts +33 -0
  869. package/dist/core/services/error-handler.d.ts.map +1 -0
  870. package/dist/core/services/error-handler.js +187 -0
  871. package/dist/core/services/error-handler.js.map +1 -0
  872. package/dist/core/types.d.ts +197 -0
  873. package/dist/core/types.d.ts.map +1 -0
  874. package/dist/core/types.js +89 -0
  875. package/dist/core/types.js.map +1 -0
  876. package/dist/core/utils/error-utils.d.ts +36 -0
  877. package/dist/core/utils/error-utils.d.ts.map +1 -0
  878. package/dist/core/utils/error-utils.js +173 -0
  879. package/dist/core/utils/error-utils.js.map +1 -0
  880. package/dist/database/adapters/base.d.ts +88 -0
  881. package/dist/database/adapters/base.d.ts.map +1 -0
  882. package/dist/database/adapters/base.js +27 -0
  883. package/dist/database/adapters/base.js.map +1 -0
  884. package/dist/database/adapters/interfaces.d.ts +64 -0
  885. package/dist/database/adapters/interfaces.d.ts.map +1 -0
  886. package/dist/database/adapters/interfaces.js +7 -0
  887. package/dist/database/adapters/interfaces.js.map +1 -0
  888. package/dist/database/adapters/postgresql.d.ts +54 -0
  889. package/dist/database/adapters/postgresql.d.ts.map +1 -0
  890. package/dist/database/adapters/postgresql.js +838 -0
  891. package/dist/database/adapters/postgresql.js.map +1 -0
  892. package/dist/database/adapters/services/connection-manager.d.ts +22 -0
  893. package/dist/database/adapters/services/connection-manager.d.ts.map +1 -0
  894. package/dist/database/adapters/services/connection-manager.js +107 -0
  895. package/dist/database/adapters/services/connection-manager.js.map +1 -0
  896. package/dist/database/adapters/services/project-service.d.ts +22 -0
  897. package/dist/database/adapters/services/project-service.d.ts.map +1 -0
  898. package/dist/database/adapters/services/project-service.js +193 -0
  899. package/dist/database/adapters/services/project-service.js.map +1 -0
  900. package/dist/database/database.d.ts +71 -0
  901. package/dist/database/database.d.ts.map +1 -0
  902. package/dist/database/database.js +312 -0
  903. package/dist/database/database.js.map +1 -0
  904. package/dist/database/factory.d.ts +10 -0
  905. package/dist/database/factory.d.ts.map +1 -0
  906. package/dist/database/factory.js +38 -0
  907. package/dist/database/factory.js.map +1 -0
  908. package/dist/database/migrations/002_phase2_features.d.ts +24 -0
  909. package/dist/database/migrations/002_phase2_features.d.ts.map +1 -0
  910. package/dist/database/migrations/002_phase2_features.js +224 -0
  911. package/dist/database/migrations/002_phase2_features.js.map +1 -0
  912. package/dist/index.d.ts +16 -0
  913. package/dist/index.d.ts.map +1 -0
  914. package/dist/index.js +58 -0
  915. package/dist/index.js.map +1 -0
  916. package/dist/integrations/claude/claude-cli-integration.d.ts +85 -0
  917. package/dist/integrations/claude/claude-cli-integration.d.ts.map +1 -0
  918. package/dist/integrations/claude/claude-cli-integration.js +278 -0
  919. package/dist/integrations/claude/claude-cli-integration.js.map +1 -0
  920. package/dist/integrations/claude/conversation-manager.d.ts +81 -0
  921. package/dist/integrations/claude/conversation-manager.d.ts.map +1 -0
  922. package/dist/integrations/claude/conversation-manager.js +378 -0
  923. package/dist/integrations/claude/conversation-manager.js.map +1 -0
  924. package/dist/integrations/claude/interceptor.d.ts +75 -0
  925. package/dist/integrations/claude/interceptor.d.ts.map +1 -0
  926. package/dist/integrations/claude/interceptor.js +173 -0
  927. package/dist/integrations/claude/interceptor.js.map +1 -0
  928. package/dist/integrations/claude/interfaces/index.d.ts +128 -0
  929. package/dist/integrations/claude/interfaces/index.d.ts.map +1 -0
  930. package/dist/integrations/claude/interfaces/index.js +7 -0
  931. package/dist/integrations/claude/interfaces/index.js.map +1 -0
  932. package/dist/integrations/claude/outcome-analyzer.d.ts +90 -0
  933. package/dist/integrations/claude/outcome-analyzer.d.ts.map +1 -0
  934. package/dist/integrations/claude/outcome-analyzer.js +394 -0
  935. package/dist/integrations/claude/outcome-analyzer.js.map +1 -0
  936. package/dist/integrations/claude/services/claude-execution-service.d.ts +26 -0
  937. package/dist/integrations/claude/services/claude-execution-service.d.ts.map +1 -0
  938. package/dist/integrations/claude/services/claude-execution-service.js +136 -0
  939. package/dist/integrations/claude/services/claude-execution-service.js.map +1 -0
  940. package/dist/integrations/claude/services/claude-response-parser.d.ts +30 -0
  941. package/dist/integrations/claude/services/claude-response-parser.d.ts.map +1 -0
  942. package/dist/integrations/claude/services/claude-response-parser.js +235 -0
  943. package/dist/integrations/claude/services/claude-response-parser.js.map +1 -0
  944. package/dist/integrations/claude/services/project-analysis-service.d.ts +22 -0
  945. package/dist/integrations/claude/services/project-analysis-service.d.ts.map +1 -0
  946. package/dist/integrations/claude/services/project-analysis-service.js +298 -0
  947. package/dist/integrations/claude/services/project-analysis-service.js.map +1 -0
  948. package/dist/integrations/claude/services/project-context-builder.d.ts +34 -0
  949. package/dist/integrations/claude/services/project-context-builder.d.ts.map +1 -0
  950. package/dist/integrations/claude/services/project-context-builder.js +304 -0
  951. package/dist/integrations/claude/services/project-context-builder.js.map +1 -0
  952. package/dist/integrations/claude/services/prompt-processing-service.d.ts +24 -0
  953. package/dist/integrations/claude/services/prompt-processing-service.d.ts.map +1 -0
  954. package/dist/integrations/claude/services/prompt-processing-service.js +266 -0
  955. package/dist/integrations/claude/services/prompt-processing-service.js.map +1 -0
  956. package/dist/integrations/claude/services/request-processing-service.d.ts +34 -0
  957. package/dist/integrations/claude/services/request-processing-service.d.ts.map +1 -0
  958. package/dist/integrations/claude/services/request-processing-service.js +254 -0
  959. package/dist/integrations/claude/services/request-processing-service.js.map +1 -0
  960. package/dist/integrations/claude/services/session-management-service.d.ts +49 -0
  961. package/dist/integrations/claude/services/session-management-service.d.ts.map +1 -0
  962. package/dist/integrations/claude/services/session-management-service.js +214 -0
  963. package/dist/integrations/claude/services/session-management-service.js.map +1 -0
  964. package/dist/mcp/index.d.ts +8 -0
  965. package/dist/mcp/index.d.ts.map +1 -0
  966. package/dist/mcp/index.js +13 -0
  967. package/dist/mcp/index.js.map +1 -0
  968. package/dist/mcp/indexing-service.d.ts +137 -0
  969. package/dist/mcp/indexing-service.d.ts.map +1 -0
  970. package/dist/mcp/indexing-service.js +961 -0
  971. package/dist/mcp/indexing-service.js.map +1 -0
  972. package/dist/mcp/mcp-server.d.ts +100 -0
  973. package/dist/mcp/mcp-server.d.ts.map +1 -0
  974. package/dist/mcp/mcp-server.js +1827 -0
  975. package/dist/mcp/mcp-server.js.map +1 -0
  976. package/dist/orchestrator/claude-tool-orchestrator.d.ts +128 -0
  977. package/dist/orchestrator/claude-tool-orchestrator.d.ts.map +1 -0
  978. package/dist/orchestrator/claude-tool-orchestrator.js +490 -0
  979. package/dist/orchestrator/claude-tool-orchestrator.js.map +1 -0
  980. package/dist/orchestrator/intelligent-task-orchestrator.d.ts +131 -0
  981. package/dist/orchestrator/intelligent-task-orchestrator.d.ts.map +1 -0
  982. package/dist/orchestrator/intelligent-task-orchestrator.js +493 -0
  983. package/dist/orchestrator/intelligent-task-orchestrator.js.map +1 -0
  984. package/dist/orchestrator/interfaces.d.ts +59 -0
  985. package/dist/orchestrator/interfaces.d.ts.map +1 -0
  986. package/dist/orchestrator/interfaces.js +7 -0
  987. package/dist/orchestrator/interfaces.js.map +1 -0
  988. package/dist/orchestrator/messaging/redis-messaging.d.ts +84 -0
  989. package/dist/orchestrator/messaging/redis-messaging.d.ts.map +1 -0
  990. package/dist/orchestrator/messaging/redis-messaging.js +384 -0
  991. package/dist/orchestrator/messaging/redis-messaging.js.map +1 -0
  992. package/dist/orchestrator/messaging/redis-queue.d.ts +89 -0
  993. package/dist/orchestrator/messaging/redis-queue.d.ts.map +1 -0
  994. package/dist/orchestrator/messaging/redis-queue.js +243 -0
  995. package/dist/orchestrator/messaging/redis-queue.js.map +1 -0
  996. package/dist/orchestrator/semantic-orchestrator.d.ts +43 -0
  997. package/dist/orchestrator/semantic-orchestrator.d.ts.map +1 -0
  998. package/dist/orchestrator/semantic-orchestrator.js +285 -0
  999. package/dist/orchestrator/semantic-orchestrator.js.map +1 -0
  1000. package/dist/orchestrator/sequential-workflow-orchestrator.d.ts +128 -0
  1001. package/dist/orchestrator/sequential-workflow-orchestrator.d.ts.map +1 -0
  1002. package/dist/orchestrator/sequential-workflow-orchestrator.js +406 -0
  1003. package/dist/orchestrator/sequential-workflow-orchestrator.js.map +1 -0
  1004. package/dist/orchestrator/services/code-duplications-service.d.ts +14 -0
  1005. package/dist/orchestrator/services/code-duplications-service.d.ts.map +1 -0
  1006. package/dist/orchestrator/services/code-duplications-service.js +116 -0
  1007. package/dist/orchestrator/services/code-duplications-service.js.map +1 -0
  1008. package/dist/orchestrator/services/database-connection-service.d.ts +14 -0
  1009. package/dist/orchestrator/services/database-connection-service.d.ts.map +1 -0
  1010. package/dist/orchestrator/services/database-connection-service.js +46 -0
  1011. package/dist/orchestrator/services/database-connection-service.js.map +1 -0
  1012. package/dist/orchestrator/services/semantic-search-service.d.ts +15 -0
  1013. package/dist/orchestrator/services/semantic-search-service.d.ts.map +1 -0
  1014. package/dist/orchestrator/services/semantic-search-service.js +154 -0
  1015. package/dist/orchestrator/services/semantic-search-service.js.map +1 -0
  1016. package/dist/orchestrator/services/tool-data-service.d.ts +14 -0
  1017. package/dist/orchestrator/services/tool-data-service.d.ts.map +1 -0
  1018. package/dist/orchestrator/services/tool-data-service.js +76 -0
  1019. package/dist/orchestrator/services/tool-data-service.js.map +1 -0
  1020. package/dist/orchestrator/tool-database-api.d.ts +47 -0
  1021. package/dist/orchestrator/tool-database-api.d.ts.map +1 -0
  1022. package/dist/orchestrator/tool-database-api.js +200 -0
  1023. package/dist/orchestrator/tool-database-api.js.map +1 -0
  1024. package/dist/orchestrator/types.d.ts +98 -0
  1025. package/dist/orchestrator/types.d.ts.map +1 -0
  1026. package/dist/orchestrator/types.js +6 -0
  1027. package/dist/orchestrator/types.js.map +1 -0
  1028. package/dist/orchestrator/workflow-definitions.d.ts +9 -0
  1029. package/dist/orchestrator/workflow-definitions.d.ts.map +1 -0
  1030. package/dist/orchestrator/workflow-definitions.js +169 -0
  1031. package/dist/orchestrator/workflow-definitions.js.map +1 -0
  1032. package/dist/orchestrator/workflow-visualizer.d.ts +54 -0
  1033. package/dist/orchestrator/workflow-visualizer.d.ts.map +1 -0
  1034. package/dist/orchestrator/workflow-visualizer.js +355 -0
  1035. package/dist/orchestrator/workflow-visualizer.js.map +1 -0
  1036. package/dist/services/managers/quality-manager.d.ts +108 -0
  1037. package/dist/services/managers/quality-manager.d.ts.map +1 -0
  1038. package/dist/services/managers/quality-manager.js +763 -0
  1039. package/dist/services/managers/quality-manager.js.map +1 -0
  1040. package/dist/services/managers/sync-manager.d.ts +106 -0
  1041. package/dist/services/managers/sync-manager.d.ts.map +1 -0
  1042. package/dist/services/managers/sync-manager.js +573 -0
  1043. package/dist/services/managers/sync-manager.js.map +1 -0
  1044. package/dist/shared/analysis-repository-consolidated.d.ts +155 -0
  1045. package/dist/shared/analysis-repository-consolidated.d.ts.map +1 -0
  1046. package/dist/shared/analysis-repository-consolidated.js +587 -0
  1047. package/dist/shared/analysis-repository-consolidated.js.map +1 -0
  1048. package/dist/shared/analysis-repository.d.ts +48 -0
  1049. package/dist/shared/analysis-repository.d.ts.map +1 -0
  1050. package/dist/shared/analysis-repository.js +183 -0
  1051. package/dist/shared/analysis-repository.js.map +1 -0
  1052. package/dist/shared/analytics-export-pipeline.d.ts +32 -0
  1053. package/dist/shared/analytics-export-pipeline.d.ts.map +1 -0
  1054. package/dist/shared/analytics-export-pipeline.js +307 -0
  1055. package/dist/shared/analytics-export-pipeline.js.map +1 -0
  1056. package/dist/shared/ast/analyzer.d.ts +59 -0
  1057. package/dist/shared/ast/analyzer.d.ts.map +1 -0
  1058. package/dist/shared/ast/analyzer.js +202 -0
  1059. package/dist/shared/ast/analyzer.js.map +1 -0
  1060. package/dist/shared/change-assessment-system.d.ts +111 -0
  1061. package/dist/shared/change-assessment-system.d.ts.map +1 -0
  1062. package/dist/shared/change-assessment-system.js +465 -0
  1063. package/dist/shared/change-assessment-system.js.map +1 -0
  1064. package/dist/shared/codebase-analyzer.d.ts +41 -0
  1065. package/dist/shared/codebase-analyzer.d.ts.map +1 -0
  1066. package/dist/shared/codebase-analyzer.js +60 -0
  1067. package/dist/shared/codebase-analyzer.js.map +1 -0
  1068. package/dist/shared/codemind-memory-system.d.ts +75 -0
  1069. package/dist/shared/codemind-memory-system.d.ts.map +1 -0
  1070. package/dist/shared/codemind-memory-system.js +222 -0
  1071. package/dist/shared/codemind-memory-system.js.map +1 -0
  1072. package/dist/shared/codeseeker-memory-system.d.ts +75 -0
  1073. package/dist/shared/codeseeker-memory-system.d.ts.map +1 -0
  1074. package/dist/shared/codeseeker-memory-system.js +222 -0
  1075. package/dist/shared/codeseeker-memory-system.js.map +1 -0
  1076. package/dist/shared/comprehensive-impact-analyzer.d.ts +94 -0
  1077. package/dist/shared/comprehensive-impact-analyzer.d.ts.map +1 -0
  1078. package/dist/shared/comprehensive-impact-analyzer.js +534 -0
  1079. package/dist/shared/comprehensive-impact-analyzer.js.map +1 -0
  1080. package/dist/shared/context-provider.d.ts +110 -0
  1081. package/dist/shared/context-provider.d.ts.map +1 -0
  1082. package/dist/shared/context-provider.js +392 -0
  1083. package/dist/shared/context-provider.js.map +1 -0
  1084. package/dist/shared/database-responsibility-guide.d.ts +183 -0
  1085. package/dist/shared/database-responsibility-guide.d.ts.map +1 -0
  1086. package/dist/shared/database-responsibility-guide.js +201 -0
  1087. package/dist/shared/database-responsibility-guide.js.map +1 -0
  1088. package/dist/shared/documentation-rag-service.d.ts +149 -0
  1089. package/dist/shared/documentation-rag-service.d.ts.map +1 -0
  1090. package/dist/shared/documentation-rag-service.js +586 -0
  1091. package/dist/shared/documentation-rag-service.js.map +1 -0
  1092. package/dist/shared/file-hash-tracker.d.ts +145 -0
  1093. package/dist/shared/file-hash-tracker.d.ts.map +1 -0
  1094. package/dist/shared/file-hash-tracker.js +387 -0
  1095. package/dist/shared/file-hash-tracker.js.map +1 -0
  1096. package/dist/shared/file-synchronization-system.d.ts +143 -0
  1097. package/dist/shared/file-synchronization-system.d.ts.map +1 -0
  1098. package/dist/shared/file-synchronization-system.js +642 -0
  1099. package/dist/shared/file-synchronization-system.js.map +1 -0
  1100. package/dist/shared/four-layer-memory-architecture.d.ts +372 -0
  1101. package/dist/shared/four-layer-memory-architecture.d.ts.map +1 -0
  1102. package/dist/shared/four-layer-memory-architecture.js +353 -0
  1103. package/dist/shared/four-layer-memory-architecture.js.map +1 -0
  1104. package/dist/shared/hybrid-file-discovery.d.ts +86 -0
  1105. package/dist/shared/hybrid-file-discovery.d.ts.map +1 -0
  1106. package/dist/shared/hybrid-file-discovery.js +270 -0
  1107. package/dist/shared/hybrid-file-discovery.js.map +1 -0
  1108. package/dist/shared/intelligent-cycle/interfaces.d.ts +73 -0
  1109. package/dist/shared/intelligent-cycle/interfaces.d.ts.map +1 -0
  1110. package/dist/shared/intelligent-cycle/interfaces.js +7 -0
  1111. package/dist/shared/intelligent-cycle/interfaces.js.map +1 -0
  1112. package/dist/shared/intelligent-cycle/services/code-extraction-service.d.ts +29 -0
  1113. package/dist/shared/intelligent-cycle/services/code-extraction-service.d.ts.map +1 -0
  1114. package/dist/shared/intelligent-cycle/services/code-extraction-service.js +191 -0
  1115. package/dist/shared/intelligent-cycle/services/code-extraction-service.js.map +1 -0
  1116. package/dist/shared/intelligent-cycle/services/intent-analysis-service.d.ts +17 -0
  1117. package/dist/shared/intelligent-cycle/services/intent-analysis-service.d.ts.map +1 -0
  1118. package/dist/shared/intelligent-cycle/services/intent-analysis-service.js +151 -0
  1119. package/dist/shared/intelligent-cycle/services/intent-analysis-service.js.map +1 -0
  1120. package/dist/shared/intelligent-cycle/services/security-scanning-service.d.ts +16 -0
  1121. package/dist/shared/intelligent-cycle/services/security-scanning-service.d.ts.map +1 -0
  1122. package/dist/shared/intelligent-cycle/services/security-scanning-service.js +171 -0
  1123. package/dist/shared/intelligent-cycle/services/security-scanning-service.js.map +1 -0
  1124. package/dist/shared/intelligent-cycle/services/semantic-deduplication-service.d.ts +15 -0
  1125. package/dist/shared/intelligent-cycle/services/semantic-deduplication-service.d.ts.map +1 -0
  1126. package/dist/shared/intelligent-cycle/services/semantic-deduplication-service.js +116 -0
  1127. package/dist/shared/intelligent-cycle/services/semantic-deduplication-service.js.map +1 -0
  1128. package/dist/shared/intelligent-cycle/services/similarity-matching-service.d.ts +13 -0
  1129. package/dist/shared/intelligent-cycle/services/similarity-matching-service.d.ts.map +1 -0
  1130. package/dist/shared/intelligent-cycle/services/similarity-matching-service.js +64 -0
  1131. package/dist/shared/intelligent-cycle/services/similarity-matching-service.js.map +1 -0
  1132. package/dist/shared/intelligent-cycle-features.d.ts +41 -0
  1133. package/dist/shared/intelligent-cycle-features.d.ts.map +1 -0
  1134. package/dist/shared/intelligent-cycle-features.js +102 -0
  1135. package/dist/shared/intelligent-cycle-features.js.map +1 -0
  1136. package/dist/shared/intelligent-tool-selector.d.ts +90 -0
  1137. package/dist/shared/intelligent-tool-selector.d.ts.map +1 -0
  1138. package/dist/shared/intelligent-tool-selector.js +357 -0
  1139. package/dist/shared/intelligent-tool-selector.js.map +1 -0
  1140. package/dist/shared/logger.d.ts +2 -0
  1141. package/dist/shared/logger.d.ts.map +1 -0
  1142. package/dist/shared/logger.js +9 -0
  1143. package/dist/shared/logger.js.map +1 -0
  1144. package/dist/shared/managers/cache-manager.d.ts +147 -0
  1145. package/dist/shared/managers/cache-manager.d.ts.map +1 -0
  1146. package/dist/shared/managers/cache-manager.js +408 -0
  1147. package/dist/shared/managers/cache-manager.js.map +1 -0
  1148. package/dist/shared/managers/database-update-manager.d.ts +142 -0
  1149. package/dist/shared/managers/database-update-manager.d.ts.map +1 -0
  1150. package/dist/shared/managers/database-update-manager.js +747 -0
  1151. package/dist/shared/managers/database-update-manager.js.map +1 -0
  1152. package/dist/shared/managers/git-branch-manager.d.ts +104 -0
  1153. package/dist/shared/managers/git-branch-manager.d.ts.map +1 -0
  1154. package/dist/shared/managers/git-branch-manager.js +435 -0
  1155. package/dist/shared/managers/git-branch-manager.js.map +1 -0
  1156. package/dist/shared/memory-architecture-integration.d.ts +124 -0
  1157. package/dist/shared/memory-architecture-integration.d.ts.map +1 -0
  1158. package/dist/shared/memory-architecture-integration.js +247 -0
  1159. package/dist/shared/memory-architecture-integration.js.map +1 -0
  1160. package/dist/shared/memory-orchestrator-integration.d.ts +86 -0
  1161. package/dist/shared/memory-orchestrator-integration.d.ts.map +1 -0
  1162. package/dist/shared/memory-orchestrator-integration.js +325 -0
  1163. package/dist/shared/memory-orchestrator-integration.js.map +1 -0
  1164. package/dist/shared/memory-system/interfaces/index.d.ts +255 -0
  1165. package/dist/shared/memory-system/interfaces/index.d.ts.map +1 -0
  1166. package/dist/shared/memory-system/interfaces/index.js +7 -0
  1167. package/dist/shared/memory-system/interfaces/index.js.map +1 -0
  1168. package/dist/shared/memory-system/memory-system.d.ts +69 -0
  1169. package/dist/shared/memory-system/memory-system.d.ts.map +1 -0
  1170. package/dist/shared/memory-system/memory-system.js +219 -0
  1171. package/dist/shared/memory-system/memory-system.js.map +1 -0
  1172. package/dist/shared/memory-system/services/memory-analytics-service.d.ts +26 -0
  1173. package/dist/shared/memory-system/services/memory-analytics-service.d.ts.map +1 -0
  1174. package/dist/shared/memory-system/services/memory-analytics-service.js +101 -0
  1175. package/dist/shared/memory-system/services/memory-analytics-service.js.map +1 -0
  1176. package/dist/shared/memory-system/services/memory-optimization-service.d.ts +21 -0
  1177. package/dist/shared/memory-system/services/memory-optimization-service.d.ts.map +1 -0
  1178. package/dist/shared/memory-system/services/memory-optimization-service.js +282 -0
  1179. package/dist/shared/memory-system/services/memory-optimization-service.js.map +1 -0
  1180. package/dist/shared/memory-system/services/memory-retrieval-service.d.ts +30 -0
  1181. package/dist/shared/memory-system/services/memory-retrieval-service.d.ts.map +1 -0
  1182. package/dist/shared/memory-system/services/memory-retrieval-service.js +430 -0
  1183. package/dist/shared/memory-system/services/memory-retrieval-service.js.map +1 -0
  1184. package/dist/shared/memory-system/services/memory-storage-service.d.ts +47 -0
  1185. package/dist/shared/memory-system/services/memory-storage-service.d.ts.map +1 -0
  1186. package/dist/shared/memory-system/services/memory-storage-service.js +450 -0
  1187. package/dist/shared/memory-system/services/memory-storage-service.js.map +1 -0
  1188. package/dist/shared/multi-level-cache.d.ts +106 -0
  1189. package/dist/shared/multi-level-cache.d.ts.map +1 -0
  1190. package/dist/shared/multi-level-cache.js +423 -0
  1191. package/dist/shared/multi-level-cache.js.map +1 -0
  1192. package/dist/shared/offline-first-cache.d.ts +69 -0
  1193. package/dist/shared/offline-first-cache.d.ts.map +1 -0
  1194. package/dist/shared/offline-first-cache.js +312 -0
  1195. package/dist/shared/offline-first-cache.js.map +1 -0
  1196. package/dist/shared/performance-monitor.d.ts +69 -0
  1197. package/dist/shared/performance-monitor.d.ts.map +1 -0
  1198. package/dist/shared/performance-monitor.js +226 -0
  1199. package/dist/shared/performance-monitor.js.map +1 -0
  1200. package/dist/shared/platform-utils.d.ts +105 -0
  1201. package/dist/shared/platform-utils.d.ts.map +1 -0
  1202. package/dist/shared/platform-utils.js +299 -0
  1203. package/dist/shared/platform-utils.js.map +1 -0
  1204. package/dist/shared/post-execution-integration.d.ts +99 -0
  1205. package/dist/shared/post-execution-integration.d.ts.map +1 -0
  1206. package/dist/shared/post-execution-integration.js +504 -0
  1207. package/dist/shared/post-execution-integration.js.map +1 -0
  1208. package/dist/shared/postgresql-analytics-database.d.ts +54 -0
  1209. package/dist/shared/postgresql-analytics-database.d.ts.map +1 -0
  1210. package/dist/shared/postgresql-analytics-database.js +333 -0
  1211. package/dist/shared/postgresql-analytics-database.js.map +1 -0
  1212. package/dist/shared/project-intelligence.d.ts +45 -0
  1213. package/dist/shared/project-intelligence.d.ts.map +1 -0
  1214. package/dist/shared/project-intelligence.js +176 -0
  1215. package/dist/shared/project-intelligence.js.map +1 -0
  1216. package/dist/shared/prompt-chunking-system.d.ts +39 -0
  1217. package/dist/shared/prompt-chunking-system.d.ts.map +1 -0
  1218. package/dist/shared/prompt-chunking-system.js +233 -0
  1219. package/dist/shared/prompt-chunking-system.js.map +1 -0
  1220. package/dist/shared/reconciliation-system.d.ts +105 -0
  1221. package/dist/shared/reconciliation-system.d.ts.map +1 -0
  1222. package/dist/shared/reconciliation-system.js +430 -0
  1223. package/dist/shared/reconciliation-system.js.map +1 -0
  1224. package/dist/shared/redis-cache-adapter.d.ts +73 -0
  1225. package/dist/shared/redis-cache-adapter.d.ts.map +1 -0
  1226. package/dist/shared/redis-cache-adapter.js +294 -0
  1227. package/dist/shared/redis-cache-adapter.js.map +1 -0
  1228. package/dist/shared/redis-file-change-sync.d.ts +126 -0
  1229. package/dist/shared/redis-file-change-sync.d.ts.map +1 -0
  1230. package/dist/shared/redis-file-change-sync.js +779 -0
  1231. package/dist/shared/redis-file-change-sync.js.map +1 -0
  1232. package/dist/shared/semantic-enhancement-engine.d.ts +70 -0
  1233. package/dist/shared/semantic-enhancement-engine.d.ts.map +1 -0
  1234. package/dist/shared/semantic-enhancement-engine.js +127 -0
  1235. package/dist/shared/semantic-enhancement-engine.js.map +1 -0
  1236. package/dist/shared/task-specific-file-orchestrator.d.ts +107 -0
  1237. package/dist/shared/task-specific-file-orchestrator.d.ts.map +1 -0
  1238. package/dist/shared/task-specific-file-orchestrator.js +492 -0
  1239. package/dist/shared/task-specific-file-orchestrator.js.map +1 -0
  1240. package/dist/shared/tool-adapter.d.ts +27 -0
  1241. package/dist/shared/tool-adapter.d.ts.map +1 -0
  1242. package/dist/shared/tool-adapter.js +147 -0
  1243. package/dist/shared/tool-adapter.js.map +1 -0
  1244. package/dist/shared/tool-config-repository.d.ts +41 -0
  1245. package/dist/shared/tool-config-repository.d.ts.map +1 -0
  1246. package/dist/shared/tool-config-repository.js +178 -0
  1247. package/dist/shared/tool-config-repository.js.map +1 -0
  1248. package/dist/shared/tool-interface.d.ts +220 -0
  1249. package/dist/shared/tool-interface.d.ts.map +1 -0
  1250. package/dist/shared/tool-interface.js +357 -0
  1251. package/dist/shared/tool-interface.js.map +1 -0
  1252. package/dist/shared/tool-registry-initializer.d.ts +32 -0
  1253. package/dist/shared/tool-registry-initializer.d.ts.map +1 -0
  1254. package/dist/shared/tool-registry-initializer.js +173 -0
  1255. package/dist/shared/tool-registry-initializer.js.map +1 -0
  1256. package/dist/shared/types.d.ts +48 -0
  1257. package/dist/shared/types.d.ts.map +1 -0
  1258. package/dist/shared/types.js +6 -0
  1259. package/dist/shared/types.js.map +1 -0
  1260. package/dist/shared/validation-cycle/interfaces/index.d.ts +102 -0
  1261. package/dist/shared/validation-cycle/interfaces/index.d.ts.map +1 -0
  1262. package/dist/shared/validation-cycle/interfaces/index.js +7 -0
  1263. package/dist/shared/validation-cycle/interfaces/index.js.map +1 -0
  1264. package/dist/shared/validation-cycle/services/core-safety-service.d.ts +21 -0
  1265. package/dist/shared/validation-cycle/services/core-safety-service.d.ts.map +1 -0
  1266. package/dist/shared/validation-cycle/services/core-safety-service.js +339 -0
  1267. package/dist/shared/validation-cycle/services/core-safety-service.js.map +1 -0
  1268. package/dist/shared/validation-cycle/services/quality-validation-service.d.ts +24 -0
  1269. package/dist/shared/validation-cycle/services/quality-validation-service.d.ts.map +1 -0
  1270. package/dist/shared/validation-cycle/services/quality-validation-service.js +368 -0
  1271. package/dist/shared/validation-cycle/services/quality-validation-service.js.map +1 -0
  1272. package/dist/shared/validation-cycle/services/validation-aggregator-service.d.ts +28 -0
  1273. package/dist/shared/validation-cycle/services/validation-aggregator-service.d.ts.map +1 -0
  1274. package/dist/shared/validation-cycle/services/validation-aggregator-service.js +214 -0
  1275. package/dist/shared/validation-cycle/services/validation-aggregator-service.js.map +1 -0
  1276. package/dist/shared/validation-cycle/services/validation-report-service.d.ts +29 -0
  1277. package/dist/shared/validation-cycle/services/validation-report-service.d.ts.map +1 -0
  1278. package/dist/shared/validation-cycle/services/validation-report-service.js +304 -0
  1279. package/dist/shared/validation-cycle/services/validation-report-service.js.map +1 -0
  1280. package/dist/shared/validation-cycle/validation-cycle.d.ts +64 -0
  1281. package/dist/shared/validation-cycle/validation-cycle.d.ts.map +1 -0
  1282. package/dist/shared/validation-cycle/validation-cycle.js +226 -0
  1283. package/dist/shared/validation-cycle/validation-cycle.js.map +1 -0
  1284. package/dist/shared/validation-cycle.d.ts +12 -0
  1285. package/dist/shared/validation-cycle.d.ts.map +1 -0
  1286. package/dist/shared/validation-cycle.js +20 -0
  1287. package/dist/shared/validation-cycle.js.map +1 -0
  1288. package/dist/storage/embedded/graphology-graph-store.d.ts +39 -0
  1289. package/dist/storage/embedded/graphology-graph-store.d.ts.map +1 -0
  1290. package/dist/storage/embedded/graphology-graph-store.js +357 -0
  1291. package/dist/storage/embedded/graphology-graph-store.js.map +1 -0
  1292. package/dist/storage/embedded/index.d.ts +40 -0
  1293. package/dist/storage/embedded/index.d.ts.map +1 -0
  1294. package/dist/storage/embedded/index.js +154 -0
  1295. package/dist/storage/embedded/index.js.map +1 -0
  1296. package/dist/storage/embedded/lru-cache-store.d.ts +44 -0
  1297. package/dist/storage/embedded/lru-cache-store.d.ts.map +1 -0
  1298. package/dist/storage/embedded/lru-cache-store.js +232 -0
  1299. package/dist/storage/embedded/lru-cache-store.js.map +1 -0
  1300. package/dist/storage/embedded/minisearch-text-store.d.ts +62 -0
  1301. package/dist/storage/embedded/minisearch-text-store.d.ts.map +1 -0
  1302. package/dist/storage/embedded/minisearch-text-store.js +521 -0
  1303. package/dist/storage/embedded/minisearch-text-store.js.map +1 -0
  1304. package/dist/storage/embedded/sqlite-project-store.d.ts +29 -0
  1305. package/dist/storage/embedded/sqlite-project-store.d.ts.map +1 -0
  1306. package/dist/storage/embedded/sqlite-project-store.js +193 -0
  1307. package/dist/storage/embedded/sqlite-project-store.js.map +1 -0
  1308. package/dist/storage/embedded/sqlite-vector-store.d.ts +48 -0
  1309. package/dist/storage/embedded/sqlite-vector-store.d.ts.map +1 -0
  1310. package/dist/storage/embedded/sqlite-vector-store.js +462 -0
  1311. package/dist/storage/embedded/sqlite-vector-store.js.map +1 -0
  1312. package/dist/storage/index.d.ts +64 -0
  1313. package/dist/storage/index.d.ts.map +1 -0
  1314. package/dist/storage/index.js +84 -0
  1315. package/dist/storage/index.js.map +1 -0
  1316. package/dist/storage/interfaces.d.ts +259 -0
  1317. package/dist/storage/interfaces.d.ts.map +1 -0
  1318. package/dist/storage/interfaces.js +12 -0
  1319. package/dist/storage/interfaces.js.map +1 -0
  1320. package/dist/storage/server/elasticsearch-text-store.d.ts +82 -0
  1321. package/dist/storage/server/elasticsearch-text-store.d.ts.map +1 -0
  1322. package/dist/storage/server/elasticsearch-text-store.js +177 -0
  1323. package/dist/storage/server/elasticsearch-text-store.js.map +1 -0
  1324. package/dist/storage/server/index.d.ts +42 -0
  1325. package/dist/storage/server/index.d.ts.map +1 -0
  1326. package/dist/storage/server/index.js +109 -0
  1327. package/dist/storage/server/index.js.map +1 -0
  1328. package/dist/storage/server/neo4j-graph-store.d.ts +49 -0
  1329. package/dist/storage/server/neo4j-graph-store.d.ts.map +1 -0
  1330. package/dist/storage/server/neo4j-graph-store.js +357 -0
  1331. package/dist/storage/server/neo4j-graph-store.js.map +1 -0
  1332. package/dist/storage/server/postgres-project-store.d.ts +30 -0
  1333. package/dist/storage/server/postgres-project-store.d.ts.map +1 -0
  1334. package/dist/storage/server/postgres-project-store.js +146 -0
  1335. package/dist/storage/server/postgres-project-store.js.map +1 -0
  1336. package/dist/storage/server/postgres-vector-store.d.ts +51 -0
  1337. package/dist/storage/server/postgres-vector-store.d.ts.map +1 -0
  1338. package/dist/storage/server/postgres-vector-store.js +306 -0
  1339. package/dist/storage/server/postgres-vector-store.js.map +1 -0
  1340. package/dist/storage/server/redis-cache-store.d.ts +61 -0
  1341. package/dist/storage/server/redis-cache-store.d.ts.map +1 -0
  1342. package/dist/storage/server/redis-cache-store.js +209 -0
  1343. package/dist/storage/server/redis-cache-store.js.map +1 -0
  1344. package/dist/storage/storage-manager.d.ts +121 -0
  1345. package/dist/storage/storage-manager.d.ts.map +1 -0
  1346. package/dist/storage/storage-manager.js +444 -0
  1347. package/dist/storage/storage-manager.js.map +1 -0
  1348. package/dist/storage/storage-provider.d.ts +62 -0
  1349. package/dist/storage/storage-provider.d.ts.map +1 -0
  1350. package/dist/storage/storage-provider.js +257 -0
  1351. package/dist/storage/storage-provider.js.map +1 -0
  1352. package/dist/utils/cache.d.ts +66 -0
  1353. package/dist/utils/cache.d.ts.map +1 -0
  1354. package/dist/utils/cache.js +254 -0
  1355. package/dist/utils/cache.js.map +1 -0
  1356. package/dist/utils/cli-logger.d.ts +75 -0
  1357. package/dist/utils/cli-logger.d.ts.map +1 -0
  1358. package/dist/utils/cli-logger.js +217 -0
  1359. package/dist/utils/cli-logger.js.map +1 -0
  1360. package/dist/utils/colored-logger.d.ts +40 -0
  1361. package/dist/utils/colored-logger.d.ts.map +1 -0
  1362. package/dist/utils/colored-logger.js +233 -0
  1363. package/dist/utils/colored-logger.js.map +1 -0
  1364. package/dist/utils/config.d.ts +61 -0
  1365. package/dist/utils/config.d.ts.map +1 -0
  1366. package/dist/utils/config.js +230 -0
  1367. package/dist/utils/config.js.map +1 -0
  1368. package/dist/utils/file-system.d.ts +30 -0
  1369. package/dist/utils/file-system.d.ts.map +1 -0
  1370. package/dist/utils/file-system.js +207 -0
  1371. package/dist/utils/file-system.js.map +1 -0
  1372. package/dist/utils/hash.d.ts +79 -0
  1373. package/dist/utils/hash.d.ts.map +1 -0
  1374. package/dist/utils/hash.js +172 -0
  1375. package/dist/utils/hash.js.map +1 -0
  1376. package/dist/utils/logger.d.ts +39 -0
  1377. package/dist/utils/logger.d.ts.map +1 -0
  1378. package/dist/utils/logger.js +106 -0
  1379. package/dist/utils/logger.js.map +1 -0
  1380. package/package.json +150 -0
@@ -0,0 +1,1987 @@
1
+ "use strict";
2
+ /**
3
+ * User Interaction Service
4
+ * Single Responsibility: Handle user interactions and Claude Code detection
5
+ * Manages user clarification prompts and Claude Code command execution
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.UserInteractionService = void 0;
12
+ const platform_utils_1 = require("../../../shared/platform-utils");
13
+ const child_process_1 = require("child_process");
14
+ const inquirer_1 = __importDefault(require("inquirer"));
15
+ const theme_1 = require("../../ui/theme");
16
+ const logger_1 = require("../../../utils/logger");
17
+ class UserInteractionService {
18
+ rl;
19
+ skipApproval = false; // When true, auto-approve changes (user selected "Yes, always")
20
+ verboseMode = false; // When true, show full debug output (files, relationships, prompt)
21
+ activeChild = null; // Track active child process for cancellation
22
+ isCancelled = false; // Flag to track user cancellation
23
+ searchModeEnabled = true; // Toggle for semantic search (default: enabled, persists between prompts)
24
+ keyInputHandler = null; // Handler for key passthrough
25
+ constructor() {
26
+ // No initialization needed - we pipe directly to claude stdin
27
+ // Set up SIGINT (Ctrl+C) handler for graceful cancellation
28
+ process.on('SIGINT', () => {
29
+ if (this.activeChild) {
30
+ console.log(theme_1.Theme.colors.warning('\n\n ⚠️ Cancelling... (press Ctrl+C again to force quit)'));
31
+ this.isCancelled = true;
32
+ this.activeChild.kill('SIGTERM');
33
+ this.activeChild = null;
34
+ }
35
+ else {
36
+ // If no active child, let the default handler take over
37
+ process.exit(0);
38
+ }
39
+ });
40
+ }
41
+ /**
42
+ * Set verbose mode (when user uses -v/--verbose flag)
43
+ */
44
+ setVerboseMode(enabled) {
45
+ this.verboseMode = enabled;
46
+ }
47
+ /**
48
+ * Check if verbose mode is enabled
49
+ */
50
+ isVerboseMode() {
51
+ return this.verboseMode;
52
+ }
53
+ /**
54
+ * Set skip approval mode (when user selects "Yes, always")
55
+ */
56
+ setSkipApproval(skip) {
57
+ this.skipApproval = skip;
58
+ }
59
+ /**
60
+ * Set the readline interface (passed from main CLI)
61
+ */
62
+ setReadlineInterface(rl) {
63
+ this.rl = rl;
64
+ }
65
+ /**
66
+ * Pause readline before inquirer prompts to avoid conflicts
67
+ */
68
+ pauseReadline() {
69
+ if (this.rl) {
70
+ this.rl.pause();
71
+ }
72
+ }
73
+ /**
74
+ * Resume readline after inquirer prompts
75
+ */
76
+ resumeReadline() {
77
+ if (this.rl) {
78
+ this.rl.resume();
79
+ }
80
+ }
81
+ /**
82
+ * Set up key input passthrough to forward Escape key to Claude
83
+ * This enables users to interrupt Claude's processing just like using Claude directly
84
+ */
85
+ setupKeyPassthrough(childStdin) {
86
+ if (!childStdin || !process.stdin.isTTY) {
87
+ return; // Can't set up raw mode if not a TTY or no stdin
88
+ }
89
+ // Save current raw mode state and enable raw mode
90
+ const wasRaw = process.stdin.isRaw;
91
+ if (!wasRaw) {
92
+ process.stdin.setRawMode(true);
93
+ }
94
+ process.stdin.resume();
95
+ // Handler for key input - forward Escape key to Claude
96
+ this.keyInputHandler = (data) => {
97
+ // Check for Escape key (0x1B)
98
+ if (data[0] === 0x1B) {
99
+ // Forward Escape to Claude's stdin
100
+ try {
101
+ childStdin.write(data);
102
+ }
103
+ catch {
104
+ // Child stdin may already be closed
105
+ }
106
+ }
107
+ // Check for Ctrl+C (0x03) - let SIGINT handler deal with it
108
+ else if (data[0] === 0x03) {
109
+ process.emit('SIGINT', 'SIGINT');
110
+ }
111
+ };
112
+ process.stdin.on('data', this.keyInputHandler);
113
+ }
114
+ /**
115
+ * Clean up key input passthrough
116
+ */
117
+ cleanupKeyPassthrough() {
118
+ if (this.keyInputHandler) {
119
+ process.stdin.removeListener('data', this.keyInputHandler);
120
+ this.keyInputHandler = null;
121
+ }
122
+ // Restore stdin state
123
+ if (process.stdin.isTTY) {
124
+ try {
125
+ process.stdin.setRawMode(false);
126
+ process.stdin.pause();
127
+ }
128
+ catch {
129
+ // Ignore errors during cleanup
130
+ }
131
+ }
132
+ }
133
+ /**
134
+ * Prompt user for clarifications based on detected assumptions and ambiguities
135
+ */
136
+ async promptForClarifications(queryAnalysis) {
137
+ const clarifications = [];
138
+ // Create questions based on assumptions and ambiguities
139
+ const questions = this.generateClarificationQuestions(queryAnalysis);
140
+ if (questions.length === 0) {
141
+ return clarifications;
142
+ }
143
+ console.log(theme_1.Theme.sectionTitle('Clarification Needed', '❓'));
144
+ console.log(theme_1.Theme.colors.warning(' CodeSeeker detected some assumptions and ambiguities in your request.'));
145
+ console.log(theme_1.Theme.colors.highlight(' Please help clarify the following questions:\n'));
146
+ this.pauseReadline();
147
+ logger_1.Logger.mute();
148
+ try {
149
+ for (let i = 0; i < questions.length; i++) {
150
+ const question = questions[i];
151
+ try {
152
+ const answer = await inquirer_1.default.prompt([
153
+ {
154
+ type: 'input',
155
+ name: 'response',
156
+ message: `${i + 1}. ${question}`,
157
+ validate: (input) => input.trim().length > 0 || 'Please provide an answer or type "skip" to skip this question'
158
+ }
159
+ ]);
160
+ if (answer.response && answer.response.toLowerCase() !== 'skip') {
161
+ clarifications.push(`${question} → ${answer.response}`);
162
+ }
163
+ }
164
+ catch (error) {
165
+ // Handle Ctrl+C gracefully - skip remaining questions
166
+ if (error.name === 'ExitPromptError' || error.message?.includes('force closed')) {
167
+ console.log('\n⚠️ Prompt cancelled - skipping remaining questions');
168
+ break;
169
+ }
170
+ throw error;
171
+ }
172
+ }
173
+ }
174
+ finally {
175
+ logger_1.Logger.unmute();
176
+ this.resumeReadline();
177
+ }
178
+ return clarifications;
179
+ }
180
+ /**
181
+ * Execute Claude Code with enhanced prompt
182
+ * When running inside Claude Code, outputs context transparently for the current Claude instance
183
+ * @param enhancedPrompt The prompt to send to Claude
184
+ * @param options.autoApprove If true, auto-approve all file changes (for automated fix tasks)
185
+ */
186
+ async executeClaudeCode(enhancedPrompt, options) {
187
+ // For automated tasks like build fixes, enable auto-approval
188
+ if (options?.autoApprove) {
189
+ this.skipApproval = true;
190
+ }
191
+ try {
192
+ // Check if running inside Claude Code
193
+ if (platform_utils_1.PlatformUtils.isRunningInClaudeCode()) {
194
+ // TRANSPARENT MODE: Pass enhanced context to Claude
195
+ // For auto-approve tasks (build fixes, test fixes), add execution directive
196
+ let promptToSend = enhancedPrompt;
197
+ if (options?.autoApprove) {
198
+ // Add directive to execute immediately without showing a plan
199
+ promptToSend = `<codeseeker-directive>
200
+ EXECUTE IMMEDIATELY - DO NOT SHOW A PLAN
201
+ This is an automated fix task. Execute the fix directly without asking for approval or showing a plan.
202
+ Just make the necessary changes to fix the issue.
203
+ </codeseeker-directive>
204
+
205
+ ${enhancedPrompt}`;
206
+ }
207
+ // Output the context in a clear, visible format that Claude will process
208
+ console.log(theme_1.Theme.sectionTitle('CodeSeeker Enhanced Context', '📤'));
209
+ console.log(theme_1.Theme.colors.muted(' The following context is being provided to Claude Code:\n'));
210
+ // Show a summary of what's being provided
211
+ const lines = promptToSend.split('\n');
212
+ const contextPreview = lines.slice(0, 15).join('\n');
213
+ console.log(contextPreview);
214
+ if (lines.length > 15) {
215
+ console.log(`\n... (${lines.length - 15} more lines of context)`);
216
+ }
217
+ // Output the full context in the special tags for Claude to process
218
+ console.log('\n<codeseeker-context>');
219
+ console.log(promptToSend);
220
+ console.log('</codeseeker-context>\n');
221
+ if (options?.autoApprove) {
222
+ console.log(theme_1.Theme.colors.warning('\n ⚡ Auto-Execute Mode'));
223
+ console.log(theme_1.Theme.colors.muted(' Claude will execute the fix immediately without showing a plan.\n'));
224
+ }
225
+ else {
226
+ console.log(theme_1.Theme.colors.info('\n ℹ️ Transparent Mode Active'));
227
+ console.log(theme_1.Theme.divider('─', 55));
228
+ console.log(theme_1.Theme.colors.muted(' CodeSeeker detected it\'s running inside Claude Code.'));
229
+ console.log(theme_1.Theme.colors.muted(' The enhanced context above will inform Claude\'s response.'));
230
+ console.log(theme_1.Theme.colors.muted(' Claude Code will now continue with this additional context.\n'));
231
+ }
232
+ // Return success - Claude (already running) will process this context
233
+ return {
234
+ response: 'Context provided to Claude Code - see enhanced context above',
235
+ filesToModify: [],
236
+ summary: 'Transparent mode: context provided to running Claude Code instance'
237
+ };
238
+ }
239
+ // EXTERNAL MODE: Execute Claude CLI with streaming output
240
+ return await this.executeClaudeCodeWithStreaming(enhancedPrompt);
241
+ }
242
+ catch (error) {
243
+ console.error('❌ Failed to execute Claude Code:', error);
244
+ return {
245
+ response: 'Failed to execute Claude Code command',
246
+ filesToModify: [],
247
+ summary: 'Execution failed'
248
+ };
249
+ }
250
+ }
251
+ /**
252
+ * Execute a direct Claude command for autonomous fix tasks (build/test fixes)
253
+ * This method bypasses the full workflow orchestrator and executes immediately.
254
+ *
255
+ * In transparent mode: Outputs a plain instruction for Claude to process without
256
+ * triggering the CodeSeeker workflow (no <codeseeker-context> tags).
257
+ *
258
+ * In external mode: Runs Claude CLI with auto-approval for immediate execution.
259
+ */
260
+ async executeDirectFixCommand(fixPrompt, taskType) {
261
+ const taskLabels = {
262
+ 'build': '🔨 Build Fix',
263
+ 'test': '🧪 Test Fix',
264
+ 'general': '🔧 Fix'
265
+ };
266
+ const label = taskLabels[taskType];
267
+ if (platform_utils_1.PlatformUtils.isRunningInClaudeCode()) {
268
+ // TRANSPARENT MODE: Output as a simple instruction for the running Claude instance
269
+ // Use a special format that doesn't trigger CodeSeeker workflow
270
+ console.log(theme_1.Theme.colors.info(`\n ${label} - Direct Execution`));
271
+ console.log(theme_1.Theme.colors.muted(' ─────────────────────────────────────────────'));
272
+ // Output the instruction directly (Claude will see this as instruction to follow)
273
+ console.log(theme_1.Theme.colors.claudeCode(`\n INSTRUCTION: ${fixPrompt.split('\n')[0]}`));
274
+ if (fixPrompt.split('\n').length > 1) {
275
+ console.log(theme_1.Theme.colors.muted(` ... (${fixPrompt.split('\n').length - 1} more lines of context)`));
276
+ }
277
+ // Output completion message
278
+ console.log(theme_1.Theme.colors.muted('\n Claude will now execute this fix directly.\n'));
279
+ // Return success - the current Claude session will process this
280
+ return { success: true, output: 'Instruction provided to Claude' };
281
+ }
282
+ // EXTERNAL MODE: Run Claude CLI with streaming and auto-approval
283
+ return new Promise((resolve) => {
284
+ const userCwd = process.env.CODESEEKER_USER_CWD || process.cwd();
285
+ // Use --dangerously-skip-permissions for auto-approved fix execution
286
+ // Note: --verbose is required when using --output-format stream-json with -p (--print)
287
+ const claudeArgs = ['-p', '--verbose', '--output-format', 'stream-json', '--dangerously-skip-permissions'];
288
+ console.log(theme_1.Theme.colors.info(`\n ${label} - Executing...`));
289
+ const child = (0, child_process_1.spawn)('claude', claudeArgs, {
290
+ cwd: userCwd,
291
+ env: { ...process.env },
292
+ stdio: ['pipe', 'pipe', 'pipe'],
293
+ shell: true
294
+ });
295
+ let buffer = '';
296
+ let lastDisplayedText = '';
297
+ let isFirstOutput = true;
298
+ let finalOutput = '';
299
+ child.stdin?.write(fixPrompt);
300
+ child.stdin?.end();
301
+ child.stdout?.on('data', (data) => {
302
+ buffer += data.toString();
303
+ const lines = buffer.split('\n');
304
+ buffer = lines.pop() || '';
305
+ for (const line of lines) {
306
+ if (!line.trim())
307
+ continue;
308
+ try {
309
+ const event = JSON.parse(line);
310
+ if (event.type === 'assistant') {
311
+ if (event.message?.content) {
312
+ for (const block of event.message.content) {
313
+ if (block.type === 'text') {
314
+ const newText = block.text || '';
315
+ if (newText.length > lastDisplayedText.length) {
316
+ const delta = newText.substring(lastDisplayedText.length);
317
+ if (isFirstOutput) {
318
+ process.stdout.write(theme_1.Theme.colors.claudeCode('\n │ '));
319
+ isFirstOutput = false;
320
+ }
321
+ const formattedDelta = delta.replace(/\n/g, theme_1.Theme.colors.claudeCode('\n │ '));
322
+ process.stdout.write(theme_1.Theme.colors.claudeCode(formattedDelta));
323
+ lastDisplayedText = newText;
324
+ }
325
+ }
326
+ }
327
+ }
328
+ }
329
+ else if (event.type === 'result') {
330
+ if (!isFirstOutput) {
331
+ process.stdout.write('\n');
332
+ }
333
+ finalOutput = event.result || '';
334
+ }
335
+ }
336
+ catch {
337
+ // Skip non-JSON lines
338
+ }
339
+ }
340
+ });
341
+ child.stderr?.on('data', (data) => {
342
+ const errorText = data.toString();
343
+ if (errorText.includes('Error') || errorText.includes('error')) {
344
+ console.error(theme_1.Theme.colors.error(` Error: ${errorText}`));
345
+ }
346
+ });
347
+ child.on('close', (code) => {
348
+ if (code === 0) {
349
+ console.log(theme_1.Theme.colors.success(` ✓ ${label} completed`));
350
+ resolve({ success: true, output: finalOutput || lastDisplayedText });
351
+ }
352
+ else {
353
+ console.log(theme_1.Theme.colors.error(` ✗ ${label} failed (exit code: ${code})`));
354
+ resolve({ success: false, output: finalOutput || lastDisplayedText });
355
+ }
356
+ });
357
+ child.on('error', (err) => {
358
+ console.error(theme_1.Theme.colors.error(` ✗ Failed to start Claude: ${err.message}`));
359
+ resolve({ success: false, output: err.message });
360
+ });
361
+ });
362
+ }
363
+ /**
364
+ * Execute Claude Code with two-phase permission handling and feedback loop
365
+ * Phase 1: Run Claude and collect proposed changes (permission denials)
366
+ * Phase 2: If user approves, resume session with permissions to execute changes
367
+ * Feedback Loop: If user provides feedback, retry with modified prompt
368
+ */
369
+ async executeClaudeCodeWithStreaming(enhancedPrompt) {
370
+ let currentPrompt = enhancedPrompt;
371
+ let allModifiedFiles = [];
372
+ let iterationCount = 0;
373
+ const MAX_ITERATIONS = 10; // Safety limit
374
+ // Main feedback loop
375
+ while (iterationCount < MAX_ITERATIONS) {
376
+ iterationCount++;
377
+ // Show compact context summary (only on first iteration or when prompt changes significantly)
378
+ if (iterationCount === 1) {
379
+ this.showCompactContextSummary(currentPrompt);
380
+ }
381
+ // Phase 1: Run Claude and collect proposed changes (with real-time streaming output)
382
+ console.log(theme_1.Theme.colors.info(iterationCount === 1 ? '\n 🤖 Claude is thinking...' : '\n 🤖 Claude is re-analyzing with your feedback...'));
383
+ const firstPhase = await this.executeClaudeFirstPhase(currentPrompt);
384
+ // Note: Claude's response is already shown during streaming (real-time output)
385
+ // The "Plan" box was removed to avoid showing the same content twice
386
+ // If there are proposed changes, show them and ask for approval
387
+ if (firstPhase.hasPermissionDenials && firstPhase.proposedChanges.length > 0) {
388
+ // Deduplicate changes (same file path should only appear once)
389
+ const uniqueChanges = this.deduplicateChanges(firstPhase.proposedChanges);
390
+ const approval = await this.showProposedChangesAndConfirm(uniqueChanges);
391
+ if (approval.choice === 'yes' || approval.choice === 'yes_always') {
392
+ if (approval.choice === 'yes_always') {
393
+ this.skipApproval = true;
394
+ }
395
+ // Phase 2: Resume session with permissions to execute changes
396
+ console.log(theme_1.Theme.colors.muted('\n Applying changes...'));
397
+ const finalResponse = await this.executeClaudeSecondPhase(firstPhase.sessionId);
398
+ // Show what was modified
399
+ this.showAppliedChanges(uniqueChanges);
400
+ // Add to total modified files
401
+ allModifiedFiles = [...allModifiedFiles, ...uniqueChanges.map(c => c.filePath)];
402
+ return {
403
+ response: finalResponse,
404
+ filesToModify: [...new Set(allModifiedFiles)], // Deduplicate
405
+ summary: `Applied ${uniqueChanges.length} file change(s)`
406
+ };
407
+ }
408
+ else if (approval.choice === 'no_feedback' && approval.feedback) {
409
+ // User provided feedback - incorporate into prompt and retry
410
+ console.log(theme_1.Theme.colors.info('\n Retrying with your feedback...'));
411
+ // Build new prompt with feedback
412
+ currentPrompt = this.incorporateFeedback(enhancedPrompt, approval.feedback, iterationCount);
413
+ // Continue loop to retry
414
+ continue;
415
+ }
416
+ else if (approval.choice === 'new_command' && approval.newCommand) {
417
+ // User wants to enter a different command entirely
418
+ // Return with special flag so caller can handle re-execution with new command
419
+ console.log(theme_1.Theme.colors.info('\n Starting new command...'));
420
+ return {
421
+ response: firstPhase.response,
422
+ filesToModify: allModifiedFiles,
423
+ summary: `new_command:${approval.newCommand}` // Special marker for caller to detect
424
+ };
425
+ }
426
+ else if (approval.choice === 'cancelled') {
427
+ // User explicitly cancelled (Ctrl+C)
428
+ console.log(theme_1.Theme.colors.muted('\n Operation cancelled.'));
429
+ return {
430
+ response: firstPhase.response,
431
+ filesToModify: allModifiedFiles,
432
+ summary: 'Operation cancelled by user'
433
+ };
434
+ }
435
+ }
436
+ else {
437
+ // No file changes proposed - check if this is expected or needs retry
438
+ if (iterationCount === 1) {
439
+ // First attempt, no changes - this is fine
440
+ return {
441
+ response: firstPhase.response,
442
+ filesToModify: [],
443
+ summary: 'Claude Code has processed the request (no file changes needed)'
444
+ };
445
+ }
446
+ else {
447
+ // After feedback, still no changes - ask if user wants to try again
448
+ console.log(theme_1.Theme.colors.warning('\n Claude didn\'t propose any file changes this time.'));
449
+ const continueChoice = await this.askToContinue();
450
+ if (continueChoice.choice === 'no_feedback' && continueChoice.feedback) {
451
+ currentPrompt = this.incorporateFeedback(enhancedPrompt, continueChoice.feedback, iterationCount);
452
+ continue;
453
+ }
454
+ else {
455
+ return {
456
+ response: firstPhase.response,
457
+ filesToModify: allModifiedFiles,
458
+ summary: 'No additional changes proposed'
459
+ };
460
+ }
461
+ }
462
+ }
463
+ }
464
+ // Max iterations reached
465
+ console.log(theme_1.Theme.colors.warning('\n Maximum retry attempts reached.'));
466
+ return {
467
+ response: 'Maximum retry attempts reached',
468
+ filesToModify: allModifiedFiles,
469
+ summary: 'Feedback loop exhausted after maximum iterations'
470
+ };
471
+ }
472
+ /**
473
+ * Incorporate user feedback into the prompt for retry
474
+ */
475
+ incorporateFeedback(originalPrompt, feedback, iteration) {
476
+ return `${originalPrompt}
477
+
478
+ # User Feedback (Iteration ${iteration})
479
+ The user reviewed the proposed changes and requested modifications:
480
+ "${feedback}"
481
+
482
+ Please revise your approach based on this feedback and propose new changes.`;
483
+ }
484
+ /**
485
+ * Ask user if they want to continue with more feedback
486
+ */
487
+ async askToContinue() {
488
+ this.pauseReadline();
489
+ logger_1.Logger.mute();
490
+ try {
491
+ const answer = await inquirer_1.default.prompt([
492
+ {
493
+ type: 'list',
494
+ name: 'choice',
495
+ message: 'What would you like to do?',
496
+ choices: [
497
+ { name: 'Provide more guidance', value: 'no_feedback' },
498
+ { name: 'Done (accept current state)', value: 'yes' }
499
+ ],
500
+ default: 'yes'
501
+ }
502
+ ]);
503
+ if (answer.choice === 'no_feedback') {
504
+ const feedbackAnswer = await inquirer_1.default.prompt([
505
+ {
506
+ type: 'input',
507
+ name: 'feedback',
508
+ message: 'What should Claude do?',
509
+ validate: (input) => input.trim().length > 0 || 'Please provide guidance'
510
+ }
511
+ ]);
512
+ return { choice: 'no_feedback', feedback: feedbackAnswer.feedback };
513
+ }
514
+ return { choice: answer.choice };
515
+ }
516
+ catch (error) {
517
+ if (error.name === 'ExitPromptError' || error.message?.includes('force closed')) {
518
+ return { choice: 'cancelled' };
519
+ }
520
+ throw error;
521
+ }
522
+ finally {
523
+ logger_1.Logger.unmute();
524
+ this.resumeReadline();
525
+ }
526
+ }
527
+ /**
528
+ * Show compact context summary - just a single line showing what's being sent
529
+ * In verbose mode, shows full context details
530
+ */
531
+ showCompactContextSummary(prompt) {
532
+ const lines = prompt.split('\n');
533
+ const totalChars = prompt.length;
534
+ // Extract file count from the prompt
535
+ const filesMatch = prompt.match(/## Relevant Files\n([\s\S]*?)(?=\n##|\n#|$)/);
536
+ const fileSection = filesMatch ? filesMatch[1] : '';
537
+ const fileMatches = fileSection.match(/\*\*([^*]+)\*\*/g) || [];
538
+ const fileCount = fileMatches.length;
539
+ // Single compact line
540
+ console.log(theme_1.Theme.colors.muted(`\n 📤 Sending: ${fileCount} files, ${lines.length} lines (${totalChars} chars)`));
541
+ // In verbose mode, show full details
542
+ if (this.verboseMode) {
543
+ console.log(theme_1.Theme.colors.info('\n ┌─ 🔍 Verbose: Full Context Details ─────────────────────────┐'));
544
+ // Show files found
545
+ if (fileMatches.length > 0) {
546
+ console.log(theme_1.Theme.colors.muted(' │'));
547
+ console.log(theme_1.Theme.colors.info(' │ Files:'));
548
+ fileMatches.forEach(match => {
549
+ const fileName = String(match).replace(/\*\*/g, '');
550
+ console.log(theme_1.Theme.colors.muted(' │ ') + theme_1.Theme.colors.highlight(fileName));
551
+ });
552
+ }
553
+ // Extract and show relationships
554
+ const relMatch = prompt.match(/## Dependencies\n([\s\S]*?)(?=\n##|\n#|$)/);
555
+ if (relMatch) {
556
+ const relSection = relMatch[1];
557
+ const relLines = relSection.split('\n').filter(l => l.trim().startsWith('-'));
558
+ if (relLines.length > 0) {
559
+ console.log(theme_1.Theme.colors.muted(' │'));
560
+ console.log(theme_1.Theme.colors.info(' │ Relationships:'));
561
+ relLines.slice(0, 10).forEach(line => {
562
+ console.log(theme_1.Theme.colors.muted(' │ ') + theme_1.Theme.colors.muted(line.trim()));
563
+ });
564
+ if (relLines.length > 10) {
565
+ console.log(theme_1.Theme.colors.muted(` │ ... and ${relLines.length - 10} more`));
566
+ }
567
+ }
568
+ }
569
+ // Extract and show components
570
+ const compMatch = prompt.match(/## Components\n([\s\S]*?)(?=\n##|\n#|$)/);
571
+ if (compMatch) {
572
+ const compSection = compMatch[1];
573
+ const compLines = compSection.split('\n').filter(l => l.trim().startsWith('-'));
574
+ if (compLines.length > 0) {
575
+ console.log(theme_1.Theme.colors.muted(' │'));
576
+ console.log(theme_1.Theme.colors.info(' │ Components:'));
577
+ compLines.slice(0, 8).forEach(line => {
578
+ console.log(theme_1.Theme.colors.muted(' │ ') + theme_1.Theme.colors.muted(line.trim()));
579
+ });
580
+ if (compLines.length > 8) {
581
+ console.log(theme_1.Theme.colors.muted(` │ ... and ${compLines.length - 8} more`));
582
+ }
583
+ }
584
+ }
585
+ console.log(theme_1.Theme.colors.muted(' │'));
586
+ console.log(theme_1.Theme.colors.info(' │ Full Prompt:'));
587
+ // Show full prompt with line numbers
588
+ lines.forEach((line, i) => {
589
+ const lineNum = String(i + 1).padStart(4, ' ');
590
+ console.log(theme_1.Theme.colors.muted(` │ ${lineNum} │ `) + line);
591
+ });
592
+ console.log(theme_1.Theme.colors.info(' └──────────────────────────────────────────────────────────────┘'));
593
+ }
594
+ }
595
+ /**
596
+ * Deduplicate proposed changes (same file path should only appear once)
597
+ */
598
+ deduplicateChanges(changes) {
599
+ const seen = new Map();
600
+ for (const change of changes) {
601
+ // Keep the last change for each file path
602
+ seen.set(change.filePath, change);
603
+ }
604
+ return Array.from(seen.values());
605
+ }
606
+ /**
607
+ * Show what changes were applied
608
+ */
609
+ showAppliedChanges(changes) {
610
+ console.log(theme_1.Theme.colors.success('\n✓ Changes applied:'));
611
+ changes.forEach((change, i) => {
612
+ const fileName = change.filePath.split(/[/\\]/).pop() || change.filePath;
613
+ const operation = change.tool === 'Write' ? 'Created' : 'Modified';
614
+ console.log(theme_1.Theme.colors.success(` ${i + 1}. ${operation}: ${fileName}`));
615
+ });
616
+ }
617
+ /**
618
+ * Phase 1: Execute Claude and collect proposed changes without applying them
619
+ * Uses stream-json format to show Claude's thinking in real-time
620
+ */
621
+ async executeClaudeFirstPhase(prompt) {
622
+ return new Promise((resolve) => {
623
+ const userCwd = process.env.CODESEEKER_USER_CWD || process.cwd();
624
+ // Use stream-json for real-time output with partial messages
625
+ // Note: --verbose is required when using --output-format stream-json with -p (--print)
626
+ const claudeArgs = ['-p', '--verbose', '--output-format', 'stream-json', '--include-partial-messages'];
627
+ const child = (0, child_process_1.spawn)('claude', claudeArgs, {
628
+ cwd: userCwd,
629
+ env: { ...process.env },
630
+ stdio: ['pipe', 'pipe', 'pipe'],
631
+ shell: true
632
+ });
633
+ let buffer = '';
634
+ let sessionId = '';
635
+ let finalResult = '';
636
+ const proposedChanges = [];
637
+ let lastDisplayedText = '';
638
+ let lastDisplayedThinking = '';
639
+ let isFirstOutput = true;
640
+ let currentToolName = '';
641
+ let lastToolStatus = '';
642
+ // Spinner configuration - only show briefly before Claude responds
643
+ const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
644
+ let spinnerIdx = 0;
645
+ let hasReceivedOutput = false;
646
+ let stderrBuffer = '';
647
+ const isTTY = process.stdout.isTTY;
648
+ // Show a brief waiting indicator until Claude starts responding
649
+ // Once Claude sends data, we'll show its actual thinking messages
650
+ let spinnerInterval = null;
651
+ if (isTTY) {
652
+ // Interactive terminal: minimal spinner just until Claude responds
653
+ spinnerInterval = setInterval(() => {
654
+ if (!hasReceivedOutput) {
655
+ const spinner = spinnerFrames[spinnerIdx++ % spinnerFrames.length];
656
+ // Simple spinner without verb - Claude will show its own thinking messages
657
+ process.stdout.write(`\r ${spinner} Waiting for Claude...`);
658
+ }
659
+ }, 100);
660
+ }
661
+ else {
662
+ // Non-interactive: show static message
663
+ process.stdout.write(' ⏳ Waiting for Claude...\n');
664
+ }
665
+ const stopSpinner = () => {
666
+ if (spinnerInterval) {
667
+ clearInterval(spinnerInterval);
668
+ spinnerInterval = null;
669
+ // Clear the spinner line in TTY mode
670
+ if (isTTY && !hasReceivedOutput) {
671
+ process.stdout.write('\r' + ' '.repeat(30) + '\r');
672
+ }
673
+ }
674
+ };
675
+ // Track active child for cancellation and key passthrough
676
+ this.activeChild = child;
677
+ // Write prompt to stdin but keep it open for Escape key passthrough
678
+ child.stdin?.write(prompt);
679
+ // Note: We don't call child.stdin?.end() here - Claude reads until newline
680
+ // and we need stdin open to forward Escape key presses
681
+ // Set up key passthrough for Escape key interruption
682
+ this.setupKeyPassthrough(child.stdin);
683
+ child.stdout?.on('data', (data) => {
684
+ // Stop the initial spinner once we receive any stdout data
685
+ if (!hasReceivedOutput) {
686
+ hasReceivedOutput = true;
687
+ stopSpinner();
688
+ }
689
+ buffer += data.toString();
690
+ // Process complete JSON lines
691
+ const lines = buffer.split('\n');
692
+ buffer = lines.pop() || ''; // Keep incomplete line in buffer
693
+ for (const line of lines) {
694
+ if (!line.trim())
695
+ continue;
696
+ try {
697
+ const event = JSON.parse(line);
698
+ // Handle different event types
699
+ if (event.type === 'assistant') {
700
+ // Partial assistant message - show Claude's thinking and reasoning
701
+ if (event.message?.content) {
702
+ for (const block of event.message.content) {
703
+ // Handle thinking/reasoning blocks (Claude's internal reasoning)
704
+ if (block.type === 'thinking') {
705
+ const thinkingText = block.thinking || '';
706
+ if (thinkingText.length > lastDisplayedThinking.length) {
707
+ const delta = thinkingText.substring(lastDisplayedThinking.length);
708
+ // First thinking block - show header with spinner
709
+ if (lastDisplayedThinking === '') {
710
+ const spinner = spinnerFrames[spinnerIdx++ % spinnerFrames.length];
711
+ process.stdout.write(theme_1.Theme.colors.muted(`\n ${spinner} Claude is thinking...\n`));
712
+ }
713
+ // Show Claude's actual thinking/reasoning in muted color
714
+ const formattedDelta = delta.replace(/\n/g, theme_1.Theme.colors.muted('\n │ '));
715
+ process.stdout.write(theme_1.Theme.colors.muted(` │ ${formattedDelta}`));
716
+ lastDisplayedThinking = thinkingText;
717
+ }
718
+ }
719
+ // Handle regular text output
720
+ else if (block.type === 'text') {
721
+ const newText = block.text || '';
722
+ // Only show new text (delta)
723
+ if (newText.length > lastDisplayedText.length) {
724
+ const delta = newText.substring(lastDisplayedText.length);
725
+ if (isFirstOutput) {
726
+ // Start with Claude-themed bar prefix
727
+ process.stdout.write(theme_1.Theme.colors.claudeCode('\n │ '));
728
+ isFirstOutput = false;
729
+ }
730
+ // Show Claude's thinking with Claude theme color and handle newlines
731
+ const formattedDelta = delta.replace(/\n/g, theme_1.Theme.colors.claudeCode('\n │ '));
732
+ process.stdout.write(theme_1.Theme.colors.claudeCode(formattedDelta));
733
+ lastDisplayedText = newText;
734
+ }
735
+ }
736
+ // Handle tool use blocks (Read, Edit, Write, Bash, etc.)
737
+ else if (block.type === 'tool_use') {
738
+ const toolName = block.name || 'Tool';
739
+ currentToolName = toolName;
740
+ // Show tool invocation with spinner
741
+ const spinner = spinnerFrames[spinnerIdx++ % spinnerFrames.length];
742
+ const toolDisplay = this.formatToolDisplay(toolName, block.input);
743
+ // Skip permission denial notices - we handle these with our own prompt
744
+ if (toolDisplay.includes('permission') || toolDisplay.includes("haven't")) {
745
+ continue;
746
+ }
747
+ if (toolDisplay !== lastToolStatus) {
748
+ process.stdout.write(theme_1.Theme.colors.info(`\n ${spinner} ${toolDisplay}`));
749
+ lastToolStatus = toolDisplay;
750
+ }
751
+ }
752
+ }
753
+ }
754
+ }
755
+ // Handle content_block_start events (tool starts)
756
+ else if (event.type === 'content_block_start') {
757
+ if (event.content_block?.type === 'tool_use') {
758
+ const toolName = event.content_block.name || 'Tool';
759
+ currentToolName = toolName;
760
+ const spinner = spinnerFrames[spinnerIdx++ % spinnerFrames.length];
761
+ process.stdout.write(theme_1.Theme.colors.info(`\n ${spinner} Using ${toolName}...`));
762
+ }
763
+ else if (event.content_block?.type === 'thinking') {
764
+ const spinner = spinnerFrames[spinnerIdx++ % spinnerFrames.length];
765
+ process.stdout.write(theme_1.Theme.colors.muted(`\n ${spinner} Claude is thinking...`));
766
+ }
767
+ }
768
+ // Handle tool result events (can come as 'tool_result' or nested in 'user' message)
769
+ else if (event.type === 'tool_result') {
770
+ if (currentToolName) {
771
+ // Show tool output using formatted display
772
+ const output = event.content || event.output || '';
773
+ const outputStr = typeof output === 'string' ? output : JSON.stringify(output);
774
+ const formattedResult = this.formatToolResult(currentToolName, outputStr);
775
+ if (formattedResult) {
776
+ process.stdout.write(formattedResult);
777
+ }
778
+ else {
779
+ process.stdout.write(theme_1.Theme.colors.success(' ✓'));
780
+ }
781
+ currentToolName = '';
782
+ }
783
+ }
784
+ // Handle 'user' type events which contain tool results in Claude Code stream-json
785
+ else if (event.type === 'user' && event.message?.content) {
786
+ for (const block of event.message.content) {
787
+ if (block.type === 'tool_result') {
788
+ // Extract tool result content
789
+ let resultContent = '';
790
+ if (typeof block.content === 'string') {
791
+ resultContent = block.content;
792
+ }
793
+ else if (Array.isArray(block.content)) {
794
+ resultContent = block.content
795
+ .map((c) => c.type === 'text' ? c.text : '')
796
+ .filter(Boolean)
797
+ .join('\n');
798
+ }
799
+ if (resultContent && currentToolName) {
800
+ const formattedResult = this.formatToolResult(currentToolName, resultContent);
801
+ if (formattedResult) {
802
+ process.stdout.write(formattedResult);
803
+ }
804
+ currentToolName = '';
805
+ }
806
+ }
807
+ }
808
+ }
809
+ else if (event.type === 'content_block_stop') {
810
+ // Just mark as complete if no result shown
811
+ if (currentToolName) {
812
+ process.stdout.write(theme_1.Theme.colors.success(' ✓'));
813
+ currentToolName = '';
814
+ }
815
+ }
816
+ else if (event.type === 'result') {
817
+ // Final result - extract session_id and permission_denials
818
+ if (!isFirstOutput) {
819
+ process.stdout.write('\n');
820
+ }
821
+ sessionId = event.session_id || '';
822
+ finalResult = event.result || '';
823
+ // Extract proposed changes from permission_denials
824
+ const denials = event.permission_denials || [];
825
+ for (const denial of denials) {
826
+ const isFileOperation = denial.tool_name === 'Write' || denial.tool_name === 'Edit';
827
+ const hasFilePath = denial.tool_input?.file_path;
828
+ if (isFileOperation && hasFilePath) {
829
+ const change = {
830
+ tool: denial.tool_name,
831
+ filePath: denial.tool_input.file_path
832
+ };
833
+ if (denial.tool_name === 'Write') {
834
+ change.content = denial.tool_input.content;
835
+ }
836
+ else if (denial.tool_name === 'Edit') {
837
+ change.oldString = denial.tool_input.old_string;
838
+ change.newString = denial.tool_input.new_string;
839
+ }
840
+ proposedChanges.push(change);
841
+ }
842
+ }
843
+ }
844
+ }
845
+ catch {
846
+ // Ignore parse errors for incomplete lines
847
+ }
848
+ }
849
+ });
850
+ child.stderr?.on('data', (data) => {
851
+ const text = data.toString().trim();
852
+ stderrBuffer += text + '\n';
853
+ if (text) {
854
+ // Filter out Claude's permission denial messages - we handle these ourselves
855
+ if (text.includes('requested permissions') && text.includes("haven't")) {
856
+ return;
857
+ }
858
+ if (text.includes('permission') && text.includes('denied')) {
859
+ return;
860
+ }
861
+ // Don't show raw stderr during normal operation - we'll analyze it on close
862
+ }
863
+ });
864
+ child.on('close', (code) => {
865
+ // Always stop spinner and clean up
866
+ stopSpinner();
867
+ this.cleanupKeyPassthrough();
868
+ this.activeChild = null;
869
+ // Check for Claude CLI specific errors in stderr
870
+ const claudeError = this.parseClaudeError(stderrBuffer, code);
871
+ if (claudeError) {
872
+ console.error(theme_1.Theme.colors.error(`\n ${claudeError}`));
873
+ resolve({
874
+ sessionId: '',
875
+ response: claudeError,
876
+ proposedChanges: [],
877
+ hasPermissionDenials: false
878
+ });
879
+ return;
880
+ }
881
+ // Process any remaining buffer
882
+ if (buffer.trim()) {
883
+ try {
884
+ const event = JSON.parse(buffer);
885
+ if (event.type === 'result') {
886
+ sessionId = event.session_id || sessionId;
887
+ finalResult = event.result || finalResult;
888
+ }
889
+ }
890
+ catch {
891
+ // Ignore
892
+ }
893
+ }
894
+ // Parse and display test results if any (language-agnostic)
895
+ const testResults = this.parseTestResults(lastDisplayedText);
896
+ if (testResults) {
897
+ this.displayTestSummary(testResults);
898
+ }
899
+ resolve({
900
+ sessionId,
901
+ response: finalResult,
902
+ proposedChanges,
903
+ hasPermissionDenials: proposedChanges.length > 0
904
+ });
905
+ });
906
+ child.on('error', (err) => {
907
+ // Stop spinner and clean up on error
908
+ stopSpinner();
909
+ this.cleanupKeyPassthrough();
910
+ this.activeChild = null;
911
+ // Handle specific spawn errors
912
+ let errorMessage = `Error: ${err.message}`;
913
+ if (err.message.includes('ENOENT') || err.message.includes('not found')) {
914
+ errorMessage = '❌ Claude CLI not found. Please install it with: npm install -g @anthropic-ai/claude-code';
915
+ }
916
+ console.error(theme_1.Theme.colors.error(`\n ${errorMessage}`));
917
+ resolve({
918
+ sessionId: '',
919
+ response: errorMessage,
920
+ proposedChanges: [],
921
+ hasPermissionDenials: false
922
+ });
923
+ });
924
+ // Timeout after 5 minutes
925
+ setTimeout(() => {
926
+ child.kill('SIGTERM');
927
+ }, 300000);
928
+ });
929
+ }
930
+ /**
931
+ * Phase 2: Resume the session with permissions to apply changes
932
+ * Uses streaming output to show Claude's reasoning and progress in real-time
933
+ */
934
+ async executeClaudeSecondPhase(sessionId) {
935
+ return new Promise((resolve) => {
936
+ const userCwd = process.env.CODESEEKER_USER_CWD || process.cwd();
937
+ // Resume the session with permission mode to apply changes
938
+ // Use stream-json for real-time output
939
+ const claudeArgs = [
940
+ '-p',
941
+ '--verbose',
942
+ '--resume', sessionId,
943
+ '--permission-mode', 'acceptEdits',
944
+ '--output-format', 'stream-json',
945
+ '--include-partial-messages'
946
+ ];
947
+ const child = (0, child_process_1.spawn)('claude', claudeArgs, {
948
+ cwd: userCwd,
949
+ env: { ...process.env },
950
+ stdio: ['pipe', 'pipe', 'pipe'],
951
+ shell: true
952
+ });
953
+ let buffer = '';
954
+ let finalResult = '';
955
+ let lastDisplayedText = '';
956
+ let isFirstOutput = true;
957
+ let currentToolName = '';
958
+ // Rotating spinner characters
959
+ const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
960
+ let spinnerIdx = 0;
961
+ // Track active child for cancellation and key passthrough
962
+ this.activeChild = child;
963
+ // Send a simple "proceed" message but keep stdin open for Escape key passthrough
964
+ child.stdin?.write('Please proceed with the file changes.');
965
+ // Note: We don't call child.stdin?.end() here - we need stdin open for Escape key
966
+ // Set up key passthrough for Escape key interruption
967
+ this.setupKeyPassthrough(child.stdin);
968
+ child.stdout?.on('data', (data) => {
969
+ buffer += data.toString();
970
+ // Process complete JSON lines
971
+ const lines = buffer.split('\n');
972
+ buffer = lines.pop() || '';
973
+ for (const line of lines) {
974
+ if (!line.trim())
975
+ continue;
976
+ try {
977
+ const event = JSON.parse(line);
978
+ if (event.type === 'assistant') {
979
+ // Show Claude's reasoning during changes
980
+ if (event.message?.content) {
981
+ for (const block of event.message.content) {
982
+ if (block.type === 'text') {
983
+ const newText = block.text || '';
984
+ if (newText.length > lastDisplayedText.length) {
985
+ const delta = newText.substring(lastDisplayedText.length);
986
+ if (isFirstOutput) {
987
+ process.stdout.write(theme_1.Theme.colors.claudeCode('\n │ '));
988
+ isFirstOutput = false;
989
+ }
990
+ const formattedDelta = delta.replace(/\n/g, theme_1.Theme.colors.claudeCode('\n │ '));
991
+ process.stdout.write(theme_1.Theme.colors.claudeCode(formattedDelta));
992
+ lastDisplayedText = newText;
993
+ }
994
+ }
995
+ else if (block.type === 'tool_use') {
996
+ // Show tool invocations (Write, Edit, etc.)
997
+ const toolName = block.name || 'Tool';
998
+ currentToolName = toolName;
999
+ const spinner = spinnerFrames[spinnerIdx++ % spinnerFrames.length];
1000
+ const toolDisplay = this.formatToolDisplay(toolName, block.input);
1001
+ process.stdout.write(theme_1.Theme.colors.info(`\n ${spinner} ${toolDisplay}`));
1002
+ }
1003
+ }
1004
+ }
1005
+ }
1006
+ else if (event.type === 'content_block_start') {
1007
+ if (event.content_block?.type === 'tool_use') {
1008
+ const toolName = event.content_block.name || 'Tool';
1009
+ currentToolName = toolName;
1010
+ const spinner = spinnerFrames[spinnerIdx++ % spinnerFrames.length];
1011
+ process.stdout.write(theme_1.Theme.colors.info(`\n ${spinner} Using ${toolName}...`));
1012
+ }
1013
+ }
1014
+ else if (event.type === 'tool_result') {
1015
+ if (currentToolName) {
1016
+ // Show tool output using formatted display
1017
+ const output = event.content || event.output || '';
1018
+ const outputStr = typeof output === 'string' ? output : JSON.stringify(output);
1019
+ const formattedResult = this.formatToolResult(currentToolName, outputStr);
1020
+ if (formattedResult) {
1021
+ process.stdout.write(formattedResult);
1022
+ }
1023
+ else {
1024
+ process.stdout.write(theme_1.Theme.colors.success(' ✓'));
1025
+ }
1026
+ currentToolName = '';
1027
+ }
1028
+ }
1029
+ // Handle 'user' type events which contain tool results in Claude Code stream-json
1030
+ else if (event.type === 'user' && event.message?.content) {
1031
+ for (const block of event.message.content) {
1032
+ if (block.type === 'tool_result') {
1033
+ // Extract tool result content
1034
+ let resultContent = '';
1035
+ if (typeof block.content === 'string') {
1036
+ resultContent = block.content;
1037
+ }
1038
+ else if (Array.isArray(block.content)) {
1039
+ resultContent = block.content
1040
+ .map((c) => c.type === 'text' ? c.text : '')
1041
+ .filter(Boolean)
1042
+ .join('\n');
1043
+ }
1044
+ if (resultContent && currentToolName) {
1045
+ const formattedResult = this.formatToolResult(currentToolName, resultContent);
1046
+ if (formattedResult) {
1047
+ process.stdout.write(formattedResult);
1048
+ }
1049
+ currentToolName = '';
1050
+ }
1051
+ }
1052
+ }
1053
+ }
1054
+ else if (event.type === 'content_block_stop') {
1055
+ if (currentToolName) {
1056
+ process.stdout.write(theme_1.Theme.colors.success(' ✓'));
1057
+ currentToolName = '';
1058
+ }
1059
+ }
1060
+ else if (event.type === 'result') {
1061
+ if (!isFirstOutput) {
1062
+ process.stdout.write('\n');
1063
+ }
1064
+ finalResult = event.result || '';
1065
+ }
1066
+ }
1067
+ catch {
1068
+ // Ignore parse errors for incomplete lines
1069
+ }
1070
+ }
1071
+ });
1072
+ child.stderr?.on('data', (data) => {
1073
+ const text = data.toString().trim();
1074
+ if (text && (text.includes('Error') || text.includes('error'))) {
1075
+ console.error(theme_1.Theme.colors.error(`\n ${text}`));
1076
+ }
1077
+ });
1078
+ child.on('close', () => {
1079
+ // Clean up key passthrough and active child reference
1080
+ this.cleanupKeyPassthrough();
1081
+ this.activeChild = null;
1082
+ // Process any remaining buffer
1083
+ if (buffer.trim()) {
1084
+ try {
1085
+ const event = JSON.parse(buffer);
1086
+ if (event.type === 'result') {
1087
+ finalResult = event.result || finalResult;
1088
+ }
1089
+ }
1090
+ catch {
1091
+ // Ignore
1092
+ }
1093
+ }
1094
+ resolve(finalResult || lastDisplayedText || 'Changes applied');
1095
+ });
1096
+ child.on('error', (err) => {
1097
+ // Clean up on error too
1098
+ this.cleanupKeyPassthrough();
1099
+ this.activeChild = null;
1100
+ resolve(`Error applying changes: ${err.message}`);
1101
+ });
1102
+ // Timeout after 5 minutes
1103
+ setTimeout(() => {
1104
+ child.kill('SIGTERM');
1105
+ }, 300000);
1106
+ });
1107
+ }
1108
+ /**
1109
+ * Show proposed changes to user and ask for confirmation
1110
+ * Uses list-style prompt like Claude Code with Yes/Yes always/No/No with feedback options
1111
+ */
1112
+ async showProposedChangesAndConfirm(changes) {
1113
+ // If skip approval is enabled, auto-approve
1114
+ if (this.skipApproval) {
1115
+ console.log(theme_1.Theme.colors.muted(`\n Auto-approving ${changes.length} change(s)...`));
1116
+ return { choice: 'yes' };
1117
+ }
1118
+ // Show full changes - no truncation
1119
+ console.log(theme_1.Theme.colors.warning('\n┌─ 📝 Proposed Changes ───────────────────────────��─────────┐'));
1120
+ for (let i = 0; i < changes.length; i++) {
1121
+ const change = changes[i];
1122
+ const fileName = change.filePath.split(/[/\\]/).pop() || change.filePath;
1123
+ const operation = change.tool === 'Write' ? '+ Create' : '~ Modify';
1124
+ const opColor = change.tool === 'Write' ? theme_1.Theme.colors.success : theme_1.Theme.colors.warning;
1125
+ console.log(theme_1.Theme.colors.muted('│'));
1126
+ console.log(theme_1.Theme.colors.muted('│ ') + opColor(`${operation}: ${change.filePath}`));
1127
+ if (change.tool === 'Write' && change.content) {
1128
+ // Show full file content for new files
1129
+ const contentLines = change.content.split('\n');
1130
+ console.log(theme_1.Theme.colors.muted('│'));
1131
+ contentLines.forEach(line => {
1132
+ console.log(theme_1.Theme.colors.muted('│ ') + theme_1.Theme.colors.success(`+ ${line}`));
1133
+ });
1134
+ }
1135
+ else if (change.tool === 'Edit') {
1136
+ // Show full diff view
1137
+ if (change.oldString) {
1138
+ console.log(theme_1.Theme.colors.muted('│'));
1139
+ const oldLines = change.oldString.split('\n');
1140
+ oldLines.forEach(line => {
1141
+ console.log(theme_1.Theme.colors.muted('│ ') + theme_1.Theme.colors.error(`- ${line}`));
1142
+ });
1143
+ }
1144
+ if (change.newString) {
1145
+ console.log(theme_1.Theme.colors.muted('│'));
1146
+ const newLines = change.newString.split('\n');
1147
+ newLines.forEach(line => {
1148
+ console.log(theme_1.Theme.colors.muted('│ ') + theme_1.Theme.colors.success(`+ ${line}`));
1149
+ });
1150
+ }
1151
+ }
1152
+ }
1153
+ console.log(theme_1.Theme.colors.muted('│'));
1154
+ console.log(theme_1.Theme.colors.warning('└───────────────────────────────────────────────────────────┘'));
1155
+ console.log(theme_1.Theme.colors.muted(' Tip: Use ↑↓ to select, Enter to confirm, Ctrl+C to cancel'));
1156
+ // Ask for confirmation with list-style prompt (like Claude Code)
1157
+ // Options: Yes, Yes always, Modify request, Enter new command, or Ctrl+C to cancel
1158
+ this.pauseReadline();
1159
+ logger_1.Logger.mute();
1160
+ try {
1161
+ const answer = await inquirer_1.default.prompt([
1162
+ {
1163
+ type: 'list',
1164
+ name: 'choice',
1165
+ message: `Apply ${changes.length} change(s)?`,
1166
+ choices: [
1167
+ { name: 'Yes', value: 'yes' },
1168
+ { name: 'Yes, and don\'t ask again', value: 'yes_always' },
1169
+ { name: 'No, enter new request', value: 'no_feedback' }
1170
+ ],
1171
+ default: 'yes'
1172
+ }
1173
+ ]);
1174
+ // If user wants to enter a new request (keeps context)
1175
+ if (answer.choice === 'no_feedback') {
1176
+ const feedbackAnswer = await inquirer_1.default.prompt([
1177
+ {
1178
+ type: 'input',
1179
+ name: 'feedback',
1180
+ message: 'Enter your request:',
1181
+ validate: (input) => input.trim().length > 0 || 'Please enter a request (or Ctrl+C to cancel)'
1182
+ }
1183
+ ]);
1184
+ return { choice: 'no_feedback', feedback: feedbackAnswer.feedback };
1185
+ }
1186
+ return { choice: answer.choice };
1187
+ }
1188
+ catch (error) {
1189
+ if (error.name === 'ExitPromptError' || error.message?.includes('force closed')) {
1190
+ console.log('\n⚠️ Cancelled');
1191
+ return { choice: 'cancelled' };
1192
+ }
1193
+ throw error;
1194
+ }
1195
+ finally {
1196
+ logger_1.Logger.unmute();
1197
+ this.resumeReadline();
1198
+ }
1199
+ }
1200
+ /**
1201
+ * This method is now deprecated - file changes are confirmed before being applied
1202
+ * via showProposedChangesAndConfirm. Keeping for backwards compatibility.
1203
+ */
1204
+ async confirmFileModifications(_filesToModify) {
1205
+ // Changes are now confirmed via showProposedChangesAndConfirm before being applied
1206
+ // This method is kept for backwards compatibility but no longer prompts
1207
+ return { approved: true, dontAskAgain: true };
1208
+ }
1209
+ /**
1210
+ * Ask user what verification steps to run after changes
1211
+ */
1212
+ async confirmBuildAndTest() {
1213
+ if (this.skipApproval) {
1214
+ return { runBuild: true, runTests: true, generateTests: false };
1215
+ }
1216
+ this.pauseReadline();
1217
+ logger_1.Logger.mute();
1218
+ try {
1219
+ console.log(theme_1.Theme.sectionTitle('Verification Options', '🔍'));
1220
+ const answer = await inquirer_1.default.prompt([
1221
+ {
1222
+ type: 'checkbox',
1223
+ name: 'options',
1224
+ message: 'Select verification steps to run:',
1225
+ choices: [
1226
+ { name: '🔨 Run build (npm run build)', value: 'build', checked: true },
1227
+ { name: '🧪 Run existing tests (npm test)', value: 'test', checked: true },
1228
+ { name: '📝 Generate new tests for changed files', value: 'generate_tests', checked: false }
1229
+ ]
1230
+ }
1231
+ ]);
1232
+ const options = {
1233
+ runBuild: answer.options.includes('build'),
1234
+ runTests: answer.options.includes('test'),
1235
+ generateTests: answer.options.includes('generate_tests')
1236
+ };
1237
+ // If generate tests is selected, ask for test type
1238
+ if (options.generateTests) {
1239
+ const testTypeAnswer = await inquirer_1.default.prompt([
1240
+ {
1241
+ type: 'list',
1242
+ name: 'testType',
1243
+ message: 'What type of tests to generate?',
1244
+ choices: [
1245
+ { name: '🔬 Unit tests (test individual functions/classes in isolation)', value: 'unit' },
1246
+ { name: '🔗 Integration tests (test component interactions)', value: 'integration' },
1247
+ { name: '🖥️ E2E tests (test full user workflows)', value: 'e2e' }
1248
+ ],
1249
+ default: 'unit'
1250
+ }
1251
+ ]);
1252
+ options.testType = testTypeAnswer.testType;
1253
+ }
1254
+ // If nothing selected, confirm skip
1255
+ if (!options.runBuild && !options.runTests && !options.generateTests) {
1256
+ const skipConfirm = await inquirer_1.default.prompt([
1257
+ {
1258
+ type: 'confirm',
1259
+ name: 'skip',
1260
+ message: 'Skip all verification?',
1261
+ default: false
1262
+ }
1263
+ ]);
1264
+ if (!skipConfirm.skip) {
1265
+ logger_1.Logger.unmute();
1266
+ this.resumeReadline();
1267
+ return this.confirmBuildAndTest();
1268
+ }
1269
+ }
1270
+ return options;
1271
+ }
1272
+ catch (error) {
1273
+ if (error.name === 'ExitPromptError' || error.message?.includes('force closed')) {
1274
+ console.log('\n⚠️ Prompt cancelled');
1275
+ return { runBuild: false, runTests: false, generateTests: false, cancelled: true };
1276
+ }
1277
+ throw error;
1278
+ }
1279
+ finally {
1280
+ logger_1.Logger.unmute();
1281
+ this.resumeReadline();
1282
+ }
1283
+ }
1284
+ /**
1285
+ * Ask user how to handle build/test failure
1286
+ */
1287
+ async promptFailureAction(failureType, errorMessage) {
1288
+ this.pauseReadline();
1289
+ logger_1.Logger.mute();
1290
+ try {
1291
+ console.log(theme_1.Theme.colors.error(`\n ❌ ${failureType === 'build' ? 'Build' : 'Test'} failed`));
1292
+ console.log(theme_1.Theme.colors.muted(` Error: ${errorMessage.substring(0, 200)}${errorMessage.length > 200 ? '...' : ''}\n`));
1293
+ const answer = await inquirer_1.default.prompt([
1294
+ {
1295
+ type: 'list',
1296
+ name: 'action',
1297
+ message: `How would you like to handle the ${failureType} failure?`,
1298
+ choices: [
1299
+ { name: `🔧 Ask Claude to fix the ${failureType} error`, value: 'fix' },
1300
+ { name: '⏭️ Continue anyway (skip this step)', value: 'continue' },
1301
+ { name: '📋 Show full error output', value: 'show_error' },
1302
+ { name: '❌ Abort workflow', value: 'abort' }
1303
+ ]
1304
+ }
1305
+ ]);
1306
+ return { action: answer.action, errorMessage };
1307
+ }
1308
+ catch (error) {
1309
+ if (error.name === 'ExitPromptError' || error.message?.includes('force closed')) {
1310
+ return { action: 'abort', errorMessage };
1311
+ }
1312
+ throw error;
1313
+ }
1314
+ finally {
1315
+ logger_1.Logger.unmute();
1316
+ this.resumeReadline();
1317
+ }
1318
+ }
1319
+ /**
1320
+ * Ask user how to continue after an interruption
1321
+ * Used when user provides new input while a Claude session is active
1322
+ * @param hasActiveSession Whether there's an active Claude session that can be resumed
1323
+ * @returns The user's choice: continue (forward to Claude), new_search (fresh CodeSeeker search), or cancel
1324
+ */
1325
+ async promptContinuationChoice(hasActiveSession) {
1326
+ this.pauseReadline();
1327
+ logger_1.Logger.mute();
1328
+ try {
1329
+ const choices = hasActiveSession
1330
+ ? [
1331
+ { name: 'Continue conversation (forward to Claude)', value: 'continue' },
1332
+ { name: 'New search (find relevant files first)', value: 'new_search' },
1333
+ { name: 'Cancel', value: 'cancel' }
1334
+ ]
1335
+ : [
1336
+ { name: 'New search (find relevant files first)', value: 'new_search' },
1337
+ { name: 'Skip search (pass directly to Claude)', value: 'continue' },
1338
+ { name: 'Cancel', value: 'cancel' }
1339
+ ];
1340
+ const answer = await inquirer_1.default.prompt([
1341
+ {
1342
+ type: 'list',
1343
+ name: 'choice',
1344
+ message: 'How should I continue?',
1345
+ choices,
1346
+ default: hasActiveSession ? 'continue' : 'new_search'
1347
+ }
1348
+ ]);
1349
+ return answer.choice;
1350
+ }
1351
+ catch (error) {
1352
+ if (error.name === 'ExitPromptError' || error.message?.includes('force closed')) {
1353
+ return 'cancel';
1354
+ }
1355
+ throw error;
1356
+ }
1357
+ finally {
1358
+ logger_1.Logger.unmute();
1359
+ this.resumeReadline();
1360
+ }
1361
+ }
1362
+ /**
1363
+ * Check if cancellation was requested
1364
+ */
1365
+ wasCancelled() {
1366
+ return this.isCancelled;
1367
+ }
1368
+ /**
1369
+ * Reset cancellation flag
1370
+ */
1371
+ resetCancellation() {
1372
+ this.isCancelled = false;
1373
+ }
1374
+ /**
1375
+ * Get current search mode status
1376
+ */
1377
+ isSearchEnabled() {
1378
+ return this.searchModeEnabled;
1379
+ }
1380
+ /**
1381
+ * Set search mode enabled/disabled
1382
+ */
1383
+ setSearchMode(enabled) {
1384
+ this.searchModeEnabled = enabled;
1385
+ }
1386
+ /**
1387
+ * Toggle search mode on/off
1388
+ */
1389
+ toggleSearchMode() {
1390
+ this.searchModeEnabled = !this.searchModeEnabled;
1391
+ return this.searchModeEnabled;
1392
+ }
1393
+ /**
1394
+ * Prepare search mode for a new prompt
1395
+ *
1396
+ * NEW BEHAVIOR (simpler):
1397
+ * - Search mode PERSISTS between prompts (respects user's manual toggle)
1398
+ * - Default is ON (enabled at session start)
1399
+ * - User can toggle with /s at any time
1400
+ * - Only --no-search flag overrides this (handled in command-router.ts)
1401
+ *
1402
+ * @param forceOn If true, always enable search (used for -c mode)
1403
+ */
1404
+ prepareForNewPrompt(forceOn = false) {
1405
+ if (forceOn) {
1406
+ // -c mode: always search
1407
+ this.searchModeEnabled = true;
1408
+ }
1409
+ // Otherwise: preserve current searchModeEnabled state
1410
+ // User can manually toggle with /s, and that preference persists
1411
+ }
1412
+ /**
1413
+ * Mark a conversation as complete (for REPL mode)
1414
+ * NOTE: This no longer changes search mode - search persists between prompts
1415
+ */
1416
+ markConversationComplete() {
1417
+ // No-op - search mode persists between prompts
1418
+ // Users can toggle manually with /s if needed
1419
+ }
1420
+ /**
1421
+ * Reset session state (for new REPL sessions)
1422
+ */
1423
+ resetSession() {
1424
+ this.searchModeEnabled = true;
1425
+ }
1426
+ /**
1427
+ * Show a compact pre-prompt menu for search mode toggle
1428
+ * Returns the user's choice and their prompt
1429
+ * @param hasActiveSession Whether there's an active Claude session (for context)
1430
+ */
1431
+ async promptWithSearchToggle(hasActiveSession = false) {
1432
+ this.pauseReadline();
1433
+ logger_1.Logger.mute();
1434
+ try {
1435
+ // Show current mode status
1436
+ const modeIndicator = this.searchModeEnabled
1437
+ ? theme_1.Theme.colors.success('🔍 Search: ON')
1438
+ : theme_1.Theme.colors.muted('🔍 Search: OFF');
1439
+ console.log(`\n ${modeIndicator}`);
1440
+ const answer = await inquirer_1.default.prompt([
1441
+ {
1442
+ type: 'list',
1443
+ name: 'action',
1444
+ message: 'Options:',
1445
+ choices: [
1446
+ {
1447
+ name: `Enter prompt ${this.searchModeEnabled ? '(with search)' : '(direct to Claude)'}`,
1448
+ value: 'prompt'
1449
+ },
1450
+ {
1451
+ name: this.searchModeEnabled
1452
+ ? 'Turn OFF search (skip file discovery)'
1453
+ : 'Turn ON search (find relevant files first)',
1454
+ value: 'toggle'
1455
+ },
1456
+ { name: 'Cancel', value: 'cancel' }
1457
+ ],
1458
+ default: 'prompt'
1459
+ }
1460
+ ]);
1461
+ // Handle toggle action - recursively call to show updated menu
1462
+ if (answer.action === 'toggle') {
1463
+ this.toggleSearchMode();
1464
+ logger_1.Logger.unmute();
1465
+ this.resumeReadline();
1466
+ return this.promptWithSearchToggle(hasActiveSession);
1467
+ }
1468
+ // Handle cancel
1469
+ if (answer.action === 'cancel') {
1470
+ return { searchEnabled: this.searchModeEnabled, prompt: '', cancelled: true };
1471
+ }
1472
+ // Get the user's prompt
1473
+ const promptAnswer = await inquirer_1.default.prompt([
1474
+ {
1475
+ type: 'input',
1476
+ name: 'userPrompt',
1477
+ message: '💬',
1478
+ validate: (input) => input.trim().length > 0 || 'Please enter a prompt (or Ctrl+C to cancel)'
1479
+ }
1480
+ ]);
1481
+ return {
1482
+ searchEnabled: this.searchModeEnabled,
1483
+ prompt: promptAnswer.userPrompt.trim(),
1484
+ cancelled: false
1485
+ };
1486
+ }
1487
+ catch (error) {
1488
+ if (error.name === 'ExitPromptError' || error.message?.includes('force closed')) {
1489
+ return { searchEnabled: this.searchModeEnabled, prompt: '', cancelled: true };
1490
+ }
1491
+ throw error;
1492
+ }
1493
+ finally {
1494
+ logger_1.Logger.unmute();
1495
+ this.resumeReadline();
1496
+ }
1497
+ }
1498
+ /**
1499
+ * Show a minimal inline search toggle (single key press style)
1500
+ * For quick mode switching without a full menu
1501
+ * Format: "[S] Search: ON/OFF | Enter prompt:"
1502
+ */
1503
+ async promptWithInlineToggle() {
1504
+ this.pauseReadline();
1505
+ logger_1.Logger.mute();
1506
+ try {
1507
+ // Compact inline display
1508
+ const searchStatus = this.searchModeEnabled ? 'ON' : 'OFF';
1509
+ const statusColor = this.searchModeEnabled ? theme_1.Theme.colors.success : theme_1.Theme.colors.muted;
1510
+ console.log(theme_1.Theme.colors.muted(`\n /s to toggle search | `) + statusColor(`Search: ${searchStatus}`));
1511
+ const answer = await inquirer_1.default.prompt([
1512
+ {
1513
+ type: 'input',
1514
+ name: 'input',
1515
+ message: '›',
1516
+ validate: (input) => {
1517
+ const trimmed = input.trim().toLowerCase();
1518
+ // Allow '/s' to toggle, empty is not allowed, anything else is the prompt
1519
+ if (trimmed === '') {
1520
+ return 'Enter your prompt, or type /s to toggle search mode';
1521
+ }
1522
+ return true;
1523
+ }
1524
+ }
1525
+ ]);
1526
+ const input = answer.input.trim();
1527
+ // Check if user wants to toggle (accepts /s or just s for convenience)
1528
+ if (input.toLowerCase() === '/s' || input.toLowerCase() === 's') {
1529
+ this.toggleSearchMode();
1530
+ logger_1.Logger.unmute();
1531
+ this.resumeReadline();
1532
+ // Recursively show the prompt again with updated status
1533
+ return this.promptWithInlineToggle();
1534
+ }
1535
+ return {
1536
+ searchEnabled: this.searchModeEnabled,
1537
+ prompt: input,
1538
+ cancelled: false
1539
+ };
1540
+ }
1541
+ catch (error) {
1542
+ if (error.name === 'ExitPromptError' || error.message?.includes('force closed')) {
1543
+ return { searchEnabled: this.searchModeEnabled, prompt: '', cancelled: true };
1544
+ }
1545
+ throw error;
1546
+ }
1547
+ finally {
1548
+ logger_1.Logger.unmute();
1549
+ this.resumeReadline();
1550
+ }
1551
+ }
1552
+ /**
1553
+ * Get the search toggle indicator string for display
1554
+ * Returns a radio-button style indicator like "( * ) Search files" or "( ) Search files"
1555
+ * @param enabled Optional override for the search state, defaults to current state
1556
+ */
1557
+ getSearchToggleIndicator(enabled) {
1558
+ const isEnabled = enabled !== undefined ? enabled : this.searchModeEnabled;
1559
+ const radioButton = isEnabled ? '(*)' : '( )';
1560
+ const color = isEnabled ? theme_1.Theme.colors.success : theme_1.Theme.colors.muted;
1561
+ return color(`${radioButton} Search files and knowledge graph`);
1562
+ }
1563
+ /**
1564
+ * Display the search toggle indicator (for use before prompts)
1565
+ * Shows: "( * ) Search files and knowledge graph" or "( ) Search files and knowledge graph"
1566
+ * Also shows toggle hint: "/s to toggle"
1567
+ */
1568
+ displaySearchToggleIndicator() {
1569
+ const indicator = this.getSearchToggleIndicator();
1570
+ const toggleHint = theme_1.Theme.colors.muted('/s toggle');
1571
+ console.log(`\n ${indicator} ${toggleHint}`);
1572
+ }
1573
+ /**
1574
+ * Check if input is a search toggle command
1575
+ * Returns true if input is 's' or '/s' (toggle search)
1576
+ */
1577
+ isSearchToggleCommand(input) {
1578
+ const trimmed = input.trim().toLowerCase();
1579
+ return trimmed === 's' || trimmed === '/s';
1580
+ }
1581
+ /**
1582
+ * Display execution summary
1583
+ */
1584
+ displayExecutionSummary(summary, stats) {
1585
+ console.log('\n✅ CodeSeeker Execution Summary');
1586
+ console.log('━'.repeat(50));
1587
+ console.log(summary);
1588
+ if (stats) {
1589
+ console.log('\n📊 Analysis Statistics:');
1590
+ console.log(` • Files analyzed: ${stats.filesFound}`);
1591
+ console.log(` • Relationships found: ${stats.relationshipsFound}`);
1592
+ console.log(` • Assumptions detected: ${stats.assumptionsDetected}`);
1593
+ console.log(` • Clarifications provided: ${stats.clarificationsProvided}`);
1594
+ }
1595
+ console.log('');
1596
+ }
1597
+ /**
1598
+ * Generate clarification questions based on analysis
1599
+ */
1600
+ generateClarificationQuestions(queryAnalysis) {
1601
+ const questions = [];
1602
+ // Questions based on assumptions
1603
+ queryAnalysis.assumptions.forEach(assumption => {
1604
+ if (assumption.includes('authentication')) {
1605
+ questions.push('What authentication method should be used? (JWT, session-based, OAuth, etc.)');
1606
+ }
1607
+ if (assumption.includes('database')) {
1608
+ questions.push('Which database tables/models should be involved in this operation?');
1609
+ }
1610
+ if (assumption.includes('API')) {
1611
+ questions.push('Should this be a REST endpoint, GraphQL resolver, or other API pattern?');
1612
+ }
1613
+ if (assumption.includes('testing')) {
1614
+ questions.push('What type of tests are needed? (unit, integration, e2e)');
1615
+ }
1616
+ });
1617
+ // Questions based on ambiguities
1618
+ queryAnalysis.ambiguities.forEach(ambiguity => {
1619
+ if (ambiguity.includes('Pronouns detected')) {
1620
+ questions.push('Which specific files or components should be modified?');
1621
+ }
1622
+ if (ambiguity.includes('Improvement request')) {
1623
+ questions.push('What specific improvements are you looking for? (performance, readability, security, etc.)');
1624
+ }
1625
+ if (ambiguity.includes('Comparison requested')) {
1626
+ questions.push('What should this be similar to? Please provide a reference example.');
1627
+ }
1628
+ });
1629
+ // Remove duplicates and limit to 3 questions to avoid overwhelming user
1630
+ return [...new Set(questions)].slice(0, 3);
1631
+ }
1632
+ /**
1633
+ * Parse test results from Claude's output (language-agnostic)
1634
+ * Supports: Jest, Mocha, pytest, Go test, Cargo test, PHPUnit, RSpec, JUnit, etc.
1635
+ */
1636
+ parseTestResults(output) {
1637
+ if (!output)
1638
+ return null;
1639
+ // Pattern matchers for different test frameworks
1640
+ const patterns = [
1641
+ // Jest/Vitest: "Tests: 5 passed, 2 failed, 7 total" or "Tests: 42 passed, 42 total"
1642
+ {
1643
+ regex: /Tests:\s*(\d+)\s*passed(?:,\s*(\d+)\s*failed)?(?:,\s*(\d+)\s*skipped)?(?:,\s*(\d+)\s*total)?/i,
1644
+ framework: 'jest',
1645
+ extractor: (m) => ({
1646
+ passed: parseInt(m[1]) || 0,
1647
+ failed: parseInt(m[2]) || 0,
1648
+ skipped: parseInt(m[3]) || 0,
1649
+ total: parseInt(m[4]) || (parseInt(m[1]) || 0) + (parseInt(m[2]) || 0) + (parseInt(m[3]) || 0),
1650
+ framework: 'jest'
1651
+ })
1652
+ },
1653
+ // Mocha: "5 passing" / "2 failing" / "1 pending"
1654
+ {
1655
+ regex: /(\d+)\s*passing.*?(?:(\d+)\s*failing)?.*?(?:(\d+)\s*pending)?/is,
1656
+ framework: 'mocha',
1657
+ extractor: (m) => ({
1658
+ passed: parseInt(m[1]) || 0,
1659
+ failed: parseInt(m[2]) || 0,
1660
+ skipped: parseInt(m[3]) || 0,
1661
+ total: (parseInt(m[1]) || 0) + (parseInt(m[2]) || 0) + (parseInt(m[3]) || 0),
1662
+ framework: 'mocha'
1663
+ })
1664
+ },
1665
+ // pytest: "5 passed, 2 failed, 1 skipped" or "===== 5 passed in 0.12s ====="
1666
+ {
1667
+ regex: /(?:=+\s*)?(\d+)\s*passed(?:[,\s]+(\d+)\s*failed)?(?:[,\s]+(\d+)\s*skipped)?/i,
1668
+ framework: 'pytest',
1669
+ extractor: (m) => ({
1670
+ passed: parseInt(m[1]) || 0,
1671
+ failed: parseInt(m[2]) || 0,
1672
+ skipped: parseInt(m[3]) || 0,
1673
+ total: (parseInt(m[1]) || 0) + (parseInt(m[2]) || 0) + (parseInt(m[3]) || 0),
1674
+ framework: 'pytest'
1675
+ })
1676
+ },
1677
+ // Go test: "ok package 0.123s" (counts ok lines) or "PASS" / "FAIL"
1678
+ {
1679
+ regex: /(?:^|\n)(?:ok\s+|PASS\s*$)/gm,
1680
+ framework: 'go',
1681
+ extractor: (m) => {
1682
+ // For Go, we need to count all matches
1683
+ const okMatches = output.match(/(?:^|\n)ok\s+/gm) || [];
1684
+ const failMatches = output.match(/(?:^|\n)FAIL\s+/gm) || [];
1685
+ const passed = okMatches.length || (output.includes('PASS') ? 1 : 0);
1686
+ const failed = failMatches.length;
1687
+ return {
1688
+ passed,
1689
+ failed,
1690
+ total: passed + failed,
1691
+ framework: 'go'
1692
+ };
1693
+ }
1694
+ },
1695
+ // Cargo test (Rust): "test result: ok. 5 passed; 0 failed; 0 ignored"
1696
+ {
1697
+ regex: /test result:\s*(?:ok|FAILED)\.\s*(\d+)\s*passed;\s*(\d+)\s*failed;\s*(\d+)\s*ignored/i,
1698
+ framework: 'cargo',
1699
+ extractor: (m) => ({
1700
+ passed: parseInt(m[1]) || 0,
1701
+ failed: parseInt(m[2]) || 0,
1702
+ skipped: parseInt(m[3]) || 0,
1703
+ total: (parseInt(m[1]) || 0) + (parseInt(m[2]) || 0) + (parseInt(m[3]) || 0),
1704
+ framework: 'cargo'
1705
+ })
1706
+ },
1707
+ // PHPUnit: "OK (5 tests, 10 assertions)" or "FAILURES! Tests: 5, Failures: 2"
1708
+ {
1709
+ regex: /(?:OK\s*\((\d+)\s*tests?|Tests:\s*(\d+),\s*(?:Assertions:\s*\d+,\s*)?Failures:\s*(\d+))/i,
1710
+ framework: 'phpunit',
1711
+ extractor: (m) => {
1712
+ if (m[1]) {
1713
+ // OK case
1714
+ return { passed: parseInt(m[1]), failed: 0, total: parseInt(m[1]), framework: 'phpunit' };
1715
+ }
1716
+ // FAILURES case
1717
+ const total = parseInt(m[2]) || 0;
1718
+ const failed = parseInt(m[3]) || 0;
1719
+ return { passed: total - failed, failed, total, framework: 'phpunit' };
1720
+ }
1721
+ },
1722
+ // RSpec (Ruby): "5 examples, 2 failures, 1 pending"
1723
+ {
1724
+ regex: /(\d+)\s*examples?,\s*(\d+)\s*failures?(?:,\s*(\d+)\s*pending)?/i,
1725
+ framework: 'rspec',
1726
+ extractor: (m) => ({
1727
+ passed: (parseInt(m[1]) || 0) - (parseInt(m[2]) || 0) - (parseInt(m[3]) || 0),
1728
+ failed: parseInt(m[2]) || 0,
1729
+ skipped: parseInt(m[3]) || 0,
1730
+ total: parseInt(m[1]) || 0,
1731
+ framework: 'rspec'
1732
+ })
1733
+ },
1734
+ // JUnit/Maven/Gradle: "Tests run: 5, Failures: 1, Errors: 0, Skipped: 1"
1735
+ {
1736
+ regex: /Tests run:\s*(\d+),\s*Failures:\s*(\d+),\s*Errors:\s*(\d+)(?:,\s*Skipped:\s*(\d+))?/i,
1737
+ framework: 'junit',
1738
+ extractor: (m) => {
1739
+ const total = parseInt(m[1]) || 0;
1740
+ const failures = parseInt(m[2]) || 0;
1741
+ const errors = parseInt(m[3]) || 0;
1742
+ const skipped = parseInt(m[4]) || 0;
1743
+ return {
1744
+ passed: total - failures - errors - skipped,
1745
+ failed: failures + errors,
1746
+ skipped,
1747
+ total,
1748
+ framework: 'junit'
1749
+ };
1750
+ }
1751
+ },
1752
+ // .NET/NUnit/xUnit: "Passed: 5, Failed: 2, Skipped: 1, Total: 8"
1753
+ {
1754
+ regex: /(?:Passed|Passed!):\s*(\d+)(?:.*?Failed:\s*(\d+))?(?:.*?Skipped:\s*(\d+))?(?:.*?Total:\s*(\d+))?/i,
1755
+ framework: 'dotnet',
1756
+ extractor: (m) => ({
1757
+ passed: parseInt(m[1]) || 0,
1758
+ failed: parseInt(m[2]) || 0,
1759
+ skipped: parseInt(m[3]) || 0,
1760
+ total: parseInt(m[4]) || (parseInt(m[1]) || 0) + (parseInt(m[2]) || 0) + (parseInt(m[3]) || 0),
1761
+ framework: 'dotnet'
1762
+ })
1763
+ }
1764
+ ];
1765
+ // Try each pattern
1766
+ for (const { regex, extractor } of patterns) {
1767
+ const match = output.match(regex);
1768
+ if (match) {
1769
+ const result = extractor(match);
1770
+ // Validate we got meaningful results
1771
+ if (result.total > 0 || result.passed > 0 || result.failed > 0) {
1772
+ return result;
1773
+ }
1774
+ }
1775
+ }
1776
+ return null;
1777
+ }
1778
+ /**
1779
+ * Parse Claude CLI stderr output to detect specific errors
1780
+ * Returns user-friendly error message or null if no error detected
1781
+ */
1782
+ parseClaudeError(stderr, exitCode) {
1783
+ const lowerStderr = stderr.toLowerCase();
1784
+ // Check for authentication/login errors
1785
+ if (lowerStderr.includes('not logged in') || lowerStderr.includes('authentication') ||
1786
+ lowerStderr.includes('api key') || lowerStderr.includes('unauthorized') ||
1787
+ lowerStderr.includes('login required')) {
1788
+ return '❌ Claude authentication required. Please run: claude login';
1789
+ }
1790
+ // Check for rate limiting
1791
+ if (lowerStderr.includes('rate limit') || lowerStderr.includes('too many requests') ||
1792
+ lowerStderr.includes('429')) {
1793
+ return '⏳ Claude rate limit exceeded. Please wait a moment and try again.';
1794
+ }
1795
+ // Check for usage/quota exceeded
1796
+ if (lowerStderr.includes('usage limit') || lowerStderr.includes('quota exceeded') ||
1797
+ lowerStderr.includes('billing') || lowerStderr.includes('maximum usage')) {
1798
+ return '💳 Claude usage limit reached. Please check your subscription or wait for reset.';
1799
+ }
1800
+ // Check for network/connectivity issues
1801
+ if (lowerStderr.includes('network') || lowerStderr.includes('connection') ||
1802
+ lowerStderr.includes('timeout') || lowerStderr.includes('econnrefused') ||
1803
+ lowerStderr.includes('offline') || lowerStderr.includes('dns')) {
1804
+ return '🌐 Network error connecting to Claude. Please check your internet connection.';
1805
+ }
1806
+ // Check for server errors
1807
+ if (lowerStderr.includes('500') || lowerStderr.includes('502') ||
1808
+ lowerStderr.includes('503') || lowerStderr.includes('service unavailable') ||
1809
+ lowerStderr.includes('server error')) {
1810
+ return '🔧 Claude server temporarily unavailable. Please try again in a few minutes.';
1811
+ }
1812
+ // Check for model not available
1813
+ if (lowerStderr.includes('model not found') || lowerStderr.includes('model unavailable')) {
1814
+ return '🤖 Requested Claude model is not available. Try updating Claude CLI.';
1815
+ }
1816
+ // Generic error with non-zero exit code and stderr content
1817
+ if (exitCode !== 0 && stderr.trim() && !stderr.includes('permission')) {
1818
+ // Only show first line of error to keep it clean
1819
+ const firstLine = stderr.trim().split('\n')[0];
1820
+ if (firstLine.length > 100) {
1821
+ return `❌ Claude error: ${firstLine.substring(0, 100)}...`;
1822
+ }
1823
+ return `❌ Claude error: ${firstLine}`;
1824
+ }
1825
+ return null;
1826
+ }
1827
+ /**
1828
+ * Display test result summary in a user-friendly format
1829
+ */
1830
+ displayTestSummary(summary) {
1831
+ const { passed, failed, skipped, framework } = summary;
1832
+ if (failed === 0) {
1833
+ // All tests passed
1834
+ console.log(theme_1.Theme.colors.success(`\n ✅ ${passed} test${passed !== 1 ? 's' : ''} passed`));
1835
+ }
1836
+ else {
1837
+ // Some tests failed
1838
+ console.log(theme_1.Theme.colors.error(`\n ❌ ${failed} test${failed !== 1 ? 's' : ''} failed, ${passed} passed`));
1839
+ }
1840
+ // Show skipped if any
1841
+ if (skipped && skipped > 0) {
1842
+ console.log(theme_1.Theme.colors.warning(` ⏭️ ${skipped} skipped`));
1843
+ }
1844
+ // Show framework if detected
1845
+ if (framework) {
1846
+ console.log(theme_1.Theme.colors.muted(` (${framework})`));
1847
+ }
1848
+ }
1849
+ /**
1850
+ * Format tool invocation for display
1851
+ * Shows detailed tool info with IN/OUT style display like Claude Code
1852
+ */
1853
+ formatToolDisplay(toolName, input) {
1854
+ const filePath = input?.file_path || input?.path || '';
1855
+ const muted = theme_1.Theme.colors.muted;
1856
+ switch (toolName.toLowerCase()) {
1857
+ case 'read':
1858
+ return filePath ? `Read ${filePath}` : 'Read file...';
1859
+ case 'edit':
1860
+ if (filePath && input?.old_string) {
1861
+ const preview = input.old_string.substring(0, 60).replace(/\n/g, '↵');
1862
+ return `Edit ${filePath}\n${muted(' ├─ old: "' + preview + (input.old_string.length > 60 ? '...' : '') + '"')}`;
1863
+ }
1864
+ return filePath ? `Edit ${filePath}` : 'Edit file...';
1865
+ case 'write':
1866
+ if (filePath && input?.content) {
1867
+ const lineCount = (input.content.match(/\n/g) || []).length + 1;
1868
+ return `Write ${filePath} (${lineCount} lines)`;
1869
+ }
1870
+ return filePath ? `Write ${filePath}` : 'Write file...';
1871
+ case 'bash':
1872
+ const cmd = input?.command || '';
1873
+ const desc = input?.description || '';
1874
+ const cmdPreview = cmd.length > 80 ? cmd.substring(0, 80) + '...' : cmd;
1875
+ if (desc) {
1876
+ return `Bash: ${desc}\n${muted(' ├─ $ ' + cmdPreview)}`;
1877
+ }
1878
+ return cmd ? `Bash\n${muted(' ├─ $ ' + cmdPreview)}` : 'Bash...';
1879
+ case 'glob':
1880
+ const pattern = input?.pattern || '';
1881
+ const globPath = input?.path || '.';
1882
+ return pattern ? `Glob "${pattern}" in ${globPath}` : 'Glob...';
1883
+ case 'grep':
1884
+ const grepPattern = input?.pattern || '';
1885
+ const grepPath = input?.path || '.';
1886
+ return grepPattern ? `Grep "${grepPattern}" in ${grepPath}` : 'Grep...';
1887
+ case 'todowrite':
1888
+ const todoCount = input?.todos?.length || 0;
1889
+ return `TodoWrite (${todoCount} items)`;
1890
+ case 'task':
1891
+ const agentType = input?.subagent_type || 'general';
1892
+ const taskDesc = input?.description || '';
1893
+ return taskDesc ? `Task [${agentType}]: ${taskDesc}` : `Task launching ${agentType} agent`;
1894
+ case 'webfetch':
1895
+ return input?.url ? `WebFetch ${input.url}` : 'WebFetch...';
1896
+ case 'websearch':
1897
+ return input?.query ? `WebSearch "${input.query}"` : 'WebSearch...';
1898
+ default:
1899
+ return `${toolName}`;
1900
+ }
1901
+ }
1902
+ /**
1903
+ * Format tool result output for display (abbreviated)
1904
+ */
1905
+ formatToolResult(toolName, output) {
1906
+ if (!output || !output.trim())
1907
+ return '';
1908
+ // Filter out permission denial messages - we handle these separately
1909
+ if (output.includes('requested permissions') && output.includes("haven't")) {
1910
+ return '';
1911
+ }
1912
+ if (output.includes('permission') && output.includes('denied')) {
1913
+ return '';
1914
+ }
1915
+ const lines = output.split('\n').filter(l => l.trim());
1916
+ const muted = theme_1.Theme.colors.muted;
1917
+ // In verbose mode, show more content
1918
+ const maxLines = this.verboseMode ? 15 : 8;
1919
+ const summaryLines = this.verboseMode ? 10 : 5;
1920
+ // For file reads, show content preview
1921
+ if (toolName.toLowerCase() === 'read') {
1922
+ if (lines.length > maxLines) {
1923
+ const preview = lines.slice(0, summaryLines).map(l => l.substring(0, 120)).join('\n ');
1924
+ return `\n${muted(' └─ ' + preview)}\n${muted(' ... (' + (lines.length - summaryLines) + ' more lines)')}`;
1925
+ }
1926
+ const preview = lines.slice(0, maxLines).map(l => l.substring(0, 120)).join('\n ');
1927
+ return `\n${muted(' └─ ' + preview)}`;
1928
+ }
1929
+ // For glob/grep, show files found
1930
+ if (toolName.toLowerCase() === 'glob' || toolName.toLowerCase() === 'grep') {
1931
+ const fileCount = lines.length;
1932
+ if (fileCount > maxLines) {
1933
+ const preview = lines.slice(0, summaryLines).join('\n ');
1934
+ return `\n${muted(' └─ ' + preview)}\n${muted(' ... (' + (fileCount - summaryLines) + ' more matches)')}`;
1935
+ }
1936
+ return `\n${muted(' └─ ' + lines.join('\n '))}`;
1937
+ }
1938
+ // For bash, show command output
1939
+ if (toolName.toLowerCase() === 'bash') {
1940
+ if (lines.length > maxLines) {
1941
+ const preview = lines.slice(0, summaryLines).map(l => l.substring(0, 120)).join('\n ');
1942
+ return `\n${muted(' └─ ' + preview)}\n${muted(' ... (' + (lines.length - summaryLines) + ' more lines)')}`;
1943
+ }
1944
+ const preview = lines.map(l => l.substring(0, 120)).join('\n ');
1945
+ return `\n${muted(' └─ ' + preview)}`;
1946
+ }
1947
+ // For Task (subagent), show agent output
1948
+ if (toolName.toLowerCase() === 'task') {
1949
+ if (lines.length > maxLines) {
1950
+ const preview = lines.slice(0, summaryLines).map(l => l.substring(0, 120)).join('\n ');
1951
+ return `\n${muted(' └─ ' + preview)}\n${muted(' ... (' + (lines.length - summaryLines) + ' more lines)')}`;
1952
+ }
1953
+ const preview = lines.map(l => l.substring(0, 120)).join('\n ');
1954
+ return `\n${muted(' └─ ' + preview)}`;
1955
+ }
1956
+ // Default: show abbreviated with reasonable limits
1957
+ if (lines.length > summaryLines) {
1958
+ const preview = lines.slice(0, summaryLines - 1).map(l => l.substring(0, 120)).join('\n ');
1959
+ return `\n${muted(' └─ ' + preview)}${muted('\n ... (' + (lines.length - summaryLines + 1) + ' more)')}`;
1960
+ }
1961
+ if (output.length < 100) {
1962
+ return ` → ${output.trim()}`;
1963
+ }
1964
+ const preview = lines.map(l => l.substring(0, 120)).join('\n ');
1965
+ return `\n${muted(' └─ ' + preview)}`;
1966
+ }
1967
+ /**
1968
+ * Parse Claude Code response to extract files and summary
1969
+ */
1970
+ parseClaudeResponse(output) {
1971
+ // In a real implementation, this would parse Claude's structured output
1972
+ // For now, return a basic structure
1973
+ const filesToModify = [];
1974
+ // Look for file mentions in the output
1975
+ const fileMatches = output.match(/(?:src\/|\.\/)[a-zA-Z0-9\/_-]+\.[a-zA-Z]{2,4}/g);
1976
+ if (fileMatches) {
1977
+ filesToModify.push(...fileMatches);
1978
+ }
1979
+ return {
1980
+ response: output,
1981
+ filesToModify: [...new Set(filesToModify)], // Remove duplicates
1982
+ summary: 'Claude Code has processed the request and provided implementation suggestions'
1983
+ };
1984
+ }
1985
+ }
1986
+ exports.UserInteractionService = UserInteractionService;
1987
+ //# sourceMappingURL=user-interaction-service.js.map