erosolar-cli 1.7.412 → 1.7.414

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 (1009) hide show
  1. package/dist/shell/interactiveShell.d.ts +14 -0
  2. package/dist/shell/interactiveShell.d.ts.map +1 -1
  3. package/dist/shell/interactiveShell.js +276 -89
  4. package/dist/shell/interactiveShell.js.map +1 -1
  5. package/package.json +1 -1
  6. package/dist/StringUtils.d.ts +0 -8
  7. package/dist/StringUtils.d.ts.map +0 -1
  8. package/dist/StringUtils.js +0 -11
  9. package/dist/StringUtils.js.map +0 -1
  10. package/dist/adapters/browser/index.d.ts +0 -12
  11. package/dist/adapters/browser/index.d.ts.map +0 -1
  12. package/dist/adapters/browser/index.js +0 -11
  13. package/dist/adapters/browser/index.js.map +0 -1
  14. package/dist/adapters/node/index.d.ts +0 -17
  15. package/dist/adapters/node/index.d.ts.map +0 -1
  16. package/dist/adapters/node/index.js +0 -35
  17. package/dist/adapters/node/index.js.map +0 -1
  18. package/dist/adapters/remote/index.d.ts +0 -13
  19. package/dist/adapters/remote/index.d.ts.map +0 -1
  20. package/dist/adapters/remote/index.js +0 -20
  21. package/dist/adapters/remote/index.js.map +0 -1
  22. package/dist/adapters/types.d.ts +0 -14
  23. package/dist/adapters/types.d.ts.map +0 -1
  24. package/dist/adapters/types.js +0 -2
  25. package/dist/adapters/types.js.map +0 -1
  26. package/dist/bin/erosolar.d.ts +0 -9
  27. package/dist/bin/erosolar.d.ts.map +0 -1
  28. package/dist/bin/erosolar.js +0 -93
  29. package/dist/bin/erosolar.js.map +0 -1
  30. package/dist/bin/selfTest.d.ts +0 -14
  31. package/dist/bin/selfTest.d.ts.map +0 -1
  32. package/dist/bin/selfTest.js +0 -304
  33. package/dist/bin/selfTest.js.map +0 -1
  34. package/dist/browser/BrowserSessionManager.d.ts +0 -307
  35. package/dist/browser/BrowserSessionManager.d.ts.map +0 -1
  36. package/dist/browser/BrowserSessionManager.js +0 -713
  37. package/dist/browser/BrowserSessionManager.js.map +0 -1
  38. package/dist/capabilities/advancedTestGenerationCapability.d.ts +0 -17
  39. package/dist/capabilities/advancedTestGenerationCapability.d.ts.map +0 -1
  40. package/dist/capabilities/advancedTestGenerationCapability.js +0 -28
  41. package/dist/capabilities/advancedTestGenerationCapability.js.map +0 -1
  42. package/dist/capabilities/agentSpawningCapability.d.ts +0 -6
  43. package/dist/capabilities/agentSpawningCapability.d.ts.map +0 -1
  44. package/dist/capabilities/agentSpawningCapability.js +0 -168
  45. package/dist/capabilities/agentSpawningCapability.js.map +0 -1
  46. package/dist/capabilities/askUserCapability.d.ts +0 -21
  47. package/dist/capabilities/askUserCapability.d.ts.map +0 -1
  48. package/dist/capabilities/askUserCapability.js +0 -155
  49. package/dist/capabilities/askUserCapability.js.map +0 -1
  50. package/dist/capabilities/bashCapability.d.ts +0 -13
  51. package/dist/capabilities/bashCapability.d.ts.map +0 -1
  52. package/dist/capabilities/bashCapability.js +0 -24
  53. package/dist/capabilities/bashCapability.js.map +0 -1
  54. package/dist/capabilities/browserAutomationCapability.d.ts +0 -37
  55. package/dist/capabilities/browserAutomationCapability.d.ts.map +0 -1
  56. package/dist/capabilities/browserAutomationCapability.js +0 -49
  57. package/dist/capabilities/browserAutomationCapability.js.map +0 -1
  58. package/dist/capabilities/buildCapability.d.ts +0 -24
  59. package/dist/capabilities/buildCapability.d.ts.map +0 -1
  60. package/dist/capabilities/buildCapability.js +0 -25
  61. package/dist/capabilities/buildCapability.js.map +0 -1
  62. package/dist/capabilities/cloudCapability.d.ts +0 -13
  63. package/dist/capabilities/cloudCapability.d.ts.map +0 -1
  64. package/dist/capabilities/cloudCapability.js +0 -38
  65. package/dist/capabilities/cloudCapability.js.map +0 -1
  66. package/dist/capabilities/codeAnalysisCapability.d.ts +0 -13
  67. package/dist/capabilities/codeAnalysisCapability.d.ts.map +0 -1
  68. package/dist/capabilities/codeAnalysisCapability.js +0 -24
  69. package/dist/capabilities/codeAnalysisCapability.js.map +0 -1
  70. package/dist/capabilities/codeGenerationCapability.d.ts +0 -13
  71. package/dist/capabilities/codeGenerationCapability.d.ts.map +0 -1
  72. package/dist/capabilities/codeGenerationCapability.js +0 -25
  73. package/dist/capabilities/codeGenerationCapability.js.map +0 -1
  74. package/dist/capabilities/codeQualityCapability.d.ts +0 -13
  75. package/dist/capabilities/codeQualityCapability.d.ts.map +0 -1
  76. package/dist/capabilities/codeQualityCapability.js +0 -25
  77. package/dist/capabilities/codeQualityCapability.js.map +0 -1
  78. package/dist/capabilities/dependencySecurityCapability.d.ts +0 -13
  79. package/dist/capabilities/dependencySecurityCapability.d.ts.map +0 -1
  80. package/dist/capabilities/dependencySecurityCapability.js +0 -24
  81. package/dist/capabilities/dependencySecurityCapability.js.map +0 -1
  82. package/dist/capabilities/devCapability.d.ts +0 -13
  83. package/dist/capabilities/devCapability.d.ts.map +0 -1
  84. package/dist/capabilities/devCapability.js +0 -24
  85. package/dist/capabilities/devCapability.js.map +0 -1
  86. package/dist/capabilities/editCapability.d.ts +0 -17
  87. package/dist/capabilities/editCapability.d.ts.map +0 -1
  88. package/dist/capabilities/editCapability.js +0 -27
  89. package/dist/capabilities/editCapability.js.map +0 -1
  90. package/dist/capabilities/emailCapability.d.ts +0 -12
  91. package/dist/capabilities/emailCapability.d.ts.map +0 -1
  92. package/dist/capabilities/emailCapability.js +0 -22
  93. package/dist/capabilities/emailCapability.js.map +0 -1
  94. package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts +0 -17
  95. package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts.map +0 -1
  96. package/dist/capabilities/enhancedCodeIntelligenceCapability.js +0 -28
  97. package/dist/capabilities/enhancedCodeIntelligenceCapability.js.map +0 -1
  98. package/dist/capabilities/enhancedDevWorkflowCapability.d.ts +0 -17
  99. package/dist/capabilities/enhancedDevWorkflowCapability.d.ts.map +0 -1
  100. package/dist/capabilities/enhancedDevWorkflowCapability.js +0 -28
  101. package/dist/capabilities/enhancedDevWorkflowCapability.js.map +0 -1
  102. package/dist/capabilities/enhancedGitCapability.d.ts +0 -7
  103. package/dist/capabilities/enhancedGitCapability.d.ts.map +0 -1
  104. package/dist/capabilities/enhancedGitCapability.js +0 -220
  105. package/dist/capabilities/enhancedGitCapability.js.map +0 -1
  106. package/dist/capabilities/filesystemCapability.d.ts +0 -13
  107. package/dist/capabilities/filesystemCapability.d.ts.map +0 -1
  108. package/dist/capabilities/filesystemCapability.js +0 -24
  109. package/dist/capabilities/filesystemCapability.js.map +0 -1
  110. package/dist/capabilities/frontendTestingCapability.d.ts +0 -13
  111. package/dist/capabilities/frontendTestingCapability.d.ts.map +0 -1
  112. package/dist/capabilities/frontendTestingCapability.js +0 -28
  113. package/dist/capabilities/frontendTestingCapability.js.map +0 -1
  114. package/dist/capabilities/globCapability.d.ts +0 -17
  115. package/dist/capabilities/globCapability.d.ts.map +0 -1
  116. package/dist/capabilities/globCapability.js +0 -27
  117. package/dist/capabilities/globCapability.js.map +0 -1
  118. package/dist/capabilities/index.d.ts +0 -26
  119. package/dist/capabilities/index.d.ts.map +0 -1
  120. package/dist/capabilities/index.js +0 -26
  121. package/dist/capabilities/index.js.map +0 -1
  122. package/dist/capabilities/interactionCapability.d.ts +0 -12
  123. package/dist/capabilities/interactionCapability.d.ts.map +0 -1
  124. package/dist/capabilities/interactionCapability.js +0 -22
  125. package/dist/capabilities/interactionCapability.js.map +0 -1
  126. package/dist/capabilities/learnCapability.d.ts +0 -22
  127. package/dist/capabilities/learnCapability.d.ts.map +0 -1
  128. package/dist/capabilities/learnCapability.js +0 -37
  129. package/dist/capabilities/learnCapability.js.map +0 -1
  130. package/dist/capabilities/mcpCapability.d.ts +0 -6
  131. package/dist/capabilities/mcpCapability.d.ts.map +0 -1
  132. package/dist/capabilities/mcpCapability.js +0 -19
  133. package/dist/capabilities/mcpCapability.js.map +0 -1
  134. package/dist/capabilities/notebookCapability.d.ts +0 -17
  135. package/dist/capabilities/notebookCapability.d.ts.map +0 -1
  136. package/dist/capabilities/notebookCapability.js +0 -27
  137. package/dist/capabilities/notebookCapability.js.map +0 -1
  138. package/dist/capabilities/performanceMonitoringCapability.d.ts +0 -108
  139. package/dist/capabilities/performanceMonitoringCapability.d.ts.map +0 -1
  140. package/dist/capabilities/performanceMonitoringCapability.js +0 -176
  141. package/dist/capabilities/performanceMonitoringCapability.js.map +0 -1
  142. package/dist/capabilities/planningCapability.d.ts +0 -16
  143. package/dist/capabilities/planningCapability.d.ts.map +0 -1
  144. package/dist/capabilities/planningCapability.js +0 -26
  145. package/dist/capabilities/planningCapability.js.map +0 -1
  146. package/dist/capabilities/refactoringCapability.d.ts +0 -13
  147. package/dist/capabilities/refactoringCapability.d.ts.map +0 -1
  148. package/dist/capabilities/refactoringCapability.js +0 -25
  149. package/dist/capabilities/refactoringCapability.js.map +0 -1
  150. package/dist/capabilities/repoChecksCapability.d.ts +0 -10
  151. package/dist/capabilities/repoChecksCapability.d.ts.map +0 -1
  152. package/dist/capabilities/repoChecksCapability.js +0 -24
  153. package/dist/capabilities/repoChecksCapability.js.map +0 -1
  154. package/dist/capabilities/searchCapability.d.ts +0 -13
  155. package/dist/capabilities/searchCapability.d.ts.map +0 -1
  156. package/dist/capabilities/searchCapability.js +0 -24
  157. package/dist/capabilities/searchCapability.js.map +0 -1
  158. package/dist/capabilities/skillCapability.d.ts +0 -3
  159. package/dist/capabilities/skillCapability.d.ts.map +0 -1
  160. package/dist/capabilities/skillCapability.js +0 -77
  161. package/dist/capabilities/skillCapability.js.map +0 -1
  162. package/dist/capabilities/taskManagementCapability.d.ts +0 -12
  163. package/dist/capabilities/taskManagementCapability.d.ts.map +0 -1
  164. package/dist/capabilities/taskManagementCapability.js +0 -22
  165. package/dist/capabilities/taskManagementCapability.js.map +0 -1
  166. package/dist/capabilities/testingCapability.d.ts +0 -13
  167. package/dist/capabilities/testingCapability.d.ts.map +0 -1
  168. package/dist/capabilities/testingCapability.js +0 -25
  169. package/dist/capabilities/testingCapability.js.map +0 -1
  170. package/dist/capabilities/todoCapability.d.ts +0 -19
  171. package/dist/capabilities/todoCapability.d.ts.map +0 -1
  172. package/dist/capabilities/todoCapability.js +0 -169
  173. package/dist/capabilities/todoCapability.js.map +0 -1
  174. package/dist/capabilities/toolManifest.d.ts +0 -3
  175. package/dist/capabilities/toolManifest.d.ts.map +0 -1
  176. package/dist/capabilities/toolManifest.js +0 -160
  177. package/dist/capabilities/toolManifest.js.map +0 -1
  178. package/dist/capabilities/toolRegistry.d.ts +0 -24
  179. package/dist/capabilities/toolRegistry.d.ts.map +0 -1
  180. package/dist/capabilities/toolRegistry.js +0 -150
  181. package/dist/capabilities/toolRegistry.js.map +0 -1
  182. package/dist/capabilities/validationCapability.d.ts +0 -13
  183. package/dist/capabilities/validationCapability.d.ts.map +0 -1
  184. package/dist/capabilities/validationCapability.js +0 -24
  185. package/dist/capabilities/validationCapability.js.map +0 -1
  186. package/dist/capabilities/webCapability.d.ts +0 -12
  187. package/dist/capabilities/webCapability.d.ts.map +0 -1
  188. package/dist/capabilities/webCapability.js +0 -22
  189. package/dist/capabilities/webCapability.js.map +0 -1
  190. package/dist/config.d.ts +0 -25
  191. package/dist/config.d.ts.map +0 -1
  192. package/dist/config.js +0 -140
  193. package/dist/config.js.map +0 -1
  194. package/dist/contracts/v1/agent.d.ts +0 -147
  195. package/dist/contracts/v1/agent.d.ts.map +0 -1
  196. package/dist/contracts/v1/agent.js +0 -8
  197. package/dist/contracts/v1/agent.js.map +0 -1
  198. package/dist/contracts/v1/agentProfileManifest.d.ts +0 -60
  199. package/dist/contracts/v1/agentProfileManifest.d.ts.map +0 -1
  200. package/dist/contracts/v1/agentProfileManifest.js +0 -9
  201. package/dist/contracts/v1/agentProfileManifest.js.map +0 -1
  202. package/dist/contracts/v1/agentRules.d.ts +0 -60
  203. package/dist/contracts/v1/agentRules.d.ts.map +0 -1
  204. package/dist/contracts/v1/agentRules.js +0 -10
  205. package/dist/contracts/v1/agentRules.js.map +0 -1
  206. package/dist/contracts/v1/provider.d.ts +0 -149
  207. package/dist/contracts/v1/provider.d.ts.map +0 -1
  208. package/dist/contracts/v1/provider.js +0 -7
  209. package/dist/contracts/v1/provider.js.map +0 -1
  210. package/dist/contracts/v1/tool.d.ts +0 -136
  211. package/dist/contracts/v1/tool.d.ts.map +0 -1
  212. package/dist/contracts/v1/tool.js +0 -7
  213. package/dist/contracts/v1/tool.js.map +0 -1
  214. package/dist/contracts/v1/toolAccess.d.ts +0 -43
  215. package/dist/contracts/v1/toolAccess.d.ts.map +0 -1
  216. package/dist/contracts/v1/toolAccess.js +0 -9
  217. package/dist/contracts/v1/toolAccess.js.map +0 -1
  218. package/dist/core/LazyLoader.d.ts +0 -129
  219. package/dist/core/LazyLoader.d.ts.map +0 -1
  220. package/dist/core/LazyLoader.js +0 -240
  221. package/dist/core/LazyLoader.js.map +0 -1
  222. package/dist/core/agent.d.ts +0 -153
  223. package/dist/core/agent.d.ts.map +0 -1
  224. package/dist/core/agent.js +0 -881
  225. package/dist/core/agent.js.map +0 -1
  226. package/dist/core/agentProfileManifest.d.ts +0 -3
  227. package/dist/core/agentProfileManifest.d.ts.map +0 -1
  228. package/dist/core/agentProfileManifest.js +0 -188
  229. package/dist/core/agentProfileManifest.js.map +0 -1
  230. package/dist/core/agentProfiles.d.ts +0 -22
  231. package/dist/core/agentProfiles.d.ts.map +0 -1
  232. package/dist/core/agentProfiles.js +0 -35
  233. package/dist/core/agentProfiles.js.map +0 -1
  234. package/dist/core/agentRulebook.d.ts +0 -11
  235. package/dist/core/agentRulebook.d.ts.map +0 -1
  236. package/dist/core/agentRulebook.js +0 -136
  237. package/dist/core/agentRulebook.js.map +0 -1
  238. package/dist/core/agentSchemaLoader.d.ts +0 -131
  239. package/dist/core/agentSchemaLoader.d.ts.map +0 -1
  240. package/dist/core/agentSchemaLoader.js +0 -234
  241. package/dist/core/agentSchemaLoader.js.map +0 -1
  242. package/dist/core/aiErrorFixer.d.ts +0 -70
  243. package/dist/core/aiErrorFixer.d.ts.map +0 -1
  244. package/dist/core/aiErrorFixer.js +0 -402
  245. package/dist/core/aiErrorFixer.js.map +0 -1
  246. package/dist/core/alphaZeroEngine.d.ts +0 -269
  247. package/dist/core/alphaZeroEngine.d.ts.map +0 -1
  248. package/dist/core/alphaZeroEngine.js +0 -523
  249. package/dist/core/alphaZeroEngine.js.map +0 -1
  250. package/dist/core/alphaZeroModular.d.ts +0 -186
  251. package/dist/core/alphaZeroModular.d.ts.map +0 -1
  252. package/dist/core/alphaZeroModular.js +0 -755
  253. package/dist/core/alphaZeroModular.js.map +0 -1
  254. package/dist/core/alphaZeroOrchestrator.d.ts +0 -140
  255. package/dist/core/alphaZeroOrchestrator.d.ts.map +0 -1
  256. package/dist/core/alphaZeroOrchestrator.js +0 -418
  257. package/dist/core/alphaZeroOrchestrator.js.map +0 -1
  258. package/dist/core/checkpoint.d.ts +0 -76
  259. package/dist/core/checkpoint.d.ts.map +0 -1
  260. package/dist/core/checkpoint.js +0 -278
  261. package/dist/core/checkpoint.js.map +0 -1
  262. package/dist/core/claudeCodeFeatures.d.ts +0 -64
  263. package/dist/core/claudeCodeFeatures.d.ts.map +0 -1
  264. package/dist/core/claudeCodeFeatures.js +0 -163
  265. package/dist/core/claudeCodeFeatures.js.map +0 -1
  266. package/dist/core/cliTestHarness.d.ts +0 -200
  267. package/dist/core/cliTestHarness.d.ts.map +0 -1
  268. package/dist/core/cliTestHarness.js +0 -549
  269. package/dist/core/cliTestHarness.js.map +0 -1
  270. package/dist/core/contextManager.d.ts +0 -263
  271. package/dist/core/contextManager.d.ts.map +0 -1
  272. package/dist/core/contextManager.js +0 -1073
  273. package/dist/core/contextManager.js.map +0 -1
  274. package/dist/core/contextWindow.d.ts +0 -42
  275. package/dist/core/contextWindow.d.ts.map +0 -1
  276. package/dist/core/contextWindow.js +0 -123
  277. package/dist/core/contextWindow.js.map +0 -1
  278. package/dist/core/costTracker.d.ts +0 -87
  279. package/dist/core/costTracker.d.ts.map +0 -1
  280. package/dist/core/costTracker.js +0 -285
  281. package/dist/core/costTracker.js.map +0 -1
  282. package/dist/core/customCommands.d.ts +0 -19
  283. package/dist/core/customCommands.d.ts.map +0 -1
  284. package/dist/core/customCommands.js +0 -84
  285. package/dist/core/customCommands.js.map +0 -1
  286. package/dist/core/errors/apiKeyErrors.d.ts +0 -11
  287. package/dist/core/errors/apiKeyErrors.d.ts.map +0 -1
  288. package/dist/core/errors/apiKeyErrors.js +0 -159
  289. package/dist/core/errors/apiKeyErrors.js.map +0 -1
  290. package/dist/core/errors/errorTypes.d.ts +0 -111
  291. package/dist/core/errors/errorTypes.d.ts.map +0 -1
  292. package/dist/core/errors/errorTypes.js +0 -348
  293. package/dist/core/errors/errorTypes.js.map +0 -1
  294. package/dist/core/errors/errorUtils.d.ts +0 -87
  295. package/dist/core/errors/errorUtils.d.ts.map +0 -1
  296. package/dist/core/errors/errorUtils.js +0 -158
  297. package/dist/core/errors/errorUtils.js.map +0 -1
  298. package/dist/core/errors/safetyValidator.d.ts +0 -71
  299. package/dist/core/errors/safetyValidator.d.ts.map +0 -1
  300. package/dist/core/errors/safetyValidator.js +0 -302
  301. package/dist/core/errors/safetyValidator.js.map +0 -1
  302. package/dist/core/errors.d.ts +0 -4
  303. package/dist/core/errors.d.ts.map +0 -1
  304. package/dist/core/errors.js +0 -33
  305. package/dist/core/errors.js.map +0 -1
  306. package/dist/core/failureRecovery.d.ts +0 -122
  307. package/dist/core/failureRecovery.d.ts.map +0 -1
  308. package/dist/core/failureRecovery.js +0 -477
  309. package/dist/core/failureRecovery.js.map +0 -1
  310. package/dist/core/hooks.d.ts +0 -113
  311. package/dist/core/hooks.d.ts.map +0 -1
  312. package/dist/core/hooks.js +0 -267
  313. package/dist/core/hooks.js.map +0 -1
  314. package/dist/core/intelligentTestFlows.d.ts +0 -126
  315. package/dist/core/intelligentTestFlows.d.ts.map +0 -1
  316. package/dist/core/intelligentTestFlows.js +0 -678
  317. package/dist/core/intelligentTestFlows.js.map +0 -1
  318. package/dist/core/isolatedVerifier.d.ts +0 -40
  319. package/dist/core/isolatedVerifier.d.ts.map +0 -1
  320. package/dist/core/isolatedVerifier.js +0 -129
  321. package/dist/core/isolatedVerifier.js.map +0 -1
  322. package/dist/core/learningPersistence.d.ts +0 -145
  323. package/dist/core/learningPersistence.d.ts.map +0 -1
  324. package/dist/core/learningPersistence.js +0 -477
  325. package/dist/core/learningPersistence.js.map +0 -1
  326. package/dist/core/memorySystem.d.ts +0 -67
  327. package/dist/core/memorySystem.d.ts.map +0 -1
  328. package/dist/core/memorySystem.js +0 -334
  329. package/dist/core/memorySystem.js.map +0 -1
  330. package/dist/core/metricsTracker.d.ts +0 -157
  331. package/dist/core/metricsTracker.d.ts.map +0 -1
  332. package/dist/core/metricsTracker.js +0 -273
  333. package/dist/core/metricsTracker.js.map +0 -1
  334. package/dist/core/modelDiscovery.d.ts +0 -101
  335. package/dist/core/modelDiscovery.d.ts.map +0 -1
  336. package/dist/core/modelDiscovery.js +0 -780
  337. package/dist/core/modelDiscovery.js.map +0 -1
  338. package/dist/core/multilinePasteHandler.d.ts +0 -35
  339. package/dist/core/multilinePasteHandler.d.ts.map +0 -1
  340. package/dist/core/multilinePasteHandler.js +0 -80
  341. package/dist/core/multilinePasteHandler.js.map +0 -1
  342. package/dist/core/offsecAlphaZero.d.ts +0 -56
  343. package/dist/core/offsecAlphaZero.d.ts.map +0 -1
  344. package/dist/core/offsecAlphaZero.js +0 -395
  345. package/dist/core/offsecAlphaZero.js.map +0 -1
  346. package/dist/core/outputStyles.d.ts +0 -48
  347. package/dist/core/outputStyles.d.ts.map +0 -1
  348. package/dist/core/outputStyles.js +0 -270
  349. package/dist/core/outputStyles.js.map +0 -1
  350. package/dist/core/performanceMonitor.d.ts +0 -124
  351. package/dist/core/performanceMonitor.d.ts.map +0 -1
  352. package/dist/core/performanceMonitor.js +0 -192
  353. package/dist/core/performanceMonitor.js.map +0 -1
  354. package/dist/core/preferences.d.ts +0 -67
  355. package/dist/core/preferences.d.ts.map +0 -1
  356. package/dist/core/preferences.js +0 -314
  357. package/dist/core/preferences.js.map +0 -1
  358. package/dist/core/responseVerifier.d.ts +0 -98
  359. package/dist/core/responseVerifier.d.ts.map +0 -1
  360. package/dist/core/responseVerifier.js +0 -509
  361. package/dist/core/responseVerifier.js.map +0 -1
  362. package/dist/core/resultVerification.d.ts +0 -141
  363. package/dist/core/resultVerification.d.ts.map +0 -1
  364. package/dist/core/resultVerification.js +0 -482
  365. package/dist/core/resultVerification.js.map +0 -1
  366. package/dist/core/schemaValidator.d.ts +0 -44
  367. package/dist/core/schemaValidator.d.ts.map +0 -1
  368. package/dist/core/schemaValidator.js +0 -155
  369. package/dist/core/schemaValidator.js.map +0 -1
  370. package/dist/core/secretStore.d.ts +0 -48
  371. package/dist/core/secretStore.d.ts.map +0 -1
  372. package/dist/core/secretStore.js +0 -367
  373. package/dist/core/secretStore.js.map +0 -1
  374. package/dist/core/securityAssessment.d.ts +0 -91
  375. package/dist/core/securityAssessment.d.ts.map +0 -1
  376. package/dist/core/securityAssessment.js +0 -580
  377. package/dist/core/securityAssessment.js.map +0 -1
  378. package/dist/core/selfEvolution.d.ts +0 -155
  379. package/dist/core/selfEvolution.d.ts.map +0 -1
  380. package/dist/core/selfEvolution.js +0 -1000
  381. package/dist/core/selfEvolution.js.map +0 -1
  382. package/dist/core/selfImprovement.d.ts +0 -141
  383. package/dist/core/selfImprovement.d.ts.map +0 -1
  384. package/dist/core/selfImprovement.js +0 -700
  385. package/dist/core/selfImprovement.js.map +0 -1
  386. package/dist/core/sessionStore.d.ts +0 -35
  387. package/dist/core/sessionStore.d.ts.map +0 -1
  388. package/dist/core/sessionStore.js +0 -189
  389. package/dist/core/sessionStore.js.map +0 -1
  390. package/dist/core/testUtils.d.ts +0 -121
  391. package/dist/core/testUtils.d.ts.map +0 -1
  392. package/dist/core/testUtils.js +0 -235
  393. package/dist/core/testUtils.js.map +0 -1
  394. package/dist/core/toolPreconditions.d.ts +0 -42
  395. package/dist/core/toolPreconditions.d.ts.map +0 -1
  396. package/dist/core/toolPreconditions.js +0 -357
  397. package/dist/core/toolPreconditions.js.map +0 -1
  398. package/dist/core/toolRuntime.d.ts +0 -158
  399. package/dist/core/toolRuntime.d.ts.map +0 -1
  400. package/dist/core/toolRuntime.js +0 -415
  401. package/dist/core/toolRuntime.js.map +0 -1
  402. package/dist/core/toolValidation.d.ts +0 -117
  403. package/dist/core/toolValidation.d.ts.map +0 -1
  404. package/dist/core/toolValidation.js +0 -282
  405. package/dist/core/toolValidation.js.map +0 -1
  406. package/dist/core/types/utilityTypes.d.ts +0 -192
  407. package/dist/core/types/utilityTypes.d.ts.map +0 -1
  408. package/dist/core/types/utilityTypes.js +0 -272
  409. package/dist/core/types/utilityTypes.js.map +0 -1
  410. package/dist/core/types.d.ts +0 -306
  411. package/dist/core/types.d.ts.map +0 -1
  412. package/dist/core/types.js +0 -76
  413. package/dist/core/types.js.map +0 -1
  414. package/dist/core/updateManager.d.ts +0 -62
  415. package/dist/core/updateManager.d.ts.map +0 -1
  416. package/dist/core/updateManager.js +0 -266
  417. package/dist/core/updateManager.js.map +0 -1
  418. package/dist/core/validationRunner.d.ts +0 -106
  419. package/dist/core/validationRunner.d.ts.map +0 -1
  420. package/dist/core/validationRunner.js +0 -888
  421. package/dist/core/validationRunner.js.map +0 -1
  422. package/dist/core/verification.d.ts +0 -137
  423. package/dist/core/verification.d.ts.map +0 -1
  424. package/dist/core/verification.js +0 -323
  425. package/dist/core/verification.js.map +0 -1
  426. package/dist/headless/headlessApp.d.ts +0 -5
  427. package/dist/headless/headlessApp.d.ts.map +0 -1
  428. package/dist/headless/headlessApp.js +0 -210
  429. package/dist/headless/headlessApp.js.map +0 -1
  430. package/dist/intelligence/codeIntelligence.d.ts +0 -118
  431. package/dist/intelligence/codeIntelligence.d.ts.map +0 -1
  432. package/dist/intelligence/codeIntelligence.js +0 -552
  433. package/dist/intelligence/codeIntelligence.js.map +0 -1
  434. package/dist/intelligence/docGenerator.d.ts +0 -86
  435. package/dist/intelligence/docGenerator.d.ts.map +0 -1
  436. package/dist/intelligence/docGenerator.js +0 -564
  437. package/dist/intelligence/docGenerator.js.map +0 -1
  438. package/dist/intelligence/index.d.ts +0 -51
  439. package/dist/intelligence/index.d.ts.map +0 -1
  440. package/dist/intelligence/index.js +0 -253
  441. package/dist/intelligence/index.js.map +0 -1
  442. package/dist/intelligence/refactoring.d.ts +0 -50
  443. package/dist/intelligence/refactoring.d.ts.map +0 -1
  444. package/dist/intelligence/refactoring.js +0 -354
  445. package/dist/intelligence/refactoring.js.map +0 -1
  446. package/dist/intelligence/testGenerator.d.ts +0 -74
  447. package/dist/intelligence/testGenerator.d.ts.map +0 -1
  448. package/dist/intelligence/testGenerator.js +0 -483
  449. package/dist/intelligence/testGenerator.js.map +0 -1
  450. package/dist/mcp/config.d.ts +0 -8
  451. package/dist/mcp/config.d.ts.map +0 -1
  452. package/dist/mcp/config.js +0 -252
  453. package/dist/mcp/config.js.map +0 -1
  454. package/dist/mcp/sseClient.d.ts +0 -34
  455. package/dist/mcp/sseClient.d.ts.map +0 -1
  456. package/dist/mcp/sseClient.js +0 -327
  457. package/dist/mcp/sseClient.js.map +0 -1
  458. package/dist/mcp/stdioClient.d.ts +0 -24
  459. package/dist/mcp/stdioClient.d.ts.map +0 -1
  460. package/dist/mcp/stdioClient.js +0 -179
  461. package/dist/mcp/stdioClient.js.map +0 -1
  462. package/dist/mcp/toolBridge.d.ts +0 -12
  463. package/dist/mcp/toolBridge.d.ts.map +0 -1
  464. package/dist/mcp/toolBridge.js +0 -117
  465. package/dist/mcp/toolBridge.js.map +0 -1
  466. package/dist/mcp/types.d.ts +0 -60
  467. package/dist/mcp/types.d.ts.map +0 -1
  468. package/dist/mcp/types.js +0 -2
  469. package/dist/mcp/types.js.map +0 -1
  470. package/dist/plugins/index.d.ts +0 -49
  471. package/dist/plugins/index.d.ts.map +0 -1
  472. package/dist/plugins/index.js +0 -114
  473. package/dist/plugins/index.js.map +0 -1
  474. package/dist/plugins/providers/anthropic/index.d.ts +0 -11
  475. package/dist/plugins/providers/anthropic/index.d.ts.map +0 -1
  476. package/dist/plugins/providers/anthropic/index.js +0 -38
  477. package/dist/plugins/providers/anthropic/index.js.map +0 -1
  478. package/dist/plugins/providers/deepseek/index.d.ts +0 -11
  479. package/dist/plugins/providers/deepseek/index.d.ts.map +0 -1
  480. package/dist/plugins/providers/deepseek/index.js +0 -52
  481. package/dist/plugins/providers/deepseek/index.js.map +0 -1
  482. package/dist/plugins/providers/google/index.d.ts +0 -11
  483. package/dist/plugins/providers/google/index.d.ts.map +0 -1
  484. package/dist/plugins/providers/google/index.js +0 -40
  485. package/dist/plugins/providers/google/index.js.map +0 -1
  486. package/dist/plugins/providers/index.d.ts +0 -2
  487. package/dist/plugins/providers/index.d.ts.map +0 -1
  488. package/dist/plugins/providers/index.js +0 -20
  489. package/dist/plugins/providers/index.js.map +0 -1
  490. package/dist/plugins/providers/ollama/index.d.ts +0 -21
  491. package/dist/plugins/providers/ollama/index.d.ts.map +0 -1
  492. package/dist/plugins/providers/ollama/index.js +0 -69
  493. package/dist/plugins/providers/ollama/index.js.map +0 -1
  494. package/dist/plugins/providers/openai/index.d.ts +0 -12
  495. package/dist/plugins/providers/openai/index.d.ts.map +0 -1
  496. package/dist/plugins/providers/openai/index.js +0 -39
  497. package/dist/plugins/providers/openai/index.js.map +0 -1
  498. package/dist/plugins/providers/xai/index.d.ts +0 -11
  499. package/dist/plugins/providers/xai/index.d.ts.map +0 -1
  500. package/dist/plugins/providers/xai/index.js +0 -39
  501. package/dist/plugins/providers/xai/index.js.map +0 -1
  502. package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts +0 -3
  503. package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts.map +0 -1
  504. package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js +0 -9
  505. package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js.map +0 -1
  506. package/dist/plugins/tools/bash/localBashPlugin.d.ts +0 -3
  507. package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +0 -1
  508. package/dist/plugins/tools/bash/localBashPlugin.js +0 -14
  509. package/dist/plugins/tools/bash/localBashPlugin.js.map +0 -1
  510. package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts +0 -14
  511. package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts.map +0 -1
  512. package/dist/plugins/tools/browser/browserAutomationPlugin.js +0 -26
  513. package/dist/plugins/tools/browser/browserAutomationPlugin.js.map +0 -1
  514. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +0 -3
  515. package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +0 -1
  516. package/dist/plugins/tools/checks/localRepoChecksPlugin.js +0 -14
  517. package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +0 -1
  518. package/dist/plugins/tools/cloud/cloudPlugin.d.ts +0 -3
  519. package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +0 -1
  520. package/dist/plugins/tools/cloud/cloudPlugin.js +0 -14
  521. package/dist/plugins/tools/cloud/cloudPlugin.js.map +0 -1
  522. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +0 -3
  523. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +0 -1
  524. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -14
  525. package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +0 -1
  526. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +0 -3
  527. package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +0 -1
  528. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +0 -14
  529. package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +0 -1
  530. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +0 -3
  531. package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +0 -1
  532. package/dist/plugins/tools/dependency/dependencyPlugin.js +0 -12
  533. package/dist/plugins/tools/dependency/dependencyPlugin.js.map +0 -1
  534. package/dist/plugins/tools/development/devPlugin.d.ts +0 -3
  535. package/dist/plugins/tools/development/devPlugin.d.ts.map +0 -1
  536. package/dist/plugins/tools/development/devPlugin.js +0 -14
  537. package/dist/plugins/tools/development/devPlugin.js.map +0 -1
  538. package/dist/plugins/tools/edit/editPlugin.d.ts +0 -9
  539. package/dist/plugins/tools/edit/editPlugin.d.ts.map +0 -1
  540. package/dist/plugins/tools/edit/editPlugin.js +0 -15
  541. package/dist/plugins/tools/edit/editPlugin.js.map +0 -1
  542. package/dist/plugins/tools/email/emailPlugin.d.ts +0 -3
  543. package/dist/plugins/tools/email/emailPlugin.d.ts.map +0 -1
  544. package/dist/plugins/tools/email/emailPlugin.js +0 -12
  545. package/dist/plugins/tools/email/emailPlugin.js.map +0 -1
  546. package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts +0 -3
  547. package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts.map +0 -1
  548. package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js +0 -9
  549. package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js.map +0 -1
  550. package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +0 -3
  551. package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +0 -1
  552. package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +0 -14
  553. package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +0 -1
  554. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts +0 -3
  555. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts.map +0 -1
  556. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js +0 -14
  557. package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js.map +0 -1
  558. package/dist/plugins/tools/glob/globPlugin.d.ts +0 -9
  559. package/dist/plugins/tools/glob/globPlugin.d.ts.map +0 -1
  560. package/dist/plugins/tools/glob/globPlugin.js +0 -15
  561. package/dist/plugins/tools/glob/globPlugin.js.map +0 -1
  562. package/dist/plugins/tools/index.d.ts +0 -3
  563. package/dist/plugins/tools/index.d.ts.map +0 -1
  564. package/dist/plugins/tools/index.js +0 -3
  565. package/dist/plugins/tools/index.js.map +0 -1
  566. package/dist/plugins/tools/interaction/interactionPlugin.d.ts +0 -3
  567. package/dist/plugins/tools/interaction/interactionPlugin.d.ts.map +0 -1
  568. package/dist/plugins/tools/interaction/interactionPlugin.js +0 -12
  569. package/dist/plugins/tools/interaction/interactionPlugin.js.map +0 -1
  570. package/dist/plugins/tools/learn/learnPlugin.d.ts +0 -3
  571. package/dist/plugins/tools/learn/learnPlugin.d.ts.map +0 -1
  572. package/dist/plugins/tools/learn/learnPlugin.js +0 -14
  573. package/dist/plugins/tools/learn/learnPlugin.js.map +0 -1
  574. package/dist/plugins/tools/mcp/mcpPlugin.d.ts +0 -3
  575. package/dist/plugins/tools/mcp/mcpPlugin.d.ts.map +0 -1
  576. package/dist/plugins/tools/mcp/mcpPlugin.js +0 -9
  577. package/dist/plugins/tools/mcp/mcpPlugin.js.map +0 -1
  578. package/dist/plugins/tools/nodeDefaults.d.ts +0 -2
  579. package/dist/plugins/tools/nodeDefaults.d.ts.map +0 -1
  580. package/dist/plugins/tools/nodeDefaults.js +0 -65
  581. package/dist/plugins/tools/nodeDefaults.js.map +0 -1
  582. package/dist/plugins/tools/notebook/notebookPlugin.d.ts +0 -9
  583. package/dist/plugins/tools/notebook/notebookPlugin.d.ts.map +0 -1
  584. package/dist/plugins/tools/notebook/notebookPlugin.js +0 -15
  585. package/dist/plugins/tools/notebook/notebookPlugin.js.map +0 -1
  586. package/dist/plugins/tools/planning/planningPlugin.d.ts +0 -9
  587. package/dist/plugins/tools/planning/planningPlugin.d.ts.map +0 -1
  588. package/dist/plugins/tools/planning/planningPlugin.js +0 -15
  589. package/dist/plugins/tools/planning/planningPlugin.js.map +0 -1
  590. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +0 -3
  591. package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +0 -1
  592. package/dist/plugins/tools/refactoring/refactoringPlugin.js +0 -12
  593. package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +0 -1
  594. package/dist/plugins/tools/registry.d.ts +0 -22
  595. package/dist/plugins/tools/registry.d.ts.map +0 -1
  596. package/dist/plugins/tools/registry.js +0 -58
  597. package/dist/plugins/tools/registry.js.map +0 -1
  598. package/dist/plugins/tools/search/localSearchPlugin.d.ts +0 -3
  599. package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +0 -1
  600. package/dist/plugins/tools/search/localSearchPlugin.js +0 -14
  601. package/dist/plugins/tools/search/localSearchPlugin.js.map +0 -1
  602. package/dist/plugins/tools/skills/skillPlugin.d.ts +0 -3
  603. package/dist/plugins/tools/skills/skillPlugin.d.ts.map +0 -1
  604. package/dist/plugins/tools/skills/skillPlugin.js +0 -9
  605. package/dist/plugins/tools/skills/skillPlugin.js.map +0 -1
  606. package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts +0 -3
  607. package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts.map +0 -1
  608. package/dist/plugins/tools/taskManagement/taskManagementPlugin.js +0 -12
  609. package/dist/plugins/tools/taskManagement/taskManagementPlugin.js.map +0 -1
  610. package/dist/plugins/tools/testing/testingPlugin.d.ts +0 -3
  611. package/dist/plugins/tools/testing/testingPlugin.d.ts.map +0 -1
  612. package/dist/plugins/tools/testing/testingPlugin.js +0 -12
  613. package/dist/plugins/tools/testing/testingPlugin.js.map +0 -1
  614. package/dist/plugins/tools/validation/validationPlugin.d.ts +0 -3
  615. package/dist/plugins/tools/validation/validationPlugin.d.ts.map +0 -1
  616. package/dist/plugins/tools/validation/validationPlugin.js +0 -14
  617. package/dist/plugins/tools/validation/validationPlugin.js.map +0 -1
  618. package/dist/plugins/tools/web/webPlugin.d.ts +0 -3
  619. package/dist/plugins/tools/web/webPlugin.d.ts.map +0 -1
  620. package/dist/plugins/tools/web/webPlugin.js +0 -12
  621. package/dist/plugins/tools/web/webPlugin.js.map +0 -1
  622. package/dist/providers/anthropicProvider.d.ts +0 -41
  623. package/dist/providers/anthropicProvider.d.ts.map +0 -1
  624. package/dist/providers/anthropicProvider.js +0 -446
  625. package/dist/providers/anthropicProvider.js.map +0 -1
  626. package/dist/providers/googleProvider.d.ts +0 -36
  627. package/dist/providers/googleProvider.d.ts.map +0 -1
  628. package/dist/providers/googleProvider.js +0 -312
  629. package/dist/providers/googleProvider.js.map +0 -1
  630. package/dist/providers/openaiChatCompletionsProvider.d.ts +0 -43
  631. package/dist/providers/openaiChatCompletionsProvider.d.ts.map +0 -1
  632. package/dist/providers/openaiChatCompletionsProvider.js +0 -475
  633. package/dist/providers/openaiChatCompletionsProvider.js.map +0 -1
  634. package/dist/providers/openaiResponsesProvider.d.ts +0 -38
  635. package/dist/providers/openaiResponsesProvider.d.ts.map +0 -1
  636. package/dist/providers/openaiResponsesProvider.js +0 -364
  637. package/dist/providers/openaiResponsesProvider.js.map +0 -1
  638. package/dist/providers/providerFactory.d.ts +0 -18
  639. package/dist/providers/providerFactory.d.ts.map +0 -1
  640. package/dist/providers/providerFactory.js +0 -25
  641. package/dist/providers/providerFactory.js.map +0 -1
  642. package/dist/providers/resilientProvider.d.ts +0 -94
  643. package/dist/providers/resilientProvider.d.ts.map +0 -1
  644. package/dist/providers/resilientProvider.js +0 -370
  645. package/dist/providers/resilientProvider.js.map +0 -1
  646. package/dist/runtime/agentController.d.ts +0 -65
  647. package/dist/runtime/agentController.d.ts.map +0 -1
  648. package/dist/runtime/agentController.js +0 -353
  649. package/dist/runtime/agentController.js.map +0 -1
  650. package/dist/runtime/agentHost.d.ts +0 -61
  651. package/dist/runtime/agentHost.d.ts.map +0 -1
  652. package/dist/runtime/agentHost.js +0 -156
  653. package/dist/runtime/agentHost.js.map +0 -1
  654. package/dist/runtime/agentSession.d.ts +0 -40
  655. package/dist/runtime/agentSession.d.ts.map +0 -1
  656. package/dist/runtime/agentSession.js +0 -206
  657. package/dist/runtime/agentSession.js.map +0 -1
  658. package/dist/runtime/browser.d.ts +0 -7
  659. package/dist/runtime/browser.d.ts.map +0 -1
  660. package/dist/runtime/browser.js +0 -10
  661. package/dist/runtime/browser.js.map +0 -1
  662. package/dist/runtime/cloud.d.ts +0 -7
  663. package/dist/runtime/cloud.d.ts.map +0 -1
  664. package/dist/runtime/cloud.js +0 -10
  665. package/dist/runtime/cloud.js.map +0 -1
  666. package/dist/runtime/node.d.ts +0 -8
  667. package/dist/runtime/node.d.ts.map +0 -1
  668. package/dist/runtime/node.js +0 -11
  669. package/dist/runtime/node.js.map +0 -1
  670. package/dist/runtime/universal.d.ts +0 -21
  671. package/dist/runtime/universal.d.ts.map +0 -1
  672. package/dist/runtime/universal.js +0 -29
  673. package/dist/runtime/universal.js.map +0 -1
  674. package/dist/shell/autoExecutor.d.ts +0 -70
  675. package/dist/shell/autoExecutor.d.ts.map +0 -1
  676. package/dist/shell/autoExecutor.js +0 -288
  677. package/dist/shell/autoExecutor.js.map +0 -1
  678. package/dist/shell/composableMessage.d.ts +0 -183
  679. package/dist/shell/composableMessage.d.ts.map +0 -1
  680. package/dist/shell/composableMessage.js +0 -420
  681. package/dist/shell/composableMessage.js.map +0 -1
  682. package/dist/shell/fileChangeTracker.d.ts +0 -39
  683. package/dist/shell/fileChangeTracker.d.ts.map +0 -1
  684. package/dist/shell/fileChangeTracker.js +0 -64
  685. package/dist/shell/fileChangeTracker.js.map +0 -1
  686. package/dist/shell/keyboardShortcuts.d.ts +0 -53
  687. package/dist/shell/keyboardShortcuts.d.ts.map +0 -1
  688. package/dist/shell/keyboardShortcuts.js +0 -166
  689. package/dist/shell/keyboardShortcuts.js.map +0 -1
  690. package/dist/shell/liveStatus.d.ts +0 -30
  691. package/dist/shell/liveStatus.d.ts.map +0 -1
  692. package/dist/shell/liveStatus.js +0 -102
  693. package/dist/shell/liveStatus.js.map +0 -1
  694. package/dist/shell/shellApp.d.ts +0 -19
  695. package/dist/shell/shellApp.d.ts.map +0 -1
  696. package/dist/shell/shellApp.js +0 -408
  697. package/dist/shell/shellApp.js.map +0 -1
  698. package/dist/shell/systemPrompt.d.ts +0 -3
  699. package/dist/shell/systemPrompt.d.ts.map +0 -1
  700. package/dist/shell/systemPrompt.js +0 -81
  701. package/dist/shell/systemPrompt.js.map +0 -1
  702. package/dist/shell/taskCompletionDetector.d.ts +0 -106
  703. package/dist/shell/taskCompletionDetector.d.ts.map +0 -1
  704. package/dist/shell/taskCompletionDetector.js +0 -402
  705. package/dist/shell/taskCompletionDetector.js.map +0 -1
  706. package/dist/shell/terminalInput.d.ts +0 -617
  707. package/dist/shell/terminalInput.d.ts.map +0 -1
  708. package/dist/shell/terminalInput.js +0 -2633
  709. package/dist/shell/terminalInput.js.map +0 -1
  710. package/dist/shell/terminalInputAdapter.d.ts +0 -263
  711. package/dist/shell/terminalInputAdapter.d.ts.map +0 -1
  712. package/dist/shell/terminalInputAdapter.js +0 -406
  713. package/dist/shell/terminalInputAdapter.js.map +0 -1
  714. package/dist/shell/updateManager.d.ts +0 -3
  715. package/dist/shell/updateManager.d.ts.map +0 -1
  716. package/dist/shell/updateManager.js +0 -120
  717. package/dist/shell/updateManager.js.map +0 -1
  718. package/dist/shell/vimMode.d.ts +0 -66
  719. package/dist/shell/vimMode.d.ts.map +0 -1
  720. package/dist/shell/vimMode.js +0 -434
  721. package/dist/shell/vimMode.js.map +0 -1
  722. package/dist/skills/skillRepository.d.ts +0 -103
  723. package/dist/skills/skillRepository.d.ts.map +0 -1
  724. package/dist/skills/skillRepository.js +0 -237
  725. package/dist/skills/skillRepository.js.map +0 -1
  726. package/dist/skills/types.d.ts +0 -37
  727. package/dist/skills/types.d.ts.map +0 -1
  728. package/dist/skills/types.js +0 -2
  729. package/dist/skills/types.js.map +0 -1
  730. package/dist/subagents/agentConfig.d.ts +0 -27
  731. package/dist/subagents/agentConfig.d.ts.map +0 -1
  732. package/dist/subagents/agentConfig.js +0 -89
  733. package/dist/subagents/agentConfig.js.map +0 -1
  734. package/dist/subagents/agentRegistry.d.ts +0 -33
  735. package/dist/subagents/agentRegistry.d.ts.map +0 -1
  736. package/dist/subagents/agentRegistry.js +0 -162
  737. package/dist/subagents/agentRegistry.js.map +0 -1
  738. package/dist/subagents/parallelAgentManager.d.ts +0 -99
  739. package/dist/subagents/parallelAgentManager.d.ts.map +0 -1
  740. package/dist/subagents/parallelAgentManager.js +0 -248
  741. package/dist/subagents/parallelAgentManager.js.map +0 -1
  742. package/dist/subagents/taskRunner.d.ts +0 -34
  743. package/dist/subagents/taskRunner.d.ts.map +0 -1
  744. package/dist/subagents/taskRunner.js +0 -459
  745. package/dist/subagents/taskRunner.js.map +0 -1
  746. package/dist/tools/advancedTestGenerationTools.d.ts +0 -21
  747. package/dist/tools/advancedTestGenerationTools.d.ts.map +0 -1
  748. package/dist/tools/advancedTestGenerationTools.js +0 -301
  749. package/dist/tools/advancedTestGenerationTools.js.map +0 -1
  750. package/dist/tools/backgroundBashTools.d.ts +0 -21
  751. package/dist/tools/backgroundBashTools.d.ts.map +0 -1
  752. package/dist/tools/backgroundBashTools.js +0 -215
  753. package/dist/tools/backgroundBashTools.js.map +0 -1
  754. package/dist/tools/bashTools.d.ts +0 -8
  755. package/dist/tools/bashTools.d.ts.map +0 -1
  756. package/dist/tools/bashTools.js +0 -251
  757. package/dist/tools/bashTools.js.map +0 -1
  758. package/dist/tools/browserAutomationTools.d.ts +0 -23
  759. package/dist/tools/browserAutomationTools.d.ts.map +0 -1
  760. package/dist/tools/browserAutomationTools.js +0 -916
  761. package/dist/tools/browserAutomationTools.js.map +0 -1
  762. package/dist/tools/buildTools.d.ts +0 -9
  763. package/dist/tools/buildTools.d.ts.map +0 -1
  764. package/dist/tools/buildTools.js +0 -344
  765. package/dist/tools/buildTools.js.map +0 -1
  766. package/dist/tools/cloudTools.d.ts +0 -49
  767. package/dist/tools/cloudTools.d.ts.map +0 -1
  768. package/dist/tools/cloudTools.js +0 -1258
  769. package/dist/tools/cloudTools.js.map +0 -1
  770. package/dist/tools/code-quality-dashboard.d.ts +0 -57
  771. package/dist/tools/code-quality-dashboard.d.ts.map +0 -1
  772. package/dist/tools/code-quality-dashboard.js +0 -218
  773. package/dist/tools/code-quality-dashboard.js.map +0 -1
  774. package/dist/tools/codeAnalysisTools.d.ts +0 -74
  775. package/dist/tools/codeAnalysisTools.d.ts.map +0 -1
  776. package/dist/tools/codeAnalysisTools.js +0 -664
  777. package/dist/tools/codeAnalysisTools.js.map +0 -1
  778. package/dist/tools/codeGenerationTools.d.ts +0 -3
  779. package/dist/tools/codeGenerationTools.d.ts.map +0 -1
  780. package/dist/tools/codeGenerationTools.js +0 -439
  781. package/dist/tools/codeGenerationTools.js.map +0 -1
  782. package/dist/tools/codeQualityTools.d.ts +0 -3
  783. package/dist/tools/codeQualityTools.d.ts.map +0 -1
  784. package/dist/tools/codeQualityTools.js +0 -296
  785. package/dist/tools/codeQualityTools.js.map +0 -1
  786. package/dist/tools/dependencyTools.d.ts +0 -3
  787. package/dist/tools/dependencyTools.d.ts.map +0 -1
  788. package/dist/tools/dependencyTools.js +0 -283
  789. package/dist/tools/dependencyTools.js.map +0 -1
  790. package/dist/tools/devTools.d.ts +0 -10
  791. package/dist/tools/devTools.d.ts.map +0 -1
  792. package/dist/tools/devTools.js +0 -2125
  793. package/dist/tools/devTools.js.map +0 -1
  794. package/dist/tools/diffUtils.d.ts +0 -36
  795. package/dist/tools/diffUtils.d.ts.map +0 -1
  796. package/dist/tools/diffUtils.js +0 -528
  797. package/dist/tools/diffUtils.js.map +0 -1
  798. package/dist/tools/editTools.d.ts +0 -29
  799. package/dist/tools/editTools.d.ts.map +0 -1
  800. package/dist/tools/editTools.js +0 -419
  801. package/dist/tools/editTools.js.map +0 -1
  802. package/dist/tools/emailTools.d.ts +0 -21
  803. package/dist/tools/emailTools.d.ts.map +0 -1
  804. package/dist/tools/emailTools.js +0 -449
  805. package/dist/tools/emailTools.js.map +0 -1
  806. package/dist/tools/enhancedCodeIntelligenceTools.d.ts +0 -27
  807. package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +0 -1
  808. package/dist/tools/enhancedCodeIntelligenceTools.js +0 -418
  809. package/dist/tools/enhancedCodeIntelligenceTools.js.map +0 -1
  810. package/dist/tools/enhancedDevWorkflowTools.d.ts +0 -15
  811. package/dist/tools/enhancedDevWorkflowTools.d.ts.map +0 -1
  812. package/dist/tools/enhancedDevWorkflowTools.js +0 -303
  813. package/dist/tools/enhancedDevWorkflowTools.js.map +0 -1
  814. package/dist/tools/fileTools.d.ts +0 -3
  815. package/dist/tools/fileTools.d.ts.map +0 -1
  816. package/dist/tools/fileTools.js +0 -334
  817. package/dist/tools/fileTools.js.map +0 -1
  818. package/dist/tools/frontendTestingTools.d.ts +0 -35
  819. package/dist/tools/frontendTestingTools.d.ts.map +0 -1
  820. package/dist/tools/frontendTestingTools.js +0 -1254
  821. package/dist/tools/frontendTestingTools.js.map +0 -1
  822. package/dist/tools/globTools.d.ts +0 -15
  823. package/dist/tools/globTools.d.ts.map +0 -1
  824. package/dist/tools/globTools.js +0 -174
  825. package/dist/tools/globTools.js.map +0 -1
  826. package/dist/tools/grepTools.d.ts +0 -19
  827. package/dist/tools/grepTools.d.ts.map +0 -1
  828. package/dist/tools/grepTools.js +0 -358
  829. package/dist/tools/grepTools.js.map +0 -1
  830. package/dist/tools/interactionTools.d.ts +0 -13
  831. package/dist/tools/interactionTools.d.ts.map +0 -1
  832. package/dist/tools/interactionTools.js +0 -171
  833. package/dist/tools/interactionTools.js.map +0 -1
  834. package/dist/tools/learnTools.d.ts +0 -152
  835. package/dist/tools/learnTools.d.ts.map +0 -1
  836. package/dist/tools/learnTools.js +0 -1942
  837. package/dist/tools/learnTools.js.map +0 -1
  838. package/dist/tools/localExplore.d.ts +0 -225
  839. package/dist/tools/localExplore.d.ts.map +0 -1
  840. package/dist/tools/localExplore.js +0 -1291
  841. package/dist/tools/localExplore.js.map +0 -1
  842. package/dist/tools/notebookEditTools.d.ts +0 -15
  843. package/dist/tools/notebookEditTools.d.ts.map +0 -1
  844. package/dist/tools/notebookEditTools.js +0 -197
  845. package/dist/tools/notebookEditTools.js.map +0 -1
  846. package/dist/tools/planningTools.d.ts +0 -21
  847. package/dist/tools/planningTools.d.ts.map +0 -1
  848. package/dist/tools/planningTools.js +0 -185
  849. package/dist/tools/planningTools.js.map +0 -1
  850. package/dist/tools/refactoringTools.d.ts +0 -3
  851. package/dist/tools/refactoringTools.d.ts.map +0 -1
  852. package/dist/tools/refactoringTools.js +0 -294
  853. package/dist/tools/refactoringTools.js.map +0 -1
  854. package/dist/tools/repoChecksTools.d.ts +0 -3
  855. package/dist/tools/repoChecksTools.d.ts.map +0 -1
  856. package/dist/tools/repoChecksTools.js +0 -161
  857. package/dist/tools/repoChecksTools.js.map +0 -1
  858. package/dist/tools/searchTools.d.ts +0 -3
  859. package/dist/tools/searchTools.d.ts.map +0 -1
  860. package/dist/tools/searchTools.js +0 -207
  861. package/dist/tools/searchTools.js.map +0 -1
  862. package/dist/tools/skillTools.d.ts +0 -8
  863. package/dist/tools/skillTools.d.ts.map +0 -1
  864. package/dist/tools/skillTools.js +0 -178
  865. package/dist/tools/skillTools.js.map +0 -1
  866. package/dist/tools/softwareEngineeringTools.d.ts +0 -7
  867. package/dist/tools/softwareEngineeringTools.d.ts.map +0 -1
  868. package/dist/tools/softwareEngineeringTools.js +0 -338
  869. package/dist/tools/softwareEngineeringTools.js.map +0 -1
  870. package/dist/tools/taskManagementTools.d.ts +0 -10
  871. package/dist/tools/taskManagementTools.d.ts.map +0 -1
  872. package/dist/tools/taskManagementTools.js +0 -157
  873. package/dist/tools/taskManagementTools.js.map +0 -1
  874. package/dist/tools/testingTools.d.ts +0 -3
  875. package/dist/tools/testingTools.d.ts.map +0 -1
  876. package/dist/tools/testingTools.js +0 -233
  877. package/dist/tools/testingTools.js.map +0 -1
  878. package/dist/tools/validationTools.d.ts +0 -7
  879. package/dist/tools/validationTools.d.ts.map +0 -1
  880. package/dist/tools/validationTools.js +0 -344
  881. package/dist/tools/validationTools.js.map +0 -1
  882. package/dist/tools/webTools.d.ts +0 -3
  883. package/dist/tools/webTools.d.ts.map +0 -1
  884. package/dist/tools/webTools.js +0 -502
  885. package/dist/tools/webTools.js.map +0 -1
  886. package/dist/ui/ShellUIAdapter.d.ts +0 -194
  887. package/dist/ui/ShellUIAdapter.d.ts.map +0 -1
  888. package/dist/ui/ShellUIAdapter.js +0 -1069
  889. package/dist/ui/ShellUIAdapter.js.map +0 -1
  890. package/dist/ui/UnifiedUIController.d.ts +0 -70
  891. package/dist/ui/UnifiedUIController.d.ts.map +0 -1
  892. package/dist/ui/UnifiedUIController.js +0 -190
  893. package/dist/ui/UnifiedUIController.js.map +0 -1
  894. package/dist/ui/animation/AnimationScheduler.d.ts +0 -192
  895. package/dist/ui/animation/AnimationScheduler.d.ts.map +0 -1
  896. package/dist/ui/animation/AnimationScheduler.js +0 -432
  897. package/dist/ui/animation/AnimationScheduler.js.map +0 -1
  898. package/dist/ui/codeHighlighter.d.ts +0 -6
  899. package/dist/ui/codeHighlighter.d.ts.map +0 -1
  900. package/dist/ui/codeHighlighter.js +0 -855
  901. package/dist/ui/codeHighlighter.js.map +0 -1
  902. package/dist/ui/compactRenderer.d.ts +0 -139
  903. package/dist/ui/compactRenderer.d.ts.map +0 -1
  904. package/dist/ui/compactRenderer.js +0 -398
  905. package/dist/ui/compactRenderer.js.map +0 -1
  906. package/dist/ui/designSystem.d.ts +0 -26
  907. package/dist/ui/designSystem.d.ts.map +0 -1
  908. package/dist/ui/designSystem.js +0 -122
  909. package/dist/ui/designSystem.js.map +0 -1
  910. package/dist/ui/display.d.ts +0 -324
  911. package/dist/ui/display.d.ts.map +0 -1
  912. package/dist/ui/display.js +0 -1328
  913. package/dist/ui/display.js.map +0 -1
  914. package/dist/ui/errorFormatter.d.ts +0 -54
  915. package/dist/ui/errorFormatter.d.ts.map +0 -1
  916. package/dist/ui/errorFormatter.js +0 -251
  917. package/dist/ui/errorFormatter.js.map +0 -1
  918. package/dist/ui/globalWriteLock.d.ts +0 -38
  919. package/dist/ui/globalWriteLock.d.ts.map +0 -1
  920. package/dist/ui/globalWriteLock.js +0 -54
  921. package/dist/ui/globalWriteLock.js.map +0 -1
  922. package/dist/ui/inPlaceUpdater.d.ts +0 -181
  923. package/dist/ui/inPlaceUpdater.d.ts.map +0 -1
  924. package/dist/ui/inPlaceUpdater.js +0 -515
  925. package/dist/ui/inPlaceUpdater.js.map +0 -1
  926. package/dist/ui/interrupts/InterruptManager.d.ts +0 -142
  927. package/dist/ui/interrupts/InterruptManager.d.ts.map +0 -1
  928. package/dist/ui/interrupts/InterruptManager.js +0 -439
  929. package/dist/ui/interrupts/InterruptManager.js.map +0 -1
  930. package/dist/ui/layout.d.ts +0 -17
  931. package/dist/ui/layout.d.ts.map +0 -1
  932. package/dist/ui/layout.js +0 -140
  933. package/dist/ui/layout.js.map +0 -1
  934. package/dist/ui/orchestration/StatusOrchestrator.d.ts +0 -156
  935. package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +0 -1
  936. package/dist/ui/orchestration/StatusOrchestrator.js +0 -406
  937. package/dist/ui/orchestration/StatusOrchestrator.js.map +0 -1
  938. package/dist/ui/orchestration/UIUpdateCoordinator.d.ts +0 -77
  939. package/dist/ui/orchestration/UIUpdateCoordinator.d.ts.map +0 -1
  940. package/dist/ui/orchestration/UIUpdateCoordinator.js +0 -265
  941. package/dist/ui/orchestration/UIUpdateCoordinator.js.map +0 -1
  942. package/dist/ui/outputMode.d.ts +0 -22
  943. package/dist/ui/outputMode.d.ts.map +0 -1
  944. package/dist/ui/outputMode.js +0 -40
  945. package/dist/ui/outputMode.js.map +0 -1
  946. package/dist/ui/richText.d.ts +0 -6
  947. package/dist/ui/richText.d.ts.map +0 -1
  948. package/dist/ui/richText.js +0 -391
  949. package/dist/ui/richText.js.map +0 -1
  950. package/dist/ui/shortcutsHelp.d.ts +0 -39
  951. package/dist/ui/shortcutsHelp.d.ts.map +0 -1
  952. package/dist/ui/shortcutsHelp.js +0 -152
  953. package/dist/ui/shortcutsHelp.js.map +0 -1
  954. package/dist/ui/streamingFormatter.d.ts +0 -17
  955. package/dist/ui/streamingFormatter.d.ts.map +0 -1
  956. package/dist/ui/streamingFormatter.js +0 -71
  957. package/dist/ui/streamingFormatter.js.map +0 -1
  958. package/dist/ui/telemetry/UITelemetry.d.ts +0 -181
  959. package/dist/ui/telemetry/UITelemetry.d.ts.map +0 -1
  960. package/dist/ui/telemetry/UITelemetry.js +0 -446
  961. package/dist/ui/telemetry/UITelemetry.js.map +0 -1
  962. package/dist/ui/textHighlighter.d.ts +0 -83
  963. package/dist/ui/textHighlighter.d.ts.map +0 -1
  964. package/dist/ui/textHighlighter.js +0 -267
  965. package/dist/ui/textHighlighter.js.map +0 -1
  966. package/dist/ui/theme.d.ts +0 -208
  967. package/dist/ui/theme.d.ts.map +0 -1
  968. package/dist/ui/theme.js +0 -249
  969. package/dist/ui/theme.js.map +0 -1
  970. package/dist/ui/toolDisplay.d.ts +0 -195
  971. package/dist/ui/toolDisplay.d.ts.map +0 -1
  972. package/dist/ui/toolDisplay.js +0 -1527
  973. package/dist/ui/toolDisplay.js.map +0 -1
  974. package/dist/ui/unified/index.d.ts +0 -50
  975. package/dist/ui/unified/index.d.ts.map +0 -1
  976. package/dist/ui/unified/index.js +0 -77
  977. package/dist/ui/unified/index.js.map +0 -1
  978. package/dist/ui/unified/layout.d.ts +0 -12
  979. package/dist/ui/unified/layout.d.ts.map +0 -1
  980. package/dist/ui/unified/layout.js +0 -96
  981. package/dist/ui/unified/layout.js.map +0 -1
  982. package/dist/ui/writeLock.d.ts +0 -65
  983. package/dist/ui/writeLock.d.ts.map +0 -1
  984. package/dist/ui/writeLock.js +0 -114
  985. package/dist/ui/writeLock.js.map +0 -1
  986. package/dist/utils/asyncUtils.d.ts +0 -95
  987. package/dist/utils/asyncUtils.d.ts.map +0 -1
  988. package/dist/utils/asyncUtils.js +0 -286
  989. package/dist/utils/asyncUtils.js.map +0 -1
  990. package/dist/utils/errorUtils.d.ts +0 -16
  991. package/dist/utils/errorUtils.d.ts.map +0 -1
  992. package/dist/utils/errorUtils.js +0 -66
  993. package/dist/utils/errorUtils.js.map +0 -1
  994. package/dist/utils/frontmatter.d.ts +0 -10
  995. package/dist/utils/frontmatter.d.ts.map +0 -1
  996. package/dist/utils/frontmatter.js +0 -78
  997. package/dist/utils/frontmatter.js.map +0 -1
  998. package/dist/utils/planFormatter.d.ts +0 -34
  999. package/dist/utils/planFormatter.d.ts.map +0 -1
  1000. package/dist/utils/planFormatter.js +0 -140
  1001. package/dist/utils/planFormatter.js.map +0 -1
  1002. package/dist/workspace.d.ts +0 -8
  1003. package/dist/workspace.d.ts.map +0 -1
  1004. package/dist/workspace.js +0 -107
  1005. package/dist/workspace.js.map +0 -1
  1006. package/dist/workspace.validator.d.ts +0 -49
  1007. package/dist/workspace.validator.d.ts.map +0 -1
  1008. package/dist/workspace.validator.js +0 -214
  1009. package/dist/workspace.validator.js.map +0 -1
