scip-query 0.6.9 → 0.7.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 (220) hide show
  1. package/README.md +3 -1
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/chunk-23YIGCYF.js +25 -0
  4. package/dist/{chunk-V4WRHJU3.js → chunk-2IYEIFPP.js} +6 -6
  5. package/dist/chunk-2JEFS2YJ.js +2 -0
  6. package/dist/chunk-33SSUPCB.js +7 -0
  7. package/dist/chunk-3GNFUVFA.js +2 -0
  8. package/dist/chunk-3OUC276S.js +2 -0
  9. package/dist/{chunk-JLFAQ2E2.js → chunk-4STLJYHI.js} +4 -4
  10. package/dist/chunk-563HLCDW.js +35 -0
  11. package/dist/chunk-5TT47UMX.js +44 -0
  12. package/dist/chunk-6H2XIIPY.js +71 -0
  13. package/dist/{chunk-I5BB33E6.js → chunk-72JOIFXL.js} +3 -3
  14. package/dist/chunk-7H4RJ4MC.js +2 -0
  15. package/dist/chunk-7O4MJYIW.js +63 -0
  16. package/dist/chunk-7OX2O53H.js +62 -0
  17. package/dist/chunk-A2AVLALL.js +2 -0
  18. package/dist/chunk-AQYBOORI.js +2 -0
  19. package/dist/chunk-ARBZM2NF.js +34 -0
  20. package/dist/{chunk-GRAEZYYU.js → chunk-BI4F6GXI.js} +2 -2
  21. package/dist/chunk-BOVNTAKQ.js +3 -0
  22. package/dist/chunk-CKIO6SVS.js +2 -0
  23. package/dist/chunk-D6Z67MZL.js +2 -0
  24. package/dist/chunk-DFK54IRN.js +2 -0
  25. package/dist/chunk-FD37DBTD.js +2 -0
  26. package/dist/chunk-FOQQDXE7.js +2 -0
  27. package/dist/chunk-GAQGJ52J.js +11 -0
  28. package/dist/chunk-IODTPF5H.js +20 -0
  29. package/dist/chunk-J6Z5YKGQ.js +4 -0
  30. package/dist/chunk-JB4PUN5S.js +40 -0
  31. package/dist/chunk-JTXKS5GK.js +3 -0
  32. package/dist/chunk-KJ3ZJIE5.js +2 -0
  33. package/dist/chunk-KJ6CW6EK.js +2 -0
  34. package/dist/{chunk-AXHDRSRI.js → chunk-KNA6Z7JB.js} +3 -3
  35. package/dist/{chunk-U3GYMGBX.js → chunk-LDV2B7ET.js} +8 -8
  36. package/dist/chunk-LWYIGRHR.js +5 -0
  37. package/dist/chunk-MDAYGS6T.js +2 -0
  38. package/dist/chunk-MX6F756F.js +2 -0
  39. package/dist/chunk-NHDPYW7O.js +2 -0
  40. package/dist/{chunk-IIKNAXAE.js → chunk-NKJKI6SE.js} +2 -2
  41. package/dist/chunk-NN3O7TPH.js +8 -0
  42. package/dist/chunk-NSTZMBAB.js +18 -0
  43. package/dist/chunk-NYEMZHUC.js +6 -0
  44. package/dist/chunk-OHEIZWIA.js +4 -0
  45. package/dist/chunk-PG3ZI5IH.js +2 -0
  46. package/dist/chunk-QAEDNTY7.js +2 -0
  47. package/dist/chunk-QE6MGGUY.js +2 -0
  48. package/dist/chunk-QPRIYXH4.js +2 -0
  49. package/dist/chunk-QWJBIBE6.js +3 -0
  50. package/dist/chunk-RCJEFQOK.js +4 -0
  51. package/dist/chunk-ROOHENEP.js +61 -0
  52. package/dist/{chunk-3JGBAAP7.js → chunk-ROZNBWIF.js} +2 -2
  53. package/dist/chunk-TGK5DFBJ.js +2 -0
  54. package/dist/chunk-TKDJQ2WD.js +59 -0
  55. package/dist/chunk-TRNAQABL.js +7 -0
  56. package/dist/chunk-U75WH4XG.js +2 -0
  57. package/dist/chunk-V53J46BX.js +2 -0
  58. package/dist/chunk-V76FCF5F.js +2 -0
  59. package/dist/chunk-VUBQBW7H.js +16 -0
  60. package/dist/chunk-WJQY2LGT.js +2 -0
  61. package/dist/{chunk-ZO5IFJRM.js → chunk-WODJHE6Z.js} +3 -3
  62. package/dist/{chunk-IX45SWX5.js → chunk-WPLKHAH7.js} +4 -4
  63. package/dist/chunk-XO6R3X5J.js +2 -0
  64. package/dist/chunk-YSZNAG4G.js +2 -0
  65. package/dist/chunk-ZNUPGRPR.js +3 -0
  66. package/dist/{chunk-UIM4WALN.js → chunk-ZXFTC5ET.js} +4 -4
  67. package/dist/cli.js +362 -527
  68. package/dist/config-types-CGIeLEpY.d.ts +108 -0
  69. package/dist/db-DdTPetj5.d.ts +69 -0
  70. package/dist/health-x7B4Xu_6.d.ts +119 -0
  71. package/dist/index.d.ts +100 -334
  72. package/dist/index.js +3 -131
  73. package/dist/postinstall.js +1 -1
  74. package/dist/queries/affected.d.ts +9 -2
  75. package/dist/queries/affected.js +1 -1
  76. package/dist/queries/bottlenecks.d.ts +12 -2
  77. package/dist/queries/bottlenecks.js +1 -1
  78. package/dist/queries/by-kind.d.ts +12 -2
  79. package/dist/queries/by-kind.js +1 -1
  80. package/dist/queries/call-graph.d.ts +19 -2
  81. package/dist/queries/call-graph.js +1 -1
  82. package/dist/queries/change-surface.d.ts +16 -2
  83. package/dist/queries/change-surface.js +1 -1
  84. package/dist/queries/code.d.ts +12 -2
  85. package/dist/queries/code.js +1 -1
  86. package/dist/queries/complexity-hotspots.d.ts +15 -2
  87. package/dist/queries/complexity-hotspots.js +1 -1
  88. package/dist/queries/complexity.d.ts +19 -2
  89. package/dist/queries/complexity.js +1 -1
  90. package/dist/queries/convergence.d.ts +22 -2
  91. package/dist/queries/convergence.js +1 -1
  92. package/dist/queries/coupling.d.ts +8 -2
  93. package/dist/queries/coupling.js +1 -1
  94. package/dist/queries/cycles.d.ts +16 -2
  95. package/dist/queries/cycles.js +1 -1
  96. package/dist/queries/dataflow.d.ts +32 -2
  97. package/dist/queries/dataflow.js +1 -1
  98. package/dist/queries/dead.d.ts +34 -2
  99. package/dist/queries/dead.js +1 -1
  100. package/dist/queries/deep-chains.d.ts +8 -2
  101. package/dist/queries/deep-chains.js +1 -1
  102. package/dist/queries/deps.d.ts +6 -2
  103. package/dist/queries/deps.js +1 -1
  104. package/dist/queries/diff-impact.d.ts +22 -2
  105. package/dist/queries/diff-impact.js +1 -1
  106. package/dist/queries/drift.d.ts +18 -2
  107. package/dist/queries/drift.js +1 -1
  108. package/dist/queries/extract-candidates.d.ts +19 -2
  109. package/dist/queries/extract-candidates.js +1 -1
  110. package/dist/queries/fan.d.ts +7 -2
  111. package/dist/queries/fan.js +1 -1
  112. package/dist/queries/files.d.ts +6 -2
  113. package/dist/queries/files.js +1 -1
  114. package/dist/queries/health.d.ts +4 -81
  115. package/dist/queries/health.js +1 -1
  116. package/dist/queries/hierarchy.d.ts +8 -2
  117. package/dist/queries/hierarchy.js +1 -1
  118. package/dist/queries/hotspots.d.ts +10 -2
  119. package/dist/queries/hotspots.js +1 -1
  120. package/dist/queries/imports.d.ts +13 -2
  121. package/dist/queries/imports.js +1 -1
  122. package/dist/queries/index.d.ts +45 -44
  123. package/dist/queries/index.js +1 -1
  124. package/dist/queries/isolated.d.ts +11 -2
  125. package/dist/queries/isolated.js +1 -1
  126. package/dist/queries/members.d.ts +10 -2
  127. package/dist/queries/members.js +1 -1
  128. package/dist/queries/methods.d.ts +8 -2
  129. package/dist/queries/methods.js +1 -1
  130. package/dist/queries/outline.d.ts +10 -2
  131. package/dist/queries/outline.js +1 -1
  132. package/dist/queries/passthrough-candidates.d.ts +14 -2
  133. package/dist/queries/passthrough-candidates.js +1 -1
  134. package/dist/queries/redundant-reexports.d.ts +13 -2
  135. package/dist/queries/redundant-reexports.js +1 -1
  136. package/dist/queries/refs.d.ts +7 -2
  137. package/dist/queries/refs.js +1 -1
  138. package/dist/queries/similar-chains.d.ts +21 -2
  139. package/dist/queries/similar-chains.js +1 -1
  140. package/dist/queries/similar-files.d.ts +12 -2
  141. package/dist/queries/similar-files.js +1 -1
  142. package/dist/queries/similar-signatures.d.ts +16 -2
  143. package/dist/queries/similar-signatures.js +1 -1
  144. package/dist/queries/similar.d.ts +21 -2
  145. package/dist/queries/similar.js +1 -1
  146. package/dist/queries/slice.d.ts +16 -2
  147. package/dist/queries/slice.js +1 -1
  148. package/dist/queries/stale-abstractions.d.ts +36 -3
  149. package/dist/queries/stale-abstractions.js +1 -1
  150. package/dist/queries/stats.d.ts +11 -2
  151. package/dist/queries/stats.js +1 -1
  152. package/dist/queries/surface.d.ts +8 -2
  153. package/dist/queries/surface.js +1 -1
  154. package/dist/queries/symbols.d.ts +10 -2
  155. package/dist/queries/symbols.js +1 -1
  156. package/dist/queries/system.d.ts +10 -2
  157. package/dist/queries/system.js +1 -1
  158. package/dist/queries/trace.d.ts +18 -2
  159. package/dist/queries/trace.js +1 -1
  160. package/dist/queries/wrapper-candidates.d.ts +14 -2
  161. package/dist/queries/wrapper-candidates.js +1 -1
  162. package/dist/reindex-worker.js +10 -10
  163. package/dist/reindex.d.ts +153 -0
  164. package/dist/reindex.js +69 -0
  165. package/dist/runtime.d.ts +108 -0
  166. package/dist/runtime.js +3 -0
  167. package/dist/scip-cli-a-xOztiK.d.ts +20 -0
  168. package/package.json +184 -4
  169. package/dist/chunk-2OP63JQQ.js +0 -2
  170. package/dist/chunk-33Z6HQBX.js +0 -5
  171. package/dist/chunk-3F453KPT.js +0 -2
  172. package/dist/chunk-3PKPUCIJ.js +0 -11
  173. package/dist/chunk-42BWO2NN.js +0 -2
  174. package/dist/chunk-4MDCFY3E.js +0 -2
  175. package/dist/chunk-4QWTQ6YV.js +0 -2
  176. package/dist/chunk-5IRX5I64.js +0 -5
  177. package/dist/chunk-5MPZ2A7J.js +0 -2
  178. package/dist/chunk-67OMD56K.js +0 -90
  179. package/dist/chunk-6UVVA5I4.js +0 -7
  180. package/dist/chunk-BAA4EJRX.js +0 -2
  181. package/dist/chunk-BT36WY5B.js +0 -114
  182. package/dist/chunk-CLKFDBS6.js +0 -39
  183. package/dist/chunk-CWMWTHV3.js +0 -2
  184. package/dist/chunk-DXO2ECRF.js +0 -7
  185. package/dist/chunk-EHEZLULQ.js +0 -85
  186. package/dist/chunk-FVH3Y44U.js +0 -1
  187. package/dist/chunk-GWBRU65E.js +0 -2
  188. package/dist/chunk-H4DXD2FB.js +0 -5
  189. package/dist/chunk-I2KUHGMX.js +0 -16
  190. package/dist/chunk-JMASYYSW.js +0 -2
  191. package/dist/chunk-KAM4C6ZD.js +0 -4
  192. package/dist/chunk-LBWLO7NA.js +0 -70
  193. package/dist/chunk-LJ2YWNQF.js +0 -2
  194. package/dist/chunk-LLDPR3DG.js +0 -6
  195. package/dist/chunk-LNUZWWWL.js +0 -2
  196. package/dist/chunk-NLJCXHFU.js +0 -84
  197. package/dist/chunk-NRAJIFQA.js +0 -2
  198. package/dist/chunk-OYRGWW6Z.js +0 -2
  199. package/dist/chunk-PVMRIOM6.js +0 -33
  200. package/dist/chunk-QRYEOK3M.js +0 -2
  201. package/dist/chunk-SF2HYG53.js +0 -4
  202. package/dist/chunk-SHGPRVWH.js +0 -2
  203. package/dist/chunk-SMOUOKAO.js +0 -2
  204. package/dist/chunk-TBJDUS4E.js +0 -71
  205. package/dist/chunk-TPXWXKL6.js +0 -2
  206. package/dist/chunk-TTCUMJ43.js +0 -19
  207. package/dist/chunk-TYR7QY5G.js +0 -2
  208. package/dist/chunk-UZG3QXTG.js +0 -2
  209. package/dist/chunk-VDMRAGBK.js +0 -6
  210. package/dist/chunk-W6SRVK2Y.js +0 -5
  211. package/dist/chunk-WGYJDGBI.js +0 -25
  212. package/dist/chunk-WYX3RU2K.js +0 -2
  213. package/dist/chunk-WZYA234B.js +0 -2
  214. package/dist/chunk-Y6ZFXZ7B.js +0 -2
  215. package/dist/chunk-YCN5XEST.js +0 -7
  216. package/dist/db-Rx8Ho_JF.d.ts +0 -838
  217. package/dist/queries/drift-policy.d.ts +0 -6
  218. package/dist/queries/drift-policy.js +0 -2
  219. package/dist/queries/health-cache-control.d.ts +0 -15
  220. package/dist/queries/health-cache-control.js +0 -2
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Check if the `scip` CLI binary is available on PATH.
3
+ */
4
+ declare function isScipInstalled(): boolean;
5
+ /**
6
+ * Get the scip CLI version if installed.
7
+ */
8
+ declare function getScipVersion(): string | null;
9
+ /**
10
+ * Print instructions for installing the scip CLI binary.
11
+ */
12
+ declare function printScipInstallInstructions(): void;
13
+ /**
14
+ * Attempt to auto-install the `scip` CLI binary.
15
+ * Tries brew (macOS), then go install, then prints manual instructions.
16
+ * Returns true if installation succeeded.
17
+ */
18
+ declare function tryInstallScipCli(onStatus: (msg: string) => void): boolean;
19
+
20
+ export { getScipVersion as g, isScipInstalled as i, printScipInstallInstructions as p, tryInstallScipCli as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scip-query",
3
- "version": "0.6.9",
3
+ "version": "0.7.0",
4
4
  "description": "Language-agnostic code intelligence CLI powered by SCIP indexes",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,9 +23,189 @@
23
23
  "import": "./dist/queries/index.js",
24
24
  "types": "./dist/queries/index.d.ts"
25
25
  },
