mistagent 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +14 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/src/api/auth.d.ts +7 -0
  6. package/dist/src/api/auth.d.ts.map +1 -0
  7. package/dist/src/api/auth.js +16 -0
  8. package/dist/src/api/auth.js.map +1 -0
  9. package/dist/src/api/chat.d.ts +8 -0
  10. package/dist/src/api/chat.d.ts.map +1 -0
  11. package/dist/src/api/chat.js +14 -0
  12. package/dist/src/api/chat.js.map +1 -0
  13. package/dist/src/api/client.d.ts +22 -0
  14. package/dist/src/api/client.d.ts.map +1 -0
  15. package/dist/src/api/client.js +140 -0
  16. package/dist/src/api/client.js.map +1 -0
  17. package/dist/src/api/commands.d.ts +8 -0
  18. package/dist/src/api/commands.d.ts.map +1 -0
  19. package/dist/src/api/commands.js +13 -0
  20. package/dist/src/api/commands.js.map +1 -0
  21. package/dist/src/api/models.d.ts +9 -0
  22. package/dist/src/api/models.d.ts.map +1 -0
  23. package/dist/src/api/models.js +13 -0
  24. package/dist/src/api/models.js.map +1 -0
  25. package/dist/src/api/sessions.d.ts +25 -0
  26. package/dist/src/api/sessions.d.ts.map +1 -0
  27. package/dist/src/api/sessions.js +26 -0
  28. package/dist/src/api/sessions.js.map +1 -0
  29. package/dist/src/api/tools.d.ts +7 -0
  30. package/dist/src/api/tools.d.ts.map +1 -0
  31. package/dist/src/api/tools.js +8 -0
  32. package/dist/src/api/tools.js.map +1 -0
  33. package/dist/src/components/App.d.ts +22 -0
  34. package/dist/src/components/App.d.ts.map +1 -0
  35. package/dist/src/components/App.js +61 -0
  36. package/dist/src/components/App.js.map +1 -0
  37. package/dist/src/components/AppLayout.d.ts +8 -0
  38. package/dist/src/components/AppLayout.d.ts.map +1 -0
  39. package/dist/src/components/AppLayout.js +18 -0
  40. package/dist/src/components/AppLayout.js.map +1 -0
  41. package/dist/src/components/Composer.d.ts +8 -0
  42. package/dist/src/components/Composer.d.ts.map +1 -0
  43. package/dist/src/components/Composer.js +294 -0
  44. package/dist/src/components/Composer.js.map +1 -0
  45. package/dist/src/components/Footer.d.ts +10 -0
  46. package/dist/src/components/Footer.d.ts.map +1 -0
  47. package/dist/src/components/Footer.js +34 -0
  48. package/dist/src/components/Footer.js.map +1 -0
  49. package/dist/src/components/Header.d.ts +3 -0
  50. package/dist/src/components/Header.d.ts.map +1 -0
  51. package/dist/src/components/Header.js +99 -0
  52. package/dist/src/components/Header.js.map +1 -0
  53. package/dist/src/components/HistoryItemDisplay.d.ts +8 -0
  54. package/dist/src/components/HistoryItemDisplay.d.ts.map +1 -0
  55. package/dist/src/components/HistoryItemDisplay.js +32 -0
  56. package/dist/src/components/HistoryItemDisplay.js.map +1 -0
  57. package/dist/src/components/InputPrompt.d.ts +11 -0
  58. package/dist/src/components/InputPrompt.d.ts.map +1 -0
  59. package/dist/src/components/InputPrompt.js +12 -0
  60. package/dist/src/components/InputPrompt.js.map +1 -0
  61. package/dist/src/components/LoadingIndicator.d.ts +8 -0
  62. package/dist/src/components/LoadingIndicator.d.ts.map +1 -0
  63. package/dist/src/components/LoadingIndicator.js +17 -0
  64. package/dist/src/components/LoadingIndicator.js.map +1 -0
  65. package/dist/src/components/LoginPrompt.d.ts +8 -0
  66. package/dist/src/components/LoginPrompt.d.ts.map +1 -0
  67. package/dist/src/components/LoginPrompt.js +76 -0
  68. package/dist/src/components/LoginPrompt.js.map +1 -0
  69. package/dist/src/components/MainContent.d.ts +3 -0
  70. package/dist/src/components/MainContent.d.ts.map +1 -0
  71. package/dist/src/components/MainContent.js +22 -0
  72. package/dist/src/components/MainContent.js.map +1 -0
  73. package/dist/src/components/ModelPicker.d.ts +3 -0
  74. package/dist/src/components/ModelPicker.d.ts.map +1 -0
  75. package/dist/src/components/ModelPicker.js +119 -0
  76. package/dist/src/components/ModelPicker.js.map +1 -0
  77. package/dist/src/components/MultiLineInput.d.ts +19 -0
  78. package/dist/src/components/MultiLineInput.d.ts.map +1 -0
  79. package/dist/src/components/MultiLineInput.js +108 -0
  80. package/dist/src/components/MultiLineInput.js.map +1 -0
  81. package/dist/src/components/SessionPicker.d.ts +3 -0
  82. package/dist/src/components/SessionPicker.d.ts.map +1 -0
  83. package/dist/src/components/SessionPicker.js +131 -0
  84. package/dist/src/components/SessionPicker.js.map +1 -0
  85. package/dist/src/components/SuggestionsDisplay.d.ts +16 -0
  86. package/dist/src/components/SuggestionsDisplay.d.ts.map +1 -0
  87. package/dist/src/components/SuggestionsDisplay.js +34 -0
  88. package/dist/src/components/SuggestionsDisplay.js.map +1 -0
  89. package/dist/src/components/messages/AssistantMessage.d.ts +8 -0
  90. package/dist/src/components/messages/AssistantMessage.d.ts.map +1 -0
  91. package/dist/src/components/messages/AssistantMessage.js +9 -0
  92. package/dist/src/components/messages/AssistantMessage.js.map +1 -0
  93. package/dist/src/components/messages/CommandResult.d.ts +8 -0
  94. package/dist/src/components/messages/CommandResult.d.ts.map +1 -0
  95. package/dist/src/components/messages/CommandResult.js +7 -0
  96. package/dist/src/components/messages/CommandResult.js.map +1 -0
  97. package/dist/src/components/messages/ErrorMessage.d.ts +7 -0
  98. package/dist/src/components/messages/ErrorMessage.d.ts.map +1 -0
  99. package/dist/src/components/messages/ErrorMessage.js +7 -0
  100. package/dist/src/components/messages/ErrorMessage.js.map +1 -0
  101. package/dist/src/components/messages/InfoMessage.d.ts +9 -0
  102. package/dist/src/components/messages/InfoMessage.d.ts.map +1 -0
  103. package/dist/src/components/messages/InfoMessage.js +8 -0
  104. package/dist/src/components/messages/InfoMessage.js.map +1 -0
  105. package/dist/src/components/messages/ModelMessage.d.ts +8 -0
  106. package/dist/src/components/messages/ModelMessage.d.ts.map +1 -0
  107. package/dist/src/components/messages/ModelMessage.js +7 -0
  108. package/dist/src/components/messages/ModelMessage.js.map +1 -0
  109. package/dist/src/components/messages/SessionMessage.d.ts +8 -0
  110. package/dist/src/components/messages/SessionMessage.d.ts.map +1 -0
  111. package/dist/src/components/messages/SessionMessage.js +12 -0
  112. package/dist/src/components/messages/SessionMessage.js.map +1 -0
  113. package/dist/src/components/messages/ToolCallMessage.d.ts +9 -0
  114. package/dist/src/components/messages/ToolCallMessage.d.ts.map +1 -0
  115. package/dist/src/components/messages/ToolCallMessage.js +14 -0
  116. package/dist/src/components/messages/ToolCallMessage.js.map +1 -0
  117. package/dist/src/components/messages/UserMessage.d.ts +7 -0
  118. package/dist/src/components/messages/UserMessage.d.ts.map +1 -0
  119. package/dist/src/components/messages/UserMessage.js +9 -0
  120. package/dist/src/components/messages/UserMessage.js.map +1 -0
  121. package/dist/src/components/shared/HorizontalLine.d.ts +11 -0
  122. package/dist/src/components/shared/HorizontalLine.d.ts.map +1 -0
  123. package/dist/src/components/shared/HorizontalLine.js +10 -0
  124. package/dist/src/components/shared/HorizontalLine.js.map +1 -0
  125. package/dist/src/components/shared/MarkdownRenderer.d.ts +7 -0
  126. package/dist/src/components/shared/MarkdownRenderer.d.ts.map +1 -0
  127. package/dist/src/components/shared/MarkdownRenderer.js +33 -0
  128. package/dist/src/components/shared/MarkdownRenderer.js.map +1 -0
  129. package/dist/src/components/shared/Spinner.d.ts +8 -0
  130. package/dist/src/components/shared/Spinner.d.ts.map +1 -0
  131. package/dist/src/components/shared/Spinner.js +7 -0
  132. package/dist/src/components/shared/Spinner.js.map +1 -0
  133. package/dist/src/components/shared/TextInput.d.ts +10 -0
  134. package/dist/src/components/shared/TextInput.d.ts.map +1 -0
  135. package/dist/src/components/shared/TextInput.js +110 -0
  136. package/dist/src/components/shared/TextInput.js.map +1 -0
  137. package/dist/src/contexts/AppContext.d.ts +21 -0
  138. package/dist/src/contexts/AppContext.d.ts.map +1 -0
  139. package/dist/src/contexts/AppContext.js +16 -0
  140. package/dist/src/contexts/AppContext.js.map +1 -0
  141. package/dist/src/contexts/ChatContext.d.ts +68 -0
  142. package/dist/src/contexts/ChatContext.d.ts.map +1 -0
  143. package/dist/src/contexts/ChatContext.js +158 -0
  144. package/dist/src/contexts/ChatContext.js.map +1 -0
  145. package/dist/src/contexts/KeypressContext.d.ts +47 -0
  146. package/dist/src/contexts/KeypressContext.d.ts.map +1 -0
  147. package/dist/src/contexts/KeypressContext.js +792 -0
  148. package/dist/src/contexts/KeypressContext.js.map +1 -0
  149. package/dist/src/contexts/ModelContext.d.ts +20 -0
  150. package/dist/src/contexts/ModelContext.d.ts.map +1 -0
  151. package/dist/src/contexts/ModelContext.js +42 -0
  152. package/dist/src/contexts/ModelContext.js.map +1 -0
  153. package/dist/src/contexts/PasteContext.d.ts +8 -0
  154. package/dist/src/contexts/PasteContext.d.ts.map +1 -0
  155. package/dist/src/contexts/PasteContext.js +12 -0
  156. package/dist/src/contexts/PasteContext.js.map +1 -0
  157. package/dist/src/contexts/SessionContext.d.ts +19 -0
  158. package/dist/src/contexts/SessionContext.d.ts.map +1 -0
  159. package/dist/src/contexts/SessionContext.js +56 -0
  160. package/dist/src/contexts/SessionContext.js.map +1 -0
  161. package/dist/src/contexts/UIContext.d.ts +15 -0
  162. package/dist/src/contexts/UIContext.d.ts.map +1 -0
  163. package/dist/src/contexts/UIContext.js +16 -0
  164. package/dist/src/contexts/UIContext.js.map +1 -0
  165. package/dist/src/hooks/useChat.d.ts +11 -0
  166. package/dist/src/hooks/useChat.d.ts.map +1 -0
  167. package/dist/src/hooks/useChat.js +146 -0
  168. package/dist/src/hooks/useChat.js.map +1 -0
  169. package/dist/src/hooks/useFileCompletion.d.ts +8 -0
  170. package/dist/src/hooks/useFileCompletion.d.ts.map +1 -0
  171. package/dist/src/hooks/useFileCompletion.js +75 -0
  172. package/dist/src/hooks/useFileCompletion.js.map +1 -0
  173. package/dist/src/hooks/useInputHistory.d.ts +6 -0
  174. package/dist/src/hooks/useInputHistory.d.ts.map +1 -0
  175. package/dist/src/hooks/useInputHistory.js +46 -0
  176. package/dist/src/hooks/useInputHistory.js.map +1 -0
  177. package/dist/src/hooks/useKeypress.d.ts +16 -0
  178. package/dist/src/hooks/useKeypress.d.ts.map +1 -0
  179. package/dist/src/hooks/useKeypress.js +23 -0
  180. package/dist/src/hooks/useKeypress.js.map +1 -0
  181. package/dist/src/hooks/useLoadingIndicator.d.ts +5 -0
  182. package/dist/src/hooks/useLoadingIndicator.d.ts.map +1 -0
  183. package/dist/src/hooks/useLoadingIndicator.js +31 -0
  184. package/dist/src/hooks/useLoadingIndicator.js.map +1 -0
  185. package/dist/src/hooks/useMultiLineInput.d.ts +37 -0
  186. package/dist/src/hooks/useMultiLineInput.d.ts.map +1 -0
  187. package/dist/src/hooks/useMultiLineInput.js +202 -0
  188. package/dist/src/hooks/useMultiLineInput.js.map +1 -0
  189. package/dist/src/hooks/usePasteBuffer.d.ts +10 -0
  190. package/dist/src/hooks/usePasteBuffer.d.ts.map +1 -0
  191. package/dist/src/hooks/usePasteBuffer.js +90 -0
  192. package/dist/src/hooks/usePasteBuffer.js.map +1 -0
  193. package/dist/src/hooks/useSlashCommand.d.ts +6 -0
  194. package/dist/src/hooks/useSlashCommand.d.ts.map +1 -0
  195. package/dist/src/hooks/useSlashCommand.js +198 -0
  196. package/dist/src/hooks/useSlashCommand.js.map +1 -0
  197. package/dist/src/hooks/useStdinInterceptor.d.ts +2 -0
  198. package/dist/src/hooks/useStdinInterceptor.d.ts.map +1 -0
  199. package/dist/src/hooks/useStdinInterceptor.js +85 -0
  200. package/dist/src/hooks/useStdinInterceptor.js.map +1 -0
  201. package/dist/src/hooks/useSymbolCompletion.d.ts +10 -0
  202. package/dist/src/hooks/useSymbolCompletion.d.ts.map +1 -0
  203. package/dist/src/hooks/useSymbolCompletion.js +65 -0
  204. package/dist/src/hooks/useSymbolCompletion.js.map +1 -0
  205. package/dist/src/hooks/useTextBuffer.d.ts +37 -0
  206. package/dist/src/hooks/useTextBuffer.d.ts.map +1 -0
  207. package/dist/src/hooks/useTextBuffer.js +627 -0
  208. package/dist/src/hooks/useTextBuffer.js.map +1 -0
  209. package/dist/src/main.d.ts +2 -0
  210. package/dist/src/main.d.ts.map +1 -0
  211. package/dist/src/main.js +152 -0
  212. package/dist/src/main.js.map +1 -0
  213. package/dist/src/tools/code-analyzer/config/ignore-service.d.ts +2 -0
  214. package/dist/src/tools/code-analyzer/config/ignore-service.d.ts.map +1 -0
  215. package/dist/src/tools/code-analyzer/config/ignore-service.js +209 -0
  216. package/dist/src/tools/code-analyzer/config/ignore-service.js.map +1 -0
  217. package/dist/src/tools/code-analyzer/config/supported-languages.d.ts +13 -0
  218. package/dist/src/tools/code-analyzer/config/supported-languages.d.ts.map +1 -0
  219. package/dist/src/tools/code-analyzer/config/supported-languages.js +17 -0
  220. package/dist/src/tools/code-analyzer/config/supported-languages.js.map +1 -0
  221. package/dist/src/tools/code-analyzer/core/graph/graph.d.ts +3 -0
  222. package/dist/src/tools/code-analyzer/core/graph/graph.d.ts.map +1 -0
  223. package/dist/src/tools/code-analyzer/core/graph/graph.js +67 -0
  224. package/dist/src/tools/code-analyzer/core/graph/graph.js.map +1 -0
  225. package/dist/src/tools/code-analyzer/core/graph/types.d.ts +62 -0
  226. package/dist/src/tools/code-analyzer/core/graph/types.d.ts.map +1 -0
  227. package/dist/src/tools/code-analyzer/core/graph/types.js +2 -0
  228. package/dist/src/tools/code-analyzer/core/graph/types.js.map +1 -0
  229. package/dist/src/tools/code-analyzer/core/ingestion/ast-cache.d.ts +12 -0
  230. package/dist/src/tools/code-analyzer/core/ingestion/ast-cache.d.ts.map +1 -0
  231. package/dist/src/tools/code-analyzer/core/ingestion/ast-cache.js +35 -0
  232. package/dist/src/tools/code-analyzer/core/ingestion/ast-cache.js.map +1 -0
  233. package/dist/src/tools/code-analyzer/core/ingestion/call-processor.d.ts +16 -0
  234. package/dist/src/tools/code-analyzer/core/ingestion/call-processor.d.ts.map +1 -0
  235. package/dist/src/tools/code-analyzer/core/ingestion/call-processor.js +328 -0
  236. package/dist/src/tools/code-analyzer/core/ingestion/call-processor.js.map +1 -0
  237. package/dist/src/tools/code-analyzer/core/ingestion/community-processor.d.ts +40 -0
  238. package/dist/src/tools/code-analyzer/core/ingestion/community-processor.d.ts.map +1 -0
  239. package/dist/src/tools/code-analyzer/core/ingestion/community-processor.js +328 -0
  240. package/dist/src/tools/code-analyzer/core/ingestion/community-processor.js.map +1 -0
  241. package/dist/src/tools/code-analyzer/core/ingestion/entry-point-scoring.d.ts +40 -0
  242. package/dist/src/tools/code-analyzer/core/ingestion/entry-point-scoring.d.ts.map +1 -0
  243. package/dist/src/tools/code-analyzer/core/ingestion/entry-point-scoring.js +236 -0
  244. package/dist/src/tools/code-analyzer/core/ingestion/entry-point-scoring.js.map +1 -0
  245. package/dist/src/tools/code-analyzer/core/ingestion/filesystem-walker.d.ts +29 -0
  246. package/dist/src/tools/code-analyzer/core/ingestion/filesystem-walker.d.ts.map +1 -0
  247. package/dist/src/tools/code-analyzer/core/ingestion/filesystem-walker.js +81 -0
  248. package/dist/src/tools/code-analyzer/core/ingestion/filesystem-walker.js.map +1 -0
  249. package/dist/src/tools/code-analyzer/core/ingestion/framework-detection.d.ts +39 -0
  250. package/dist/src/tools/code-analyzer/core/ingestion/framework-detection.d.ts.map +1 -0
  251. package/dist/src/tools/code-analyzer/core/ingestion/framework-detection.js +184 -0
  252. package/dist/src/tools/code-analyzer/core/ingestion/framework-detection.js.map +1 -0
  253. package/dist/src/tools/code-analyzer/core/ingestion/heritage-processor.d.ts +21 -0
  254. package/dist/src/tools/code-analyzer/core/ingestion/heritage-processor.d.ts.map +1 -0
  255. package/dist/src/tools/code-analyzer/core/ingestion/heritage-processor.js +198 -0
  256. package/dist/src/tools/code-analyzer/core/ingestion/heritage-processor.js.map +1 -0
  257. package/dist/src/tools/code-analyzer/core/ingestion/import-processor.d.ts +39 -0
  258. package/dist/src/tools/code-analyzer/core/ingestion/import-processor.d.ts.map +1 -0
  259. package/dist/src/tools/code-analyzer/core/ingestion/import-processor.js +791 -0
  260. package/dist/src/tools/code-analyzer/core/ingestion/import-processor.js.map +1 -0
  261. package/dist/src/tools/code-analyzer/core/ingestion/parsing-processor.d.ts +16 -0
  262. package/dist/src/tools/code-analyzer/core/ingestion/parsing-processor.d.ts.map +1 -0
  263. package/dist/src/tools/code-analyzer/core/ingestion/parsing-processor.js +296 -0
  264. package/dist/src/tools/code-analyzer/core/ingestion/parsing-processor.js.map +1 -0
  265. package/dist/src/tools/code-analyzer/core/ingestion/pipeline.d.ts +3 -0
  266. package/dist/src/tools/code-analyzer/core/ingestion/pipeline.d.ts.map +1 -0
  267. package/dist/src/tools/code-analyzer/core/ingestion/pipeline.js +309 -0
  268. package/dist/src/tools/code-analyzer/core/ingestion/pipeline.js.map +1 -0
  269. package/dist/src/tools/code-analyzer/core/ingestion/process-processor.d.ts +52 -0
  270. package/dist/src/tools/code-analyzer/core/ingestion/process-processor.d.ts.map +1 -0
  271. package/dist/src/tools/code-analyzer/core/ingestion/process-processor.js +310 -0
  272. package/dist/src/tools/code-analyzer/core/ingestion/process-processor.js.map +1 -0
  273. package/dist/src/tools/code-analyzer/core/ingestion/structure-processor.d.ts +3 -0
  274. package/dist/src/tools/code-analyzer/core/ingestion/structure-processor.d.ts.map +1 -0
  275. package/dist/src/tools/code-analyzer/core/ingestion/structure-processor.js +37 -0
  276. package/dist/src/tools/code-analyzer/core/ingestion/structure-processor.js.map +1 -0
  277. package/dist/src/tools/code-analyzer/core/ingestion/symbol-table.d.ts +34 -0
  278. package/dist/src/tools/code-analyzer/core/ingestion/symbol-table.d.ts.map +1 -0
  279. package/dist/src/tools/code-analyzer/core/ingestion/symbol-table.js +39 -0
  280. package/dist/src/tools/code-analyzer/core/ingestion/symbol-table.js.map +1 -0
  281. package/dist/src/tools/code-analyzer/core/ingestion/tree-sitter-queries.d.ts +13 -0
  282. package/dist/src/tools/code-analyzer/core/ingestion/tree-sitter-queries.d.ts.map +1 -0
  283. package/dist/src/tools/code-analyzer/core/ingestion/tree-sitter-queries.js +355 -0
  284. package/dist/src/tools/code-analyzer/core/ingestion/tree-sitter-queries.js.map +1 -0
  285. package/dist/src/tools/code-analyzer/core/ingestion/utils.d.ts +11 -0
  286. package/dist/src/tools/code-analyzer/core/ingestion/utils.d.ts.map +1 -0
  287. package/dist/src/tools/code-analyzer/core/ingestion/utils.js +48 -0
  288. package/dist/src/tools/code-analyzer/core/ingestion/utils.js.map +1 -0
  289. package/dist/src/tools/code-analyzer/core/ingestion/workers/parse-worker.d.ts +59 -0
  290. package/dist/src/tools/code-analyzer/core/ingestion/workers/parse-worker.d.ts.map +1 -0
  291. package/dist/src/tools/code-analyzer/core/ingestion/workers/parse-worker.js +538 -0
  292. package/dist/src/tools/code-analyzer/core/ingestion/workers/parse-worker.js.map +1 -0
  293. package/dist/src/tools/code-analyzer/core/ingestion/workers/worker-pool.d.ts +17 -0
  294. package/dist/src/tools/code-analyzer/core/ingestion/workers/worker-pool.d.ts.map +1 -0
  295. package/dist/src/tools/code-analyzer/core/ingestion/workers/worker-pool.js +121 -0
  296. package/dist/src/tools/code-analyzer/core/ingestion/workers/worker-pool.js.map +1 -0
  297. package/dist/src/tools/code-analyzer/core/tree-sitter/parser-loader.d.ts +5 -0
  298. package/dist/src/tools/code-analyzer/core/tree-sitter/parser-loader.d.ts.map +1 -0
  299. package/dist/src/tools/code-analyzer/core/tree-sitter/parser-loader.js +45 -0
  300. package/dist/src/tools/code-analyzer/core/tree-sitter/parser-loader.js.map +1 -0
  301. package/dist/src/tools/code-analyzer/index.d.ts +17 -0
  302. package/dist/src/tools/code-analyzer/index.d.ts.map +1 -0
  303. package/dist/src/tools/code-analyzer/index.js +15 -0
  304. package/dist/src/tools/code-analyzer/index.js.map +1 -0
  305. package/dist/src/tools/code-analyzer/lib/utils.d.ts +2 -0
  306. package/dist/src/tools/code-analyzer/lib/utils.d.ts.map +1 -0
  307. package/dist/src/tools/code-analyzer/lib/utils.js +4 -0
  308. package/dist/src/tools/code-analyzer/lib/utils.js.map +1 -0
  309. package/dist/src/tools/code-analyzer/types/pipeline.d.ts +33 -0
  310. package/dist/src/tools/code-analyzer/types/pipeline.d.ts.map +1 -0
  311. package/dist/src/tools/code-analyzer/types/pipeline.js +19 -0
  312. package/dist/src/tools/code-analyzer/types/pipeline.js.map +1 -0
  313. package/dist/src/types/api.d.ts +124 -0
  314. package/dist/src/types/api.d.ts.map +1 -0
  315. package/dist/src/types/api.js +3 -0
  316. package/dist/src/types/api.js.map +1 -0
  317. package/dist/src/types/history.d.ts +49 -0
  318. package/dist/src/types/history.d.ts.map +1 -0
  319. package/dist/src/types/history.js +10 -0
  320. package/dist/src/types/history.js.map +1 -0
  321. package/dist/src/utils/colors.d.ts +40 -0
  322. package/dist/src/utils/colors.d.ts.map +1 -0
  323. package/dist/src/utils/colors.js +48 -0
  324. package/dist/src/utils/colors.js.map +1 -0
  325. package/dist/src/utils/config.d.ts +13 -0
  326. package/dist/src/utils/config.d.ts.map +1 -0
  327. package/dist/src/utils/config.js +74 -0
  328. package/dist/src/utils/config.js.map +1 -0
  329. package/dist/src/utils/constants.d.ts +8 -0
  330. package/dist/src/utils/constants.d.ts.map +1 -0
  331. package/dist/src/utils/constants.js +48 -0
  332. package/dist/src/utils/constants.js.map +1 -0
  333. package/dist/src/utils/fileRef.d.ts +26 -0
  334. package/dist/src/utils/fileRef.d.ts.map +1 -0
  335. package/dist/src/utils/fileRef.js +305 -0
  336. package/dist/src/utils/fileRef.js.map +1 -0
  337. package/dist/src/utils/formatters.d.ts +4 -0
  338. package/dist/src/utils/formatters.d.ts.map +1 -0
  339. package/dist/src/utils/formatters.js +18 -0
  340. package/dist/src/utils/formatters.js.map +1 -0
  341. package/dist/src/utils/pasteTransform.d.ts +37 -0
  342. package/dist/src/utils/pasteTransform.d.ts.map +1 -0
  343. package/dist/src/utils/pasteTransform.js +161 -0
  344. package/dist/src/utils/pasteTransform.js.map +1 -0
  345. package/dist/src/utils/pasteUtils.d.ts +7 -0
  346. package/dist/src/utils/pasteUtils.d.ts.map +1 -0
  347. package/dist/src/utils/pasteUtils.js +33 -0
  348. package/dist/src/utils/pasteUtils.js.map +1 -0
  349. package/dist/src/utils/textUtils.d.ts +25 -0
  350. package/dist/src/utils/textUtils.d.ts.map +1 -0
  351. package/dist/src/utils/textUtils.js +107 -0
  352. package/dist/src/utils/textUtils.js.map +1 -0
  353. package/package.json +71 -0