@@ -1,1942 +0,0 @@
1
- /**
2
- * Learn Tools - Codebase exploration and learning tools for understanding codebases.
3
- *
4
- * These tools enable deep codebase exploration without requiring external API calls
5
- * for the core analysis. The AI can use these tools to build a comprehensive
6
- * understanding of any codebase's architecture, patterns, and conventions.
7
- *
8
- * Features:
9
- * - Codebase structure analysis
10
- * - Pattern detection and learning
11
- * - Architecture understanding
12
- * - File relationship mapping
13
- * - Topic-based exploration
14
- */
15
- import { readFileSync, existsSync, readdirSync, statSync } from 'node:fs';
16
- import { join, relative, extname, basename } from 'node:path';
17
- import { buildError } from '../core/errors.js';
18
- // =====================================================
19
- // Constants
20
- // =====================================================
21
- const IGNORED_DIRS = new Set([
22
- 'node_modules',
23
- '.git',
24
- '.svn',
25
- '.hg',
26
- 'dist',
27
- 'build',
28
- 'out',
29
- '.next',
30
- '.nuxt',
31
- '.output',
32
- 'coverage',
33
- '.nyc_output',
34
- '.cache',
35
- '.turbo',
36
- '.vercel',
37
- '.netlify',
38
- '__pycache__',
39
- '.pytest_cache',
40
- '.mypy_cache',
41
- '.ruff_cache',
42
- 'venv',
43
- '.venv',
44
- 'env',
45
- '.env',
46
- 'target',
47
- 'vendor',
48
- '.idea',
49
- '.vscode',
50
- ]);
51
- const LANGUAGE_MAP = {
52
- '.ts': 'TypeScript',
53
- '.tsx': 'TypeScript React',
54
- '.js': 'JavaScript',
55
- '.jsx': 'JavaScript React',
56
- '.mjs': 'JavaScript (ESM)',
57
- '.cjs': 'JavaScript (CJS)',
58
- '.py': 'Python',
59
- '.pyw': 'Python',
60
- '.pyi': 'Python Stub',
61
- '.rs': 'Rust',
62
- '.go': 'Go',
63
- '.java': 'Java',
64
- '.kt': 'Kotlin',
65
- '.kts': 'Kotlin Script',
66
- '.scala': 'Scala',
67
- '.rb': 'Ruby',
68
- '.php': 'PHP',
69
- '.cs': 'C#',
70
- '.fs': 'F#',
71
- '.cpp': 'C++',
72
- '.cc': 'C++',
73
- '.cxx': 'C++',
74
- '.c': 'C',
75
- '.h': 'C/C++ Header',
76
- '.hpp': 'C++ Header',
77
- '.swift': 'Swift',
78
- '.m': 'Objective-C',
79
- '.mm': 'Objective-C++',
80
- '.vue': 'Vue',
81
- '.svelte': 'Svelte',
82
- '.elm': 'Elm',
83
- '.ex': 'Elixir',
84
- '.exs': 'Elixir Script',
85
- '.erl': 'Erlang',
86
- '.hs': 'Haskell',
87
- '.ml': 'OCaml',
88
- '.mli': 'OCaml Interface',
89
- '.lua': 'Lua',
90
- '.pl': 'Perl',
91
- '.pm': 'Perl Module',
92
- '.sh': 'Shell',
93
- '.bash': 'Bash',
94
- '.zsh': 'Zsh',
95
- '.fish': 'Fish',
96
- '.ps1': 'PowerShell',
97
- '.sql': 'SQL',
98
- '.json': 'JSON',
99
- '.yaml': 'YAML',
100
- '.yml': 'YAML',
101
- '.toml': 'TOML',
102
- '.xml': 'XML',
103
- '.md': 'Markdown',
104
- '.mdx': 'MDX',
105
- '.html': 'HTML',
106
- '.htm': 'HTML',
107
- '.css': 'CSS',
108
- '.scss': 'SCSS',
109
- '.sass': 'Sass',
110
- '.less': 'Less',
111
- '.styl': 'Stylus',
112
- };
113
- const CONFIG_FILES = {
114
- 'package.json': { type: 'npm', purpose: 'Node.js package configuration and dependencies' },
115
- 'tsconfig.json': { type: 'typescript', purpose: 'TypeScript compiler configuration' },
116
- 'pyproject.toml': { type: 'python', purpose: 'Python project configuration (PEP 517/518)' },
117
- 'setup.py': { type: 'python', purpose: 'Python package setup (legacy)' },
118
- 'requirements.txt': { type: 'python', purpose: 'Python dependencies' },
119
- 'Cargo.toml': { type: 'rust', purpose: 'Rust package manifest' },
120
- 'go.mod': { type: 'go', purpose: 'Go module definition' },
121
- 'pom.xml': { type: 'maven', purpose: 'Maven project configuration' },
122
- 'build.gradle': { type: 'gradle', purpose: 'Gradle build configuration' },
123
- 'build.gradle.kts': { type: 'gradle', purpose: 'Gradle Kotlin build configuration' },
124
- 'Gemfile': { type: 'ruby', purpose: 'Ruby dependencies (Bundler)' },
125
- 'composer.json': { type: 'php', purpose: 'PHP Composer dependencies' },
126
- '.eslintrc.json': { type: 'linting', purpose: 'ESLint configuration' },
127
- '.eslintrc.js': { type: 'linting', purpose: 'ESLint configuration' },
128
- '.prettierrc': { type: 'formatting', purpose: 'Prettier configuration' },
129
- 'prettier.config.js': { type: 'formatting', purpose: 'Prettier configuration' },
130
- '.gitignore': { type: 'git', purpose: 'Git ignore patterns' },
131
- '.dockerignore': { type: 'docker', purpose: 'Docker ignore patterns' },
132
- 'Dockerfile': { type: 'docker', purpose: 'Docker image definition' },
133
- 'docker-compose.yml': { type: 'docker', purpose: 'Docker Compose services' },
134
- 'docker-compose.yaml': { type: 'docker', purpose: 'Docker Compose services' },
135
- 'Makefile': { type: 'build', purpose: 'Make build automation' },
136
- '.env.example': { type: 'config', purpose: 'Environment variable template' },
137
- 'jest.config.js': { type: 'testing', purpose: 'Jest test configuration' },
138
- 'vitest.config.ts': { type: 'testing', purpose: 'Vitest test configuration' },
139
- 'webpack.config.js': { type: 'bundler', purpose: 'Webpack bundler configuration' },
140
- 'vite.config.ts': { type: 'bundler', purpose: 'Vite build tool configuration' },
141
- 'rollup.config.js': { type: 'bundler', purpose: 'Rollup bundler configuration' },
142
- 'next.config.js': { type: 'framework', purpose: 'Next.js configuration' },
143
- 'nuxt.config.ts': { type: 'framework', purpose: 'Nuxt.js configuration' },
144
- 'tailwind.config.js': { type: 'css', purpose: 'Tailwind CSS configuration' },
145
- '.github/workflows': { type: 'ci', purpose: 'GitHub Actions workflows' },
146
- '.gitlab-ci.yml': { type: 'ci', purpose: 'GitLab CI/CD configuration' },
147
- 'Jenkinsfile': { type: 'ci', purpose: 'Jenkins pipeline definition' },
148
- };
149
- const ARCHITECTURE_PATTERNS = [
150
- {
151
- name: 'MVC (Model-View-Controller)',
152
- indicators: ['models', 'views', 'controllers', 'routes'],
153
- type: 'architectural',
154
- },
155
- {
156
- name: 'Clean Architecture',
157
- indicators: ['domain', 'application', 'infrastructure', 'presentation', 'entities', 'use-cases', 'usecases'],
158
- type: 'architectural',
159
- },
160
- {
161
- name: 'Hexagonal Architecture',
162
- indicators: ['ports', 'adapters', 'domain', 'application'],
163
- type: 'architectural',
164
- },
165
- {
166
- name: 'Feature-based Structure',
167
- indicators: ['features', 'modules'],
168
- type: 'structural',
169
- },
170
- {
171
- name: 'Component-based',
172
- indicators: ['components', 'shared', 'common'],
173
- type: 'structural',
174
- },
175
- {
176
- name: 'Layered Architecture',
177
- indicators: ['api', 'services', 'repositories', 'data', 'business'],
178
- type: 'architectural',
179
- },
180
- {
181
- name: 'Microservices',
182
- indicators: ['services', 'gateway', 'docker-compose'],
183
- type: 'architectural',
184
- },
185
- {
186
- name: 'Monorepo',
187
- indicators: ['packages', 'apps', 'libs', 'workspace'],
188
- type: 'structural',
189
- },
190
- {
191
- name: 'Plugin Architecture',
192
- indicators: ['plugins', 'extensions', 'addons'],
193
- type: 'architectural',
194
- },
195
- {
196
- name: 'Event-Driven',
197
- indicators: ['events', 'handlers', 'listeners', 'subscribers', 'publishers'],
198
- type: 'architectural',
199
- },
200
- ];
201
- // =====================================================
202
- // Tool Creation
203
- // =====================================================
204
- export function createLearnTools(workingDir) {
205
- return [
206
- createLearnCodebaseTool(workingDir),
207
- createLearnFileTool(workingDir),
208
- createLearnTopicTool(workingDir),
209
- createLearnSummaryTool(workingDir),
210
- ];
211
- }
212
- // =====================================================
213
- // learn_codebase Tool
214
- // =====================================================
215
- function createLearnCodebaseTool(workingDir) {
216
- return {
217
- name: 'learn_codebase',
218
- description: `Analyze and learn the entire codebase structure, architecture, patterns, and conventions.
219
- This tool provides a comprehensive overview of the project without requiring external API calls.
220
- Use this to understand:
221
- - Project structure and organization
222
- - Primary programming languages used
223
- - Architectural patterns detected
224
- - Configuration and build setup
225
- - Entry points and key files
226
- - Dependencies and package management`,
227
- parameters: {
228
- type: 'object',
229
- properties: {
230
- depth: {
231
- type: 'number',
232
- description: 'Maximum directory depth to analyze (default: 5)',
233
- },
234
- includeHidden: {
235
- type: 'boolean',
236
- description: 'Include hidden files/directories in analysis (default: false)',
237
- },
238
- focusPath: {
239
- type: 'string',
240
- description: 'Focus analysis on a specific subdirectory',
241
- },
242
- },
243
- additionalProperties: false,
244
- },
245
- cacheable: true,
246
- handler: async (args) => {
247
- try {
248
- const depth = typeof args['depth'] === 'number' ? args['depth'] : 5;
249
- const includeHidden = args['includeHidden'] === true;
250
- const focusPath = args['focusPath'];
251
- const targetDir = focusPath ? resolveFilePath(workingDir, focusPath) : workingDir;
252
- if (!existsSync(targetDir)) {
253
- return `Error: Directory not found: ${targetDir}`;
254
- }
255
- // Deep analysis with progressive output
256
- const analysis = await analyzeCodebaseDeep(targetDir, workingDir, depth, includeHidden);
257
- return formatCodebaseAnalysis(analysis);
258
- }
259
- catch (error) {
260
- return buildError('analyzing codebase', error, { workingDir });
261
- }
262
- },
263
- };
264
- }
265
- // =====================================================
266
- // learn_file Tool
267
- // =====================================================
268
- function createLearnFileTool(workingDir) {
269
- return {
270
- name: 'learn_file',
271
- description: `Deep-learn a specific file's purpose, structure, patterns, and relationships.
272
- This tool provides detailed analysis of a single file including:
273
- - File purpose and responsibilities
274
- - Imports and dependencies
275
- - Exports and public interface
276
- - Functions and classes with their purposes
277
- - Complexity metrics
278
- - Relationships to other files`,
279
- parameters: {
280
- type: 'object',
281
- properties: {
282
- path: {
283
- type: 'string',
284
- description: 'Path to the file to analyze',
285
- },
286
- includeRelationships: {
287
- type: 'boolean',
288
- description: 'Analyze relationships to other files (default: true)',
289
- },
290
- },
291
- required: ['path'],
292
- additionalProperties: false,
293
- },
294
- cacheable: true,
295
- handler: async (args) => {
296
- try {
297
- const filePath = resolveFilePath(workingDir, args['path']);
298
- const includeRelationships = args['includeRelationships'] !== false;
299
- if (!existsSync(filePath)) {
300
- return `Error: File not found: ${filePath}`;
301
- }
302
- const stat = statSync(filePath);
303
- if (stat.isDirectory()) {
304
- return `Error: Path is a directory, not a file: ${filePath}`;
305
- }
306
- const analysis = analyzeFile(filePath, workingDir, includeRelationships);
307
- return formatFileAnalysis(analysis);
308
- }
309
- catch (error) {
310
- return buildError('analyzing file', error, { path: String(args['path']) });
311
- }
312
- },
313
- };
314
- }
315
- // =====================================================
316
- // learn_topic Tool
317
- // =====================================================
318
- function createLearnTopicTool(workingDir) {
319
- return {
320
- name: 'learn_topic',
321
- description: `Learn about a specific topic, pattern, or concept within the codebase.
322
- Use this to understand how specific patterns are implemented, such as:
323
- - Authentication/authorization patterns
324
- - Error handling conventions
325
- - Data validation approaches
326
- - API design patterns
327
- - State management
328
- - Testing patterns
329
- - Any custom pattern or convention`,
330
- parameters: {
331
- type: 'object',
332
- properties: {
333
- topic: {
334
- type: 'string',
335
- description: 'The topic or pattern to learn about (e.g., "authentication", "error handling", "api routes")',
336
- },
337
- maxFiles: {
338
- type: 'number',
339
- description: 'Maximum number of relevant files to analyze (default: 10)',
340
- },
341
- maxExamples: {
342
- type: 'number',
343
- description: 'Maximum number of code examples to include (default: 5)',
344
- },
345
- },
346
- required: ['topic'],
347
- additionalProperties: false,
348
- },
349
- cacheable: true,
350
- handler: async (args) => {
351
- try {
352
- const topic = args['topic'];
353
- const maxFiles = typeof args['maxFiles'] === 'number' ? args['maxFiles'] : 10;
354
- const maxExamples = typeof args['maxExamples'] === 'number' ? args['maxExamples'] : 5;
355
- if (!topic || !topic.trim()) {
356
- return 'Error: topic must be a non-empty string';
357
- }
358
- const analysis = analyzeTopic(workingDir, topic.trim(), maxFiles, maxExamples);
359
- return formatTopicAnalysis(analysis);
360
- }
361
- catch (error) {
362
- return buildError('analyzing topic', error, { topic: String(args['topic']) });
363
- }
364
- },
365
- };
366
- }
367
- // =====================================================
368
- // learn_summary Tool
369
- // =====================================================
370
- function createLearnSummaryTool(workingDir) {
371
- return {
372
- name: 'learn_summary',
373
- description: `Generate a learning summary for the codebase suitable for onboarding.
374
- This creates a comprehensive summary including:
375
- - Quick start guide
376
- - Key concepts and terminology
377
- - Architecture overview
378
- - Important files and their purposes
379
- - Common patterns and conventions
380
- - Development workflow suggestions`,
381
- parameters: {
382
- type: 'object',
383
- properties: {
384
- format: {
385
- type: 'string',
386
- description: 'Output format: "markdown" (default) or "text"',
387
- enum: ['markdown', 'text'],
388
- },
389
- focus: {
390
- type: 'string',
391
- description: 'Focus area for the summary (e.g., "frontend", "backend", "api")',
392
- },
393
- },
394
- additionalProperties: false,
395
- },
396
- cacheable: true,
397
- handler: async (args) => {
398
- try {
399
- const format = args['format'] || 'markdown';
400
- const focus = args['focus'];
401
- const analysis = analyzeCodebase(workingDir, workingDir, 4, false);
402
- return formatLearningSummary(analysis, format, focus);
403
- }
404
- catch (error) {
405
- return buildError('generating learning summary', error, { workingDir });
406
- }
407
- },
408
- };
409
- }
410
- // =====================================================
411
- // Analysis Functions
412
- // =====================================================
413
- /**
414
- * Deep codebase analysis with thorough exploration.
415
- * Does actual file content analysis for better insights.
416
- */
417
- async function analyzeCodebaseDeep(targetDir, workingDir, maxDepth, includeHidden) {
418
- const files = [];
419
- const directories = [];
420
- const configFiles = [];
421
- // Phase 1: Directory structure traversal
422
- const structure = buildDirectoryTree(targetDir, workingDir, 0, maxDepth, includeHidden, files, directories, configFiles);
423
- // Phase 2: File type detection and language breakdown
424
- const languageCounts = new Map();
425
- for (const file of files) {
426
- const lang = LANGUAGE_MAP[file.ext] || 'Other';
427
- const existing = languageCounts.get(lang) || { ext: file.ext, count: 0 };
428
- existing.count++;
429
- languageCounts.set(lang, existing);
430
- }
431
- const totalFiles = files.length;
432
- const languages = Array.from(languageCounts.entries())
433
- .map(([language, data]) => ({
434
- language,
435
- extension: data.ext,
436
- fileCount: data.count,
437
- percentage: totalFiles > 0 ? (data.count / totalFiles) * 100 : 0,
438
- }))
439
- .sort((a, b) => b.fileCount - a.fileCount);
440
- // Phase 3: Architecture pattern detection
441
- const dirNames = directories.map((d) => basename(d).toLowerCase());
442
- const patterns = detectPatterns(dirNames, files.map((f) => f.path));
443
- // Phase 4: Configuration file analysis with deep inspection
444
- const configDetails = analyzeConfigFilesDeep(configFiles, targetDir);
445
- // Phase 5: Dependency analysis
446
- const dependencies = analyzeDependencies(targetDir);
447
- // Phase 6: Entry point identification
448
- const entryPoints = findEntryPoints(files.map((f) => f.path), configFiles);
449
- // Phase 7: Component and layer mapping
450
- const architecture = buildArchitectureInsights(patterns, dirNames, targetDir, workingDir);
451
- // Phase 8: Deep source file analysis for patterns and complexity
452
- const keyFiles = files
453
- .filter(f => LANGUAGE_MAP[f.ext] && f.size < 100000)
454
- .slice(0, 50);
455
- const codePatterns = new Map();
456
- let totalComplexity = 0;
457
- let analyzedFiles = 0;
458
- for (const file of keyFiles) {
459
- try {
460
- const fullPath = join(workingDir, file.path);
461
- const content = readFileSync(fullPath, 'utf-8');
462
- const filePatterns = detectCodePatterns(content, file.ext);
463
- // Accumulate pattern counts
464
- for (const pattern of filePatterns) {
465
- codePatterns.set(pattern, (codePatterns.get(pattern) || 0) + 1);
466
- }
467
- // Calculate complexity metrics
468
- const complexity = calculateComplexity(content);
469
- totalComplexity += complexity.cyclomaticComplexity;
470
- analyzedFiles++;
471
- }
472
- catch {
473
- // Skip unreadable files
474
- }
475
- }
476
- // Add detected code patterns to the patterns list
477
- for (const [patternName, count] of codePatterns.entries()) {
478
- if (count >= 3) { // Only include patterns found in multiple files
479
- patterns.push({
480
- name: patternName,
481
- type: 'design',
482
- description: `Found ${patternName} pattern in ${count} files`,
483
- evidence: [`Detected in ${count} source files`],
484
- confidence: count >= 10 ? 'high' : count >= 5 ? 'medium' : 'low',
485
- });
486
- }
487
- }
488
- return {
489
- rootDir: relative(workingDir, targetDir) || '.',
490
- totalFiles,
491
- totalDirectories: directories.length,
492
- languages,
493
- structure,
494
- patterns,
495
- architecture,
496
- entryPoints,
497
- configFiles: configDetails,
498
- dependencies,
499
- };
500
- }
501
- function analyzeConfigFilesDeep(configs, targetDir) {
502
- // Enhance config info with actual content analysis where useful
503
- return configs.map(config => {
504
- try {
505
- const fullPath = join(targetDir, config.path);
506
- if (config.name === 'package.json' && existsSync(fullPath)) {
507
- const content = JSON.parse(readFileSync(fullPath, 'utf-8'));
508
- const scripts = Object.keys(content.scripts || {}).slice(0, 5);
509
- if (scripts.length > 0) {
510
- return {
511
- ...config,
512
- purpose: `${config.purpose} (scripts: ${scripts.join(', ')})`,
513
- };
514
- }
515
- }
516
- }
517
- catch {
518
- // Keep original
519
- }
520
- return config;
521
- });
522
- }
523
- function analyzeCodebase(targetDir, workingDir, maxDepth, includeHidden) {
524
- const files = [];
525
- const directories = [];
526
- const configFiles = [];
527
- // Build directory tree and collect files
528
- const structure = buildDirectoryTree(targetDir, workingDir, 0, maxDepth, includeHidden, files, directories, configFiles);
529
- // Calculate language breakdown
530
- const languageCounts = new Map();
531
- for (const file of files) {
532
- const lang = LANGUAGE_MAP[file.ext] || 'Other';
533
- const existing = languageCounts.get(lang) || { ext: file.ext, count: 0 };
534
- existing.count++;
535
- languageCounts.set(lang, existing);
536
- }
537
- const totalFiles = files.length;
538
- const languages = Array.from(languageCounts.entries())
539
- .map(([language, data]) => ({
540
- language,
541
- extension: data.ext,
542
- fileCount: data.count,
543
- percentage: totalFiles > 0 ? (data.count / totalFiles) * 100 : 0,
544
- }))
545
- .sort((a, b) => b.fileCount - a.fileCount);
546
- // Detect architecture patterns
547
- const dirNames = directories.map((d) => basename(d).toLowerCase());
548
- const patterns = detectPatterns(dirNames, files.map((f) => f.path));
549
- // Build architecture insights
550
- const architecture = buildArchitectureInsights(patterns, dirNames, targetDir, workingDir);
551
- // Find entry points
552
- const entryPoints = findEntryPoints(files.map((f) => f.path), configFiles);
553
- // Analyze dependencies
554
- const dependencies = analyzeDependencies(targetDir);
555
- return {
556
- rootDir: relative(workingDir, targetDir) || '.',
557
- totalFiles,
558
- totalDirectories: directories.length,
559
- languages,
560
- structure,
561
- patterns,
562
- architecture,
563
- entryPoints,
564
- configFiles,
565
- dependencies,
566
- };
567
- }
568
- function buildDirectoryTree(dir, workingDir, depth, maxDepth, includeHidden, files, directories, configFiles) {
569
- const name = basename(dir) || dir;
570
- const relPath = relative(workingDir, dir) || '.';
571
- const node = {
572
- name,
573
- path: relPath,
574
- type: 'directory',
575
- children: [],
576
- };
577
- if (depth >= maxDepth) {
578
- return node;
579
- }
580
- try {
581
- const entries = readdirSync(dir, { withFileTypes: true });
582
- for (const entry of entries) {
583
- // Skip hidden files/dirs if not requested
584
- if (!includeHidden && entry.name.startsWith('.')) {
585
- continue;
586
- }
587
- // Skip ignored directories
588
- if (IGNORED_DIRS.has(entry.name)) {
589
- continue;
590
- }
591
- const fullPath = join(dir, entry.name);
592
- const entryRelPath = relative(workingDir, fullPath);
593
- if (entry.isDirectory()) {
594
- directories.push(fullPath);
595
- const childNode = buildDirectoryTree(fullPath, workingDir, depth + 1, maxDepth, includeHidden, files, directories, configFiles);
596
- node.children.push(childNode);
597
- }
598
- else if (entry.isFile()) {
599
- try {
600
- const stat = statSync(fullPath);
601
- const ext = extname(entry.name).toLowerCase();
602
- const language = LANGUAGE_MAP[ext];
603
- files.push({ path: entryRelPath, ext, size: stat.size });
604
- // Check if it's a config file
605
- const configInfo = CONFIG_FILES[entry.name];
606
- if (configInfo) {
607
- configFiles.push({
608
- name: entry.name,
609
- path: entryRelPath,
610
- type: configInfo.type,
611
- purpose: configInfo.purpose,
612
- });
613
- }
614
- node.children.push({
615
- name: entry.name,
616
- path: entryRelPath,
617
- type: 'file',
618
- size: stat.size,
619
- language,
620
- });
621
- }
622
- catch {
623
- // Skip files we can't stat
624
- }
625
- }
626
- }
627
- }
628
- catch {
629
- // Skip directories we can't read
630
- }
631
- return node;
632
- }
633
- function detectPatterns(dirNames, filePaths) {
634
- const patterns = [];
635
- const dirNameSet = new Set(dirNames);
636
- const filePathsLower = filePaths.map((p) => p.toLowerCase());
637
- for (const pattern of ARCHITECTURE_PATTERNS) {
638
- const matches = pattern.indicators.filter((ind) => dirNameSet.has(ind));
639
- if (matches.length >= 2 || (matches.length >= 1 && pattern.indicators.length <= 2)) {
640
- const confidence = matches.length >= 3 ? 'high' : matches.length >= 2 ? 'medium' : 'low';
641
- patterns.push({
642
- name: pattern.name,
643
- type: pattern.type,
644
- description: `Detected ${pattern.name} pattern based on directory structure`,
645
- evidence: matches.map((m) => `Found "${m}" directory`),
646
- confidence,
647
- });
648
- }
649
- }
650
- // Detect naming conventions
651
- const hasKebabCase = filePathsLower.some((p) => /[a-z]+-[a-z]+/.test(basename(p)));
652
- const hasCamelCase = filePaths.some((p) => /[a-z]+[A-Z][a-z]+/.test(basename(p)));
653
- const hasPascalCase = filePaths.some((p) => /^[A-Z][a-z]+[A-Z]/.test(basename(p)));
654
- const hasSnakeCase = filePathsLower.some((p) => /[a-z]+_[a-z]+/.test(basename(p)));
655
- const namingConventions = [];
656
- if (hasKebabCase)
657
- namingConventions.push('kebab-case');
658
- if (hasCamelCase)
659
- namingConventions.push('camelCase');
660
- if (hasPascalCase)
661
- namingConventions.push('PascalCase');
662
- if (hasSnakeCase)
663
- namingConventions.push('snake_case');
664
- if (namingConventions.length > 0) {
665
- patterns.push({
666
- name: 'File Naming Convention',
667
- type: 'naming',
668
- description: `Uses ${namingConventions.join(', ')} naming convention(s)`,
669
- evidence: namingConventions.map((n) => `Detected ${n} pattern in filenames`),
670
- confidence: 'medium',
671
- });
672
- }
673
- // Detect test patterns
674
- const hasTestDir = dirNameSet.has('test') || dirNameSet.has('tests') || dirNameSet.has('__tests__');
675
- const hasSpecFiles = filePathsLower.some((p) => p.includes('.spec.') || p.includes('.test.'));
676
- if (hasTestDir || hasSpecFiles) {
677
- patterns.push({
678
- name: 'Testing Structure',
679
- type: 'structural',
680
- description: hasTestDir
681
- ? 'Uses dedicated test directory'
682
- : 'Uses co-located test files (.spec/.test)',
683
- evidence: hasTestDir
684
- ? ['Found test/tests/__tests__ directory']
685
- : ['Found .spec or .test files alongside source'],
686
- confidence: 'high',
687
- });
688
- }
689
- return patterns;
690
- }
691
- function buildArchitectureInsights(patterns, dirNames, targetDir, workingDir) {
692
- const archPattern = patterns.find((p) => p.type === 'architectural');
693
- const type = archPattern?.name || 'Custom/Unknown';
694
- const layers = [];
695
- const components = [];
696
- // Identify layers based on common directory names
697
- const layerDirs = ['api', 'routes', 'controllers', 'services', 'models', 'views', 'components', 'utils', 'lib', 'core'];
698
- for (const layer of layerDirs) {
699
- if (dirNames.includes(layer)) {
700
- layers.push(layer);
701
- }
702
- }
703
- // Build component info from top-level directories
704
- try {
705
- const entries = readdirSync(targetDir, { withFileTypes: true });
706
- for (const entry of entries) {
707
- if (entry.isDirectory() && !IGNORED_DIRS.has(entry.name) && !entry.name.startsWith('.')) {
708
- const componentPath = relative(workingDir, join(targetDir, entry.name));
709
- components.push({
710
- name: entry.name,
711
- type: inferComponentType(entry.name),
712
- path: componentPath,
713
- responsibilities: inferResponsibilities(entry.name),
714
- });
715
- }
716
- }
717
- }
718
- catch {
719
- // Ignore errors
720
- }
721
- const dataFlow = inferDataFlow(layers, type);
722
- return {
723
- type,
724
- layers,
725
- components,
726
- dataFlow,
727
- };
728
- }
729
- function inferComponentType(name) {
730
- const lower = name.toLowerCase();
731
- if (['api', 'routes', 'controllers', 'handlers'].includes(lower))
732
- return 'API Layer';
733
- if (['services', 'business', 'domain'].includes(lower))
734
- return 'Business Logic';
735
- if (['models', 'entities', 'schemas'].includes(lower))
736
- return 'Data Models';
737
- if (['views', 'pages', 'screens'].includes(lower))
738
- return 'Presentation';
739
- if (['components', 'ui'].includes(lower))
740
- return 'UI Components';
741
- if (['utils', 'helpers', 'lib', 'common', 'shared'].includes(lower))
742
- return 'Utilities';
743
- if (['config', 'configs', 'settings'].includes(lower))
744
- return 'Configuration';
745
- if (['test', 'tests', '__tests__', 'spec'].includes(lower))
746
- return 'Testing';
747
- if (['types', 'interfaces', 'contracts'].includes(lower))
748
- return 'Type Definitions';
749
- if (['middleware', 'middlewares'].includes(lower))
750
- return 'Middleware';
751
- if (['plugins', 'extensions', 'addons'].includes(lower))
752
- return 'Extensions';
753
- return 'Module';
754
- }
755
- function inferResponsibilities(name) {
756
- const lower = name.toLowerCase();
757
- const responsibilities = [];
758
- if (['api', 'routes'].includes(lower)) {
759
- responsibilities.push('HTTP request handling', 'Route definitions', 'Request/response processing');
760
- }
761
- else if (lower === 'controllers') {
762
- responsibilities.push('Request handling', 'Input validation', 'Response formatting');
763
- }
764
- else if (lower === 'services') {
765
- responsibilities.push('Business logic', 'Data orchestration', 'External integrations');
766
- }
767
- else if (lower === 'models') {
768
- responsibilities.push('Data structures', 'Database schemas', 'Data validation');
769
- }
770
- else if (['views', 'pages'].includes(lower)) {
771
- responsibilities.push('UI rendering', 'Page composition', 'Layout management');
772
- }
773
- else if (lower === 'components') {
774
- responsibilities.push('Reusable UI elements', 'Component logic', 'State management');
775
- }
776
- else if (['utils', 'helpers'].includes(lower)) {
777
- responsibilities.push('Utility functions', 'Common helpers', 'Shared logic');
778
- }
779
- return responsibilities.length > 0 ? responsibilities : ['Module functionality'];
780
- }
781
- function inferDataFlow(layers, archType) {
782
- if (archType.includes('MVC')) {
783
- return ['Request → Controller → Model → View → Response'];
784
- }
785
- if (archType.includes('Clean')) {
786
- return [
787
- 'External → Controllers → Use Cases → Entities',
788
- 'Entities → Use Cases → Presenters → External',
789
- ];
790
- }
791
- if (archType.includes('Layered')) {
792
- return ['API → Services → Repositories → Database'];
793
- }
794
- if (layers.length > 0) {
795
- return [`Request → ${layers.join(' → ')} → Response`];
796
- }
797
- return ['Standard request/response flow'];
798
- }
799
- function findEntryPoints(filePaths, configFiles) {
800
- const entryPoints = [];
801
- // Check for common entry point patterns
802
- const entryPatterns = [
803
- 'index.ts',
804
- 'index.js',
805
- 'main.ts',
806
- 'main.js',
807
- 'app.ts',
808
- 'app.js',
809
- 'server.ts',
810
- 'server.js',
811
- 'cli.ts',
812
- 'cli.js',
813
- '__main__.py',
814
- 'main.py',
815
- 'app.py',
816
- 'manage.py',
817
- 'main.go',
818
- 'main.rs',
819
- 'lib.rs',
820
- ];
821
- for (const pattern of entryPatterns) {
822
- const match = filePaths.find((p) => basename(p) === pattern || p.endsWith(`/src/${pattern}`) || p.endsWith(`/bin/${pattern}`));
823
- if (match) {
824
- entryPoints.push(match);
825
- }
826
- }
827
- // Check package.json for main/bin
828
- const pkgJson = configFiles.find((c) => c.name === 'package.json');
829
- if (pkgJson) {
830
- entryPoints.push(`${pkgJson.path} (see "main" or "bin" fields)`);
831
- }
832
- return [...new Set(entryPoints)];
833
- }
834
- function analyzeDependencies(dir) {
835
- const result = {
836
- dependencies: [],
837
- devDependencies: [],
838
- hasDependencyFile: false,
839
- };
840
- // Check package.json
841
- const pkgPath = join(dir, 'package.json');
842
- if (existsSync(pkgPath)) {
843
- try {
844
- const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
845
- result.packageManager = 'npm';
846
- result.hasDependencyFile = true;
847
- result.dependencies = Object.keys(pkg.dependencies || {}).slice(0, 20);
848
- result.devDependencies = Object.keys(pkg.devDependencies || {}).slice(0, 20);
849
- }
850
- catch {
851
- // Ignore parse errors
852
- }
853
- }
854
- // Check pyproject.toml
855
- const pyprojectPath = join(dir, 'pyproject.toml');
856
- if (existsSync(pyprojectPath)) {
857
- result.packageManager = result.packageManager || 'pip';
858
- result.hasDependencyFile = true;
859
- // Basic TOML parsing for dependencies
860
- try {
861
- const content = readFileSync(pyprojectPath, 'utf-8');
862
- const depMatch = content.match(/dependencies\s*=\s*\[([\s\S]*?)\]/);
863
- if (depMatch && depMatch[1]) {
864
- const deps = depMatch[1].match(/"([^"]+)"/g) || [];
865
- result.dependencies = deps.map((d) => d.replace(/"/g, '').split(/[<>=!]/)[0]?.trim() ?? '').slice(0, 20);
866
- }
867
- }
868
- catch {
869
- // Ignore parse errors
870
- }
871
- }
872
- // Check Cargo.toml
873
- const cargoPath = join(dir, 'Cargo.toml');
874
- if (existsSync(cargoPath)) {
875
- result.packageManager = 'cargo';
876
- result.hasDependencyFile = true;
877
- }
878
- // Check go.mod
879
- const goModPath = join(dir, 'go.mod');
880
- if (existsSync(goModPath)) {
881
- result.packageManager = 'go modules';
882
- result.hasDependencyFile = true;
883
- }
884
- return result;
885
- }
886
- function analyzeFile(filePath, workingDir, includeRelationships) {
887
- const content = readFileSync(filePath, 'utf-8');
888
- const lines = content.split('\n');
889
- const ext = extname(filePath).toLowerCase();
890
- const language = LANGUAGE_MAP[ext] || 'Unknown';
891
- const relPath = relative(workingDir, filePath);
892
- const imports = extractImports(content, ext);
893
- const exports = extractExports(content, ext);
894
- const functions = extractFunctions(content, ext);
895
- const classes = extractClasses(content, ext);
896
- const patterns = detectCodePatterns(content, ext);
897
- const complexity = calculateComplexity(content);
898
- const purpose = inferFilePurpose(basename(filePath), content, imports, exports, functions, classes);
899
- const relationships = [];
900
- if (includeRelationships) {
901
- // Build relationships from imports
902
- for (const imp of imports) {
903
- if (imp.isRelative) {
904
- relationships.push({
905
- targetFile: imp.resolvedPath || imp.source,
906
- type: 'imports',
907
- symbols: imp.specifiers,
908
- });
909
- }
910
- }
911
- }
912
- return {
913
- path: relPath,
914
- language,
915
- size: content.length,
916
- lineCount: lines.length,
917
- purpose,
918
- imports,
919
- exports,
920
- functions,
921
- classes,
922
- patterns,
923
- relationships,
924
- complexity,
925
- };
926
- }
927
- function extractImports(content, ext) {
928
- const imports = [];
929
- if (['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'].includes(ext)) {
930
- // ES6 imports
931
- const importRegex = /import\s+(?:(\*\s+as\s+\w+)|(\{[^}]+\})|(\w+)(?:\s*,\s*\{([^}]+)\})?)\s+from\s+['"]([^'"]+)['"]/g;
932
- let match;
933
- while ((match = importRegex.exec(content)) !== null) {
934
- const source = match[5] || '';
935
- let specifiers = [];
936
- if (match[1]) {
937
- // namespace import
938
- specifiers = [match[1].trim()];
939
- }
940
- else if (match[2]) {
941
- // named imports
942
- specifiers = match[2]
943
- .replace(/[{}]/g, '')
944
- .split(',')
945
- .map((s) => s.trim())
946
- .filter(Boolean);
947
- }
948
- else if (match[3]) {
949
- // default import
950
- specifiers = [match[3]];
951
- if (match[4]) {
952
- // additional named imports
953
- specifiers.push(...match[4]
954
- .split(',')
955
- .map((s) => s.trim())
956
- .filter(Boolean));
957
- }
958
- }
959
- imports.push({
960
- source,
961
- specifiers,
962
- isRelative: source.startsWith('.') || source.startsWith('/'),
963
- });
964
- }
965
- // CommonJS requires
966
- const requireRegex = /(?:const|let|var)\s+(?:(\{[^}]+\})|(\w+))\s*=\s*require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
967
- while ((match = requireRegex.exec(content)) !== null) {
968
- const source = match[3] || '';
969
- let specifiers = [];
970
- if (match[1]) {
971
- specifiers = match[1]
972
- .replace(/[{}]/g, '')
973
- .split(',')
974
- .map((s) => s.trim())
975
- .filter(Boolean);
976
- }
977
- else if (match[2]) {
978
- specifiers = [match[2]];
979
- }
980
- imports.push({
981
- source,
982
- specifiers,
983
- isRelative: source.startsWith('.') || source.startsWith('/'),
984
- });
985
- }
986
- }
987
- else if (ext === '.py') {
988
- // Python imports
989
- const fromImportRegex = /from\s+([^\s]+)\s+import\s+(.+)/g;
990
- let match;
991
- while ((match = fromImportRegex.exec(content)) !== null) {
992
- const source = match[1] ?? '';
993
- const specifiers = (match[2] ?? '')
994
- .split(',')
995
- .map((s) => s.trim().split(' as ')[0]?.trim() ?? '')
996
- .filter(Boolean);
997
- imports.push({
998
- source,
999
- specifiers,
1000
- isRelative: source.startsWith('.'),
1001
- });
1002
- }
1003
- const importRegex = /^import\s+([^\s,]+(?:\s*,\s*[^\s,]+)*)/gm;
1004
- while ((match = importRegex.exec(content)) !== null) {
1005
- const modules = (match[1] ?? '').split(',').map((s) => s.trim().split(' as ')[0]?.trim() ?? '');
1006
- for (const mod of modules) {
1007
- if (mod) {
1008
- imports.push({
1009
- source: mod,
1010
- specifiers: [mod],
1011
- isRelative: mod.startsWith('.'),
1012
- });
1013
- }
1014
- }
1015
- }
1016
- }
1017
- return imports;
1018
- }
1019
- function extractExports(content, ext) {
1020
- const exports = [];
1021
- if (['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'].includes(ext)) {
1022
- // Export default
1023
- const defaultMatch = content.match(/export\s+default\s+(?:class|function)?\s*(\w+)?/);
1024
- if (defaultMatch) {
1025
- exports.push({
1026
- name: defaultMatch[1] || 'default',
1027
- type: 'default',
1028
- });
1029
- }
1030
- // Named exports
1031
- const namedExportRegex = /export\s+(?:const|let|var|function|class|interface|type|enum)\s+(\w+)/g;
1032
- let match;
1033
- while ((match = namedExportRegex.exec(content)) !== null) {
1034
- const name = match[1] || '';
1035
- const line = content.substring(0, match.index).split('\n').length;
1036
- const lineContent = content.split('\n')[line - 1] || '';
1037
- let type = 'named';
1038
- if (lineContent.includes('interface'))
1039
- type = 'interface';
1040
- else if (lineContent.includes('type'))
1041
- type = 'type';
1042
- else if (lineContent.includes('class'))
1043
- type = 'class';
1044
- else if (lineContent.includes('function'))
1045
- type = 'function';
1046
- exports.push({ name, type });
1047
- }
1048
- // Re-exports
1049
- const reExportRegex = /export\s+\{([^}]+)\}\s+from/g;
1050
- while ((match = reExportRegex.exec(content)) !== null) {
1051
- const names = (match[1] ?? '').split(',').map((s) => s.trim().split(' as ')[0]?.trim() ?? '');
1052
- for (const name of names) {
1053
- if (name) {
1054
- exports.push({ name, type: 'named' });
1055
- }
1056
- }
1057
- }
1058
- }
1059
- else if (ext === '.py') {
1060
- // Python __all__
1061
- const allMatch = content.match(/__all__\s*=\s*\[([\s\S]*?)\]/);
1062
- if (allMatch && allMatch[1]) {
1063
- const names = (allMatch[1].match(/['"]([^'"]+)['"]/g) || []).map((s) => s.replace(/['"]/g, ''));
1064
- for (const name of names) {
1065
- exports.push({ name, type: 'named' });
1066
- }
1067
- }
1068
- // Public functions/classes (not starting with _)
1069
- const defRegex = /^(?:def|class)\s+([a-zA-Z][a-zA-Z0-9_]*)/gm;
1070
- let match;
1071
- while ((match = defRegex.exec(content)) !== null) {
1072
- const name = match[1] || '';
1073
- if (!name.startsWith('_')) {
1074
- const lineContent = content.split('\n')[content.substring(0, match.index).split('\n').length - 1] || '';
1075
- exports.push({
1076
- name,
1077
- type: lineContent.startsWith('class') ? 'class' : 'function',
1078
- });
1079
- }
1080
- }
1081
- }
1082
- return exports;
1083
- }
1084
- function extractFunctions(content, ext) {
1085
- const functions = [];
1086
- if (['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'].includes(ext)) {
1087
- // Regular functions
1088
- const funcRegex = /(?:export\s+)?(?:async\s+)?function\s+(\w+)\s*\(([^)]*)\)(?:\s*:\s*([^{]+))?\s*\{/g;
1089
- let match;
1090
- while ((match = funcRegex.exec(content)) !== null) {
1091
- const name = match[1] || '';
1092
- const params = (match[2] || '').split(',').map((p) => p.trim().split(':')[0]?.trim() ?? '').filter(Boolean);
1093
- const returnType = (match[3] || '').trim() || undefined;
1094
- const line = content.substring(0, match.index).split('\n').length;
1095
- const isAsync = content.substring(match.index - 20, match.index).includes('async');
1096
- const isExported = content.substring(match.index - 20, match.index).includes('export');
1097
- functions.push({
1098
- name,
1099
- line,
1100
- parameters: params,
1101
- returnType,
1102
- isAsync,
1103
- isExported,
1104
- complexity: 1,
1105
- });
1106
- }
1107
- // Arrow functions
1108
- const arrowRegex = /(?:export\s+)?(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s+)?\(?([^)=]*)\)?\s*(?::\s*([^=]+))?\s*=>/g;
1109
- while ((match = arrowRegex.exec(content)) !== null) {
1110
- const name = match[1] || '';
1111
- const params = (match[2] || '').split(',').map((p) => p.trim().split(':')[0]?.trim() ?? '').filter(Boolean);
1112
- const returnType = (match[3] || '').trim() || undefined;
1113
- const line = content.substring(0, match.index).split('\n').length;
1114
- const isAsync = content.substring(match.index, match.index + 50).includes('async');
1115
- const isExported = content.substring(match.index - 20, match.index).includes('export');
1116
- functions.push({
1117
- name,
1118
- line,
1119
- parameters: params,
1120
- returnType,
1121
- isAsync,
1122
- isExported,
1123
- complexity: 1,
1124
- });
1125
- }
1126
- }
1127
- else if (ext === '.py') {
1128
- const defRegex = /(?:async\s+)?def\s+(\w+)\s*\(([^)]*)\)(?:\s*->\s*([^:]+))?\s*:/g;
1129
- let match;
1130
- while ((match = defRegex.exec(content)) !== null) {
1131
- const name = match[1] ?? '';
1132
- const params = (match[2] ?? '')
1133
- .split(',')
1134
- .map((p) => (p.trim().split(':')[0]?.split('=')[0]?.trim()) ?? '')
1135
- .filter((p) => p && p !== 'self' && p !== 'cls');
1136
- const returnType = (match[3] || '').trim() || undefined;
1137
- const line = content.substring(0, match.index).split('\n').length;
1138
- const isAsync = content.substring(match.index - 10, match.index).includes('async');
1139
- functions.push({
1140
- name,
1141
- line,
1142
- parameters: params,
1143
- returnType,
1144
- isAsync,
1145
- isExported: !name.startsWith('_'),
1146
- complexity: 1,
1147
- });
1148
- }
1149
- }
1150
- return functions;
1151
- }
1152
- function extractClasses(content, ext) {
1153
- const classes = [];
1154
- if (['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'].includes(ext)) {
1155
- const classRegex = /(?:export\s+)?class\s+(\w+)(?:\s+extends\s+(\w+))?(?:\s+implements\s+([^{]+))?\s*\{/g;
1156
- let match;
1157
- while ((match = classRegex.exec(content)) !== null) {
1158
- const name = match[1] || '';
1159
- const line = content.substring(0, match.index).split('\n').length;
1160
- const extendsClass = match[2];
1161
- const implementsList = match[3]
1162
- ? match[3]
1163
- .split(',')
1164
- .map((s) => s.trim())
1165
- .filter(Boolean)
1166
- : undefined;
1167
- const isExported = content.substring(match.index - 20, match.index).includes('export');
1168
- // Find class body and extract methods/properties
1169
- const classStart = match.index + match[0].length;
1170
- let braceCount = 1;
1171
- let classEnd = classStart;
1172
- for (let i = classStart; i < content.length && braceCount > 0; i++) {
1173
- if (content[i] === '{')
1174
- braceCount++;
1175
- if (content[i] === '}')
1176
- braceCount--;
1177
- classEnd = i;
1178
- }
1179
- const classBody = content.substring(classStart, classEnd);
1180
- const methods = [];
1181
- const properties = [];
1182
- // Extract methods
1183
- const methodRegex = /(?:async\s+)?(?:public|private|protected)?\s*(\w+)\s*\([^)]*\)/g;
1184
- let methodMatch;
1185
- while ((methodMatch = methodRegex.exec(classBody)) !== null) {
1186
- if (methodMatch[1] && methodMatch[1] !== 'constructor') {
1187
- methods.push(methodMatch[1]);
1188
- }
1189
- }
1190
- // Extract properties
1191
- const propRegex = /(?:public|private|protected|readonly)?\s+(\w+)\s*[:=]/g;
1192
- let propMatch;
1193
- while ((propMatch = propRegex.exec(classBody)) !== null) {
1194
- if (propMatch[1]) {
1195
- properties.push(propMatch[1]);
1196
- }
1197
- }
1198
- classes.push({
1199
- name,
1200
- line,
1201
- methods,
1202
- properties,
1203
- extends: extendsClass,
1204
- implements: implementsList,
1205
- isExported,
1206
- });
1207
- }
1208
- }
1209
- else if (ext === '.py') {
1210
- const classRegex = /class\s+(\w+)(?:\s*\(([^)]*)\))?\s*:/g;
1211
- let match;
1212
- while ((match = classRegex.exec(content)) !== null) {
1213
- const name = match[1] || '';
1214
- const line = content.substring(0, match.index).split('\n').length;
1215
- const parentClasses = match[2]
1216
- ? match[2]
1217
- .split(',')
1218
- .map((s) => s.trim())
1219
- .filter(Boolean)
1220
- : [];
1221
- classes.push({
1222
- name,
1223
- line,
1224
- methods: [],
1225
- properties: [],
1226
- extends: parentClasses[0],
1227
- implements: parentClasses.slice(1),
1228
- isExported: !name.startsWith('_'),
1229
- });
1230
- }
1231
- }
1232
- return classes;
1233
- }
1234
- function detectCodePatterns(content, _ext) {
1235
- const patterns = [];
1236
- // Common patterns detection
1237
- if (/async\s+function|async\s+\(|await\s+/.test(content)) {
1238
- patterns.push('Async/Await');
1239
- }
1240
- if (/Promise\.all|Promise\.race|Promise\.allSettled/.test(content)) {
1241
- patterns.push('Promise Combinators');
1242
- }
1243
- if (/try\s*\{[\s\S]*?\}\s*catch/.test(content)) {
1244
- patterns.push('Try-Catch Error Handling');
1245
- }
1246
- if (/\.map\s*\(|\.filter\s*\(|\.reduce\s*\(/.test(content)) {
1247
- patterns.push('Functional Array Methods');
1248
- }
1249
- if (/Object\.freeze|Object\.seal|readonly\s+/.test(content)) {
1250
- patterns.push('Immutability');
1251
- }
1252
- if (/interface\s+\w+|type\s+\w+\s*=/.test(content)) {
1253
- patterns.push('TypeScript Types');
1254
- }
1255
- if (/\bclass\s+\w+/.test(content)) {
1256
- patterns.push('Object-Oriented');
1257
- }
1258
- if (/export\s+default|export\s+\{|module\.exports/.test(content)) {
1259
- patterns.push('Module Pattern');
1260
- }
1261
- if (/\.test\(|\.spec\.|describe\s*\(|it\s*\(|expect\s*\(/.test(content)) {
1262
- patterns.push('Testing');
1263
- }
1264
- if (/console\.(log|error|warn|debug)/.test(content)) {
1265
- patterns.push('Console Logging');
1266
- }
1267
- if (/@decorator|@\w+\s*\(|@\w+\s*\n/.test(content)) {
1268
- patterns.push('Decorators');
1269
- }
1270
- if (/useEffect|useState|useCallback|useMemo/.test(content)) {
1271
- patterns.push('React Hooks');
1272
- }
1273
- if (/createSlice|createReducer|createAction/.test(content)) {
1274
- patterns.push('Redux Toolkit');
1275
- }
1276
- return patterns;
1277
- }
1278
- function calculateComplexity(content) {
1279
- const lines = content.split('\n');
1280
- const linesOfCode = lines.filter((l) => l.trim() && !l.trim().startsWith('//')).length;
1281
- const linesOfComments = lines.filter((l) => l.trim().startsWith('//')).length;
1282
- // Simple cyclomatic complexity estimation
1283
- let cyclomaticComplexity = 1;
1284
- const controlFlowPatterns = /\bif\b|\belse\b|\bfor\b|\bwhile\b|\bcase\b|\bcatch\b|\b\?\s*:/g;
1285
- const matches = content.match(controlFlowPatterns);
1286
- if (matches) {
1287
- cyclomaticComplexity += matches.length;
1288
- }
1289
- // Cognitive complexity (simplified)
1290
- let cognitiveComplexity = cyclomaticComplexity;
1291
- const nestedPatterns = /\{\s*\{|\bif\b.*\bif\b/g;
1292
- const nestedMatches = content.match(nestedPatterns);
1293
- if (nestedMatches) {
1294
- cognitiveComplexity += nestedMatches.length * 2;
1295
- }
1296
- // Maintainability index (simplified, 0-100 scale)
1297
- const maintainabilityIndex = Math.max(0, Math.min(100, 171 - 5.2 * Math.log(linesOfCode + 1) - 0.23 * cyclomaticComplexity - 16.2 * Math.log(linesOfCode / (linesOfComments + 1) + 1)));
1298
- return {
1299
- cyclomaticComplexity,
1300
- cognitiveComplexity,
1301
- maintainabilityIndex: Math.round(maintainabilityIndex),
1302
- linesOfCode,
1303
- linesOfComments,
1304
- };
1305
- }
1306
- function inferFilePurpose(filename, _content, _imports, exports, functions, classes) {
1307
- const lower = filename.toLowerCase();
1308
- // Check filename patterns
1309
- if (lower.includes('test') || lower.includes('spec')) {
1310
- return 'Test file for unit/integration testing';
1311
- }
1312
- if (lower === 'index.ts' || lower === 'index.js') {
1313
- return 'Module entry point and public API exports';
1314
- }
1315
- if (lower.includes('config')) {
1316
- return 'Configuration settings and constants';
1317
- }
1318
- if (lower.includes('type') || lower.includes('interface')) {
1319
- return 'Type definitions and interfaces';
1320
- }
1321
- if (lower.includes('util') || lower.includes('helper')) {
1322
- return 'Utility functions and helpers';
1323
- }
1324
- if (lower.includes('hook')) {
1325
- return 'Custom React hooks';
1326
- }
1327
- if (lower.includes('context')) {
1328
- return 'React context provider';
1329
- }
1330
- if (lower.includes('store') || lower.includes('reducer')) {
1331
- return 'State management';
1332
- }
1333
- if (lower.includes('service')) {
1334
- return 'Business logic and service layer';
1335
- }
1336
- if (lower.includes('api') || lower.includes('client')) {
1337
- return 'API client and HTTP requests';
1338
- }
1339
- if (lower.includes('route')) {
1340
- return 'Route definitions and handlers';
1341
- }
1342
- if (lower.includes('middleware')) {
1343
- return 'Middleware functions';
1344
- }
1345
- if (lower.includes('model') || lower.includes('entity')) {
1346
- return 'Data models and entities';
1347
- }
1348
- if (lower.includes('schema')) {
1349
- return 'Schema definitions and validation';
1350
- }
1351
- if (lower.includes('component')) {
1352
- return 'UI component';
1353
- }
1354
- // Infer from content
1355
- if (classes.length > 0 && functions.length === 0) {
1356
- return `Class definitions: ${classes.map((c) => c.name).join(', ')}`;
1357
- }
1358
- if (functions.length > 0 && classes.length === 0) {
1359
- const exportedFuncs = functions.filter((f) => f.isExported);
1360
- if (exportedFuncs.length > 0) {
1361
- return `Function library: ${exportedFuncs.map((f) => f.name).slice(0, 3).join(', ')}${exportedFuncs.length > 3 ? '...' : ''}`;
1362
- }
1363
- }
1364
- if (exports.length > 0) {
1365
- return `Module exporting: ${exports.map((e) => e.name).slice(0, 3).join(', ')}${exports.length > 3 ? '...' : ''}`;
1366
- }
1367
- return 'General module';
1368
- }
1369
- function analyzeTopic(workingDir, topic, maxFiles, maxExamples) {
1370
- const topicLower = topic.toLowerCase();
1371
- const relevantFiles = [];
1372
- const patterns = new Map();
1373
- const examples = [];
1374
- // Keywords to search for based on topic
1375
- const keywords = generateTopicKeywords(topicLower);
1376
- // Search through files
1377
- const allFiles = collectAllFiles(workingDir, 4);
1378
- for (const filePath of allFiles) {
1379
- try {
1380
- const content = readFileSync(filePath, 'utf-8');
1381
- const lines = content.split('\n');
1382
- const relPath = relative(workingDir, filePath);
1383
- // Calculate relevance score
1384
- let relevance = 0;
1385
- const snippets = [];
1386
- for (const keyword of keywords) {
1387
- const regex = new RegExp(keyword, 'gi');
1388
- const matches = content.match(regex);
1389
- if (matches) {
1390
- relevance += matches.length;
1391
- // Find snippets containing the keyword
1392
- for (let i = 0; i < lines.length && snippets.length < 3; i++) {
1393
- if (lines[i]?.toLowerCase().includes(keyword)) {
1394
- const snippet = lines.slice(Math.max(0, i - 1), Math.min(lines.length, i + 3)).join('\n');
1395
- if (!snippets.includes(snippet)) {
1396
- snippets.push(snippet);
1397
- // Add to patterns
1398
- const patternName = identifyPattern(lines[i] ?? '', keyword);
1399
- if (patternName) {
1400
- const existing = patterns.get(patternName) || { count: 0, locations: [] };
1401
- existing.count++;
1402
- if (!existing.locations.includes(relPath)) {
1403
- existing.locations.push(relPath);
1404
- }
1405
- patterns.set(patternName, existing);
1406
- }
1407
- // Add to examples
1408
- if (examples.length < maxExamples) {
1409
- examples.push({
1410
- file: relPath,
1411
- line: i + 1,
1412
- code: snippet,
1413
- explanation: `Example of ${topic} usage`,
1414
- });
1415
- }
1416
- }
1417
- }
1418
- }
1419
- }
1420
- }
1421
- if (relevance > 0) {
1422
- relevantFiles.push({
1423
- path: relPath,
1424
- relevance,
1425
- snippets,
1426
- });
1427
- }
1428
- }
1429
- catch {
1430
- // Skip files we can't read
1431
- }
1432
- }
1433
- // Sort by relevance and limit
1434
- relevantFiles.sort((a, b) => b.relevance - a.relevance);
1435
- const topFiles = relevantFiles.slice(0, maxFiles);
1436
- // Convert patterns map to array
1437
- const topicPatterns = Array.from(patterns.entries())
1438
- .map(([name, data]) => ({
1439
- name,
1440
- occurrences: data.count,
1441
- locations: data.locations,
1442
- }))
1443
- .sort((a, b) => b.occurrences - a.occurrences);
1444
- // Generate summary
1445
- const summary = generateTopicSummary(topic, topFiles, topicPatterns, examples);
1446
- return {
1447
- topic,
1448
- relevantFiles: topFiles,
1449
- patterns: topicPatterns,
1450
- examples: examples.slice(0, maxExamples),
1451
- summary,
1452
- };
1453
- }
1454
- function generateTopicKeywords(topic) {
1455
- const keywords = [topic];
1456
- // Add related keywords
1457
- const relatedKeywords = {
1458
- auth: ['authentication', 'authorize', 'login', 'logout', 'session', 'token', 'jwt', 'oauth', 'passport'],
1459
- error: ['error', 'exception', 'catch', 'throw', 'try', 'finally', 'fail', 'handle'],
1460
- api: ['api', 'route', 'endpoint', 'handler', 'request', 'response', 'http', 'rest', 'graphql'],
1461
- test: ['test', 'spec', 'describe', 'it', 'expect', 'mock', 'jest', 'vitest', 'pytest'],
1462
- database: ['database', 'db', 'sql', 'query', 'model', 'schema', 'migration', 'orm', 'prisma', 'mongoose'],
1463
- validation: ['validate', 'validation', 'schema', 'zod', 'yup', 'joi', 'check', 'verify'],
1464
- state: ['state', 'store', 'reducer', 'action', 'dispatch', 'context', 'redux', 'zustand', 'recoil'],
1465
- cache: ['cache', 'memoize', 'memo', 'redis', 'memcached', 'ttl', 'invalidate'],
1466
- logging: ['log', 'logger', 'logging', 'debug', 'trace', 'info', 'warn', 'error', 'console'],
1467
- config: ['config', 'configuration', 'settings', 'env', 'environment', 'options'],
1468
- };
1469
- for (const [key, related] of Object.entries(relatedKeywords)) {
1470
- if (topic.includes(key)) {
1471
- keywords.push(...related);
1472
- }
1473
- }
1474
- return [...new Set(keywords)];
1475
- }
1476
- function identifyPattern(line, _keyword) {
1477
- const lower = line.toLowerCase();
1478
- if (lower.includes('try') && lower.includes('catch'))
1479
- return 'Try-Catch Pattern';
1480
- if (lower.includes('async') && lower.includes('await'))
1481
- return 'Async/Await Pattern';
1482
- if (lower.includes('export') && lower.includes('default'))
1483
- return 'Default Export';
1484
- if (lower.includes('import') && lower.includes('from'))
1485
- return 'ES6 Import';
1486
- if (lower.includes('class') && lower.includes('extends'))
1487
- return 'Class Inheritance';
1488
- if (lower.includes('interface') || lower.includes('type'))
1489
- return 'Type Definition';
1490
- if (/\.(map|filter|reduce)\s*\(/.test(lower))
1491
- return 'Functional Methods';
1492
- if (lower.includes('usestate') || lower.includes('useeffect'))
1493
- return 'React Hooks';
1494
- if (lower.includes('describe') && lower.includes('it'))
1495
- return 'Test Structure';
1496
- return null;
1497
- }
1498
- function generateTopicSummary(topic, files, patterns, examples) {
1499
- const parts = [];
1500
- parts.push(`Analysis of "${topic}" in this codebase:\n`);
1501
- if (files.length === 0) {
1502
- parts.push(`No files found directly related to "${topic}". Consider searching for related terms.`);
1503
- }
1504
- else {
1505
- parts.push(`Found ${files.length} relevant file(s).`);
1506
- if (patterns.length > 0) {
1507
- parts.push(`\nDetected patterns:`);
1508
- for (const pattern of patterns.slice(0, 5)) {
1509
- parts.push(`- ${pattern.name}: ${pattern.occurrences} occurrence(s)`);
1510
- }
1511
- }
1512
- if (examples.length > 0) {
1513
- parts.push(`\n${examples.length} code example(s) available.`);
1514
- }
1515
- parts.push(`\nMost relevant files:`);
1516
- for (const file of files.slice(0, 5)) {
1517
- parts.push(`- ${file.path} (relevance: ${file.relevance})`);
1518
- }
1519
- }
1520
- return parts.join('\n');
1521
- }
1522
- function collectAllFiles(dir, maxDepth, depth = 0) {
1523
- const files = [];
1524
- if (depth >= maxDepth)
1525
- return files;
1526
- try {
1527
- const entries = readdirSync(dir, { withFileTypes: true });
1528
- for (const entry of entries) {
1529
- if (entry.name.startsWith('.') || IGNORED_DIRS.has(entry.name)) {
1530
- continue;
1531
- }
1532
- const fullPath = join(dir, entry.name);
1533
- if (entry.isDirectory()) {
1534
- files.push(...collectAllFiles(fullPath, maxDepth, depth + 1));
1535
- }
1536
- else if (entry.isFile()) {
1537
- const ext = extname(entry.name).toLowerCase();
1538
- if (LANGUAGE_MAP[ext]) {
1539
- files.push(fullPath);
1540
- }
1541
- }
1542
- }
1543
- }
1544
- catch {
1545
- // Skip directories we can't read
1546
- }
1547
- return files;
1548
- }
1549
- // =====================================================
1550
- // Formatting Functions
1551
- // =====================================================
1552
- function formatCodebaseAnalysis(analysis) {
1553
- const output = [];
1554
- // Show analysis phases completed
1555
- output.push('# Codebase Analysis: ' + analysis.rootDir);
1556
- output.push('');
1557
- output.push('## Analysis Phases Completed');
1558
- output.push('✓ Directory structure traversal');
1559
- output.push('✓ File type detection and language breakdown');
1560
- output.push('✓ Architecture pattern detection');
1561
- output.push('✓ Configuration file analysis');
1562
- output.push('✓ Dependency analysis');
1563
- output.push('✓ Entry point identification');
1564
- output.push('✓ Component and layer mapping');
1565
- output.push('');
1566
- // Overview
1567
- output.push('## Overview');
1568
- output.push(`- Total files analyzed: ${analysis.totalFiles}`);
1569
- output.push(`- Total directories scanned: ${analysis.totalDirectories}`);
1570
- output.push(`- Patterns detected: ${analysis.patterns.length}`);
1571
- output.push(`- Config files found: ${analysis.configFiles.length}`);
1572
- output.push('');
1573
- // Languages
1574
- output.push('## Languages');
1575
- for (const lang of analysis.languages.slice(0, 10)) {
1576
- output.push(`- ${lang.language}: ${lang.fileCount} files (${lang.percentage.toFixed(1)}%)`);
1577
- }
1578
- output.push('');
1579
- // Architecture
1580
- output.push('## Architecture');
1581
- output.push(`- Type: ${analysis.architecture.type}`);
1582
- if (analysis.architecture.layers.length > 0) {
1583
- output.push(`- Layers: ${analysis.architecture.layers.join(', ')}`);
1584
- }
1585
- if (analysis.architecture.dataFlow.length > 0) {
1586
- output.push('- Data Flow:');
1587
- for (const flow of analysis.architecture.dataFlow) {
1588
- output.push(` - ${flow}`);
1589
- }
1590
- }
1591
- output.push('');
1592
- // Detected Patterns
1593
- if (analysis.patterns.length > 0) {
1594
- output.push('## Detected Patterns');
1595
- for (const pattern of analysis.patterns) {
1596
- output.push(`- **${pattern.name}** (${pattern.confidence} confidence)`);
1597
- output.push(` ${pattern.description}`);
1598
- }
1599
- output.push('');
1600
- }
1601
- // Key Components
1602
- if (analysis.architecture.components.length > 0) {
1603
- output.push('## Key Components');
1604
- for (const comp of analysis.architecture.components.slice(0, 15)) {
1605
- output.push(`- **${comp.name}** (${comp.type}): ${comp.path}`);
1606
- if (comp.responsibilities.length > 0) {
1607
- output.push(` Responsibilities: ${comp.responsibilities.join(', ')}`);
1608
- }
1609
- }
1610
- output.push('');
1611
- }
1612
- // Entry Points
1613
- if (analysis.entryPoints.length > 0) {
1614
- output.push('## Entry Points');
1615
- for (const entry of analysis.entryPoints) {
1616
- output.push(`- ${entry}`);
1617
- }
1618
- output.push('');
1619
- }
1620
- // Configuration Files
1621
- if (analysis.configFiles.length > 0) {
1622
- output.push('## Configuration Files');
1623
- for (const config of analysis.configFiles.slice(0, 10)) {
1624
- output.push(`- **${config.name}** (${config.type}): ${config.purpose}`);
1625
- }
1626
- output.push('');
1627
- }
1628
- // Dependencies
1629
- if (analysis.dependencies.hasDependencyFile) {
1630
- output.push('## Dependencies');
1631
- output.push(`- Package Manager: ${analysis.dependencies.packageManager || 'Unknown'}`);
1632
- if (analysis.dependencies.dependencies.length > 0) {
1633
- output.push(`- Dependencies: ${analysis.dependencies.dependencies.slice(0, 10).join(', ')}${analysis.dependencies.dependencies.length > 10 ? '...' : ''}`);
1634
- }
1635
- if (analysis.dependencies.devDependencies.length > 0) {
1636
- output.push(`- Dev Dependencies: ${analysis.dependencies.devDependencies.slice(0, 10).join(', ')}${analysis.dependencies.devDependencies.length > 10 ? '...' : ''}`);
1637
- }
1638
- output.push('');
1639
- }
1640
- // Directory Structure (simplified)
1641
- output.push('## Directory Structure');
1642
- output.push(formatDirectoryTree(analysis.structure, 0, 3));
1643
- return output.join('\n');
1644
- }
1645
- function formatDirectoryTree(node, depth, maxDepth) {
1646
- const indent = ' '.repeat(depth);
1647
- const lines = [];
1648
- if (node.type === 'directory') {
1649
- lines.push(`${indent}${node.name}/`);
1650
- if (node.children && depth < maxDepth) {
1651
- for (const child of node.children.slice(0, 15)) {
1652
- lines.push(formatDirectoryTree(child, depth + 1, maxDepth));
1653
- }
1654
- if (node.children.length > 15) {
1655
- lines.push(`${indent} ... (${node.children.length - 15} more)`);
1656
- }
1657
- }
1658
- }
1659
- else {
1660
- const langSuffix = node.language ? ` [${node.language}]` : '';
1661
- lines.push(`${indent}${node.name}${langSuffix}`);
1662
- }
1663
- return lines.join('\n');
1664
- }
1665
- function formatFileAnalysis(analysis) {
1666
- const output = [];
1667
- output.push(`# File Analysis: ${analysis.path}`);
1668
- output.push('');
1669
- // Overview
1670
- output.push('## Overview');
1671
- output.push(`- Language: ${analysis.language}`);
1672
- output.push(`- Lines: ${analysis.lineCount}`);
1673
- output.push(`- Size: ${(analysis.size / 1024).toFixed(2)} KB`);
1674
- output.push(`- Purpose: ${analysis.purpose}`);
1675
- output.push('');
1676
- // Complexity
1677
- output.push('## Complexity Metrics');
1678
- output.push(`- Cyclomatic Complexity: ${analysis.complexity.cyclomaticComplexity}`);
1679
- output.push(`- Cognitive Complexity: ${analysis.complexity.cognitiveComplexity}`);
1680
- output.push(`- Maintainability Index: ${analysis.complexity.maintainabilityIndex}/100`);
1681
- output.push(`- Lines of Code: ${analysis.complexity.linesOfCode}`);
1682
- output.push(`- Lines of Comments: ${analysis.complexity.linesOfComments}`);
1683
- output.push('');
1684
- // Imports
1685
- if (analysis.imports.length > 0) {
1686
- output.push('## Imports');
1687
- for (const imp of analysis.imports.slice(0, 15)) {
1688
- const type = imp.isRelative ? '(relative)' : '(external)';
1689
- output.push(`- ${imp.source} ${type}`);
1690
- if (imp.specifiers.length > 0) {
1691
- output.push(` Imports: ${imp.specifiers.join(', ')}`);
1692
- }
1693
- }
1694
- if (analysis.imports.length > 15) {
1695
- output.push(`- ... and ${analysis.imports.length - 15} more imports`);
1696
- }
1697
- output.push('');
1698
- }
1699
- // Exports
1700
- if (analysis.exports.length > 0) {
1701
- output.push('## Exports');
1702
- for (const exp of analysis.exports) {
1703
- output.push(`- ${exp.name} (${exp.type})`);
1704
- }
1705
- output.push('');
1706
- }
1707
- // Functions
1708
- if (analysis.functions.length > 0) {
1709
- output.push('## Functions');
1710
- for (const func of analysis.functions.slice(0, 20)) {
1711
- const async = func.isAsync ? 'async ' : '';
1712
- const exported = func.isExported ? 'export ' : '';
1713
- const params = func.parameters.join(', ');
1714
- const ret = func.returnType ? `: ${func.returnType}` : '';
1715
- output.push(`- Line ${func.line}: ${exported}${async}${func.name}(${params})${ret}`);
1716
- }
1717
- if (analysis.functions.length > 20) {
1718
- output.push(`- ... and ${analysis.functions.length - 20} more functions`);
1719
- }
1720
- output.push('');
1721
- }
1722
- // Classes
1723
- if (analysis.classes.length > 0) {
1724
- output.push('## Classes');
1725
- for (const cls of analysis.classes) {
1726
- const exported = cls.isExported ? 'export ' : '';
1727
- const ext = cls.extends ? ` extends ${cls.extends}` : '';
1728
- const impl = cls.implements?.length ? ` implements ${cls.implements.join(', ')}` : '';
1729
- output.push(`- Line ${cls.line}: ${exported}class ${cls.name}${ext}${impl}`);
1730
- if (cls.methods.length > 0) {
1731
- output.push(` Methods: ${cls.methods.join(', ')}`);
1732
- }
1733
- if (cls.properties.length > 0) {
1734
- output.push(` Properties: ${cls.properties.join(', ')}`);
1735
- }
1736
- }
1737
- output.push('');
1738
- }
1739
- // Patterns
1740
- if (analysis.patterns.length > 0) {
1741
- output.push('## Detected Patterns');
1742
- output.push(analysis.patterns.join(', '));
1743
- output.push('');
1744
- }
1745
- // Relationships
1746
- if (analysis.relationships.length > 0) {
1747
- output.push('## File Relationships');
1748
- for (const rel of analysis.relationships) {
1749
- output.push(`- ${rel.type}: ${rel.targetFile}`);
1750
- if (rel.symbols.length > 0) {
1751
- output.push(` Symbols: ${rel.symbols.join(', ')}`);
1752
- }
1753
- }
1754
- output.push('');
1755
- }
1756
- return output.join('\n');
1757
- }
1758
- function formatTopicAnalysis(analysis) {
1759
- const output = [];
1760
- output.push(`# Topic Analysis: "${analysis.topic}"`);
1761
- output.push('');
1762
- output.push(analysis.summary);
1763
- output.push('');
1764
- // Patterns
1765
- if (analysis.patterns.length > 0) {
1766
- output.push('## Patterns Found');
1767
- for (const pattern of analysis.patterns) {
1768
- output.push(`### ${pattern.name}`);
1769
- output.push(`- Occurrences: ${pattern.occurrences}`);
1770
- output.push(`- Found in: ${pattern.locations.slice(0, 5).join(', ')}${pattern.locations.length > 5 ? '...' : ''}`);
1771
- output.push('');
1772
- }
1773
- }
1774
- // Relevant Files
1775
- if (analysis.relevantFiles.length > 0) {
1776
- output.push('## Relevant Files');
1777
- for (const file of analysis.relevantFiles) {
1778
- output.push(`### ${file.path}`);
1779
- output.push(`Relevance Score: ${file.relevance}`);
1780
- if (file.snippets.length > 0) {
1781
- output.push('');
1782
- output.push('Relevant snippets:');
1783
- for (const snippet of file.snippets.slice(0, 2)) {
1784
- output.push('```');
1785
- output.push(snippet);
1786
- output.push('```');
1787
- }
1788
- }
1789
- output.push('');
1790
- }
1791
- }
1792
- // Code Examples
1793
- if (analysis.examples.length > 0) {
1794
- output.push('## Code Examples');
1795
- for (const example of analysis.examples) {
1796
- output.push(`### ${example.file}:${example.line}`);
1797
- output.push(example.explanation);
1798
- output.push('```');
1799
- output.push(example.code);
1800
- output.push('```');
1801
- output.push('');
1802
- }
1803
- }
1804
- return output.join('\n');
1805
- }
1806
- function formatLearningSummary(analysis, format, _focus) {
1807
- const output = [];
1808
- const isMarkdown = format === 'markdown';
1809
- const h1 = (text) => (isMarkdown ? `# ${text}` : text.toUpperCase());
1810
- const h2 = (text) => (isMarkdown ? `## ${text}` : `\n${text}`);
1811
- const bullet = isMarkdown ? '-' : '*';
1812
- output.push(h1('Codebase Learning Summary'));
1813
- output.push('');
1814
- // Quick Start
1815
- output.push(h2('Quick Start'));
1816
- output.push('');
1817
- const mainLang = analysis.languages[0];
1818
- if (mainLang) {
1819
- output.push(`This is primarily a **${mainLang.language}** project.`);
1820
- }
1821
- if (analysis.dependencies.packageManager) {
1822
- output.push(`Package manager: **${analysis.dependencies.packageManager}**`);
1823
- }
1824
- if (analysis.entryPoints.length > 0) {
1825
- output.push(`Main entry point: \`${analysis.entryPoints[0]}\``);
1826
- }
1827
- output.push('');
1828
- // Architecture Overview
1829
- output.push(h2('Architecture Overview'));
1830
- output.push('');
1831
- output.push(`Architecture Type: **${analysis.architecture.type}**`);
1832
- if (analysis.architecture.layers.length > 0) {
1833
- output.push(`Layers: ${analysis.architecture.layers.join(' → ')}`);
1834
- }
1835
- for (const flow of analysis.architecture.dataFlow) {
1836
- output.push(`${bullet} ${flow}`);
1837
- }
1838
- output.push('');
1839
- // Key Concepts
1840
- output.push(h2('Key Concepts'));
1841
- output.push('');
1842
- for (const pattern of analysis.patterns.slice(0, 5)) {
1843
- output.push(`${bullet} **${pattern.name}**: ${pattern.description}`);
1844
- }
1845
- output.push('');
1846
- // Important Files
1847
- output.push(h2('Important Files'));
1848
- output.push('');
1849
- for (const config of analysis.configFiles.slice(0, 5)) {
1850
- output.push(`${bullet} \`${config.path}\`: ${config.purpose}`);
1851
- }
1852
- if (analysis.entryPoints.length > 0) {
1853
- output.push('');
1854
- output.push('Entry points:');
1855
- for (const entry of analysis.entryPoints) {
1856
- output.push(`${bullet} \`${entry}\``);
1857
- }
1858
- }
1859
- output.push('');
1860
- // Directory Guide
1861
- output.push(h2('Directory Guide'));
1862
- output.push('');
1863
- for (const comp of analysis.architecture.components.slice(0, 10)) {
1864
- output.push(`${bullet} **${comp.name}/** (${comp.type})`);
1865
- if (comp.responsibilities.length > 0) {
1866
- output.push(` ${comp.responsibilities.slice(0, 2).join(', ')}`);
1867
- }
1868
- }
1869
- output.push('');
1870
- // Common Patterns
1871
- if (analysis.patterns.length > 0) {
1872
- output.push(h2('Common Patterns'));
1873
- output.push('');
1874
- for (const pattern of analysis.patterns.filter((p) => p.confidence === 'high').slice(0, 5)) {
1875
- output.push(`${bullet} **${pattern.name}**`);
1876
- for (const evidence of pattern.evidence.slice(0, 2)) {
1877
- output.push(` ${bullet} ${evidence}`);
1878
- }
1879
- }
1880
- output.push('');
1881
- }
1882
- // Development Workflow
1883
- output.push(h2('Development Workflow'));
1884
- output.push('');
1885
- const hasTest = analysis.configFiles.some((c) => c.type === 'testing');
1886
- const hasLint = analysis.configFiles.some((c) => c.type === 'linting');
1887
- const hasBundler = analysis.configFiles.some((c) => c.type === 'bundler');
1888
- if (analysis.dependencies.packageManager === 'npm') {
1889
- output.push('```bash');
1890
- output.push('# Install dependencies');
1891
- output.push('npm install');
1892
- output.push('');
1893
- if (hasBundler) {
1894
- output.push('# Build project');
1895
- output.push('npm run build');
1896
- output.push('');
1897
- }
1898
- if (hasTest) {
1899
- output.push('# Run tests');
1900
- output.push('npm test');
1901
- output.push('');
1902
- }
1903
- if (hasLint) {
1904
- output.push('# Lint code');
1905
- output.push('npm run lint');
1906
- }
1907
- output.push('```');
1908
- }
1909
- else if (analysis.dependencies.packageManager === 'pip') {
1910
- output.push('```bash');
1911
- output.push('# Install dependencies');
1912
- output.push('pip install -e .');
1913
- output.push('');
1914
- if (hasTest) {
1915
- output.push('# Run tests');
1916
- output.push('pytest');
1917
- }
1918
- output.push('```');
1919
- }
1920
- output.push('');
1921
- // Next Steps
1922
- output.push(h2('Suggested Next Steps'));
1923
- output.push('');
1924
- output.push(`1. Read the entry point: \`${analysis.entryPoints[0] || 'index file'}\``);
1925
- if (analysis.configFiles.some((c) => c.name === 'package.json')) {
1926
- output.push('2. Review `package.json` for available scripts');
1927
- }
1928
- output.push('3. Explore the main directories to understand the structure');
1929
- if (hasTest) {
1930
- output.push('4. Run the test suite to verify setup');
1931
- }
1932
- output.push('5. Use `learn_topic` to explore specific features');
1933
- return output.join('\n');
1934
- }
1935
- // =====================================================
1936
- // Utilities
1937
- // =====================================================
1938
- function resolveFilePath(workingDir, path) {
1939
- const normalized = path.trim();
1940
- return normalized.startsWith('/') ? normalized : join(workingDir, normalized);
1941
- }
1942
- //# sourceMappingURL=learnTools.js.map