26
- "./queries/*": {
27
- "import": "./dist/queries/*.js",
28
- "types": "./dist/queries/*.d.ts"
26
+ "./queries/affected": {
27
+ "import": "./dist/queries/affected.js",
28
+ "types": "./dist/queries/affected.d.ts"
29
+ },
30
+ "./queries/bottlenecks": {
31
+ "import": "./dist/queries/bottlenecks.js",
32
+ "types": "./dist/queries/bottlenecks.d.ts"
33
+ },
34
+ "./queries/by-kind": {
35
+ "import": "./dist/queries/by-kind.js",
36
+ "types": "./dist/queries/by-kind.d.ts"
37
+ },
38
+ "./queries/call-graph": {
39
+ "import": "./dist/queries/call-graph.js",
40
+ "types": "./dist/queries/call-graph.d.ts"
41
+ },
42
+ "./queries/change-surface": {
43
+ "import": "./dist/queries/change-surface.js",
44
+ "types": "./dist/queries/change-surface.d.ts"
45
+ },
46
+ "./queries/code": {
47
+ "import": "./dist/queries/code.js",
48
+ "types": "./dist/queries/code.d.ts"
49
+ },
50
+ "./queries/complexity": {
51
+ "import": "./dist/queries/complexity.js",
52
+ "types": "./dist/queries/complexity.d.ts"
53
+ },
54
+ "./queries/complexity-hotspots": {
55
+ "import": "./dist/queries/complexity-hotspots.js",
56
+ "types": "./dist/queries/complexity-hotspots.d.ts"
57
+ },
58
+ "./queries/convergence": {
59
+ "import": "./dist/queries/convergence.js",
60
+ "types": "./dist/queries/convergence.d.ts"
61
+ },
62
+ "./queries/coupling": {
63
+ "import": "./dist/queries/coupling.js",
64
+ "types": "./dist/queries/coupling.d.ts"
65
+ },
66
+ "./queries/cycles": {
67
+ "import": "./dist/queries/cycles.js",
68
+ "types": "./dist/queries/cycles.d.ts"
69
+ },
70
+ "./queries/dataflow": {
71
+ "import": "./dist/queries/dataflow.js",
72
+ "types": "./dist/queries/dataflow.d.ts"
73
+ },
74
+ "./queries/dead": {
75
+ "import": "./dist/queries/dead.js",
76
+ "types": "./dist/queries/dead.d.ts"
77
+ },
78
+ "./queries/deep-chains": {
79
+ "import": "./dist/queries/deep-chains.js",
80
+ "types": "./dist/queries/deep-chains.d.ts"
81
+ },
82
+ "./queries/deps": {
83
+ "import": "./dist/queries/deps.js",
84
+ "types": "./dist/queries/deps.d.ts"
85
+ },
86
+ "./queries/diff-impact": {
87
+ "import": "./dist/queries/diff-impact.js",
88
+ "types": "./dist/queries/diff-impact.d.ts"
89
+ },
90
+ "./queries/drift": {
91
+ "import": "./dist/queries/drift.js",
92
+ "types": "./dist/queries/drift.d.ts"
93
+ },
94
+ "./queries/extract-candidates": {
95
+ "import": "./dist/queries/extract-candidates.js",
96
+ "types": "./dist/queries/extract-candidates.d.ts"
97
+ },
98
+ "./queries/fan": {
99
+ "import": "./dist/queries/fan.js",
100
+ "types": "./dist/queries/fan.d.ts"
101
+ },
102
+ "./queries/files": {
103
+ "import": "./dist/queries/files.js",
104
+ "types": "./dist/queries/files.d.ts"
105
+ },
106
+ "./queries/health": {
107
+ "import": "./dist/queries/health.js",
108
+ "types": "./dist/queries/health.d.ts"
109
+ },
110
+ "./queries/hierarchy": {
111
+ "import": "./dist/queries/hierarchy.js",
112
+ "types": "./dist/queries/hierarchy.d.ts"
113
+ },
114
+ "./queries/hotspots": {
115
+ "import": "./dist/queries/hotspots.js",
116
+ "types": "./dist/queries/hotspots.d.ts"
117
+ },
118
+ "./queries/imports": {
119
+ "import": "./dist/queries/imports.js",
120
+ "types": "./dist/queries/imports.d.ts"
121
+ },
122
+ "./queries/index": {
123
+ "import": "./dist/queries/index.js",
124
+ "types": "./dist/queries/index.d.ts"
125
+ },
126
+ "./queries/isolated": {
127
+ "import": "./dist/queries/isolated.js",
128
+ "types": "./dist/queries/isolated.d.ts"
129
+ },
130
+ "./queries/members": {
131
+ "import": "./dist/queries/members.js",
132
+ "types": "./dist/queries/members.d.ts"
133
+ },
134
+ "./queries/methods": {
135
+ "import": "./dist/queries/methods.js",
136
+ "types": "./dist/queries/methods.d.ts"
137
+ },
138
+ "./queries/outline": {
139
+ "import": "./dist/queries/outline.js",
140
+ "types": "./dist/queries/outline.d.ts"
141
+ },
142
+ "./queries/passthrough-candidates": {
143
+ "import": "./dist/queries/passthrough-candidates.js",
144
+ "types": "./dist/queries/passthrough-candidates.d.ts"
145
+ },
146
+ "./queries/redundant-reexports": {
147
+ "import": "./dist/queries/redundant-reexports.js",
148
+ "types": "./dist/queries/redundant-reexports.d.ts"
149
+ },
150
+ "./queries/refs": {
151
+ "import": "./dist/queries/refs.js",
152
+ "types": "./dist/queries/refs.d.ts"
153
+ },
154
+ "./queries/similar": {
155
+ "import": "./dist/queries/similar.js",
156
+ "types": "./dist/queries/similar.d.ts"
157
+ },
158
+ "./queries/similar-chains": {
159
+ "import": "./dist/queries/similar-chains.js",
160
+ "types": "./dist/queries/similar-chains.d.ts"
161
+ },
162
+ "./queries/similar-files": {
163
+ "import": "./dist/queries/similar-files.js",
164
+ "types": "./dist/queries/similar-files.d.ts"
165
+ },
166
+ "./queries/similar-signatures": {
167
+ "import": "./dist/queries/similar-signatures.js",
168
+ "types": "./dist/queries/similar-signatures.d.ts"
169
+ },
170
+ "./queries/slice": {
171
+ "import": "./dist/queries/slice.js",
172
+ "types": "./dist/queries/slice.d.ts"
173
+ },
174
+ "./queries/stale-abstractions": {
175
+ "import": "./dist/queries/stale-abstractions.js",
176
+ "types": "./dist/queries/stale-abstractions.d.ts"
177
+ },
178
+ "./queries/stats": {
179
+ "import": "./dist/queries/stats.js",
180
+ "types": "./dist/queries/stats.d.ts"
181
+ },
182
+ "./queries/surface": {
183
+ "import": "./dist/queries/surface.js",
184
+ "types": "./dist/queries/surface.d.ts"
185
+ },
186
+ "./queries/symbols": {
187
+ "import": "./dist/queries/symbols.js",
188
+ "types": "./dist/queries/symbols.d.ts"
189
+ },
190
+ "./queries/system": {
191
+ "import": "./dist/queries/system.js",
192
+ "types": "./dist/queries/system.d.ts"
193
+ },
194
+ "./queries/trace": {
195
+ "import": "./dist/queries/trace.js",
196
+ "types": "./dist/queries/trace.d.ts"
197
+ },
198
+ "./queries/wrapper-candidates": {
199
+ "import": "./dist/queries/wrapper-candidates.js",
200
+ "types": "./dist/queries/wrapper-candidates.d.ts"
201
+ },
202
+ "./reindex": {
203
+ "import": "./dist/reindex.js",
204
+ "types": "./dist/reindex.d.ts"
205
+ },
206
+ "./runtime": {
207
+ "import": "./dist/runtime.js",
208
+ "types": "./dist/runtime.d.ts"
29
209
  }
30
210
  },