@@ -0,0 +1,310 @@
1
+ /**
2
+ * Process Detection Processor
3
+ *
4
+ * Detects execution flows (Processes) in the code graph by:
5
+ * 1. Finding entry points (functions with no internal callers)
6
+ * 2. Tracing forward via CALLS edges (BFS)
7
+ * 3. Grouping and deduplicating similar paths
8
+ * 4. Labeling with heuristic names
9
+ *
10
+ * Processes help agents understand how features work through the codebase.
11
+ */
12
+ import { calculateEntryPointScore, isTestFile } from './entry-point-scoring.js';
13
+ const isDev = process.env.NODE_ENV === 'development';
14
+ const DEFAULT_CONFIG = {
15
+ maxTraceDepth: 10,
16
+ maxBranching: 4,
17
+ maxProcesses: 75,
18
+ minSteps: 3, // 3+ steps = genuine multi-hop flow (2-step is just "A calls B")
19
+ };
20
+ // ============================================================================
21
+ // MAIN PROCESSOR
22
+ // ============================================================================
23
+ /**
24
+ * Detect processes (execution flows) in the knowledge graph
25
+ *
26
+ * This runs AFTER community detection, using CALLS edges to trace flows.
27
+ */
28
+ export const processProcesses = async (knowledgeGraph, memberships, onProgress, config = {}) => {
29
+ const cfg = { ...DEFAULT_CONFIG, ...config };
30
+ onProgress?.('Finding entry points...', 0);
31
+ // Build lookup maps
32
+ const membershipMap = new Map();
33
+ memberships.forEach(m => membershipMap.set(m.nodeId, m.communityId));
34
+ const callsEdges = buildCallsGraph(knowledgeGraph);
35
+ const reverseCallsEdges = buildReverseCallsGraph(knowledgeGraph);
36
+ const nodeMap = new Map();
37
+ for (const n of knowledgeGraph.iterNodes())
38
+ nodeMap.set(n.id, n);
39
+ // Step 1: Find entry points (functions that call others but have few callers)
40
+ const entryPoints = findEntryPoints(knowledgeGraph, reverseCallsEdges, callsEdges);
41
+ onProgress?.(`Found ${entryPoints.length} entry points, tracing flows...`, 20);
42
+ onProgress?.(`Found ${entryPoints.length} entry points, tracing flows...`, 20);
43
+ // Step 2: Trace processes from each entry point
44
+ const allTraces = [];
45
+ for (let i = 0; i < entryPoints.length && allTraces.length < cfg.maxProcesses * 2; i++) {
46
+ const entryId = entryPoints[i];
47
+ const traces = traceFromEntryPoint(entryId, callsEdges, cfg);
48
+ // Filter out traces that are too short
49
+ traces.filter(t => t.length >= cfg.minSteps).forEach(t => allTraces.push(t));
50
+ if (i % 10 === 0) {
51
+ onProgress?.(`Tracing entry point ${i + 1}/${entryPoints.length}...`, 20 + (i / entryPoints.length) * 40);
52
+ }
53
+ }
54
+ onProgress?.(`Found ${allTraces.length} traces, deduplicating...`, 60);
55
+ // Step 3: Deduplicate similar traces (subset removal)
56
+ const uniqueTraces = deduplicateTraces(allTraces);
57
+ // Step 3b: Deduplicate by entry+terminal pair (keep longest path per pair)
58
+ const endpointDeduped = deduplicateByEndpoints(uniqueTraces);
59
+ onProgress?.(`Deduped ${uniqueTraces.length} → ${endpointDeduped.length} unique endpoint pairs`, 70);
60
+ // Step 4: Limit to max processes (prioritize longer traces)
61
+ const limitedTraces = endpointDeduped
62
+ .sort((a, b) => b.length - a.length)
63
+ .slice(0, cfg.maxProcesses);
64
+ onProgress?.(`Creating ${limitedTraces.length} process nodes...`, 80);
65
+ // Step 5: Create process nodes
66
+ const processes = [];
67
+ const steps = [];
68
+ limitedTraces.forEach((trace, idx) => {
69
+ const entryPointId = trace[0];
70
+ const terminalId = trace[trace.length - 1];
71
+ // Get communities touched
72
+ const communitiesSet = new Set();
73
+ trace.forEach(nodeId => {
74
+ const comm = membershipMap.get(nodeId);
75
+ if (comm)
76
+ communitiesSet.add(comm);
77
+ });
78
+ const communities = Array.from(communitiesSet);
79
+ // Determine process type
80
+ const processType = communities.length > 1 ? 'cross_community' : 'intra_community';
81
+ // Generate label
82
+ const entryNode = nodeMap.get(entryPointId);
83
+ const terminalNode = nodeMap.get(terminalId);
84
+ const entryName = entryNode?.properties.name || 'Unknown';
85
+ const terminalName = terminalNode?.properties.name || 'Unknown';
86
+ const heuristicLabel = `${capitalize(entryName)} → ${capitalize(terminalName)}`;
87
+ const processId = `proc_${idx}_${sanitizeId(entryName)}`;
88
+ processes.push({
89
+ id: processId,
90
+ label: heuristicLabel,
91
+ heuristicLabel,
92
+ processType,
93
+ stepCount: trace.length,
94
+ communities,
95
+ entryPointId,
96
+ terminalId,
97
+ trace,
98
+ });
99
+ // Create step relationships
100
+ trace.forEach((nodeId, stepIdx) => {
101
+ steps.push({
102
+ nodeId,
103
+ processId,
104
+ step: stepIdx + 1, // 1-indexed
105
+ });
106
+ });
107
+ });
108
+ onProgress?.('Process detection complete!', 100);
109
+ // Calculate stats
110
+ const crossCommunityCount = processes.filter(p => p.processType === 'cross_community').length;
111
+ const avgStepCount = processes.length > 0
112
+ ? processes.reduce((sum, p) => sum + p.stepCount, 0) / processes.length
113
+ : 0;
114
+ return {
115
+ processes,
116
+ steps,
117
+ stats: {
118
+ totalProcesses: processes.length,
119
+ crossCommunityCount,
120
+ avgStepCount: Math.round(avgStepCount * 10) / 10,
121
+ entryPointsFound: entryPoints.length,
122
+ },
123
+ };
124
+ };
125
+ /**
126
+ * Minimum edge confidence for process tracing.
127
+ * Filters out ambiguous fuzzy-global matches (0.3) that cause
128
+ * traces to jump across unrelated code areas.
129
+ */
130
+ const MIN_TRACE_CONFIDENCE = 0.5;
131
+ const buildCallsGraph = (graph) => {
132
+ const adj = new Map();
133
+ for (const rel of graph.iterRelationships()) {
134
+ if (rel.type === 'CALLS' && rel.confidence >= MIN_TRACE_CONFIDENCE) {
135
+ if (!adj.has(rel.sourceId)) {
136
+ adj.set(rel.sourceId, []);
137
+ }
138
+ adj.get(rel.sourceId).push(rel.targetId);
139
+ }
140
+ }
141
+ return adj;
142
+ };
143
+ const buildReverseCallsGraph = (graph) => {
144
+ const adj = new Map();
145
+ for (const rel of graph.iterRelationships()) {
146
+ if (rel.type === 'CALLS' && rel.confidence >= MIN_TRACE_CONFIDENCE) {
147
+ if (!adj.has(rel.targetId)) {
148
+ adj.set(rel.targetId, []);
149
+ }
150
+ adj.get(rel.targetId).push(rel.sourceId);
151
+ }
152
+ }
153
+ return adj;
154
+ };
155
+ /**
156
+ * Find functions/methods that are good entry points for tracing.
157
+ *
158
+ * Entry points are scored based on:
159
+ * 1. Call ratio (calls many, called by few)
160
+ * 2. Export status (exported/public functions rank higher)
161
+ * 3. Name patterns (handle*, on*, *Controller, etc.)
162
+ *
163
+ * Test files are excluded entirely.
164
+ */
165
+ const findEntryPoints = (graph, reverseCallsEdges, callsEdges) => {
166
+ const symbolTypes = new Set(['Function', 'Method']);
167
+ const entryPointCandidates = [];
168
+ for (const node of graph.iterNodes()) {
169
+ if (!symbolTypes.has(node.label))
170
+ continue;
171
+ const filePath = node.properties.filePath || '';
172
+ // Skip test files entirely
173
+ if (isTestFile(filePath))
174
+ continue;
175
+ const callers = reverseCallsEdges.get(node.id) || [];
176
+ const callees = callsEdges.get(node.id) || [];
177
+ // Must have at least 1 outgoing call to trace forward
178
+ if (callees.length === 0)
179
+ continue;
180
+ // Calculate entry point score using new scoring system
181
+ const { score, reasons } = calculateEntryPointScore(node.properties.name, node.properties.language || 'javascript', node.properties.isExported ?? false, callers.length, callees.length, filePath // Pass filePath for framework detection
182
+ );
183
+ if (score > 0) {
184
+ entryPointCandidates.push({ id: node.id, score, reasons });
185
+ }
186
+ }
187
+ // Sort by score descending and return top candidates
188
+ const sorted = entryPointCandidates.sort((a, b) => b.score - a.score);
189
+ // DEBUG: Log top candidates with new scoring details
190
+ if (sorted.length > 0 && isDev) {
191
+ console.log(`[Process] Top 10 entry point candidates (new scoring):`);
192
+ sorted.slice(0, 10).forEach((c, i) => {
193
+ const node = graph.getNode(c.id);
194
+ const exported = node?.properties.isExported ? '✓' : '✗';
195
+ const shortPath = node?.properties.filePath?.split('/').slice(-2).join('/') || '';
196
+ console.log(` ${i + 1}. ${node?.properties.name} [exported:${exported}] (${shortPath})`);
197
+ console.log(` score: ${c.score.toFixed(2)} = [${c.reasons.join(' × ')}]`);
198
+ });
199
+ }
200
+ return sorted
201
+ .slice(0, 200) // Limit to prevent explosion
202
+ .map(c => c.id);
203
+ };
204
+ // ============================================================================
205
+ // HELPER: Trace from entry point (BFS)
206
+ // ============================================================================
207
+ /**
208
+ * Trace forward from an entry point using BFS.
209
+ * Returns all distinct paths up to maxDepth.
210
+ */
211
+ const traceFromEntryPoint = (entryId, callsEdges, config) => {
212
+ const traces = [];
213
+ // BFS with path tracking
214
+ // Each queue item: [currentNodeId, pathSoFar]
215
+ const queue = [[entryId, [entryId]]];
216
+ const visited = new Set();
217
+ while (queue.length > 0 && traces.length < config.maxBranching * 3) {
218
+ const [currentId, path] = queue.shift();
219
+ // Get outgoing calls
220
+ const callees = callsEdges.get(currentId) || [];
221
+ if (callees.length === 0) {
222
+ // Terminal node - this is a complete trace
223
+ if (path.length >= config.minSteps) {
224
+ traces.push([...path]);
225
+ }
226
+ }
227
+ else if (path.length >= config.maxTraceDepth) {
228
+ // Max depth reached - save what we have
229
+ if (path.length >= config.minSteps) {
230
+ traces.push([...path]);
231
+ }
232
+ }
233
+ else {
234
+ // Continue tracing - limit branching
235
+ const limitedCallees = callees.slice(0, config.maxBranching);
236
+ let addedBranch = false;
237
+ for (const calleeId of limitedCallees) {
238
+ // Avoid cycles
239
+ if (!path.includes(calleeId)) {
240
+ queue.push([calleeId, [...path, calleeId]]);
241
+ addedBranch = true;
242
+ }
243
+ }
244
+ // If all branches were cycles, save current path as terminal
245
+ if (!addedBranch && path.length >= config.minSteps) {
246
+ traces.push([...path]);
247
+ }
248
+ }
249
+ }
250
+ return traces;
251
+ };
252
+ // ============================================================================
253
+ // HELPER: Deduplicate traces
254
+ // ============================================================================
255
+ /**
256
+ * Merge traces that are subsets of other traces.
257
+ * Keep longer traces, remove redundant shorter ones.
258
+ */
259
+ const deduplicateTraces = (traces) => {
260
+ if (traces.length === 0)
261
+ return [];
262
+ // Sort by length descending
263
+ const sorted = [...traces].sort((a, b) => b.length - a.length);
264
+ const unique = [];
265
+ for (const trace of sorted) {
266
+ // Check if this trace is a subset of any already-added trace
267
+ const traceKey = trace.join('->');
268
+ const isSubset = unique.some(existing => {
269
+ const existingKey = existing.join('->');
270
+ return existingKey.includes(traceKey);
271
+ });
272
+ if (!isSubset) {
273
+ unique.push(trace);
274
+ }
275
+ }
276
+ return unique;
277
+ };
278
+ // ============================================================================
279
+ // HELPER: Deduplicate by entry+terminal endpoints
280
+ // ============================================================================
281
+ /**
282
+ * Keep only the longest trace per unique entry→terminal pair.
283
+ * Multiple paths between the same two endpoints are redundant for agents.
284
+ */
285
+ const deduplicateByEndpoints = (traces) => {
286
+ if (traces.length === 0)
287
+ return [];
288
+ const byEndpoints = new Map();
289
+ // Sort longest first so the first seen per key is the longest
290
+ const sorted = [...traces].sort((a, b) => b.length - a.length);
291
+ for (const trace of sorted) {
292
+ const key = `${trace[0]}::${trace[trace.length - 1]}`;
293
+ if (!byEndpoints.has(key)) {
294
+ byEndpoints.set(key, trace);
295
+ }
296
+ }
297
+ return Array.from(byEndpoints.values());
298
+ };
299
+ // ============================================================================
300
+ // HELPER: String utilities
301
+ // ============================================================================
302
+ const capitalize = (s) => {
303
+ if (!s)
304
+ return s;
305
+ return s.charAt(0).toUpperCase() + s.slice(1);
306
+ };
307
+ const sanitizeId = (s) => {
308
+ return s.replace(/[^a-zA-Z0-9]/g, '_').substring(0, 20).toLowerCase();
309
+ };
310
+ //# sourceMappingURL=process-processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-processor.js","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/ingestion/process-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEhF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAarD,MAAM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vC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACjB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,CAAS,EAAU,EAAE;IACvC,OAAO,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AACxE,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { KnowledgeGraph } from "../graph/types.js";
2
+ export declare const processStructure: (graph: KnowledgeGraph, paths: string[]) => void;
3
+ //# sourceMappingURL=structure-processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structure-processor.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/ingestion/structure-processor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAgC,MAAM,mBAAmB,CAAC;AAEjF,eAAO,MAAM,gBAAgB,GAAK,OAAO,cAAc,EAAE,OAAO,MAAM,EAAE,SA2CvE,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { generateId } from "../../lib/utils.js";
2
+ export const processStructure = (graph, paths) => {
3
+ paths.forEach(path => {
4
+ const parts = path.split('/');
5
+ let currentPath = '';
6
+ let parentId = '';
7
+ parts.forEach((part, index) => {
8
+ const isFile = index === parts.length - 1;
9
+ const label = isFile ? 'File' : 'Folder';
10
+ currentPath = currentPath ? `${currentPath}/${part}` : part;
11
+ const nodeId = generateId(label, currentPath);
12
+ const node = {
13
+ id: nodeId,
14
+ label: label,
15
+ properties: {
16
+ name: part,
17
+ filePath: currentPath
18
+ }
19
+ };
20
+ graph.addNode(node);
21
+ if (parentId) {
22
+ const relId = generateId('CONTAINS', `${parentId}->${nodeId}`);
23
+ const relationship = {
24
+ id: relId,
25
+ type: 'CONTAINS',
26
+ sourceId: parentId,
27
+ targetId: nodeId,
28
+ confidence: 1.0,
29
+ reason: '',
30
+ };
31
+ graph.addRelationship(relationship);
32
+ }
33
+ parentId = nodeId;
34
+ });
35
+ });
36
+ };
37
+ //# sourceMappingURL=structure-processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structure-processor.js","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/ingestion/structure-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAE,KAAqB,EAAE,KAAe,EAAC,EAAE;IACvE,KAAK,CAAC,OAAO,CAAE,IAAI,CAAC,EAAE;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC7B,IAAI,WAAW,GAAG,EAAE,CAAA;QACpB,IAAI,QAAQ,GAAG,EAAE,CAAA;QAEjB,KAAK,CAAC,OAAO,CAAE,CAAC,IAAI,EAAE,KAAK,EAAG,EAAE;YAC5B,MAAM,MAAM,GAAG,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;YACzC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;YAExC,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;YAE3D,MAAM,MAAM,GAAC,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;YAE3C,MAAM,IAAI,GAAc;gBACpB,EAAE,EAAE,MAAM;gBACV,KAAK,EAAE,KAAK;gBACZ,UAAU,EAAE;oBACR,IAAI,EAAE,IAAI;oBACV,QAAQ,EAAE,WAAW;iBACxB;aACJ,CAAA;YACD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAEnB,IAAG,QAAQ,EAAC,CAAC;gBACT,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,EAAE,GAAG,QAAQ,KAAK,MAAM,EAAE,CAAC,CAAA;gBAE9D,MAAM,YAAY,GAAoB;oBAClC,EAAE,EAAE,KAAK;oBACT,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE,QAAQ;oBAClB,QAAQ,EAAE,MAAM;oBAChB,UAAU,EAAE,GAAG;oBACf,MAAM,EAAE,EAAE;iBACb,CAAA;gBAED,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,CAAA;YACvC,CAAC;YAED,QAAQ,GAAG,MAAM,CAAA;QAErB,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC,CAAA"}
@@ -0,0 +1,34 @@
1
+ export interface SymbolDefinition {
2
+ nodeId: string;
3
+ filePath: string;
4
+ type: string;
5
+ }
6
+ export interface SymbolTable {
7
+ /**
8
+ * Register a new symbol definition
9
+ */
10
+ add: (filePath: string, name: string, nodeId: string, type: string) => void;
11
+ /**
12
+ * High Confidence: Look for a symbol specifically inside a file
13
+ * Returns the Node ID if found
14
+ */
15
+ lookupExact: (filePath: string, name: string) => string | undefined;
16
+ /**
17
+ * Low Confidence: Look for a symbol anywhere in the project
18
+ * Used when imports are missing or for framework magic
19
+ */
20
+ lookupFuzzy: (name: string) => SymbolDefinition[];
21
+ /**
22
+ * Debugging: See how many symbols are tracked
23
+ */
24
+ getStats: () => {
25
+ fileCount: number;
26
+ globalSymbolCount: number;
27
+ };
28
+ /**
29
+ * Cleanup memory
30
+ */
31
+ clear: () => void;
32
+ }
33
+ export declare const createSymbolTable: () => SymbolTable;
34
+ //# sourceMappingURL=symbol-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbol-table.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/ingestion/symbol-table.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,GAAG,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5E;;;OAGG;IACH,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAEpE;;;OAGG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,gBAAgB,EAAE,CAAC;IAElD;;OAEG;IACH,QAAQ,EAAE,MAAM;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAA;KAAE,CAAC;IAEjE;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,QAAO,WA4CpC,CAAC"}
@@ -0,0 +1,39 @@
1
+ export const createSymbolTable = () => {
2
+ // 1. File-Specific Index (The "Good" one)
3
+ // Structure: FilePath -> (SymbolName -> NodeID)
4
+ const fileIndex = new Map();
5
+ // 2. Global Reverse Index (The "Backup")
6
+ // Structure: SymbolName -> [List of Definitions]
7
+ const globalIndex = new Map();
8
+ const add = (filePath, name, nodeId, type) => {
9
+ // A. Add to File Index
10
+ if (!fileIndex.has(filePath)) {
11
+ fileIndex.set(filePath, new Map());
12
+ }
13
+ fileIndex.get(filePath).set(name, nodeId);
14
+ // B. Add to Global Index
15
+ if (!globalIndex.has(name)) {
16
+ globalIndex.set(name, []);
17
+ }
18
+ globalIndex.get(name).push({ nodeId, filePath, type });
19
+ };
20
+ const lookupExact = (filePath, name) => {
21
+ const fileSymbols = fileIndex.get(filePath);
22
+ if (!fileSymbols)
23
+ return undefined;
24
+ return fileSymbols.get(name);
25
+ };
26
+ const lookupFuzzy = (name) => {
27
+ return globalIndex.get(name) || [];
28
+ };
29
+ const getStats = () => ({
30
+ fileCount: fileIndex.size,
31
+ globalSymbolCount: globalIndex.size
32
+ });
33
+ const clear = () => {
34
+ fileIndex.clear();
35
+ globalIndex.clear();
36
+ };
37
+ return { add, lookupExact, lookupFuzzy, getStats, clear };
38
+ };
39
+ //# sourceMappingURL=symbol-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbol-table.js","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/ingestion/symbol-table.ts"],"names":[],"mappings":"AAmCA,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAgB,EAAE;IACjD,0CAA0C;IAC1C,gDAAgD;IAChD,MAAM,SAAS,GAAG,IAAI,GAAG,EAA+B,CAAC;IAEzD,yCAAyC;IACzC,iDAAiD;IACjD,MAAM,WAAW,GAAG,IAAI,GAAG,EAA8B,CAAC;IAE1D,MAAM,GAAG,GAAG,CAAC,QAAgB,EAAE,IAAY,EAAE,MAAc,EAAE,IAAY,EAAE,EAAE;QAC3E,uBAAuB;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QACrC,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAE3C,yBAAyB;QACzB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5B,CAAC;QACD,WAAW,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,IAAY,EAAsB,EAAE;QACzE,MAAM,WAAW,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,WAAW;YAAE,OAAO,SAAS,CAAC;QACnC,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,IAAY,EAAsB,EAAE;QACvD,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACrC,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,CAAC;QACtB,SAAS,EAAE,SAAS,CAAC,IAAI;QACzB,iBAAiB,EAAE,WAAW,CAAC,IAAI;KACpC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,SAAS,CAAC,KAAK,EAAE,CAAC;QAClB,WAAW,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC5D,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { SupportedLanguages } from '../../config/supported-languages.js';
2
+ export declare const TYPESCRIPT_QUERIES = "\n(class_declaration\n name: (type_identifier) @name) @definition.class\n\n(interface_declaration\n name: (type_identifier) @name) @definition.interface\n\n(function_declaration\n name: (identifier) @name) @definition.function\n\n(method_definition\n name: (property_identifier) @name) @definition.method\n\n(lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: (arrow_function))) @definition.function\n\n(lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: (function_expression))) @definition.function\n\n(export_statement\n declaration: (lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: (arrow_function)))) @definition.function\n\n(export_statement\n declaration: (lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: (function_expression)))) @definition.function\n\n(import_statement\n source: (string) @import.source) @import\n\n(call_expression\n function: (identifier) @call.name) @call\n\n(call_expression\n function: (member_expression\n property: (property_identifier) @call.name)) @call\n\n; Heritage queries - class extends\n(class_declaration\n name: (type_identifier) @heritage.class\n (class_heritage\n (extends_clause\n value: (identifier) @heritage.extends))) @heritage\n\n; Heritage queries - class implements interface\n(class_declaration\n name: (type_identifier) @heritage.class\n (class_heritage\n (implements_clause\n (type_identifier) @heritage.implements))) @heritage.impl\n";
3
+ export declare const JAVASCRIPT_QUERIES = "\n(class_declaration\n name: (identifier) @name) @definition.class\n\n(function_declaration\n name: (identifier) @name) @definition.function\n\n(method_definition\n name: (property_identifier) @name) @definition.method\n\n(lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: (arrow_function))) @definition.function\n\n(lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: (function_expression))) @definition.function\n\n(export_statement\n declaration: (lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: (arrow_function)))) @definition.function\n\n(export_statement\n declaration: (lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: (function_expression)))) @definition.function\n\n(import_statement\n source: (string) @import.source) @import\n\n(call_expression\n function: (identifier) @call.name) @call\n\n(call_expression\n function: (member_expression\n property: (property_identifier) @call.name)) @call\n\n; Heritage queries - class extends (JavaScript uses different AST than TypeScript)\n; In tree-sitter-javascript, class_heritage directly contains the parent identifier\n(class_declaration\n name: (identifier) @heritage.class\n (class_heritage\n (identifier) @heritage.extends)) @heritage\n";
4
+ export declare const PYTHON_QUERIES = "\n(class_definition\n name: (identifier) @name) @definition.class\n\n(function_definition\n name: (identifier) @name) @definition.function\n\n(import_statement\n name: (dotted_name) @import.source) @import\n\n(import_from_statement\n module_name: (dotted_name) @import.source) @import\n\n(call\n function: (identifier) @call.name) @call\n\n(call\n function: (attribute\n attribute: (identifier) @call.name)) @call\n\n; Heritage queries - Python class inheritance\n(class_definition\n name: (identifier) @heritage.class\n superclasses: (argument_list\n (identifier) @heritage.extends)) @heritage\n";
5
+ export declare const JAVA_QUERIES = "\n; Classes, Interfaces, Enums, Annotations\n(class_declaration name: (identifier) @name) @definition.class\n(interface_declaration name: (identifier) @name) @definition.interface\n(enum_declaration name: (identifier) @name) @definition.enum\n(annotation_type_declaration name: (identifier) @name) @definition.annotation\n\n; Methods & Constructors\n(method_declaration name: (identifier) @name) @definition.method\n(constructor_declaration name: (identifier) @name) @definition.constructor\n\n; Imports - capture any import declaration child as source\n(import_declaration (_) @import.source) @import\n\n; Calls\n(method_invocation name: (identifier) @call.name) @call\n(method_invocation object: (_) name: (identifier) @call.name) @call\n\n; Heritage - extends class\n(class_declaration name: (identifier) @heritage.class\n (superclass (type_identifier) @heritage.extends)) @heritage\n\n; Heritage - implements interfaces\n(class_declaration name: (identifier) @heritage.class\n (super_interfaces (type_list (type_identifier) @heritage.implements))) @heritage.impl\n";
6
+ export declare const C_QUERIES = "\n; Functions\n(function_definition declarator: (function_declarator declarator: (identifier) @name)) @definition.function\n(declaration declarator: (function_declarator declarator: (identifier) @name)) @definition.function\n\n; Structs, Unions, Enums, Typedefs\n(struct_specifier name: (type_identifier) @name) @definition.struct\n(union_specifier name: (type_identifier) @name) @definition.union\n(enum_specifier name: (type_identifier) @name) @definition.enum\n(type_definition declarator: (type_identifier) @name) @definition.typedef\n\n; Macros\n(preproc_function_def name: (identifier) @name) @definition.macro\n(preproc_def name: (identifier) @name) @definition.macro\n\n; Includes\n(preproc_include path: (_) @import.source) @import\n\n; Calls\n(call_expression function: (identifier) @call.name) @call\n(call_expression function: (field_expression field: (field_identifier) @call.name)) @call\n";
7
+ export declare const GO_QUERIES = "\n; Functions & Methods\n(function_declaration name: (identifier) @name) @definition.function\n(method_declaration name: (field_identifier) @name) @definition.method\n\n; Types\n(type_declaration (type_spec name: (type_identifier) @name type: (struct_type))) @definition.struct\n(type_declaration (type_spec name: (type_identifier) @name type: (interface_type))) @definition.interface\n(type_declaration (type_spec name: (type_identifier) @name)) @definition.type\n\n; Imports\n(import_declaration (import_spec path: (interpreted_string_literal) @import.source)) @import\n(import_declaration (import_spec_list (import_spec path: (interpreted_string_literal) @import.source))) @import\n\n; Calls\n(call_expression function: (identifier) @call.name) @call\n(call_expression function: (selector_expression field: (field_identifier) @call.name)) @call\n";
8
+ export declare const CPP_QUERIES = "\n; Classes, Structs, Namespaces\n(class_specifier name: (type_identifier) @name) @definition.class\n(struct_specifier name: (type_identifier) @name) @definition.struct\n(namespace_definition name: (namespace_identifier) @name) @definition.namespace\n(enum_specifier name: (type_identifier) @name) @definition.enum\n\n; Functions & Methods\n(function_definition declarator: (function_declarator declarator: (identifier) @name)) @definition.function\n(function_definition declarator: (function_declarator declarator: (qualified_identifier name: (identifier) @name))) @definition.method\n\n; Templates\n(template_declaration (class_specifier name: (type_identifier) @name)) @definition.template\n(template_declaration (function_definition declarator: (function_declarator declarator: (identifier) @name))) @definition.template\n\n; Includes\n(preproc_include path: (_) @import.source) @import\n\n; Calls\n(call_expression function: (identifier) @call.name) @call\n(call_expression function: (field_expression field: (field_identifier) @call.name)) @call\n(call_expression function: (qualified_identifier name: (identifier) @call.name)) @call\n(call_expression function: (template_function name: (identifier) @call.name)) @call\n\n; Heritage\n(class_specifier name: (type_identifier) @heritage.class\n (base_class_clause (type_identifier) @heritage.extends)) @heritage\n(class_specifier name: (type_identifier) @heritage.class\n (base_class_clause (access_specifier) (type_identifier) @heritage.extends)) @heritage\n";
9
+ export declare const CSHARP_QUERIES = "\n; Types\n(class_declaration name: (identifier) @name) @definition.class\n(interface_declaration name: (identifier) @name) @definition.interface\n(struct_declaration name: (identifier) @name) @definition.struct\n(enum_declaration name: (identifier) @name) @definition.enum\n(record_declaration name: (identifier) @name) @definition.record\n(delegate_declaration name: (identifier) @name) @definition.delegate\n\n; Namespaces\n(namespace_declaration name: (identifier) @name) @definition.namespace\n(namespace_declaration name: (qualified_name) @name) @definition.namespace\n\n; Methods & Properties\n(method_declaration name: (identifier) @name) @definition.method\n(local_function_statement name: (identifier) @name) @definition.function\n(constructor_declaration name: (identifier) @name) @definition.constructor\n(property_declaration name: (identifier) @name) @definition.property\n\n; Using\n(using_directive (qualified_name) @import.source) @import\n(using_directive (identifier) @import.source) @import\n\n; Calls\n(invocation_expression function: (identifier) @call.name) @call\n(invocation_expression function: (member_access_expression name: (identifier) @call.name)) @call\n\n; Heritage\n(class_declaration name: (identifier) @heritage.class\n (base_list (simple_base_type (identifier) @heritage.extends))) @heritage\n(class_declaration name: (identifier) @heritage.class\n (base_list (simple_base_type (generic_name (identifier) @heritage.extends)))) @heritage\n";
10
+ export declare const RUST_QUERIES = "\n; Functions & Items\n(function_item name: (identifier) @name) @definition.function\n(struct_item name: (type_identifier) @name) @definition.struct\n(enum_item name: (type_identifier) @name) @definition.enum\n(trait_item name: (type_identifier) @name) @definition.trait\n(impl_item type: (type_identifier) @name) @definition.impl\n(mod_item name: (identifier) @name) @definition.module\n\n; Type aliases, const, static, macros\n(type_item name: (type_identifier) @name) @definition.type\n(const_item name: (identifier) @name) @definition.const\n(static_item name: (identifier) @name) @definition.static\n(macro_definition name: (identifier) @name) @definition.macro\n\n; Use statements\n(use_declaration argument: (_) @import.source) @import\n\n; Calls\n(call_expression function: (identifier) @call.name) @call\n(call_expression function: (field_expression field: (field_identifier) @call.name)) @call\n(call_expression function: (scoped_identifier name: (identifier) @call.name)) @call\n(call_expression function: (generic_function function: (identifier) @call.name)) @call\n\n; Heritage (trait implementation)\n(impl_item trait: (type_identifier) @heritage.trait type: (type_identifier) @heritage.class) @heritage\n(impl_item trait: (generic_type type: (type_identifier) @heritage.trait) type: (type_identifier) @heritage.class) @heritage\n";
11
+ export declare const SOLIDITY_QUERIES = "\n; Contracts, Libraries, Interfaces\n(contract_declaration name: (identifier) @name) @definition.class\n(library_declaration name: (identifier) @name) @definition.class\n(interface_declaration name: (identifier) @name) @definition.interface\n\n; Functions, Constructors, Modifiers\n(function_definition name: (identifier) @name) @definition.function\n(modifier_definition name: (identifier) @name) @definition.function\n\n; Events, Errors\n(event_definition name: (identifier) @name) @definition.function\n(error_declaration name: (identifier) @name) @definition.function\n\n; Structs, Enums\n(struct_declaration name: (identifier) @name) @definition.struct\n(enum_declaration name: (identifier) @name) @definition.enum\n\n; Imports\n(import_directive source: (string) @import.source) @import\n\n; Calls (Solidity call_expression uses 'expression' child, not 'function' field)\n(call_expression (expression (identifier) @call.name)) @call\n(call_expression (expression (member_expression property: (identifier) @call.name))) @call\n\n; Heritage - contract inheritance (contract X is Y, Z)\n(contract_declaration\n name: (identifier) @heritage.class\n (inheritance_specifier ancestor: (user_defined_type (identifier) @heritage.extends))) @heritage\n(interface_declaration\n name: (identifier) @heritage.class\n (inheritance_specifier ancestor: (user_defined_type (identifier) @heritage.extends))) @heritage\n";
12
+ export declare const LANGUAGE_QUERIES: Record<SupportedLanguages, string>;
13
+ //# sourceMappingURL=tree-sitter-queries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree-sitter-queries.d.ts","sourceRoot":"","sources":["../../../../../../src/tools/code-analyzer/core/ingestion/tree-sitter-queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAWzE,eAAO,MAAM,kBAAkB,gjDA0D9B,CAAC;AAGF,eAAO,MAAM,kBAAkB,61CAgD9B,CAAC;AAGF,eAAO,MAAM,cAAc,umBAyB1B,CAAC;AAGF,eAAO,MAAM,YAAY,mjCAyBxB,CAAC;AAGF,eAAO,MAAM,SAAS,44BAqBrB,CAAC;AAGF,eAAO,MAAM,UAAU,s1BAiBtB,CAAC;AAGF,eAAO,MAAM,WAAW,g/CA6BvB,CAAC;AAGF,eAAO,MAAM,cAAc,08CAgC1B,CAAC;AAGF,eAAO,MAAM,YAAY,q0CA2BxB,CAAC;AAGF,eAAO,MAAM,gBAAgB,y4CAgC5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAW/D,CAAC"}