erosolar-cli 1.7.195 → 1.7.196

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