31
211
  "scripts": {
@@ -1,2 +0,0 @@
1
- import{a as p}from"./chunk-LNUZWWWL.js";import{k as c,l as u}from"./chunk-EHEZLULQ.js";import{s as m}from"./chunk-NLJCXHFU.js";function w(n,e={}){let{limit:r=20,scope:s,minFanIn:l=2,minFanOut:t=2,scanLimit:i}=e,f=new p(n);return y(f.productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof i=="number"&&i>0}),i).map(o=>b(n,o,e.semantic!==!1)).filter(o=>o.fanIn>=l&&o.fanOut>=t).sort((o,a)=>a.score-o.score||a.fanIn-o.fanIn).slice(0,r)}function b(n,e,r){let s=new Set(u(n,e,{limit:500,semantic:r}).map(t=>t.file)).size,l=new Set(c(n,e,{limit:500,semantic:r}).filter(t=>t.file!==e.relativePath).map(t=>`${t.symbol}|${t.file}`)).size;return{symbol:e.symbol,shortName:m(e.symbol),fanIn:s,fanOut:l,score:s*l,definedIn:e.relativePath}}function y(n,e){return typeof e!="number"||e<=0||n.length<=e?n:n.slice(0,e)}export{w as a};
2
- //# sourceMappingURL=chunk-2OP63JQQ.js.map
@@ -1,5 +0,0 @@
1
- import{a as b,b as w,c as F,d as G,e as ee,f as D,g as v,h as _,i as W,j as J,k as h,l as z,m as q}from"./chunk-67OMD56K.js";import{a as $,c as K,d as k,h as j,i as Y,l as g}from"./chunk-NLJCXHFU.js";function te(e){return e.replace(/'''[\s\S]*?'''/g,C).replace(/"""[\s\S]*?"""/g,C).replace(/#.*$/gm,C).replace(/\/\/.*$/gm,C).replace(/\/\*[\s\S]*?\*\//g,C).replace(/`(?:\\[\s\S]|[^`])*`/g,C).replace(/'(?:\\.|[^'\\\r\n])*'/g,C).replace(/"(?:\\.|[^"\\\r\n])*"/g,C)}function C(e){return e.replace(/[^\r\n]/g," ")}var V=K("stripped-lines");function Tt(e,r,t){return V.get(e,r,t,()=>te(t).split(`
2
- `))}function kt(e){V.invalidateAll(e),U=null,O=""}function At(e,r){V.invalidate(e,r),U=null,O=""}var U=null,O="";function _e(e){return U===e||(U=e,O=te(e)),O}function E(e,r,t){let s=_e(e);return`${s.slice(0,r)}${" ".repeat(t-r)}${s.slice(t)}`}function S(e,r){return new RegExp(`\\b${re(r)}\\b`,"m").test(e)}function A(e,r){let t=new Set,s=new RegExp(`\\b${re(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let n of e.matchAll(s)){let i=n[1];i&&t.add(i)}return[...t]}function re(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ce=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(e){let r=[],t=0,s=0;for(let n=0;n<e.length;n++){let i=e[n];(i==="{"||i==="["||i==="(")&&t++,(i==="}"||i==="]"||i===")")&&t--,i===","&&t===0&&(r.push(e.slice(s,n)),s=n+1)}return r.push(e.slice(s)),r}function y(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function f(e,r){let t=new Set,s=(n,i)=>{let o=i||r.has(n.type);!o&&Ce.has(n.type)&&t.add(n.text);for(let a of n.children)s(a,o)};return s(e.rootNode,!1),t}function P(e,r,t,s,n,i,o){return{importedName:n,localName:i,sourcePath:o??h(e,s,ee(r)),kind:"named",used:S(t,i),usedMembers:[]}}function N(e,r,t){let s=[];for(let n of e.matchAll(r)){let i=n[0];if(!i||typeof n.index!="number")continue;let o=E(e,n.index,n.index+i.length);for(let a of t(n,o))s.push(a)}return s}function ne(e,r,t){let s=g(e,r);return s?Ee(e,r,s):we(t).flatMap(n=>qe(e,r,n.clause,n.specifier,n.start,n.end,t))}function Ee(e,r,t){let s=Re(e,r,t),n=[];for(let i of t.rootNode.descendantsOfType("import_statement"))n.push(...De(e,r,t,i,s));return n}function Re(e,r,t){let s=f(t,new Set(["import_statement"]));if(Y(r))for(let n of Ke(e,r))s.add(n);return s}function De(e,r,t,s,n){let i=ve(s);if(!i)return[];let o=D(e,r,i),a=y(s,"import_clause");return a?Te(t,a,o,n,Oe(s.text)):[ke(o)]}function Te(e,r,t,s,n){let i=[];for(let o of r.namedChildren)if(o.type==="identifier")i.push(Ae(o.text,t,s,n));else if(o.type==="namespace_import"){let a=Me(e,o,t,s,n);a&&i.push(a)}else o.type==="named_imports"&&i.push(...$e(o,t,s,n));return i}function ke(e){return{importedName:"*",localName:null,sourcePath:e,kind:"side-effect",used:!0,usedMembers:[]}}function Ae(e,r,t,s){return{importedName:"default",localName:e,sourcePath:r,kind:"default",used:t.has(e),usedMembers:[],isTypeOnly:s}}function Me(e,r,t,s,n){let o=y(r,"identifier")?.text??"";if(!o)return null;let a=je(e,o);return{importedName:"*",localName:o,sourcePath:t,kind:"namespace",used:a.length>0||s.has(o),usedMembers:a,isTypeOnly:n}}function $e(e,r,t,s){let n=[];for(let i of e.namedChildren){if(i.type!=="import_specifier")continue;let o=i.namedChild(0),a=i.namedChild(1);if(!o)continue;let c=o.text,p=a?.text??c;n.push({importedName:c,localName:p,sourcePath:r,kind:"named",used:t.has(p),usedMembers:[],isTypeOnly:s||Le(i.text)})}return n}function ve(e){let r=y(e,"string");if(!r)return null;let t=y(r,"string_fragment");return t?t.text:null}function Oe(e){return/^\s*import\s+type\b/.test(e)}function Le(e){return/^\s*type\b/.test(e.trim())}function je(e,r){let t=new Set;for(let s of e.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),i=s.namedChild(1);!n||!i||n.type!=="identifier"||n.text!==r||(i.type==="property_identifier"||i.type==="identifier")&&t.add(i.text)}return[...t]}function we(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of e.matchAll(t)){let i=n[0],o=n[1],a=n[2];!i||!a||typeof n.index!="number"||r.push({clause:o,specifier:a,start:n.index,end:n.index+i.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of e.matchAll(s)){let i=n[0],o=n[1];!i||!o||typeof n.index!="number"||r.push({clause:null,specifier:o,start:n.index,end:n.index+i.length})}return r.sort((n,i)=>n.start-i.start)}function qe(e,r,t,s,n,i,o){let a=D(e,r,s),c=E(o,n,i);return t?Ue(t).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let m=A(c,u.localName);return{...u,used:m.length>0||S(c,u.localName),usedMembers:m}}return u.kind==="side-effect"?{...u,used:!0,usedMembers:[]}:{...u,used:u.localName?S(c,u.localName):!1,usedMembers:[]}}):[{importedName:"*",localName:null,sourcePath:a,kind:"side-effect",used:!0,usedMembers:[]}]}function Ue(e){let r=e.trim(),t=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,i]=Be(s),o=[];return n&&o.push(...se(n,t)),i&&o.push(...se(i,t)),o}function se(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let s=t.slice(1,-1).trim();return s?x(s).map(n=>{let i=n.trim(),o=r||/^type\b/.test(i),a=i.replace(/^type\s+/,""),[c,p]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(p??c).trim(),kind:"named",isTypeOnly:o}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function Be(e){let r=0;for(let t=0;t<e.length;t++){let s=e[t];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function oe(e,r){let t=g(e,r);if(t)return He(e,r,t);let s=k(e,r);return s?Fe(e,r,s):[]}function Fe(e,r,t){return[...We(e,r,t),...Je(e,r,t),...ze(e,r,t)]}function We(e,r,t){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of t.matchAll(n)){if(typeof i.index!="number")continue;let o=i[1]??"",a=i[2]??"",c=x(o).map(m=>Ve(m.trim())).filter(m=>!!m),p=M(t,i.index),u=M(t,i.index+i[0].length-1);s.push({kind:"named",sourcePath:D(e,r,a),names:c,startLine:p,endLine:u})}return s}function Je(e,r,t){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of t.matchAll(n)){if(typeof i.index!="number")continue;let o=i[2]??"",a=M(t,i.index),c=M(t,i.index+i[0].length-1);s.push({kind:"star-as",sourcePath:D(e,r,o),names:[],startLine:a,endLine:c})}return s}function ze(e,r,t){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of t.matchAll(n)){if(typeof i.index!="number")continue;let o=i[1]??"",a=M(t,i.index),c=M(t,i.index+i[0].length-1);s.push({kind:"star",sourcePath:D(e,r,o),names:[],startLine:a,endLine:c})}return s}function Ve(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function M(e,r){let t=0;for(let s=0;s<r&&s<e.length;s++)e.charCodeAt(s)===10&&t++;return t}function He(e,r,t){let s=[];for(let n of t.rootNode.descendantsOfType("export_statement")){let i=Qe(e,r,n);if(i===void 0)continue;let o=n.startPosition.row,a=n.endPosition.row,c=Xe(n,i,o,a);s.push(c)}return s}function Qe(e,r,t){let s=y(t,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return D(e,r,n.text)}function Xe(e,r,t,s){let n=y(e,"export_clause");if(n){let o=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),p=a.namedChild(1);c&&o.push((p??c).text)}return{kind:"named",sourcePath:r,names:o,startLine:t,endLine:s}}return y(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:s}}var Ze=$("vue-non-script-identifiers");function Ke(e,r){return Ze.get(e,r,()=>{let t=new Set,s=k(e,r);if(!s)return t;let i=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,o=>o.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,o=>o.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,o=>o.replace(/[^\r\n]/g," "));for(let o of i.matchAll(/[A-Za-z_$][\w$]*/g))t.add(o[0]);return t})}import{basename as ie}from"path";function ae(e,r,t){let s=g(e,r);return s?Ye(e,r,s):N(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,i)=>{let o=n[1]?.trim();if(!o)return[];let a=ie(o).replace(/\.[^.]+$/,"");return[{importedName:o,localName:a,sourcePath:J(e,r,o),kind:"named",used:S(i,a),usedMembers:[]}]})}function Ye(e,r,t){let s=f(t,new Set(["preproc_include"])),n=[];for(let i of t.rootNode.descendantsOfType("preproc_include")){let o=null;for(let c of i.namedChildren){if(c.type==="system_lib_string"){o=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){o=c.namedChildren.find(u=>u.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!o)continue;let a=ie(o).replace(/\.[^.]+$/,"");n.push({importedName:o,localName:a,sourcePath:J(e,r,o),kind:"named",used:s.has(a),usedMembers:[]})}return n}function ce(e,r,t){let s=[];for(let n of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let i=n[1]?.trim(),o=n[2]?.trim()??null,a=n[0];if(!i||!a||typeof n.index!="number")continue;let c=E(t,n.index,n.index+a.length);s.push({importedName:i,localName:o,sourcePath:z(e,r,i),kind:o?"namespace":"side-effect",used:o?S(c,o):!0,usedMembers:o?A(c,o):[]})}return s}function pe(e,r,t){let s=[];for(let n of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let i=n[1]?.trim();i&&s.push({specifier:i,sourcePath:z(e,r,i)})}return s}function me(e,r,t){let s=g(e,r),n=j(r);if(s&&n==="csharp")return et(e,r,s);if(s&&n==="vb")return Ge(e,r,s);let i=G(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(t,i,(o,a)=>{let c=o[1]?.trim();if(!c)return[];let[p,u]=c.split(/\s*=\s*/),m=!!u,l=(m?u:p)?.trim()??c,d=l.split(".").pop()??l,I=m?p?.trim()??d:d;return[P(e,r,a,l,d,I,h(e,l,w))]})}function Ge(e,r,t){let s=f(t,new Set(["imports_statement"])),n=[];for(let i of t.rootNode.descendantsOfType("imports_statement")){let o=i.namedChildren.filter(l=>l.type==="namespace_name");if(o.length===0)continue;let a=o[o.length-1],c=o.length>1?o[0]:null,p=a.text,u=p.split(".").pop()??p,m=c?.text??u;n.push({importedName:u,localName:m,sourcePath:h(e,p,w),kind:c?"namespace":"named",used:s.has(m),usedMembers:[]})}return n}function et(e,r,t){let s=f(t,new Set(["using_directive"])),n=[];for(let i of t.rootNode.descendantsOfType("using_directive")){let o=i.namedChildren;if(o.length===0)continue;let a=null,c;o.length>=2&&o[0].type==="identifier"&&(o[1].type==="qualified_name"||o[1].type==="identifier")?(a=o[0],c=o[1]):c=o[o.length-1];let p=c.text,u=p.split(".").pop()??p,m=a?.text??u;n.push({importedName:u,localName:m,sourcePath:h(e,p,w),kind:a?"namespace":"named",used:s.has(m),usedMembers:[]})}return n}function ue(e,r,t){let s=g(e,r),n=j(r);return s&&n==="java"?tt(e,r,s):s&&n==="kotlin"?rt(e,r,s):s&&n==="scala"?st(e,r,s):N(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(i,o)=>{let a=i[1]?.trim();return a?nt(e,r,a,o):[]})}function tt(e,r,t){let s=f(t,new Set(["import_declaration"])),n=[];for(let i of t.rootNode.descendantsOfType("import_declaration")){let o=i.children.some(m=>m.type==="asterisk"),c=i.namedChildren.find(m=>m.type==="scoped_identifier")??i.namedChildren.find(m=>m.type==="identifier");if(!c)continue;let p=c.text;if(o){n.push({importedName:"*",localName:null,sourcePath:h(e,p,b),kind:"namespace",used:!0,usedMembers:[]});continue}let u=p.split(".").pop()??p;n.push({importedName:u,localName:u,sourcePath:h(e,p,b),kind:"named",used:s.has(u),usedMembers:[]})}return n}function rt(e,r,t){let s=f(t,new Set(["import_header","import_list"])),n=[];for(let i of t.rootNode.descendantsOfType("import_header")){let o=i.namedChildren.find(d=>d.type==="identifier");if(!o)continue;let a=i.namedChildren.some(d=>d.type==="wildcard_import"),c=i.namedChildren.find(d=>d.type==="import_alias");if(a){n.push({importedName:"*",localName:null,sourcePath:h(e,o.text,b),kind:"namespace",used:!0,usedMembers:[]});continue}let p=o.text,u=p.split(".").pop()??p,l=c?.namedChild(0)?.text??u;n.push({importedName:u,localName:l,sourcePath:h(e,p,b),kind:"named",used:s.has(l),usedMembers:[]})}return n}function st(e,r,t){let s=f(t,new Set(["import_declaration"])),n=[];for(let i of t.rootNode.descendantsOfType("import_declaration")){let o=i.namedChildren.find(m=>m.type==="namespace_selectors"||m.type==="namespace_wildcard"),a=i.namedChildren.filter(m=>m!==o&&(m.type==="identifier"||m.type==="stable_identifier")),c=a.map(m=>m.text).join(".");if(!c)continue;if(o?.type==="namespace_wildcard"){n.push({importedName:"*",localName:null,sourcePath:h(e,c,b),kind:"namespace",used:!0,usedMembers:[]});continue}if(o?.type==="namespace_selectors"){for(let m of o.namedChildren)if(m.type==="arrow_renamed_identifier"){let[l,d]=m.namedChildren;if(!l)continue;let I=l.text,R=d?.text??I;if(I==="_")continue;n.push({importedName:I,localName:R,sourcePath:h(e,`${c}.${I}`,b),kind:"named",used:s.has(R),usedMembers:[]})}else if(m.type==="identifier"){let l=m.text;n.push({importedName:l,localName:l,sourcePath:h(e,`${c}.${l}`,b),kind:"named",used:s.has(l),usedMembers:[]})}continue}let p=a[a.length-1]?.text??c,u=a.slice(0,-1).map(m=>m.text).join(".")||c;n.push({importedName:p,localName:p,sourcePath:h(e,u&&a.length>1?`${u}.${p}`:c,b),kind:"named",used:s.has(p),usedMembers:[]})}return n}function nt(e,r,t,s){if(t.includes("{")&&t.includes("}")){let n=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),i=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return x(i).flatMap(o=>{let a=o.trim();if(!a)return[];let[c,p]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),u=c?.trim();if(!u||u==="_")return[];let m=(p??u.split(".").pop()??u).trim(),l=u==="_"?n:`${n}.${u}`.replace(/\.\./g,".");return[P(e,r,s,l,u,m)]})}return[P(e,r,s,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function de(e,r,t){let s=g(e,r);return s?ot(e,r,s):N(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,i)=>{let o=n[1]?.trim();return o?x(o).flatMap(a=>{let c=a.trim();if(!c)return[];let[p,u]=c.split(/\s+as\s+/i),m=p?.trim()??c,l=m.split("\\").pop()??m,d=(u??l).trim();return[P(e,r,i,m,l,d,h(e,m.replace(/\\/g,"."),F))]}):[]})}function ot(e,r,t){let s=f(t,new Set(["namespace_use_declaration"])),n=[],i=(o,a,c)=>{n.push({importedName:a,localName:c,sourcePath:h(e,o.replace(/\\/g,"."),F),kind:"named",used:s.has(c),usedMembers:[]})};for(let o of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=o.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=o.namedChildren.find(p=>p.type==="namespace_name")?.text??"";for(let p of a.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:u,localName:m,qualified:l}=le(p,c);u&&i(l,u,m)}continue}for(let c of o.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=le(c,"");p&&i(m,p,u)}}return n}function le(e,r){let t=e.namedChildren.find(p=>p.type==="qualified_name"),s=e.namedChildren.filter(p=>p.type==="name"),n="";t?n=t.text:s.length>=1&&(n=s[0].text);let i=t&&s.length>0?s[s.length-1]:null,o=n.split("\\").pop()??n,a=i?.text??o,c=r?`${r}\\${n}`:n;return{importedName:o,localName:a,qualified:c}}function he(e,r,t){let s=g(e,r);return s?it(e,r,s):ct(t).flatMap(n=>mt(e,r,n,t))}function it(e,r,t){let s=f(t,new Set(["import_statement","import_from_statement"])),n=[];for(let i of t.rootNode.descendantsOfType("import_statement"))for(let o of i.namedChildren){let a=fe(o);if(!a)continue;let c=v(e,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let i of t.rootNode.descendantsOfType("import_from_statement")){let o=i.namedChild(0);if(!o)continue;let a=at(o);if(a===null)continue;let c=v(e,r,a);for(let p=1;p<i.namedChildCount;p+=1){let u=i.namedChild(p);if(u.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let m=fe(u);m&&n.push({importedName:m.qualifiedName,localName:m.localName,sourcePath:c,kind:"named",used:s.has(m.localName),usedMembers:[]})}}return n}function fe(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function at(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=y(e,"import_prefix")?.text??"",t=y(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function ct(e){let r=e.split(`
3
- `),t=[],s=0;for(let n=0;n<r.length;n++){let i=r[n],o=i.trimStart(),a=s;if(s+=i.length+1,!o.startsWith("import ")&&!o.startsWith("from "))continue;let c=i,p=a+i.length,u=ge(i);for(;n+1<r.length&&(u>0||c.trimEnd().endsWith("\\"));){n++;let l=r[n];c+=`
4
- ${l}`,p+=1+l.length,u+=ge(l),s+=l.length+1}let m=pt(c);m&&t.push({...m,start:a,end:p})}return t}function pt(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let s=t[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:t[1],clause:s}}function mt(e,r,t,s){let n=E(s,t.start,t.end),i=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return x(i).flatMap(c=>{let p=c.trim().replace(/,$/,"");if(!p)return[];let[u,m]=p.split(/\s+as\s+/),l=u.trim(),d=(m??l.split(".")[0]??l).trim(),I=v(e,r,l),R=A(n,d);return[{importedName:l,localName:d,sourcePath:I,kind:"namespace",used:S(n,d)||R.length>0,usedMembers:R}]});let o=t.module?v(e,r,t.module):null,a=[];for(let c of x(i)){let p=c.trim().replace(/,$/,"");if(!p)continue;if(p==="*"){a.push({importedName:"*",localName:null,sourcePath:o,kind:"side-effect",used:!0,usedMembers:[]});continue}let[u,m]=p.split(/\s+as\s+/),l=(m??u).trim();a.push({importedName:u.trim(),localName:l,sourcePath:o,kind:"named",used:S(n,l),usedMembers:[]})}return a}function ge(e){let r=0;for(let t of e)t==="("&&r++,t===")"&&r--;return r}import{basename as ut}from"path";function Se(e,r,t){let s=g(e,r);return s?lt(e,r,s):N(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,i)=>{let o=n[1],a=n[2];if(!o||!a)return[];let c=o==="require_relative"?W(e,r,a):null;if(c){let p=xe(a);return[{importedName:p,localName:p,sourcePath:c,kind:"named",used:S(i,p),usedMembers:[]}]}return[{importedName:a,localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]}]})}function lt(e,r,t){let s=f(t,new Set([])),n=[],i=new Set(["require","require_relative","load"]);for(let o of t.rootNode.descendantsOfType("call")){let a=o.namedChild(0);if(!a||a.type!=="identifier"||!i.has(a.text))continue;let p=o.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!p||p.type!=="string")continue;let m=p.namedChildren.find(d=>d.type==="string_content")?.text;if(!m)continue;let l=a.text==="require_relative"?W(e,r,m):null;if(l){let d=xe(m);n.push({importedName:d,localName:d,sourcePath:l,kind:"named",used:s.has(d),usedMembers:[]})}else n.push({importedName:m,localName:null,sourcePath:l,kind:"side-effect",used:!0,usedMembers:[]})}return n}function xe(e){return ut(e).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function ye(e,r,t){let s=g(e,r);return s?dt(e,r,s):N(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,i)=>{let o=n[1]?.trim();return o?ft(e,r,o,i):[]})}function dt(e,r,t){let s=f(t,new Set(["use_declaration"])),n=[];for(let i of t.rootNode.descendantsOfType("use_declaration")){let o=i.namedChild(0);if(o)for(let a of L(o,"")){if(!a.importedName||a.importedName==="*")continue;let c=_(e,r,a.qualifiedName)??_(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push({importedName:a.importedName,localName:a.localName,sourcePath:c,kind:"named",used:s.has(a.localName),usedMembers:[]})}}return n}function L(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:B(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,s=t.split("::").pop()??t;return[{qualifiedName:B(r,t),importedName:s,localName:s}]}case"scoped_use_list":{let t=e.namedChild(0),s=e.namedChild(1);if(!t||!s)return[];let n=B(r,t.text),i=[];for(let o of s.namedChildren)i.push(...L(o,n));return i}case"use_list":{let t=[];for(let s of e.namedChildren)t.push(...L(s,r));return t}case"use_as_clause":{let t=e.namedChild(0),s=e.namedChild(1);if(!t||!s)return[];let n=L(t,r),i=s.text;return n.map(o=>({...o,localName:i}))}case"use_wildcard":{let t=e.namedChild(0),s=t?t.text:"";return[{qualifiedName:B(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function B(e,r){return e?r?`${e}::${r}`:e:r}function ft(e,r,t,s){let n=t.trim();if(n.includes("{")&&n.includes("}")){let u=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),m=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(m).flatMap(l=>{let d=l.trim();if(!d||d==="self")return[];let[I,R]=d.split(/\s+as\s+/),T=I?.trim();if(!T)return[];let Pe=(R??T.split("::").pop()??T).trim(),be=`${u}::${T}`.replace(/::::/g,"::");return[P(e,r,s,be,T.split("::").pop()??T,Pe,_(e,r,u))]})}let[i,o]=n.split(/\s+as\s+/),a=i?.trim()??n,c=(o??a.split("::").pop()??a).trim(),p=_(e,r,a)??_(e,r,a.split("::").slice(0,-1).join("::"));return[P(e,r,s,a,a.split("::").pop()??a,c,p)]}function Ne(e,r,t){let s=g(e,r);if(s)return gt(e,r,s);let n=[];for(let i of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let o=i[1]?.trim();o&&n.push(...St(e,r,o))}return n}function gt(e,r,t){let s=[];for(let n of t.rootNode.descendantsOfType("use_declaration")){if(!ht(n))continue;let i=n.namedChildren.find(o=>o.type!=="visibility_modifier");if(i)for(let o of L(i,""))o.importedName&&s.push(H(e,r,o.qualifiedName))}return s}function ht(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function St(e,r,t){let s=t.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),i=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(i).flatMap(o=>{let a=o.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),p=`${n}::${c?.trim()??a}`.replace(/::::/g,"::");return[H(e,r,p)]})}return[H(e,r,s)]}function H(e,r,t){return{specifier:t,sourcePath:_(e,r,t)??_(e,r,t.split("::").slice(0,-1).join("::"))}}function Ie(e,r){let t=r.toLowerCase();for(let s of e)for(let n of s.extensions)if(t.endsWith(n))return s;return null}var xt={language:"javascript",extensions:[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],parseImports:ne},yt={language:"python",extensions:[".py",".pyi"],parseImports:he},Nt={language:"jvm",extensions:[".java",".scala",".kt",".kts"],parseImports:ue},It={language:"rust",extensions:[".rs"],parseImports:ye,parseExports:Ne},Pt={language:"ruby",extensions:[".rb"],parseImports:Se},bt={language:"c/cpp",extensions:[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],parseImports:ae},_t={language:"dotnet",extensions:[".cs",".vb"],parseImports:me},Ct={language:"dart",extensions:[".dart"],parseImports:ce,parseExports:pe},Et={language:"php",extensions:[".php"],parseImports:de},Rt=[xt,yt,Nt,It,Pt,bt,_t,Ct,Et];function Q(e){return Ie(Rt,e)}function Fr(e,r){return oe(e,r)}var X=$("source-imports"),Z=$("source-exports");function Wr(e,r){let t=q(r);return X.get(e,t,()=>{let s=Q(t);if(!s)return[];let n=k(e,t);return n?s.parseImports(e,t,n):[]})}function Jr(e,r){let t=q(r);return Z.get(e,t,()=>{let s=Q(t);if(!s?.parseExports)return[];let n=k(e,t);return n?s.parseExports(e,t,n):[]})}function zr(e){X.invalidateAll(e),Z.invalidateAll(e)}function Vr(e,r){let t=q(r);X.invalidate(e,t),Z.invalidate(e,t)}export{te as a,Tt as b,kt as c,At as d,re as e,Fr as f,Wr as g,Jr as h,zr as i,Vr as j};
5
- //# sourceMappingURL=chunk-33Z6HQBX.js.map
@@ -1,2 +0,0 @@
1
- import{g as c,i as n}from"./chunk-EHEZLULQ.js";import{c as o,i as m}from"./chunk-33Z6HQBX.js";import{n as r}from"./chunk-67OMD56K.js";import{e as t,j as i}from"./chunk-NLJCXHFU.js";import{getHeapStatistics as s}from"v8";var p=64*1024*1024;function P(e,a={}){n(e),a.semanticProvider===!0&&r(e),c(e),m(e),o(e),i(e),t(e)}function _(){let e=globalThis.gc;if(!e)return;let a=s();a.heap_size_limit-a.used_heap_size<p||e()}export{P as a,_ as b};
2
- //# sourceMappingURL=chunk-3F453KPT.js.map
@@ -1,11 +0,0 @@
1
- import{a as f}from"./chunk-LLDPR3DG.js";import{a as d}from"./chunk-LNUZWWWL.js";import{q as c}from"./chunk-67OMD56K.js";import{s as u}from"./chunk-NLJCXHFU.js";function I(e,t,i={}){let n=f(e,t);if(!n)return null;let r=h(e,n);if(!r||e.isIgnored(r.relative_path))return null;let o=[],l=0,m=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,m);for(let s of m){let a=S(e,r,s,p.get(s.symbolId)??new Set);l+=a,o.push({symbol:s.symbol,shortName:u(s.symbol),startLine:s.startLine,endLine:s.endLine,externalConsumers:a,riskLevel:_(a)})}return{file:r.relative_path,symbols:o,totalExternalConsumers:l}}function h(e,t){return e.get(`SELECT id, relative_path FROM documents
2
- WHERE relative_path = ?
3
- ${e.pathExclusionsFor("documents")}
4
- LIMIT 1`,t)??null}function g(e,t){return new d(e).definitionsForFile(t).sort((i,n)=>i.startLine-n.startLine||i.endLine-n.endLine)}function S(e,t,i,n){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
5
- FROM mentions m
6
- JOIN chunks c ON m.chunk_id = c.id
7
- JOIN documents consumer_d ON consumer_d.id = c.document_id
8
- WHERE m.symbol_id = ?
9
- AND m.role != 1
10
- AND c.document_id != ?`,i.symbolId,t.id);return new Set([...r.map(o=>o.relative_path),...[...n].filter(o=>o!==t.relative_path)]).size}function _(e){return e>10?"high":e>0?"medium":"low"}export{I as a};
11
- //# sourceMappingURL=chunk-3PKPUCIJ.js.map
@@ -1,2 +0,0 @@
1
- import{G as p,r as d,s as f,u}from"./chunk-NLJCXHFU.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},c=new Map;for(let[e,i]of Object.entries(m))c.set(i.toLowerCase(),Number(e));function g(e){let i=parseInt(e,10);if(!isNaN(i))return i;let s=e.toLowerCase(),n=c.get(s);if(n!==void 0)return n;for(let[r,o]of c)if(r.includes(s))return o;return null}function N(e,i,s={}){let{scope:n,limit:r=100}=s,o=g(i);return o===null?[]:b(e,n).map(t=>({row:t,resolvedKind:y(t)})).filter(t=>t.resolvedKind===o).slice(0,r).map(({row:t,resolvedKind:l})=>({symbol:t.symbol,shortName:f(t.symbol),kind:l,kindName:m[l]??"Unknown",relativePath:t.relative_path,startLine:t.start_line,endLine:t.end_line}))}function P(e,i={}){let s=new Map;for(let n of b(e,i.scope)){let r=y(n);r===null||r===0||s.set(r,(s.get(r)??0)+1)}return[...s.entries()].sort((n,r)=>r[1]-n[1]||n[0]-r[0]).map(([n,r])=>({kind:n,kindName:m[n]??"Unknown",count:r}))}function b(e,i){return p(e,{scope:i}).map(S)}function S(e){return{symbol:e.symbol,kind:e.kind,documentation:e.documentation,enclosing_symbol:e.enclosingSymbol,relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine}}function y(e){return e.kind!==null&&e.kind!==0?h(e.kind,e.symbol,e.documentation):M(e.symbol,e.documentation,e.enclosing_symbol)}function h(e,i,s){let n=(s??"").toLowerCase();if(u(i)==="type"){if(n.includes("type "))return 76;if(n.includes("interface "))return 27;if(n.includes("struct "))return 68;if(n.includes("trait "))return 73;if(n.includes("class "))return 9}return e}function M(e,i,s){let n=d(e);if("kind"in n)return null;let r=n.descriptors,o=r[r.length-2]??null,a=u(e),t=(i??"").toLowerCase();return a==="type"?t.includes("type ")?76:t.includes("interface ")?27:t.includes("struct ")?68:t.includes("trait ")?73:(t.includes("class "),9):a==="method"?o?.suffix==="type"?33:23:a==="namespace"?39:a!=="term"?null:t.includes("async def ")||t.includes("def ")?23:(s?u(s):o?.suffix??null)==="type"?21:83}export{N as a,P as b};
2
- //# sourceMappingURL=chunk-42BWO2NN.js.map
@@ -1,2 +0,0 @@
1
- import{k as g}from"./chunk-EHEZLULQ.js";import{a as u}from"./chunk-BT36WY5B.js";import{s as i}from"./chunk-NLJCXHFU.js";function S(r,d,p,f={}){let s=u(r,d),n=u(r,p);if(!s||!n)return null;let c=new Set(g(r,s,{semantic:f.semantic}).map(e=>e.symbol)),h=new Set(g(r,n,{semantic:f.semantic}).map(e=>e.symbol)),l=[];for(let e of c)h.has(e)&&l.push(e);let a=[];for(let e of c)h.has(e)||a.push(e);let o=[];for(let e of h)c.has(e)||o.push(e);let m=new Set([...c,...h]),b=m.size>0?l.length/m.size:0,t;m.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":l.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":a.length===0&&o.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":a.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":o.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":a.length<=2&&o.length<=2?t=`Create a shared function with the ${l.length} common callees. Pass the ${a.length+o.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${l.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${a.length} callees in A, ${o.length} in B).`;let y=s.endLine-s.startLine+1,A=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:i(s.symbol),file:s.relativePath,loc:y},symbolB:{symbol:n.symbol,shortName:i(n.symbol),file:n.relativePath,loc:A},similarity:b,sharedCallees:l.map(i),uniqueToA:a.map(i),uniqueToB:o.map(i),consolidationStrategy:t}}export{S as a};
2
- //# sourceMappingURL=chunk-4MDCFY3E.js.map
@@ -1,2 +0,0 @@
1
- import{a as C}from"./chunk-LNUZWWWL.js";import{b as L}from"./chunk-EHEZLULQ.js";import{h,s as v,t as S}from"./chunk-NLJCXHFU.js";function D(s,o={}){let{scope:c,minLoc:d=3,scanLimit:r}=o,t=new C(s),l=o.semantic!==!1,a=P(t.productionCallableDefinitions({scope:c,minLoc:d,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,sortByLocDesc:typeof r=="number"&&r>0}),r),u=t.crossFileCallerMap(a,{semantic:l}),i=new Set(u.keys()),p=new Map;for(let e of a){let n=S(e.symbol);if(!n)continue;let m=p.get(n)??[];m.push(e.symbolId),p.set(n,m)}let M=s.all(`SELECT relative_path FROM documents WHERE 1 = 1 ${s.pathExclusionsFor("documents")}`);for(let e of M){if(s.isIgnored(e.relative_path)||h(e.relative_path)!=="rust")continue;let n=L(s,e.relative_path);for(let m of n){let I=p.get(m);if(I)for(let w of I)i.add(w)}}let b=g(t,a,{additive:!1,semantic:l}),f=a.filter(e=>!i.has(e.symbolId)).filter(e=>!b.has(e.symbolId)),x=t.sourceFallbackCallerFiles(f);for(let e of x.keys())i.add(e);let y=f.filter(e=>!i.has(e.symbolId)),R=g(t,y,{additive:!0,semantic:l});for(let e of R)b.add(e);return y.filter(e=>!b.has(e.symbolId)).sort((e,n)=>n.endLine-n.startLine-(e.endLine-e.startLine)||e.relativePath.localeCompare(n.relativePath)||e.startLine-n.startLine).map(e=>({symbol:e.symbol,shortName:v(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1}))}function g(s,o,c){if(o.length===0)return new Set;let d=new Map(o.map(t=>[t.symbolId,t.symbol])),r=s.calleeMap(o,{additive:c.additive,semantic:c.semantic});return new Set([...r.entries()].filter(([t,l])=>{let a=d.get(t);return l.some(u=>u.symbol!==a)}).map(([t])=>t))}function P(s,o){return typeof o!="number"||o<=0||s.length<=o?s:s.slice(0,o)}export{D as a};
2
- //# sourceMappingURL=chunk-4QWTQ6YV.js.map
@@ -1,5 +0,0 @@
1
- import{a as l}from"./chunk-NLJCXHFU.js";import{readdirSync as x}from"fs";import{extname as p,join as g}from"path";var f=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],w=[".vue"],S=new Set(f.map(e=>e.toLowerCase())),m=[...S].sort().join(","),E=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function C(e,o={}){let s=o.includeIndexed??!0,i=o.includeAuxiliary??!0,t=o.extensions?.map(c=>c.toLowerCase()),r=t?new Set(t):S,a=t?[...r].sort().join(","):m,n=`${s?"1":"0"}|${i?"1":"0"}|${a}`;return h.get(e,n,()=>{let c=new Set;if(s){let u=e.all(`SELECT relative_path
2
- FROM documents
3
- WHERE 1 = 1
4
- ${e.pathExclusionsFor("documents")}`);for(let d of u)e.isIgnored(d.relative_path)||r.has(p(d.relative_path).toLowerCase())&&c.add(d.relative_path)}if(i)for(let u of y(e.config.projectRoot,r))e.isIgnored(u)||c.add(u);return[...c].sort()})}var h=l("source-files");function y(e,o){let s=new Set,i=t=>{let r=t?g(e,t):e,a;try{a=x(r,{withFileTypes:!0})}catch{return}for(let n of a)if(!E.has(n.name)){if(n.isDirectory()){i(t?`${t}/${n.name}`:n.name);continue}o.has(p(n.name).toLowerCase())&&s.add(t?`${t}/${n.name}`:n.name)}};return i(""),s}export{w as a,E as b,C as c};
5
- //# sourceMappingURL=chunk-5IRX5I64.js.map
@@ -1,2 +0,0 @@
1
- import{a as w}from"./chunk-LNUZWWWL.js";import{c as g}from"./chunk-JMASYYSW.js";import{k as p,m as h}from"./chunk-EHEZLULQ.js";import{a as u,b as S}from"./chunk-BT36WY5B.js";import{J as d,s as b}from"./chunk-NLJCXHFU.js";function I(e,o,l={}){let{direction:c="backward",maxDepth:a=3}=l,n=u(e,o);return n?c==="backward"?R(e,n,a,{semantic:l.semantic!==!1}):M(e,n,{semantic:l.semantic!==!1}):null}function R(e,o,l,c){let a=[],n=new Set([o.symbol]),s=[o];for(let m=1;m<=l&&s.length!==0;m++){let t=[];for(let r of s){let i=p(e,r,{semantic:c.semantic});for(let f of i){if(n.has(f.symbol))continue;n.add(f.symbol),a.push({symbol:f.symbol,shortName:b(f.symbol),file:f.file,relationship:m===1?"referenced within definition (callee)":`depth ${m} callee`});let y=S(e,f.symbol);y&&!e.isIgnored(y.relativePath)&&t.push(y)}}s=t}return{symbol:o.symbol,shortName:b(o.symbol),direction:"backward",connectedSymbols:a}}function M(e,o,l){let c=g(e,o,{semantic:l.semantic}),a=c.length>0?c:h(e,o),n=new Set,s=[],m=new w(e);for(let t of a){if(s.length>=30)break;if(e.isIgnored(t.file))continue;let r=t.enclosingSymbol??d(m.definitionsForFile(t.file),t.line)?.symbol??null;if(!r||r===o.symbol)continue;let i=S(e,r);!i||e.isIgnored(i.relativePath)||n.has(i.symbol)||(n.add(i.symbol),s.push({symbol:i.symbol,shortName:b(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,r)=>t.file.localeCompare(r.file)),{symbol:o.symbol,shortName:b(o.symbol),direction:"forward",connectedSymbols:s}}export{I as a};
2
- //# sourceMappingURL=chunk-5MPZ2A7J.js.map
@@ -1,90 +0,0 @@
1
- import{F,b as Y,t as C}from"./chunk-NLJCXHFU.js";import g from"path";import{createRequire as Ye}from"module";import{existsSync as T,readdirSync as Ge,readFileSync as pe}from"fs";import{existsSync as R}from"fs";import{basename as he,dirname as y,extname as S,join as p,relative as E,resolve as f}from"path";var ye=Y("indexed-paths"),N=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],G=[".py",".pyi"],q=[".java",".scala",".kt",".kts"],Q=[".rs"],Z=[".rb"],ee=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],te=[".cs",".vb"],ne=[".dart"],re=[".php"],Ie=new Set(N),O=new Set(G),ie=new Set(q),P=new Set(Q),A=new Set(Z),oe=new Set(ee),se=new Set(te),j=new Set(ne),ae=new Set(re),xe=[{extensions:N,lookup:Ie},{extensions:G,lookup:O},{extensions:q,lookup:ie},{extensions:Q,lookup:P},{extensions:Z,lookup:A},{extensions:ee,lookup:oe},{extensions:te,lookup:se},{extensions:ne,lookup:j},{extensions:re,lookup:ae}];function I(t,e){return e.has(S(t).toLowerCase())}function Ee(t){return I(t,O)}function Ne(t){return I(t,ie)}function be(t){return I(t,P)}function ve(t){return I(t,A)}function ke(t){return I(t,oe)}function De(t){return I(t,se)}function Dt(t){return S(t).toLowerCase()===".vb"}function Re(t){return I(t,j)}function Te(t){return I(t,ae)}function Le(t){let e=S(t).toLowerCase();for(let n of xe)if(n.lookup.has(e))return n.extensions;return N}function _e(t){return Ne(t)||De(t)||Te(t)}function w(t,e,n){return Ee(e)?Ce(t,e,n):be(e)?Fe(t,e,n):ve(e)?Oe(t,e,n):ke(e)?Pe(t,e,n):_e(e)?Ae(t,n.replace(/\\/g,"."),Le(e)):Re(e)?je(t,e,n):Me(t,e,n)}function Me(t,e,n){if(!n.startsWith(".")&&!n.startsWith("/"))return null;let r=y(p(t.config.projectRoot,e)),i=f(r,n),o=b(t);for(let s of Ke(i)){let a=x(E(t.config.projectRoot,s));if(o.has(a)||R(s))return a}return x(E(t.config.projectRoot,i))}function Ce(t,e,n){let r=b(t),i;if(n.startsWith(".")){let o=n.match(/^(\.+)(.*)$/);if(!o)return null;let s=o[1].length,a=o[2].replace(/^\./,""),c=y(p(t.config.projectRoot,e));for(let l=1;l<s;l++)c=y(c);i=a?f(c,a.replace(/\./g,"/")):c}else i=f(t.config.projectRoot,n.replace(/\./g,"/"));for(let o of we(i)){let s=x(E(t.config.projectRoot,o));if(r.has(s)||R(o))return s}return null}function Fe(t,e,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let i=y(p(t.config.projectRoot,e)),o;return r.startsWith("crate::")?o=f(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?o=f(i,r.slice(6).replace(/::/g,"/")):o=f(y(i),r.slice(7).replace(/::/g,"/")),W(t,We(o))}function Oe(t,e,n){let r=y(p(t.config.projectRoot,e)),i=f(r,n);return W(t,$e(i))}function Pe(t,e,n){let r=y(p(t.config.projectRoot,e)),i=[f(r,n),f(t.config.projectRoot,n),f(t.config.projectRoot,"include",n),f(t.config.projectRoot,"src",n)];return W(t,i)}function Ae(t,e,n){let r=b(t),i=e.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),o=i.replace(/\./g,"/"),s=i.split(".").pop()??i;for(let c of n){let l=`${o}${c}`,d=[...r].find(m=>m.endsWith(l));if(d)return d}for(let c of n){let l=[...r].find(d=>he(d)===`${s}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(S(c).toLowerCase())).filter(c=>c.includes(`/${o}/`)||c.includes(`/${s}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function je(t,e,n){let r=b(t);if(n.startsWith("package:")){let s=n.slice(8),a=s.indexOf("/");if(a<0)return null;let c=s.slice(a+1),l=x(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let i=y(p(t.config.projectRoot,e)),o=f(i,n);for(let s of Ue(o)){let a=x(E(t.config.projectRoot,s));if(r.has(a)||R(s))return a}return null}function we(t){let e=S(t);return O.has(e)?[t]:[`${t}.py`,`${t}.pyi`,p(t,"__init__.py"),p(t,"__init__.pyi")]}function W(t,e){let n=b(t);for(let r of e){let i=x(E(t.config.projectRoot,r));if(n.has(i)||R(r))return i}return null}function We(t){let e=S(t);return P.has(e)?[t]:[`${t}.rs`,p(t,"mod.rs")]}function $e(t){let e=S(t);return A.has(e)?[t]:[`${t}.rb`,p(t,"index.rb")]}function Ue(t){let e=S(t);return j.has(e)?[t]:[`${t}.dart`,t]}function Ke(t){let e=S(t),n=new Set;if(e){n.add(t);for(let r of N)n.add(t.slice(0,-e.length)+r)}else for(let r of N)n.add(`${t}${r}`),n.add(p(t,`index${r}`));return[...n]}function b(t){return ye.get(t,()=>new Set(t.all(`SELECT relative_path
2
- FROM documents
3
- WHERE 1 = 1
4
- ${t.pathExclusionsFor("documents")}`).map(e=>x(e.relative_path)).filter(e=>!t.isIgnored(e))))}function x(t){return t.replace(/\\/g,"/")}import{existsSync as v,readFileSync as He,readdirSync as Xe,statSync as Je}from"fs";import u from"path";var U=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function K(t,e){let r=e?u.dirname(u.join(t,e)):t,i=u.resolve(t);for(;r.startsWith(i);){for(let s of U){let a=u.join(r,s);if(v(a))return a}let o=u.dirname(r);if(o===r)break;r=o}for(let o of U){let s=u.join(t,o);if(v(s))return s}return null}function ce(t){let e=t.config.projectRoot,n=new Set(Be(e,t.config.semantic?.typescript?.tsconfigs)),r=t.all(`SELECT relative_path
5
- FROM documents
6
- WHERE (
7
- relative_path LIKE '%.ts'
8
- OR relative_path LIKE '%.tsx'
9
- OR relative_path LIKE '%.mts'
10
- OR relative_path LIKE '%.cts'
11
- OR relative_path LIKE '%.js'
12
- OR relative_path LIKE '%.jsx'
13
- OR relative_path LIKE '%.mjs'
14
- OR relative_path LIKE '%.cjs'
15
- )
16
- ${t.pathExclusionsFor("documents")}`);for(let i of r){if(t.isIgnored(i.relative_path))continue;let o=K(e,i.relative_path);o&&n.add(u.resolve(o))}if(n.size===0){let i=K(e);i&&n.add(u.resolve(i))}return[...n].filter(i=>!le(e,i)).sort((i,o)=>i.localeCompare(o))}function Be(t,e=[]){let n=new Set;for(let r of e){let i=u.isAbsolute(r)?r:u.join(t,r);v(i)&&n.add(u.resolve(i))}for(let r of Ve(t))for(let i of U){let o=u.join(r,i);v(o)&&n.add(u.resolve(o))}if(n.size===0){let r=K(t);r&&n.add(u.resolve(r))}return[...n].filter(r=>!le(t,r)).sort((r,i)=>r.localeCompare(i))}function Ve(t){let e=u.join(t,"package.json");if(!v(e))return[];let n;try{n=JSON.parse(He(e,"utf8"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(i=>ze(t,i))}function ze(t,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=u.join(t,e);return $(s)?[s]:[]}let n=e.indexOf("*"),r=e.slice(0,n).replace(/\/$/,""),i=e.slice(n+1).replace(/^\//,""),o=u.join(t,r||".");return $(o)?Xe(o).map(s=>u.join(o,s,i)).filter($):[]}function $(t){try{return Je(t).isDirectory()}catch{return!1}}function le(t,e){let n=u.relative(t,e).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}var qe=Ye(import.meta.url),k;function ge(t,e){let n=Qe();if(!n)return H("ts-morph is not installed");let r=ce(t);if(r.length===0)return H("no tsconfig found");try{let i=r.map(o=>({tsconfigPath:o,project:new n.Project({tsConfigFilePath:o,skipFileDependencyResolution:!1})}));return new X(t,n,i)}catch(i){return H(i instanceof Error?i.message:String(i),r[0],r)}}function Qe(){if(k!==void 0)return k;try{k=qe("ts-morph")}catch{k=null}return k}function H(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var X=class{constructor(e,n,r){this.db=e;this.tsMorph=n;this.projects=r;this.workspacePackages=rt(e.config.projectRoot)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;sourceFileCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return h(this.importUsageCache,e,()=>{let n=this.sourceFile(e);if(!n)return[];let r=[];for(let i of n.getImportDeclarations())for(let o of this.importUsageForDeclaration(e,i))r.push(o);return r})}referencesFor(e){return h(this.referencesCache,e.symbolId,()=>{let n=this.nodeForDefinition(e),r=this.packageImportReferencesForDefinition(e);return n?ut(n,e,r,this.db.config.projectRoot):r})}calleesFor(e){return h(this.calleesCache,e.symbolId,()=>h(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}signatureFor(e){return h(this.signatureCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let r=n.getType().getCallSignatures()[0];if(!r)return null;let i=r.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return fe(c)}),o=r.getReturnType().getText(n);return`(${i.join(",")})=>${fe(o)}`})}importUsageForDeclaration(e,n){let r=w(this.db,e,n.getModuleSpecifierValue()),i=ue(n);return n.getImportClause()?.isTypeOnly()?i.map(o=>tt(e,r,o)):i.map(o=>this.valueImportUsageForEntry(e,r,o))}valueImportUsageForEntry(e,n,r){let i=r.identifier?r.identifier.findReferences():[],o=[];for(let l of i)for(let d of dt(l,e,r.identifier,this.db.config.projectRoot))o.push(d);let s=o.some(l=>!de(l.node)),a=o.some(l=>de(l.node)),c=r.isTypeOnly;return{importer:e,sourcePath:n,importedName:r.importedName,localName:r.localName,kind:r.kind,isTypeOnly:c,isUsed:c||o.length>0,isTypeUsed:c||a,isValueUsed:s,references:o.map(l=>l.location)}}sourceFile(e){return this.sourceFileMatch(e)?.sourceFile??null}sourceFileMatch(e){return It(e)?h(this.sourceFileCache,e,()=>{let n=g.join(this.db.config.projectRoot,e);for(let{project:r}of this.projects){let i=r.getSourceFile(n)??r.addSourceFileAtPathIfExists(n)??null;if(i)return{project:r,sourceFile:i}}return null}):null}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,n=this.packageExports();for(let r of this.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,n,r);for(let[r,i]of e)e.set(r,J(i));return this.packageImportReferenceIndex=e,e}indexedTypeScriptLikeDocuments(){return this.db.all(`SELECT relative_path
17
- FROM documents
18
- WHERE (
19
- relative_path LIKE '%.ts'
20
- OR relative_path LIKE '%.tsx'
21
- OR relative_path LIKE '%.mts'
22
- OR relative_path LIKE '%.cts'
23
- OR relative_path LIKE '%.js'
24
- OR relative_path LIKE '%.jsx'
25
- OR relative_path LIKE '%.mjs'
26
- OR relative_path LIKE '%.cjs'
27
- )
28
- ${this.db.pathExclusionsFor("documents")}`).map(e=>e.relative_path)}addPackageImportReferencesForDocument(e,n,r){if(this.db.isIgnored(r))return;let i=this.sourceFileMatch(r);if(i)for(let o of i.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,n,r,o)}addPackageImportReferencesForDeclaration(e,n,r,i){let o=st(this.workspacePackages,i.getModuleSpecifierValue());if(!o)return;let s=n.get(o);if(s)for(let a of ue(i)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=ft(a.identifier,r,this.db.config.projectRoot);l.length>0&&ht(e,c,l)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let e=new Map;for(let n of this.workspacePackages){let r=new Map;for(let i of at(n))this.collectPackageExports(n,i,r,new Set);r.size>0&&e.set(n.name,r)}return this.packageExportIndex=e,e}collectPackageExports(e,n,r,i){if(i.has(n))return;i.add(n);let o=this.sourceFile(n);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?w(this.db,n,a):n;if(!c||!c.startsWith(`${e.sourceRootRelative}/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,r,i);continue}for(let d of l){let m=d.getNameNode().getText(),V=d.getAliasNode()?.getText()??m,z=this.indexedDefinitionByLeaf(c,m);if(!z)continue;let D=r.get(V);D||(D=new Set,r.set(V,D)),D.add(z.symbolId)}}}indexedDefinitionByLeaf(e,n){return h(this.indexedDefinitionLeafCache,e,()=>mt(this.db,e)).get(n)??null}nodeForDefinition(e){return h(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return h(this.fileDefinitionNodeCache,e,()=>{let n=this.sourceFile(e);if(!n)return new Map;let r=Ze(this.db,e);return r.size===0?new Map:et(this.tsMorph,n,r)})}definitionFromSymbol(e){let n=e.getDeclarations();for(let r of n){let i=r.getSourceFile(),o=_(this.db.config.projectRoot,i.getFilePath());if(!o||this.db.isIgnored(o))continue;let s=L(i,r),a=gt(this.db,o,s,e.getName());if(a)return{symbol:a.symbol,file:a.relativePath,line:a.startLine}}return null}calleeMapForFile(e){let n=this.sourceFile(e);if(!n)return new Map;let r=F(this.db,e).sort((o,s)=>o.startLine-s.startLine||s.endLine-o.endLine);if(r.length===0)return new Map;let i=new Map;n.forEachDescendant(o=>{if(!this.tsMorph.Node.isCallExpression(o)&&!this.tsMorph.Node.isNewExpression(o))return;let s=this.semanticCalleeForCallNode(n,r,o);s&&nt(i,s.callerId,s.target)});for(let[o,s]of i)i.set(o,yt(s));return i}semanticCalleeForCallNode(e,n,r){let i=St(n,L(e,r));if(!i)return null;let o=r.getExpression(),s=o.getSymbol()??o.getType().getSymbol(),a=s?this.definitionFromSymbol(s):null;return a?{callerId:i.symbolId,target:{symbol:a.symbol,file:a.file,line:a.line}}:null}};function ue(t){let e=[],n=t.getDefaultImport();n&&e.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:t.getImportClause()?.isTypeOnly()??!1});let r=t.getNamespaceImport();r&&e.push({identifier:r,importedName:"*",localName:r.getText(),kind:"namespace",isTypeOnly:t.getImportClause()?.isTypeOnly()??!1});for(let i of t.getNamedImports()){let o=i.getNameNode(),a=i.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:i.isTypeOnly()||(t.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Ze(t,e){let n=new Map;for(let r of F(t,e)){let i=C(r.symbol)??r.leaf;if(!i)continue;let o=n.get(i);o||(o=[],n.set(i,o)),o.push(r)}return n}function et(t,e,n){let r=new Map,i=new Map;return e.forEachDescendant(o=>{for(let s of pt(t,o)){let a=n.get(s);if(!a)continue;let c=L(e,o);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let d=Math.abs(c-l.startLine),m=i.get(l.symbolId);m!==void 0&&m<=d||(i.set(l.symbolId,d),r.set(l.symbolId,o))}}}),r}function tt(t,e,n){return{importer:t,sourcePath:e,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function nt(t,e,n){let r=t.get(e);r||(r=[],t.set(e,r)),r.push(n)}function rt(t){let e=g.join(t,"package.json");if(!T(e))return[];let n;try{n=JSON.parse(pe(e,"utf8"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(i=>it(t,i)).flatMap(i=>ot(t,i))}function it(t,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=g.join(t,e);return T(g.join(s,"package.json"))?[s]:[]}let n=e.indexOf("*"),r=e.slice(0,n).replace(/\/$/,""),i=e.slice(n+1).replace(/^\//,""),o=g.join(t,r||".");if(!T(o))return[];try{return Ge(o).map(s=>g.join(o,s,i)).filter(s=>T(g.join(s,"package.json")))}catch{return[]}}function ot(t,e){try{let n=JSON.parse(pe(g.join(e,"package.json"),"utf8"));if(!n.name)return[];let r=g.relative(t,e).replace(/\\/g,"/");return[{name:n.name,rootRelative:r,sourceRootRelative:`${r}/src`}]}catch{return[]}}function st(t,e){for(let n of t)if(e===n.name||e.startsWith(`${n.name}/`))return n.name;return null}function at(t){return[`${t.sourceRootRelative}/index.ts`,`${t.sourceRootRelative}/index.tsx`,`${t.sourceRootRelative}/index.mts`,`${t.sourceRootRelative}/index.cts`]}function ct(t,e){return t.getReferences().map(n=>{let r=n.getNode();return me(r,e)})}function lt(t){let e=t;return typeof e.findReferences=="function"?e.findReferences():[]}function ut(t,e,n,r){let i=[];for(let o of lt(t))for(let s of ct(o,r))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||i.push(s);for(let o of n)i.push(o);return J(i)}function dt(t,e,n,r){let i=[],o=n?.getStart();for(let s of t.getReferences()){let a=s.getNode();_(r,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||i.push({location:me(a,r),node:a}))}return i}function me(t,e){let n=t.getSourceFile(),r=n.getLineAndColumnAtPos(t.getStart());return{file:_(e,n.getFilePath())??n.getBaseName(),line:r.line-1,column:r.column-1}}function ft(t,e,n){let r=t.getSourceFile(),i=L(r,t),o=t.getText(),s=new RegExp(`\\b${xt(o)}\\b`,"g"),a=r.getFullText().split(`
29
- `),c=[];for(let l=0;l<a.length;l++){if(l===i)continue;let d=a[l]??"";s.lastIndex=0;let m;for(;(m=s.exec(d))!==null;)c.push({file:e,line:l,column:m.index})}return J(c.filter(l=>_(n,g.join(n,l.file))===e))}function de(t){for(let e=t;e;e=e.getParent()){let n=e.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function pt(t,e){let n=[],r=i=>{i&&!n.includes(i)&&n.push(i)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let i=e.getNameNode();r(i?.getText())}if("getName"in e&&typeof e.getName=="function"){let i=e.getName();r(i)}return t.Node.isIdentifier(e)&&r(e.getText()),n}function gt(t,e,n,r){return t.all(`SELECT
30
- gs.id AS symbolId,
31
- gs.symbol,
32
- d.relative_path AS relativePath,
33
- COALESCE(der.start_line, c.start_line) AS startLine,
34
- COALESCE(der.end_line, c.end_line) AS endLine,
35
- COALESCE(gs.display_name, '') AS leaf,
36
- NULL AS parentTypeName,
37
- CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
38
- CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
39
- gs.kind AS kind,
40
- gs.documentation AS documentation,
41
- gs.enclosing_symbol AS enclosingSymbol
42
- FROM global_symbols gs
43
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
44
- LEFT JOIN chunks c ON c.document_id = der.document_id
45
- JOIN documents d ON d.id = der.document_id
46
- WHERE d.relative_path = ?
47
- AND COALESCE(gs.display_name, gs.symbol) LIKE ?
48
- ORDER BY ABS(COALESCE(der.start_line, c.start_line) - ?)
49
- LIMIT 5`,e,`%${r}%`,n)[0]??null}function mt(t,e){let n=t.all(`SELECT
50
- d.id AS documentId,
51
- gs.id AS symbolId,
52
- gs.symbol,
53
- d.relative_path AS relativePath,
54
- der.start_line AS startLine,
55
- der.end_line AS endLine,
56
- COALESCE(gs.display_name, '') AS leaf,
57
- NULL AS parentTypeName,
58
- CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
59
- CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
60
- gs.kind AS kind,
61
- gs.documentation AS documentation,
62
- gs.enclosing_symbol AS enclosingSymbol
63
- FROM global_symbols gs
64
- JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
65
- JOIN documents d ON d.id = der.document_id
66
- WHERE d.relative_path = ?
67
- UNION ALL
68
- SELECT
69
- d.id AS documentId,
70
- gs.id AS symbolId,
71
- gs.symbol,
72
- d.relative_path AS relativePath,
73
- MIN(c.start_line) AS startLine,
74
- MAX(c.end_line) AS endLine,
75
- COALESCE(gs.display_name, '') AS leaf,
76
- NULL AS parentTypeName,
77
- CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
78
- CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
79
- gs.kind AS kind,
80
- gs.documentation AS documentation,
81
- gs.enclosing_symbol AS enclosingSymbol
82
- FROM global_symbols gs
83
- JOIN mentions m ON m.symbol_id = gs.id
84
- JOIN chunks c ON c.id = m.chunk_id
85
- JOIN documents d ON d.id = c.document_id
86
- WHERE d.relative_path = ?
87
- AND m.role = 1
88
- GROUP BY gs.id, gs.symbol, d.id, d.relative_path, gs.display_name, gs.kind, gs.documentation, gs.enclosing_symbol
89
- ORDER BY startLine, endLine`,e,e),r=new Set,i=new Map;for(let o of n){if(r.has(o.symbolId))continue;r.add(o.symbolId);let s=o.leaf||C(o.symbol);!s||i.has(s)||i.set(s,{...o,leaf:s})}return i}function St(t,e){let n=null;for(let r of t)e<r.startLine||e>r.endLine||(!n||r.startLine>=n.startLine)&&(n=r);return n}function L(t,e){return t.getLineAndColumnAtPos(e.getStart()).line-1}function J(t){let e=new Set,n=[];for(let r of t){let i=`${r.file}:${r.line}:${r.column}`;e.has(i)||(e.add(i),n.push(r))}return n}function ht(t,e,n){for(let r of e){let i=t.get(r)??[];i.push(...n),t.set(r,i)}}function yt(t){let e=new Set,n=[];for(let r of t){let i=`${r.symbol}|${r.file}|${r.line}`;e.has(i)||(e.add(i),n.push(r))}return n}function h(t,e,n){if(t.has(e))return t.get(e);let r=n();return t.set(e,r),r}function _(t,e){let n=g.relative(t||process.cwd(),e).replace(/\\/g,"/");return!n||n.startsWith("..")?null:n}function It(t){return/\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs)$/.test(t)}function fe(t){return t.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}function xt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var B=new WeakMap;function Se(t,e){let n=`${t.config.projectRoot}:typescript-workspace`,r=B.get(t);r||(r=new Map,B.set(t,r));let i=r.get(n);if(i)return i;let o=ge(t,e);return r.set(n,o),o}function $t(t){B.delete(t)}function Ht(t,e){let n=M(t,e);return n?n.importUsage(e):[]}function Et(t,e){let n=M(t,e.relativePath);return n?n.referencesFor(e):[]}function Xt(t,e){let n=new Map;for(let r of e)for(let i of Et(t,r)){if(i.file===r.relativePath||t.isIgnored(i.file))continue;let o=n.get(r.symbolId);o||(o=new Set,n.set(r.symbolId,o)),o.add(i.file)}return n}function Jt(t,e){let n=new Map;for(let r of e){let i=M(t,r.relativePath);if(!i)continue;let o=i.calleesFor(r);o.length>0&&n.set(r.symbolId,o)}return n}function Bt(t,e){let n=M(t,e.relativePath);return n?n.signatureFor(e):null}function M(t,e){if(!Nt(e))return null;let n=Se(t,e);return n.availability().available?n:null}function Nt(t){return/\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs)$/.test(t)}export{q as a,te as b,re as c,Dt as d,Le as e,w as f,Ce as g,Fe as h,Oe as i,Pe as j,Ae as k,je as l,x as m,$t as n,Ht as o,Et as p,Xt as q,Jt as r,Bt as s};
90
- //# sourceMappingURL=chunk-67OMD56K.js.map
@@ -1,7 +0,0 @@
1
- import{c as S}from"./chunk-JMASYYSW.js";import{m as g}from"./chunk-EHEZLULQ.js";import{a as R}from"./chunk-BT36WY5B.js";import{d as h,w as m}from"./chunk-NLJCXHFU.js";function w(t,r,n={}){let e=R(t,r);if(!e)return[];let a=!m(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],l=S(t,e,{semantic:n.semantic}),f=(l.length>0?l:g(t,e)).filter(s=>!t.isIgnored(s.file)).map(s=>({relativePath:s.file,line:s.line})),o=d(t,e),p=new Set,c=[];for(let s of[...a,...f,...o]){let u=`${s.relativePath}:${s.line}`;p.has(u)||(p.add(u),c.push(s))}return c}function d(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=v(r.symbol);if(n.length===0)return[];let e=t.all(`SELECT relative_path
2
- FROM documents
3
- WHERE relative_path LIKE '%.rb'
4
- ${t.pathExclusionsFor("documents")}
5
- ORDER BY relative_path`),i=[];for(let a of e){if(t.isIgnored(a.relative_path))continue;let l=h(t,a.relative_path);if(!l)continue;let f=l.split(`
6
- `);for(let o=0;o<f.length;o++){let p=f[o]??"";n.some(c=>new RegExp(`@${c}\\b|\\b${c}:`).test(p))&&i.push({relativePath:a.relative_path,line:o})}}return i}function v(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{w as a};
7
- //# sourceMappingURL=chunk-6UVVA5I4.js.map
@@ -1,2 +0,0 @@
1
- import{b as p}from"./chunk-LLDPR3DG.js";import{B as f,I as u}from"./chunk-NLJCXHFU.js";function S(a,b){let y=p(a,b),o=u(a,y,{sort:!0});if(o.length===0)return[];let i=o.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,children:[]})),s=new Map;for(let e of i)s.set(e.symbol,e);let m=[];for(let e=0;e<o.length;e++){let r=o[e],n=i[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,c=1/0;for(let t of i)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!f(t.symbol,n.symbol))continue;let d=t.endLine-t.startLine;d<c&&(c=d,l=t)}l?l.children.push(n):m.push(n)}return m}export{S as a};
2
- //# sourceMappingURL=chunk-BAA4EJRX.js.map