scip-query 0.6.4 → 0.6.5

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 (196) hide show
  1. package/README.md +31 -29
  2. package/dist/augment-vue-worker.js +2 -0
  3. package/dist/chunk-2ZGHRI2A.js +5 -0
  4. package/dist/chunk-32R4VYYA.js +2 -0
  5. package/dist/chunk-3UB2DPLP.js +2 -0
  6. package/dist/chunk-4X7C236P.js +84 -0
  7. package/dist/chunk-5LQ6CVX3.js +2 -0
  8. package/dist/chunk-5YYMKE3G.js +70 -0
  9. package/dist/chunk-7LSCW7NF.js +6 -0
  10. package/dist/chunk-7X7FLQC5.js +2 -0
  11. package/dist/chunk-A5UNS4DR.js +4 -0
  12. package/dist/chunk-BNCTPTVX.js +2 -0
  13. package/dist/{chunk-CGAO6FHN.js → chunk-C5BFS23M.js} +2 -2
  14. package/dist/{chunk-OOMAS234.js → chunk-DRLWW74T.js} +2 -2
  15. package/dist/chunk-EB5IVUNU.js +2 -0
  16. package/dist/{chunk-ZE3BTHTS.js → chunk-ERRUE5G4.js} +4 -4
  17. package/dist/chunk-F4KR22Z2.js +2 -0
  18. package/dist/chunk-FG6A6ZUP.js +2 -0
  19. package/dist/chunk-FHSD5RKF.js +19 -0
  20. package/dist/chunk-FVVEIGP3.js +5 -0
  21. package/dist/chunk-GBDZY73J.js +2 -0
  22. package/dist/{chunk-4TYGGOLO.js → chunk-H4DXD2FB.js} +1 -1
  23. package/dist/chunk-HUASU3AD.js +71 -0
  24. package/dist/chunk-IJWIYZO5.js +2 -0
  25. package/dist/chunk-K6H3XJQW.js +7 -0
  26. package/dist/{chunk-KYT47WU2.js → chunk-KAM4C6ZD.js} +1 -1
  27. package/dist/{chunk-IDCWMWWP.js → chunk-KTCODJNQ.js} +3 -3
  28. package/dist/chunk-LJ2YWNQF.js +2 -0
  29. package/dist/chunk-LT2CPEQ4.js +2 -0
  30. package/dist/chunk-M5QTG55L.js +2 -0
  31. package/dist/chunk-MKFH7QJG.js +7 -0
  32. package/dist/chunk-MO32JMOD.js +12 -0
  33. package/dist/chunk-MO65UK5V.js +6 -0
  34. package/dist/chunk-MTK3JAJT.js +2 -0
  35. package/dist/{chunk-6UJ5PXER.js → chunk-MXWC53GJ.js} +4 -4
  36. package/dist/{chunk-IVT2U2BV.js → chunk-OQZF2DQJ.js} +3 -3
  37. package/dist/chunk-PBFMZKXE.js +6 -0
  38. package/dist/{chunk-LAXFZ3UW.js → chunk-PFMGJ4BR.js} +4 -4
  39. package/dist/{chunk-QID23O53.js → chunk-PK4U6NWP.js} +2 -2
  40. package/dist/{chunk-GALIM3IE.js → chunk-Q2ALKKSE.js} +4 -4
  41. package/dist/chunk-QFCK6WV2.js +39 -0
  42. package/dist/chunk-QFZE73XF.js +84 -0
  43. package/dist/chunk-QRYEOK3M.js +2 -0
  44. package/dist/{chunk-LORWXBOO.js → chunk-RKTDEIHF.js} +1 -1
  45. package/dist/chunk-ROWAEEOD.js +2 -0
  46. package/dist/chunk-RT5PV5JQ.js +7 -0
  47. package/dist/chunk-TLRA5TR6.js +2 -0
  48. package/dist/chunk-U5MVUPOO.js +2 -0
  49. package/dist/chunk-URUVLDM7.js +29 -0
  50. package/dist/chunk-WHGCGENP.js +16 -0
  51. package/dist/chunk-WIIZF5FP.js +2 -0
  52. package/dist/chunk-WNMAH3P7.js +2 -0
  53. package/dist/chunk-XV3XUZ3X.js +11 -0
  54. package/dist/chunk-YDKWDTAW.js +2 -0
  55. package/dist/{chunk-5OVBASGY.js → chunk-YDNCX5PF.js} +2 -2
  56. package/dist/chunk-YU25IHJX.js +90 -0
  57. package/dist/{chunk-AW3QJT4O.js → chunk-Z5CTXSWT.js} +3 -3
  58. package/dist/chunk-ZFCQQ4B5.js +2 -0
  59. package/dist/chunk-ZHHMG4UC.js +114 -0
  60. package/dist/cli.js +487 -388
  61. package/dist/{db-DKhNQ75l.d.ts → db-BZPa7dzJ.d.ts} +19 -9
  62. package/dist/index.d.ts +221 -13
  63. package/dist/index.js +45 -31
  64. package/dist/postinstall.js +1 -1
  65. package/dist/queries/affected.d.ts +1 -1
  66. package/dist/queries/affected.js +1 -1
  67. package/dist/queries/bottlenecks.d.ts +1 -1
  68. package/dist/queries/bottlenecks.js +1 -1
  69. package/dist/queries/by-kind.d.ts +1 -1
  70. package/dist/queries/by-kind.js +1 -1
  71. package/dist/queries/call-graph.d.ts +1 -1
  72. package/dist/queries/call-graph.js +1 -1
  73. package/dist/queries/change-surface.d.ts +1 -1
  74. package/dist/queries/change-surface.js +1 -1
  75. package/dist/queries/code.d.ts +1 -1
  76. package/dist/queries/code.js +1 -1
  77. package/dist/queries/complexity-hotspots.d.ts +1 -1
  78. package/dist/queries/complexity-hotspots.js +1 -1
  79. package/dist/queries/complexity.d.ts +1 -1
  80. package/dist/queries/complexity.js +1 -1
  81. package/dist/queries/convergence.d.ts +1 -1
  82. package/dist/queries/convergence.js +1 -1
  83. package/dist/queries/coupling.d.ts +1 -1
  84. package/dist/queries/coupling.js +1 -1
  85. package/dist/queries/cycles.d.ts +1 -1
  86. package/dist/queries/cycles.js +1 -1
  87. package/dist/queries/dataflow.d.ts +1 -1
  88. package/dist/queries/dataflow.js +1 -1
  89. package/dist/queries/dead.d.ts +1 -1
  90. package/dist/queries/dead.js +1 -1
  91. package/dist/queries/deep-chains.d.ts +1 -1
  92. package/dist/queries/deep-chains.js +1 -1
  93. package/dist/queries/deps.d.ts +1 -1
  94. package/dist/queries/deps.js +1 -1
  95. package/dist/queries/diff-impact.d.ts +1 -1
  96. package/dist/queries/diff-impact.js +1 -1
  97. package/dist/queries/drift-policy.d.ts +6 -0
  98. package/dist/queries/drift-policy.js +2 -0
  99. package/dist/queries/drift.d.ts +1 -1
  100. package/dist/queries/drift.js +1 -1
  101. package/dist/queries/extract-candidates.d.ts +1 -1
  102. package/dist/queries/extract-candidates.js +1 -1
  103. package/dist/queries/fan.d.ts +1 -1
  104. package/dist/queries/fan.js +1 -1
  105. package/dist/queries/files.d.ts +1 -1
  106. package/dist/queries/files.js +1 -1
  107. package/dist/queries/health.d.ts +1 -1
  108. package/dist/queries/health.js +1 -1
  109. package/dist/queries/hierarchy.d.ts +1 -1
  110. package/dist/queries/hierarchy.js +1 -1
  111. package/dist/queries/hotspots.d.ts +1 -1
  112. package/dist/queries/hotspots.js +1 -1
  113. package/dist/queries/imports.d.ts +1 -1
  114. package/dist/queries/imports.js +1 -1
  115. package/dist/queries/index.d.ts +1 -1
  116. package/dist/queries/index.js +1 -1
  117. package/dist/queries/isolated.d.ts +1 -1
  118. package/dist/queries/isolated.js +1 -1
  119. package/dist/queries/members.d.ts +1 -1
  120. package/dist/queries/members.js +1 -1
  121. package/dist/queries/methods.d.ts +1 -1
  122. package/dist/queries/methods.js +1 -1
  123. package/dist/queries/outline.d.ts +1 -1
  124. package/dist/queries/outline.js +1 -1
  125. package/dist/queries/passthrough-candidates.d.ts +1 -1
  126. package/dist/queries/passthrough-candidates.js +1 -1
  127. package/dist/queries/redundant-reexports.d.ts +1 -1
  128. package/dist/queries/redundant-reexports.js +1 -1
  129. package/dist/queries/refs.d.ts +1 -1
  130. package/dist/queries/refs.js +1 -1
  131. package/dist/queries/similar-chains.d.ts +1 -1
  132. package/dist/queries/similar-chains.js +1 -1
  133. package/dist/queries/similar-files.d.ts +1 -1
  134. package/dist/queries/similar-files.js +1 -1
  135. package/dist/queries/similar-signatures.d.ts +1 -1
  136. package/dist/queries/similar-signatures.js +1 -1
  137. package/dist/queries/similar.d.ts +1 -1
  138. package/dist/queries/similar.js +1 -1
  139. package/dist/queries/slice.d.ts +1 -1
  140. package/dist/queries/slice.js +1 -1
  141. package/dist/queries/stale-abstractions.d.ts +1 -1
  142. package/dist/queries/stale-abstractions.js +1 -1
  143. package/dist/queries/stats.d.ts +1 -1
  144. package/dist/queries/stats.js +1 -1
  145. package/dist/queries/surface.d.ts +1 -1
  146. package/dist/queries/surface.js +1 -1
  147. package/dist/queries/symbols.d.ts +1 -1
  148. package/dist/queries/symbols.js +1 -1
  149. package/dist/queries/system.d.ts +1 -1
  150. package/dist/queries/system.js +1 -1
  151. package/dist/queries/trace.d.ts +1 -1
  152. package/dist/queries/trace.js +1 -1
  153. package/dist/queries/wrapper-candidates.d.ts +1 -1
  154. package/dist/queries/wrapper-candidates.js +1 -1
  155. package/dist/reindex-worker.js +10 -63
  156. package/package.json +4 -2
  157. package/dist/chunk-2DQK2IDZ.js +0 -19
  158. package/dist/chunk-4HCKXL7T.js +0 -6
  159. package/dist/chunk-4Q2D5BMS.js +0 -2
  160. package/dist/chunk-5IM4IQ6N.js +0 -2
  161. package/dist/chunk-5NSYCQWM.js +0 -6
  162. package/dist/chunk-6QKHOBC6.js +0 -2
  163. package/dist/chunk-6U5UHIRD.js +0 -5
  164. package/dist/chunk-AQFXC7CF.js +0 -2
  165. package/dist/chunk-BSONDC3H.js +0 -7
  166. package/dist/chunk-ECT6SOBO.js +0 -2
  167. package/dist/chunk-FFE3RZ65.js +0 -2
  168. package/dist/chunk-FT4WPAEX.js +0 -65
  169. package/dist/chunk-G6HYVVRV.js +0 -2
  170. package/dist/chunk-GVVKLMXG.js +0 -10
  171. package/dist/chunk-HVM6SQPQ.js +0 -2
  172. package/dist/chunk-IJO2HZFL.js +0 -2
  173. package/dist/chunk-INPQVQ6O.js +0 -12
  174. package/dist/chunk-JSBWVSES.js +0 -39
  175. package/dist/chunk-MFVPKCS5.js +0 -2
  176. package/dist/chunk-MWCN46ZX.js +0 -89
  177. package/dist/chunk-N3Z2SJCR.js +0 -2
  178. package/dist/chunk-NKU7Z242.js +0 -8
  179. package/dist/chunk-P6IUCZA3.js +0 -24
  180. package/dist/chunk-PM3GTZ4I.js +0 -2
  181. package/dist/chunk-QL5MJOVA.js +0 -84
  182. package/dist/chunk-QWFK4QOQ.js +0 -2
  183. package/dist/chunk-RBYC6PHE.js +0 -2
  184. package/dist/chunk-TS7E5XBZ.js +0 -29
  185. package/dist/chunk-TUC6IWTY.js +0 -2
  186. package/dist/chunk-USMVRM6F.js +0 -2
  187. package/dist/chunk-VTZPTRKS.js +0 -7
  188. package/dist/chunk-WUYKGQSK.js +0 -2
  189. package/dist/chunk-X7LOLGYY.js +0 -2
  190. package/dist/chunk-XGOEZVMA.js +0 -7
  191. package/dist/chunk-Y6NOLG4X.js +0 -70
  192. package/dist/chunk-YVQ7CIKO.js +0 -6
  193. package/dist/chunk-ZIFKQQW2.js +0 -4
  194. package/dist/chunk-ZOR6FW74.js +0 -2
  195. package/dist/chunk-ZPZLVFJQ.js +0 -41
  196. package/dist/chunk-ZZ3F6P3X.js +0 -2
package/README.md CHANGED
@@ -253,11 +253,11 @@ Show a symbol's definition (with signature) and every file that references it. L
253
253
  ```bash
254
254
  scip-query trace parseSymbol
255
255
  # ═══ DEFINITION ═══
256
- # src/symbol-parser.ts:35-99 — parseSymbol(raw: string): ScipSymbol | ScipLocalSymbol
256
+ # src/symbols/symbol-parser.ts:35-99 — parseSymbol(raw: string): ScipSymbol | ScipLocalSymbol
257
257
  #
258
258
  # ═══ REFERENCED BY ═══
259
259
  # src/index.ts
260
- # src/symbol-parser.ts
260
+ # src/symbols/symbol-parser.ts
261
261
  ```
262
262
 
263
263
  **Value:** End-to-end symbol investigation. Answers "where is this defined, what's its signature, and who uses it?" in one command.
@@ -339,8 +339,8 @@ List all internal files that this file depends on (forward dependencies).
339
339
 
340
340
  ```bash
341
341
  scip-query deps cli.ts
342
- # src/config.ts
343
- # src/db.ts
342
+ # src/runtime/config.ts
343
+ # src/storage/db.ts
344
344
  # src/queries/index.ts
345
345
  # src/reindex/index.ts
346
346
  ```
@@ -382,11 +382,11 @@ scip-query system queries
382
382
  # ...
383
383
  #
384
384
  # ═══ DEPENDS ON (internal) ═══
385
- # src/db.ts
386
- # src/symbol-parser.ts
385
+ # src/storage/db.ts
386
+ # src/symbols/symbol-parser.ts
387
387
  #
388
388
  # ═══ DEPENDED ON BY ═══
389
- # src/cli.ts
389
+ # src/runtime/cli.ts
390
390
  # src/index.ts
391
391
  ```
392
392
 
@@ -399,9 +399,9 @@ scip-query system queries
399
399
  What symbols do external consumers actually use from this module? The true public API — not what's exported, but what's actually imported and referenced by other modules.
400
400
 
401
401
  ```bash
402
- scip-query surface db.ts
403
- # src/cli.ts → ScipDatabase
404
- # src/cli.ts → ScipDatabase:close()
402
+ scip-query surface storage/db.ts
403
+ # src/runtime/cli.ts → ScipDatabase
404
+ # src/runtime/cli.ts → ScipDatabase:close()
405
405
  # src/queries/dead.ts → ScipDatabase:all()
406
406
  # src/queries/dead.ts → ScipDatabase:isIgnored()
407
407
  ```
@@ -547,14 +547,14 @@ scip-query fan-in -n 10
547
547
  How many external symbols a file references. Without an argument, shows the top N files by fan-out. High fan-out files are fragile — they depend on many things, so upstream changes are more likely to break them.
548
548
 
549
549
  ```bash
550
- scip-query fan-out cli.ts
551
- # 23 symbols src/cli.ts
550
+ scip-query fan-out runtime/cli.ts
551
+ # 23 symbols src/runtime/cli.ts
552
552
 
553
553
  scip-query fan-out -n 10
554
554
  # symbols file
555
555
  # ─────── ────
556
556
  # 68 src/queries/index.ts
557
- # 23 src/cli.ts
557
+ # 23 src/runtime/cli.ts
558
558
  ```
559
559
 
560
560
  **Options:**
@@ -574,7 +574,7 @@ scip-query bottlenecks -n 10
574
574
  # score fan-in fan-out symbol
575
575
  # ───── ────── ─────── ──────
576
576
  # 136 2 68 src:queries:index
577
- # 124 31 4 src:db:ScipDatabase
577
+ # 124 31 4 src:storage:db:ScipDatabase
578
578
  ```
579
579
 
580
580
  **Options:**
@@ -592,13 +592,13 @@ scip-query bottlenecks -n 10
592
592
  Measure coupling between two specific files (how many symbols they share), or find the most coupled file pairs across the codebase.
593
593
 
594
594
  ```bash
595
- scip-query coupling db.ts cli.ts
596
- # db.ts ↔ cli.ts: 4 shared symbols
595
+ scip-query coupling storage/db.ts runtime/cli.ts
596
+ # storage/db.ts ↔ runtime/cli.ts: 4 shared symbols
597
597
 
598
598
  scip-query coupling -n 10
599
599
  # shared file1 → file2
600
600
  # ────── ─────────────
601
- # 5 src/db.ts → src/queries/stats.ts
601
+ # 5 src/storage/db.ts → src/queries/stats.ts
602
602
  ```
603
603
 
604
604
  **Options:**
@@ -639,11 +639,11 @@ Find the longest transitive dependency chains in the codebase. A chain A → B
639
639
  ```bash
640
640
  scip-query deep-chains -n 5 --min-depth 4
641
641
  # Chain 1 (depth 5):
642
- # → src/cli.ts
642
+ # → src/runtime/cli.ts
643
643
  # → src/queries/index.ts
644
644
  # → src/queries/surface.ts
645
- # → src/db.ts
646
- # → src/types.ts
645
+ # → src/storage/db.ts
646
+ # → src/domain/types.ts
647
647
  ```
648
648
 
649
649
  **Options:**
@@ -868,16 +868,20 @@ scip-query diff-impact --base main
868
868
 
869
869
  #### `drift [module]`
870
870
 
871
- Detect files that deviate from their directory's typical dependency pattern.
871
+ Detect unused imports, layer violations, and dependency-pattern deviations.
872
872
 
873
873
  ```bash
874
- scip-query drift
875
- # src/services/legacy-auth.ts (65% deviation from src/services)
876
- # Missing expected: validator.ts, logger.ts
877
- # Unexpected: raw-sql.ts, deprecated-crypto.ts
874
+ scip-query drift --min-deviation 6
875
+ #
876
+ # src/services/legacy-auth.ts
877
+ # [LAYER] Imports from infra/ (infra/raw-sql.ts) — may cross architectural boundary
878
+ # app/ should not depend on infra/
878
879
  ```
879
880
 
880
- **Value:** Finds files that don't follow their neighbors' conventions. The outliers are either legacy code needing migration or intentional exceptions needing documentation.
881
+ **Options:**
882
+ - `--min-deviation <n>` — Minimum sibling files before reporting unique dependency deviations (default: 5)
883
+
884
+ **Value:** Finds unused imports, layer-policy violations, and files that don't follow their neighbors' dependency conventions. The outliers are either legacy code needing migration or intentional exceptions needing documentation.
881
885
 
882
886
  ---
883
887
 
@@ -1096,9 +1100,7 @@ Find barrel file re-exports that nobody imports through.
1096
1100
 
1097
1101
  ```bash
1098
1102
  scip-query redundant-reexports
1099
- # src/index.ts
1100
- # resolveCacheDir() (from src/config.ts)
1101
- # barrel: 0 consumer(s) | direct: 0 consumer(s)
1103
+ # No redundant re-exports found.
1102
1104
  ```
1103
1105
 
1104
1106
  **Options:**
@@ -0,0 +1,2 @@
1
+ import{c as t}from"./chunk-HUASU3AD.js";import{writeFileSync as o}from"fs";import{workerData as s}from"worker_threads";var e=s;try{let r=t({projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,vueFiles:e.vueFiles,tasks:e.tasks});o(e.resultPath,JSON.stringify({ok:!0,result:r}))}catch(r){o(e.resultPath,JSON.stringify({ok:!1,error:r instanceof Error?r.message:String(r)}))}finally{let r=new Int32Array(e.sharedBuffer);Atomics.add(r,0,1),Atomics.notify(r,0)}
2
+ //# sourceMappingURL=augment-vue-worker.js.map
@@ -0,0 +1,5 @@
1
+ import{a as b,b as L,c as q,d as X,e as Z,f as T,g as $,h as _,i as U,j as B,k as h,l as W,m as J}from"./chunk-YU25IHJX.js";import{a as M,c as H,d as v,f as j,g as Q,h as g}from"./chunk-QFZE73XF.js";import{existsSync as ye,readFileSync as Ne}from"fs";import{join as Ie}from"path";function G(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 _e=H("stripped-lines");function At(e,r,t){return _e.get(e,r,t,()=>G(t).split(`
2
+ `))}var K=null,z="";function Ce(e){return K===e||(K=e,z=G(e)),z}function E(e,r,t){let s=Ce(e);return`${s.slice(0,r)}${" ".repeat(t-r)}${s.slice(t)}`}function S(e,r){return new RegExp(`\\b${Y(r)}\\b`,"m").test(e)}function k(e,r){let t=new Set,s=new RegExp(`\\b${Y(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let n of e.matchAll(s)){let o=n[1];o&&t.add(o)}return[...t]}function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function x(e){let r=[],t=0,s=0;for(let n=0;n<e.length;n++){let o=e[n];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&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=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]),n=(o,i)=>{let a=i||r.has(o.type);!a&&s.has(o.type)&&t.add(o.text);for(let c of o.children)n(c,a)};return n(e.rootNode,!1),t}function P(e,r,t,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??h(e,s,Z(r)),kind:"named",used:S(t,o),usedMembers:[]}}function N(e,r,t){let s=[];for(let n of e.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=E(e,n.index,n.index+o.length);s.push(...t(n,i))}return s}function te(e,r,t){let s=g(e,r);return s?Ee(e,r,s):ve(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 o of t.rootNode.descendantsOfType("import_statement"))n.push(...Te(e,r,t,o,s));return n}function Re(e,r,t){let s=f(t,new Set(["import_statement"]));if(Q(r))for(let n of Ke(e,r))s.add(n);return s}function Te(e,r,t,s,n){let o=Oe(s);if(!o)return[];let i=T(e,r,o),a=y(s,"import_clause");return a?De(t,a,i,n,je(s.text)):[ke(i)]}function De(e,r,t,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Ae(i.text,t,s,n));else if(i.type==="namespace_import"){let a=Me(e,i,t,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...$e(i,t,s,n));return o}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 i=y(r,"identifier")?.text??"";if(!i)return null;let a=we(e,i);return{importedName:"*",localName:i,sourcePath:t,kind:"namespace",used:a.length>0||s.has(i),usedMembers:a,isTypeOnly:n}}function $e(e,r,t,s){let n=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,p=a?.text??c;n.push({importedName:c,localName:p,sourcePath:r,kind:"named",used:t.has(p),usedMembers:[],isTypeOnly:s||Le(o.text)})}return n}function Oe(e){let r=y(e,"string");if(!r)return null;let t=y(r,"string_fragment");return t?t.text:null}function je(e){return/^\s*import\s+type\b/.test(e)}function Le(e){return/^\s*type\b/.test(e.trim())}function we(e,r){let t=new Set;for(let s of e.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),o=s.namedChild(1);!n||!o||n.type!=="identifier"||n.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function ve(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of e.matchAll(t)){let o=n[0],i=n[1],a=n[2];!o||!a||typeof n.index!="number"||r.push({clause:i,specifier:a,start:n.index,end:n.index+o.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of e.matchAll(s)){let o=n[0],i=n[1];!o||!i||typeof n.index!="number"||r.push({clause:null,specifier:i,start:n.index,end:n.index+o.length})}return r.sort((n,o)=>n.start-o.start)}function qe(e,r,t,s,n,o,i){let a=T(e,r,s),c=E(i,n,o);return t?Ue(t).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let m=k(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,o]=Be(s),i=[];return n&&i.push(...ee(n,t)),o&&i.push(...ee(o,t)),i}function ee(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 o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,p]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(p??c).trim(),kind:"named",isTypeOnly:i}}):[]}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 re(e,r){let t=g(e,r);if(t)return He(e,r,t);let s=v(e,r);return s?We(e,r,s):[]}function We(e,r,t){return[...Je(e,r,t),...ze(e,r,t),...Fe(e,r,t)]}function Je(e,r,t){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=x(i).map(m=>Ve(m.trim())).filter(m=>!!m),p=A(t,o.index),u=A(t,o.index+o[0].length-1);s.push({kind:"named",sourcePath:T(e,r,a),names:c,startLine:p,endLine:u})}return s}function ze(e,r,t){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=A(t,o.index),c=A(t,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:T(e,r,i),names:[],startLine:a,endLine:c})}return s}function Fe(e,r,t){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=A(t,o.index),c=A(t,o.index+o[0].length-1);s.push({kind:"star",sourcePath:T(e,r,i),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 A(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 o=Qe(e,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,c=Xe(n,o,i,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 T(e,r,n.text)}function Xe(e,r,t,s){let n=y(e,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),p=a.namedChild(1);c&&i.push((p??c).text)}return{kind:"named",sourcePath:r,names:i,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=M("vue-non-script-identifiers");function Ke(e,r){return Ze.get(e,r,()=>{let t=new Set,s=v(e,r);if(!s)return t;let o=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}import{basename as se}from"path";function ne(e,r,t){let s=g(e,r);return s?Ge(e,r,s):N(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let a=se(i).replace(/\.[^.]+$/,"");return[{importedName:i,localName:a,sourcePath:B(e,r,i),kind:"named",used:S(o,a),usedMembers:[]}]})}function Ge(e,r,t){let s=f(t,new Set(["preproc_include"])),n=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(u=>u.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=se(i).replace(/\.[^.]+$/,"");n.push({importedName:i,localName:a,sourcePath:B(e,r,i),kind:"named",used:s.has(a),usedMembers:[]})}return n}function oe(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 o=n[1]?.trim(),i=n[2]?.trim()??null,a=n[0];if(!o||!a||typeof n.index!="number")continue;let c=E(t,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:W(e,r,o),kind:i?"namespace":"side-effect",used:i?S(c,i):!0,usedMembers:i?k(c,i):[]})}return s}function ie(e,r,t){let s=[];for(let n of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:W(e,r,o)})}return s}function ae(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 Ye(e,r,s);let o=X(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(t,o,(i,a)=>{let c=i[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,L))]})}function Ye(e,r,t){let s=f(t,new Set(["imports_statement"])),n=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(l=>l.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,p=a.text,u=p.split(".").pop()??p,m=c?.text??u;n.push({importedName:u,localName:m,sourcePath:h(e,p,L),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 o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.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,L),kind:a?"namespace":"named",used:s.has(m),usedMembers:[]})}return n}function ce(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,(o,i)=>{let a=o[1]?.trim();return a?nt(e,r,a,i):[]})}function tt(e,r,t){let s=f(t,new Set(["import_declaration"])),n=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(m=>m.type==="asterisk"),c=o.namedChildren.find(m=>m.type==="scoped_identifier")??o.namedChildren.find(m=>m.type==="identifier");if(!c)continue;let p=c.text;if(i){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 o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),c=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push({importedName:"*",localName:null,sourcePath:h(e,i.text,b),kind:"namespace",used:!0,usedMembers:[]});continue}let p=i.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 o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(m=>m.type==="namespace_selectors"||m.type==="namespace_wildcard"),a=o.namedChildren.filter(m=>m!==i&&(m.type==="identifier"||m.type==="stable_identifier")),c=a.map(m=>m.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){n.push({importedName:"*",localName:null,sourcePath:h(e,c,b),kind:"namespace",used:!0,usedMembers:[]});continue}if(i?.type==="namespace_selectors"){for(let m of i.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(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.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 me(e,r,t){let s=g(e,r);return s?ot(e,r,s):N(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,o)=>{let i=n[1]?.trim();return i?x(i).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,o,m,l,d,h(e,m.replace(/\\/g,"."),q))]}):[]})}function ot(e,r,t){let s=f(t,new Set(["namespace_use_declaration"])),n=[],o=(i,a,c)=>{n.push({importedName:a,localName:c,sourcePath:h(e,i.replace(/\\/g,"."),q),kind:"named",used:s.has(c),usedMembers:[]})};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.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}=pe(p,c);u&&o(l,u,m)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=pe(c,"");p&&o(m,p,u)}}return n}function pe(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 o=t&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,c=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:c}}function de(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 o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=ue(i);if(!a)continue;let c=$(e,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=at(i);if(a===null)continue;let c=$(e,r,a);for(let p=1;p<o.namedChildCount;p+=1){let u=o.namedChild(p);if(u.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let m=ue(u);m&&n.push({importedName:m.qualifiedName,localName:m.localName,sourcePath:c,kind:"named",used:s.has(m.localName),usedMembers:[]})}}return n}function ue(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 o=r[n],i=o.trimStart(),a=s;if(s+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,p=a+o.length,u=le(o);for(;n+1<r.length&&(u>0||c.trimEnd().endsWith("\\"));){n++;let l=r[n];c+=`
4
+ ${l}`,p+=1+l.length,u+=le(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),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return x(o).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=$(e,r,l),R=k(n,d);return[{importedName:l,localName:d,sourcePath:I,kind:"namespace",used:S(n,d)||R.length>0,usedMembers:R}]});let i=t.module?$(e,r,t.module):null,a=[];for(let c of x(o)){let p=c.trim().replace(/,$/,"");if(!p)continue;if(p==="*"){a.push({importedName:"*",localName:null,sourcePath:i,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:i,kind:"named",used:S(n,l),usedMembers:[]})}return a}function le(e){let r=0;for(let t of e)t==="("&&r++,t===")"&&r--;return r}import{basename as ut}from"path";function fe(e,r,t){let s=g(e,r);return s?lt(e,r,s):N(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,o)=>{let i=n[1],a=n[2];if(!i||!a)return[];let c=i==="require_relative"?U(e,r,a):null;if(c){let p=ge(a);return[{importedName:p,localName:p,sourcePath:c,kind:"named",used:S(o,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=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let p=i.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"?U(e,r,m):null;if(l){let d=ge(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 ge(e){return ut(e).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function he(e,r,t){let s=g(e,r);return s?dt(e,r,s):N(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,o)=>{let i=n[1]?.trim();return i?ft(e,r,i,o):[]})}function dt(e,r,t){let s=f(t,new Set(["use_declaration"])),n=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of O(i,"")){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 O(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:w(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,s=t.split("::").pop()??t;return[{qualifiedName:w(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=w(r,t.text),o=[];for(let i of s.namedChildren)o.push(...O(i,n));return o}case"use_list":{let t=[];for(let s of e.namedChildren)t.push(...O(s,r));return t}case"use_as_clause":{let t=e.namedChild(0),s=e.namedChild(1);if(!t||!s)return[];let n=O(t,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),s=t?t.text:"";return[{qualifiedName:w(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function w(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+/),D=I?.trim();if(!D)return[];let Pe=(R??D.split("::").pop()??D).trim(),be=`${u}::${D}`.replace(/::::/g,"::");return[P(e,r,s,be,D.split("::").pop()??D,Pe,_(e,r,u))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,c=(i??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 Se(e,r,t){let s=g(e,r);if(s)return gt(e,r,s);let n=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(...St(e,r,i))}return n}function gt(e,r,t){let s=[];for(let n of t.rootNode.descendantsOfType("use_declaration")){if(!ht(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of O(o,""))i.importedName&&s.push(F(e,r,i.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(),o=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),p=`${n}::${c?.trim()??a}`.replace(/::::/g,"::");return[F(e,r,p)]})}return[F(e,r,s)]}function F(e,r,t){return{specifier:t,sourcePath:_(e,r,t)??_(e,r,t.split("::").slice(0,-1).join("::"))}}function xe(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:te},yt={language:"python",extensions:[".py",".pyi"],parseImports:de},Nt={language:"jvm",extensions:[".java",".scala",".kt",".kts"],parseImports:ce},It={language:"rust",extensions:[".rs"],parseImports:he,parseExports:Se},Pt={language:"ruby",extensions:[".rb"],parseImports:fe},bt={language:"c/cpp",extensions:[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],parseImports:ne},_t={language:"dotnet",extensions:[".cs",".vb"],parseImports:ae},Ct={language:"dart",extensions:[".dart"],parseImports:oe,parseExports:ie},Et={language:"php",extensions:[".php"],parseImports:me},Rt=[xt,yt,Nt,It,Pt,bt,_t,Ct,Et];function V(e){return xe(Rt,e)}function Jr(e,r){return re(e,r)}var Tt=M("source-imports"),Dt=M("source-exports");function zr(e,r){let t=J(r);return Tt.get(e,t,()=>{let s=V(t);if(!s)return[];let n=Ie(e.config.projectRoot,t);if(!ye(n))return[];let o=Ne(n,"utf-8");return s.parseImports(e,t,o)})}function Fr(e,r){let t=J(r);return Dt.get(e,t,()=>{let s=V(t);if(!s?.parseExports)return[];let n=Ie(e.config.projectRoot,t);if(!ye(n))return[];let o=Ne(n,"utf-8");return s.parseExports(e,t,o)})}export{G as a,At as b,Y as c,Jr as d,zr as e,Fr as f};
5
+ //# sourceMappingURL=chunk-2ZGHRI2A.js.map
@@ -0,0 +1,2 @@
1
+ import{a as b,e as N}from"./chunk-PK4U6NWP.js";import{a as p,b as q,d as A}from"./chunk-WIIZF5FP.js";import{c as M}from"./chunk-KTCODJNQ.js";import{b as h,c as R,f as F,g as k,k as T,m as v}from"./chunk-4X7C236P.js";import{A as P,C as x,e as d,f as y,g as S,l as g,r as L,s as D,u as C,v as I}from"./chunk-QFZE73XF.js";function O(i,e,o){let l=e.identifierResolution==="strict"?p:q;for(let r of e.paths){let s=y(r);if(!s&&!(e.includeVueSfc&&S(r))||i.isIgnored(r)||e.skipPath?.(r))continue;let u=F(i,r);for(let[n,a]of u)for(let f of l(i,r,n))o({sourceFile:r,name:n,target:f,occurrences:a.length,kind:"identifier"});if(e.includeCrossLanguageDispatchNames)for(let n of R(i,r))for(let a of p(i,r,n))o({sourceFile:r,name:n,target:a,occurrences:1,kind:"cross-language-dispatch"});if(e.includeRustAttributeNames&&s==="rust")for(let n of h(i,r))for(let a of l(i,r,n))o({sourceFile:r,name:n,target:a,occurrences:1,kind:"rust-attribute"})}}var E=class{constructor(e){this.db=e}db;scopedDefinitions(e){return x(this.db,e)}definitionsForFile(e){return P(this.db,e)}productionCallableDefinitions(e={}){let{scope:o,minLoc:l=1,maxLoc:r=Number.POSITIVE_INFINITY,excludeSymbol:s,excludeEntrySurfaces:u=!1,excludeTypesFiles:n=!1,requireFunctionLikeSymbol:a=!1,requireCallableSymbol:f=!1,excludeRustTraitImplMembers:V=!1,includeSuppressed:G=!1,sortByLocDesc:K=!1}=e,m=this.scopedDefinitions(o).filter(t=>!this.db.isIgnored(t.relativePath)).filter(t=>!u||!N(this.db,t.relativePath)).filter(t=>B(t,{requireFunctionLikeSymbol:a,requireCallableSymbol:f})).filter(t=>s===void 0||t.symbol!==s).filter(t=>c(t)>=l&&c(t)<=r).filter(t=>!n||!H(t.relativePath)).filter(t=>!V||!C(t.symbol)).filter(t=>b(t.relativePath)!=="test").filter(t=>!I(t.symbol)).filter(t=>G||!d(this.db,t.relativePath,t.startLine));return K?[...m].sort((t,j)=>c(j)-c(t)):m}calleeMap(e,o={}){return T(this.db,e,o)}crossFileCallerMap(e){return v(this.db,e)}sourceFallbackCallerFiles(e){return A(this.db,e)}fileDependencyGraph(e){return k(this.db,e)}fileKind(e){return b(e)}hasSuppressionComment(e){return d(this.db,e.relativePath,e.startLine)}sourceFiles(){return M(this.db)}scanSourceReferences(e,o){O(this.db,e,o)}callableSignature(e){return g(this.db,e.relativePath,e.startLine,e.endLine)}};function c(i){return i.endLine-i.startLine+1}function B(i,e){return e.requireCallableSymbol?L(i.symbol):e.requireFunctionLikeSymbol?D(i.symbol):i.isFunctionLike}function H(i){return(i.split("/").pop()??"").includes("types")}export{E as a};
2
+ //# sourceMappingURL=chunk-32R4VYYA.js.map
@@ -0,0 +1,2 @@
1
+ import{a as y}from"./chunk-32R4VYYA.js";import{f as g,h,o as m,s as p}from"./chunk-QFZE73XF.js";function x(n,e,s,o){let r=g(e);if(!r)return!0;let i=h(n,e);if(!i)return!0;let a=b.get(i);return a||(a=L(i,r),b.set(i,a)),a.get(`${s}:${o}`)??!0}var b=new WeakMap;function L(n,e){let s=e==="rust"?new Set(["function_item","function_signature_item"]):e==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),o=new Map,r=i=>{s.has(i.type)&&o.set(`${i.startPosition.row}:${i.endPosition.row}`,S(i,e));for(let a of i.children)r(a)};return r(n.rootNode),o}function S(n,e){let s=n.namedChildren.find(t=>t.type==="block"||t.type==="statement_block");if(!s)return!1;let o=s.namedChildren.filter(t=>t.type!=="comment"&&t.type!=="line_comment"&&t.type!=="block_comment");if(o.length!==1)return!1;let r=o[0],i=null;if(r.type==="return_statement"||r.type==="expression_statement"?i=r.namedChild(0)??null:e==="rust"&&(r.type==="call_expression"||r.type==="macro_invocation")&&(i=r),!i)return!1;let a=e==="python"?"call":"call_expression";if(i.type!==a)return!1;let f=i.namedChildren.find(t=>t.type==="arguments"||t.type==="argument_list");if(!f)return!1;let c=f.namedChildren.filter(t=>t.type!=="comment"),u=n.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters");if(!u)return!1;let l=[];for(let t of u.namedChildren)if(t.type==="identifier")l.push(t.text);else{let d=t.namedChildren.find(C=>C.type==="identifier");d&&l.push(d.text)}if(c.length!==l.length)return!1;for(let t=0;t<l.length;t+=1){let d=c[t];if(d.type!=="identifier"||d.text!==l[t])return!1}return!0}function k(n,e){let{scope:s,maxLoc:o=15,limit:r=30}=e??{},i=new y(n),a=w(i,s,o),f=i.calleeMap(a),c=[];for(let u of a){let l=_(n,u,f.get(u.symbolId)??[]);l&&c.push(l)}return c.sort((u,l)=>u.loc-l.loc||u.file.localeCompare(l.file)),c.slice(0,r)}function _(n,e,s){let o=P(s);if(o.size!==1||!x(n,e.relativePath,e.startLine,e.endLine))return null;let[,r]=[...o.entries()][0];return{symbol:e.symbol,shortName:m(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:D(e),forwardsTo:r.symbol,forwardsToShort:m(r.symbol),forwardsToFile:r.file}}function P(n){let e=n.some(o=>p(o.symbol))?n.filter(o=>p(o.symbol)):n,s=new Map;for(let o of e)s.has(o.symbol)||s.set(o.symbol,o);return s}function w(n,e,s){return n.productionCallableDefinitions({scope:e,minLoc:3,maxLoc:s,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0})}function D(n){return n.endLine-n.startLine+1}export{k as a};
2
+ //# sourceMappingURL=chunk-3UB2DPLP.js.map
@@ -0,0 +1,84 @@
1
+ import{a as H,b as $,c as J,e as k}from"./chunk-2ZGHRI2A.js";import{o as B,p as j,q as z}from"./chunk-YU25IHJX.js";import{c as G}from"./chunk-ZHHMG4UC.js";import{A as M,B as N,E as v,a as S,b as x,d as w,f as b,h as L,i as C,k as A,m as P,p as I,r as W}from"./chunk-QFZE73XF.js";var R=new WeakMap;function ft(e,t){let n=b(t);return n==="rust"?fe(e,t):n==="typescript"||n==="tsx"||n==="javascript"?ce(e,t):[]}var le=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]);function ce(e,t){let n=L(e,t);if(!n)return[];let r=R.get(n);if(r)return r;let i=/(^|\/)(pages|app)\/.+\.(tsx?|jsx?)$/.test(t)||/(^|\/)(layout|page|loading|error|not-found|head|template|default)\.(tsx?|jsx?)$/.test(t),s=/(^|\/)src\/(pages|views|routes)\/.+\.(tsx?|jsx?|vue)$/.test(t),o=!1,l=n.rootNode;for(let a of l.namedChildren){if(a.type!=="expression_statement")continue;let u=a.namedChild(0);if(!u||u.type!=="call_expression")continue;let d=u.namedChild(0);if(!d)continue;let f=d.type==="member_expression"?d.namedChild(d.namedChildCount-1)?.text:d.text;if(f&&le.has(f)){o=!0;break}}let c=[];o&&c.push({startLine:0,endLine:l.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"}),(i||s)&&c.push({startLine:0,endLine:l.endPosition.row,reason:i?"Next.js / Remix route file":"Vite/Vue route component"});for(let a of l.namedChildren){let u=null,d=null;if(a.type==="function_declaration")u=a.namedChild(0)?.text??null,d=a;else if(a.type==="export_statement"){let f=a.namedChild(0);f?.type==="function_declaration"&&(u=f.namedChild(0)?.text??null,d=f)}else if(a.type==="lexical_declaration"){let f=a.namedChild(0);if(f?.type==="variable_declarator"){let g=f.namedChild(0)?.text,m=f.namedChild(1);g&&(m?.type==="arrow_function"||m?.type==="function_expression")&&(u=g,d=f)}}u&&/^use[A-Z]/.test(u)&&d&&c.push({startLine:d.startPosition.row,endLine:d.endPosition.row,reason:"React custom hook (use*)"})}return c.push(...Y(n,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),R.set(n,c),c}var ue=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function de(e){return ue.test(e)}function Y(e,t,n){let r=[],i=s=>{if(t.has(s.type)&&s.parent){let l=s.parent.children,c=-1;for(let a=0;a<l.length;a+=1)if(l[a].startIndex===s.startIndex&&l[a].type===s.type){c=a;break}if(c>0)for(let a=c-1;a>=0;a-=1){let u=l[a];if(n.has(u.type)){if(de(u.text)){r.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(u.type==="attribute_item"||u.type==="inner_attribute_item"))break}}for(let o of s.namedChildren)i(o)};return i(e.rootNode),r}function fe(e,t){let n=L(e,t);if(!n)return[];let r=R.get(n);if(r)return r;let i=[],s=me(n);return s?(R.set(n,s),s):(K(n.rootNode,i,!1,!1),i.push(...Y(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),i.push(...he(n.rootNode)),R.set(n,i),i)}function me(e){return Se(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function K(e,t,n,r){let i=n,s=r;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(s=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?pe(e,t,n,r):r&&_e(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?ge(e,t,n):e.type==="mod_item"&&D(e).some(o=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(o))&&(i=!0);for(let o of e.namedChildren)K(o,t,i,s)}function pe(e,t,n,r){let i=D(e),s=null;r?s="trait impl method (dynamic dispatch)":n&&(s="inside #[cfg(test)] mod");for(let o of i){let l=be(o);if(l){s=l;break}if(q(o)){s="#[allow(dead_code)]";break}}s&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:s})}function ge(e,t,n){let r=D(e),i=e.namedChildren.find(s=>s.type==="type_identifier")?.text;r.some(ye)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:i}),r.some(q)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:i}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:i})}function D(e){let t=e.parent;if(!t)return[];let n=t.children,r=-1;for(let s=0;s<n.length;s+=1)if(n[s].startIndex===e.startIndex&&n[s].type===e.type){r=s;break}if(r<=0)return[];let i=[];for(let s=r-1;s>=0;s-=1){let o=n[s];if(o.type==="attribute_item"||o.type==="inner_attribute_item")i.push(o.text);else{if(o.type==="line_comment"||o.type==="block_comment")continue;break}}return i}function be(e){return/#\[\s*tauri::command\b/.test(e)?"#[tauri::command]":/#\[\s*command\b/.test(e)?"#[command]":/#\[\s*test\b/.test(e)?"#[test]":/#\[\s*bench\b/.test(e)?"#[bench]":/#\[\s*tokio::test\b/.test(e)?"#[tokio::test]":/#\[\s*async_std::test\b/.test(e)?"#[async_std::test]":/#\[\s*wasm_bindgen\b/.test(e)?"#[wasm_bindgen]":/#\[\s*no_mangle\b/.test(e)?"#[no_mangle]":/#\[\s*napi\b/.test(e)?"#[napi]":/#\[\s*pyfunction\b/.test(e)?"#[pyfunction]":/#\[\s*pymethod\b/.test(e)?"#[pymethod]":/#\[\s*pyo3\b/.test(e)?"#[pyo3]":/#\[\s*cfg\s*\(\s*test\s*\)/.test(e)?"#[cfg(test)]":/#\[\s*doc\s*\(\s*hidden\s*\)/.test(e)?"#[doc(hidden)]":null}function ye(e){return/#\[\s*derive\s*\(/.test(e)?/\bSerialize\b/.test(e)||/\bDeserialize\b/.test(e)||/\bFromRow\b/.test(e)||/\bDeriveEntityModel\b/.test(e)||/\bIntoSchema\b/.test(e)||/\bToSchema\b/.test(e)||/\bDeriveValueType\b/.test(e)||/\bsqlx::FromRow\b/.test(e)||/\bError\b/.test(e)||/\bthiserror::Error\b/.test(e):!1}function q(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function _e(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function he(e){let t=Ie(e);if(t.size===0)return[];let n=[];for(let r of e.descendantsOfType("mod_item")){let i=r.childForFieldName("name")?.text;i&&t.has(i)&&n.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:i})}return n}function Se(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var Ee=[{key:"default",re:/\bdefault\s*=\s*"([^"]+)"/g},{key:"with",re:/\bwith\s*=\s*"([^"]+)"/g},{key:"serialize_with",re:/\bserialize_with\s*=\s*"([^"]+)"/g},{key:"deserialize_with",re:/\bdeserialize_with\s*=\s*"([^"]+)"/g},{key:"skip_serializing_if",re:/\bskip_serializing_if\s*=\s*"([^"]+)"/g},{key:"getter",re:/\bgetter\s*=\s*"([^"]+)"/g},{key:"rename_all_with",re:/\brename_all_with\s*=\s*"([^"]+)"/g},{key:"schema_with",re:/\bschema_with\s*=\s*"([^"]+)"/g}],Z=/^#!?\[\s*serde\s*\(/,Le=/^#!?\[\s*schemars\s*\(/,Re=/^#!?\[\s*validate\s*\(/,U=/\bwith\s*=\s*"([^"]+)"/g;function X(e,t){return A(e,t,Ce,()=>new Set,(n,r,i)=>{if(r==="rust"){for(let s of n.rootNode.descendantsOfType("attribute_item"))V(s.text,i);for(let s of n.rootNode.descendantsOfType("inner_attribute_item"))V(s.text,i)}})??new Set}var Ce=new WeakMap;function V(e,t){let n=Z.test(e),r=Le.test(e),i=Re.test(e);if(!(!n&&!r&&!i))for(let{re:s}of Ee){s.lastIndex=0;let o;for(;(o=s.exec(e))!==null;){let l=o[1],c=l.split("::").pop()??l;c==="is_none"&&/\bOption\b/.test(l)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(l)||c&&t.add(c)}}}function Ie(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!Z.test(n.text))continue;U.lastIndex=0;let r;for(;(r=U.exec(n.text))!==null;){let i=r[1],s=i.split("::").pop()??i;s&&t.add(s)}}return t}var xe=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function mt(e,t){return A(e,t,we,()=>new Set,(n,r,i)=>{if(!(r!=="typescript"&&r!=="tsx"&&r!=="javascript"))for(let s of n.rootNode.descendantsOfType("call_expression")){let o=s.namedChild(0);if(!o)continue;let l=P(o);if(!l||!xe.has(l))continue;let c=s.namedChildren.find(d=>d.type==="arguments");if(!c)continue;let a=c.namedChild(0);if(!a||a.type!=="string")continue;let u=a.namedChildren.find(d=>d.type==="string_fragment");u&&i.add(u.text)}})??new Set}var we=new WeakMap;function ee(e,t,n,r={}){if(!n)return[];let i=w(e,t);if(!i)return[];if(i.indexOf(n)===-1)return[];if(b(t))return(O(e,t).get(n)??[]).filter(u=>!Q(u,r));let s=$(e,t,i),o=new RegExp(`\\b${J(n)}\\b`),l=[];for(let c=0;c<s.length;c++)Q(c,r)||o.test(s[c]??"")&&l.push(c);return l}function Q(e,t){return typeof t.excludeStartLine=="number"&&typeof t.excludeEndLine=="number"&&e>=t.excludeStartLine&&e<=t.excludeEndLine}var Ae=S("file-identifiers");function ht(e,t){return Ae.get(e,t,()=>new Set(O(e,t).keys()))}var ke=S("file-ident-lines");function O(e,t){return ke.get(e,t,()=>Ne(e,t))}var Me=S("file-idents-by-line");function te(e,t){return Me.get(e,t,()=>{let n=O(e,t),r=0;for(let s of n.values()){let o=s[s.length-1];o!==void 0&&o>r&&(r=o)}let i=new Array(r+1);for(let s=0;s<=r;s+=1)i[s]=new Set;for(let[s,o]of n)for(let l of o)i[l].add(s);return i})}function Ne(e,t){let n=new Map,r=(l,c)=>{let a=n.get(l);if(!a){n.set(l,[c]);return}a[a.length-1]!==c&&a.push(c)};if(b(t)){let l=L(e,t);if(l){let c=b(t),a=c==="rust"?new Set(["identifier","type_identifier","field_identifier"]):c==="python"?new Set(["identifier"]):new Set(["identifier","property_identifier","type_identifier"]),u=new Set(["rust","python"]),d=/\{([^{}]*)\}/g,f=/\b([A-Za-z_][\w]*)\b/g,g=m=>{if(a.has(m.type)&&r(m.text,m.startPosition.row),c&&u.has(c)&&m.type==="string_content"){let p=m.startPosition.row;for(let y of m.text.matchAll(d)){let E=y[1]??"";for(let _ of E.matchAll(f))_[1]&&r(_[1],p)}}for(let p of m.children)g(p)};return g(l.rootNode),n}}let i=w(e,t);if(!i)return n;let s=H(i).split(/\r?\n/),o=/\b([A-Za-z_$][\w$]*)\b/g;for(let l=0;l<s.length;l+=1){let c=s[l]??"";for(let a of c.matchAll(o))a[1]&&r(a[1],l)}return n}var ve=S("file-dep-graph");function Mt(e,t){return ve.get(e,t??"",()=>{let n=new Map,r=Oe(e),i=(s,o)=>Fe(e,n,r,s,o);for(let s of De(e,t))i(s.from_file,s.to_file);for(let s of r)if(!(t&&!s.includes(t)))for(let o of k(e,s))o.sourcePath&&i(s,o.sourcePath);return n})}function De(e,t){let n=t?`AND d1.relative_path LIKE '%${t}%'`:"";return e.all(`SELECT DISTINCT
2
+ d1.relative_path AS from_file,
3
+ d2.relative_path AS to_file
4
+ FROM mentions m
5
+ JOIN chunks c ON m.chunk_id = c.id
6
+ JOIN documents d1 ON c.document_id = d1.id
7
+ JOIN global_symbols gs ON m.symbol_id = gs.id
8
+ JOIN (
9
+ SELECT m2.symbol_id, c2.document_id
10
+ FROM mentions m2
11
+ JOIN chunks c2 ON m2.chunk_id = c2.id
12
+ WHERE m2.role = 1
13
+ GROUP BY m2.symbol_id
14
+ ) sym_def ON sym_def.symbol_id = gs.id
15
+ JOIN documents d2 ON sym_def.document_id = d2.id
16
+ WHERE d1.id != d2.id
17
+ AND m.role != 1
18
+ ${e.pathExclusionsFor("d1","d2")}
19
+ ${n}`)}function Oe(e){return new Set(e.all(`SELECT relative_path
20
+ FROM documents
21
+ WHERE 1 = 1
22
+ ${e.pathExclusionsFor("documents")}
23
+ ORDER BY relative_path`).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)))}function Fe(e,t,n,r,i){if(r===i||e.isIgnored(r)||e.isIgnored(i)||!n.has(i))return;let s=t.get(r);s||(s=new Set,t.set(r,s)),s.add(i)}function Nt(e,t,n={}){let r=ie(e,[t],{additive:n.additive}),i=n.callableOnly?(r.get(t.symbolId)??[]).filter(s=>W(s.symbol)):r.get(t.symbolId)??[];return typeof n.limit=="number"?i.slice(0,n.limit):i}function vt(e,t,n={}){let r=He(e)?Je(e,t):$e(e).get(t.symbolId)??[];return typeof n.limit=="number"?r.slice(0,n.limit):r}var Te=x("caller-rows"),Pe=2e4;function He(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Pe}function $e(e){return Te.get(e,()=>{let t=N(e),n=ie(e,t),r=new Map;for(let o of t)r.set(o.symbol,o.symbolId);let i=new Map,s=new Map;for(let o of t){let l=n.get(o.symbolId);if(!(!l||l.length===0))for(let c of l){let a=r.get(c.symbol);if(a===void 0||a===o.symbolId)continue;let u=i.get(a);u||(u=[],i.set(a,u),s.set(a,new Set));let d=`${o.symbol}|${o.relativePath}`;s.get(a).has(d)||(s.get(a).add(d),u.push({symbol:o.symbol,file:o.relativePath}))}}return i})}function Je(e,t){let n=[],r=new Set,i=o=>{if(o.symbol===t.symbol)return;let l=`${o.symbol}|${o.file}`;r.has(l)||(r.add(l),n.push(o))};for(let o of Ge(e,t))o.file!==t.relativePath&&i({symbol:o.enclosingSymbol??o.file,file:o.file});let s=We(e,t);if(s)for(let o of B(e,s)){if(o.file===t.relativePath||e.isIgnored(o.file))continue;let l=v(M(e,o.file),o.line);i({symbol:l?.symbol??o.file,file:o.file})}return n}function We(e,t){return e.get(`SELECT
24
+ d.id AS documentId,
25
+ gs.id AS symbolId,
26
+ gs.symbol,
27
+ d.relative_path AS relativePath,
28
+ COALESCE(der.start_line, c.start_line) AS startLine,
29
+ COALESCE(der.end_line, c.end_line) AS endLine,
30
+ COALESCE(gs.display_name, '') AS leaf,
31
+ NULL AS parentTypeName,
32
+ CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
33
+ CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
34
+ gs.kind AS kind,
35
+ gs.documentation AS documentation,
36
+ gs.enclosing_symbol AS enclosingSymbol
37
+ FROM global_symbols gs
38
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
39
+ LEFT JOIN chunks c ON c.document_id = der.document_id
40
+ JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
41
+ WHERE gs.id = ?
42
+ LIMIT 1`,t.symbolId)??null}function Ge(e,t){let n=Ve(e,t);return n?Ye(e,Be(e,n.match,n.identifier)):[]}function Be(e,t,n){let r=new Map;for(let[i,s]of je(e,t.symbolId))r.set(i,ze(e,i,s,t,n));return r}function je(e,t){let n=new Map,r=e.all(`SELECT DISTINCT d.relative_path, c.start_line, c.end_line
43
+ FROM mentions m
44
+ JOIN chunks c ON m.chunk_id = c.id
45
+ JOIN documents d ON c.document_id = d.id
46
+ WHERE m.symbol_id = ?
47
+ AND m.role != 1
48
+ ${e.pathExclusionsFor("d")}
49
+ ORDER BY d.relative_path, c.start_line`,t);for(let i of r){if(e.isIgnored(i.relative_path))continue;let s=n.get(i.relative_path);s||(s=[],n.set(i.relative_path,s)),s.push({start_line:i.start_line,end_line:i.end_line})}return n}function ze(e,t,n,r,i){let s=t===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},o=i?ee(e,t,i,s):[];return n.flatMap(l=>Ue(o,l))}function Ue(e,t){let n=e.filter(r=>r>=t.start_line&&r<=t.end_line);return n.length>0?n:[t.start_line]}function Ve(e,t){let n=G(e,t);return n?{match:n,identifier:I(n.symbol)||null}:null}function Ye(e,t){let n=[],r=new Set;for(let[i,s]of t){let o=M(e,i);for(let l of s){let c=v(o,l),a=`${i}|${l}|${c?.symbol??""}`;r.has(a)||(r.add(a),n.push({file:i,line:l,enclosingSymbol:c?.symbol??null}))}}return n}function ie(e,t,n={}){if(t.length===0)return new Map;let r=n.additive??!1,i=[],s=[];for(let a of t)b(a.relativePath)&&C(e,a.relativePath)!==null?i.push(a):s.push(a);let o=new Map,l=a=>{for(let[u,d]of a){let f=o.get(u);f||(f=[],o.set(u,f));let g=new Set(f.map(m=>`${m.symbol}|${m.chunkId}`));for(let m of d){let p=`${m.symbol}|${m.chunkId}`;g.has(p)||(g.add(p),f.push(m))}}};i.length>0&&l(Ke(e,i)),l(ct(z(e,t)));let c=r?t:s;return c.length>0&&l(tt(e,c)),o}function Ke(e,t){let n=new Map,r=qe(t,n),i=oe(e);for(let[s,o]of r){let l=C(e,s);if(l)for(let c of l){let a=Ze(o,c.line);if(!a)continue;let u=Xe(e,s,i,c.calleeLeaf,c.memberAccess);u&&u.symbol!==a.symbol&&n.get(a.symbolId).push({symbol:u.symbol,file:u.file,chunkId:c.line})}}return n}function qe(e,t){let n=new Map;for(let r of e){let i=n.get(r.relativePath);i?i.push(r):n.set(r.relativePath,[r]),t.set(r.symbolId,[])}for(let r of n.values())r.sort((i,s)=>i.endLine-i.startLine-(s.endLine-s.startLine));return n}function Ze(e,t){return e.find(n=>t>=n.startLine&&t<=n.endLine)??null}function Xe(e,t,n,r,i){let s=se(t,n.get(r)??[]);return s.length===0?null:re(e,t,s,i)}function se(e,t){let n=ne(e);return n?t.filter(r=>ne(r.file)===n):t}function re(e,t,n,r){let i=n.find(s=>s.file===t);if(i)return i;if(r){let s=new Set(k(e,t).map(o=>o.sourcePath).filter(o=>!!o));return n.find(o=>[...s].some(l=>Qe(l,o.file)))??null}return n.length===1?n[0]:null}function Qe(e,t){let n=r=>r.replace(/\\/g,"/").replace(/^\.\//,"");return n(e)===n(t)}function ne(e){let t=b(e);return t?t==="typescript"||t==="tsx"||t==="javascript"?"javascript-family":t:null}var et=x("global-leaf-index");function oe(e){return et.get(e,()=>{let t=e.all(`SELECT gs.id, gs.symbol,
50
+ COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
51
+ FROM global_symbols gs
52
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
53
+ LEFT JOIN documents der_doc ON der_doc.id = der.document_id
54
+ LEFT JOIN (
55
+ SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
56
+ FROM mentions m
57
+ JOIN chunks c ON m.chunk_id = c.id
58
+ JOIN documents d ON c.document_id = d.id
59
+ WHERE m.role = 1
60
+ GROUP BY m.symbol_id
61
+ ) mention_doc ON mention_doc.symbol_id = gs.id
62
+ WHERE 1 = 1
63
+ ${e.symbolNoiseFor("gs")}`),n=new Map;for(let r of t){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=I(r.symbol);if(!i)continue;let s=n.get(i);s||(s=[],n.set(i,s)),s.some(o=>o.symbolId===r.id)||s.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return n})}function tt(e,t){if(t.length===0)return new Map;let n=e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
64
+ FROM mentions m
65
+ JOIN chunks c ON m.chunk_id = c.id
66
+ WHERE m.role != 1`),r=new Map;for(let a of n)r.has(a.document_id)||r.set(a.document_id,[]),r.get(a.document_id).push(a);let i=new Map(e.all("SELECT id, relative_path FROM documents").map(a=>[a.id,a.relative_path])),s=new Map,o=e.all(`SELECT gs.id AS symbol_id, gs.symbol,
67
+ COALESCE(der.document_id, def_chunk.document_id) AS document_id
68
+ FROM global_symbols gs
69
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
70
+ LEFT JOIN (
71
+ SELECT m.symbol_id, MIN(c.document_id) AS document_id
72
+ FROM mentions m
73
+ JOIN chunks c ON m.chunk_id = c.id
74
+ WHERE m.role = 1
75
+ GROUP BY m.symbol_id
76
+ ) def_chunk ON def_chunk.symbol_id = gs.id`);for(let a of o)s.has(a.symbol_id)||s.set(a.symbol_id,{symbol:a.symbol,file:a.document_id!==null?i.get(a.document_id)??"":""});let l=new Map,c=i;for(let a of t){let u=r.get(a.documentId)??[],d=new Set,f=[],g=null,m=()=>{if(g)return g;let p=c.get(a.documentId)??"",y=new Set;if(p){let E=te(e,p),_=Math.max(0,a.startLine),T=Math.min(E.length-1,a.endLine);for(let h=_;h<=T;h+=1)for(let ae of E[h])y.add(ae)}return g=y,y};for(let p of u){if(p.symbol_id===a.symbolId)continue;let y=s.get(p.symbol_id);if(!y)continue;if(!(p.start_line>=a.startLine&&p.end_line<=a.endLine)){if(!(p.start_line<=a.endLine&&p.end_line>=a.startLine))continue;let h=I(y.symbol);if(!h||!m().has(h))continue}let _=`${y.symbol}|${p.chunk_id}`;d.has(_)||(d.add(_),f.push({...y,chunkId:p.chunk_id}))}l.set(a.symbolId,f)}return l}function Dt(e,t){let n=new Map,r=e.all(`SELECT relative_path FROM documents
77
+ WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`),i=oe(e),s=t??N(e);return nt(e,n,r,i),it(e,n,s),at(e,n,r,i),ut(n,j(e,lt(s))),n}function nt(e,t,n,r){for(let i of n){if(!b(i.relative_path)||e.isIgnored(i.relative_path))continue;let s=C(e,i.relative_path);if(s)for(let o of s){let l=se(i.relative_path,r.get(o.calleeLeaf)??[]);if(!l||l.length===0)continue;let c=re(e,i.relative_path,l,o.memberAccess);c&&c.file!==i.relative_path&&F(t,c.symbolId,i.relative_path)}}}function it(e,t,n){let r=rt(n);for(let i of st(e))e.isIgnored(i.relative_path)||ot(i,r.get(i.symbol_id))||F(t,i.symbol_id,i.relative_path)}function st(e){return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
78
+ c.start_line AS chunk_start, c.end_line AS chunk_end
79
+ FROM mentions m
80
+ JOIN chunks c ON m.chunk_id = c.id
81
+ JOIN documents d ON c.document_id = d.id
82
+ WHERE m.role != 1
83
+ ${e.pathExclusionsFor("d")}`)}function rt(e){let t=new Map;for(let n of e)t.set(n.symbolId,{docId:n.documentId,startLine:n.startLine,endLine:n.endLine});return t}function ot(e,t){return!!t&&t.docId===e.document_id&&e.chunk_start>=t.startLine&&e.chunk_end<=t.endLine}function at(e,t,n,r){for(let i of n){if(e.isIgnored(i.relative_path)||b(i.relative_path)!=="rust")continue;let s=X(e,i.relative_path);if(s.size!==0)for(let o of s){let l=r.get(o);if(l)for(let c of l)c.file!==i.relative_path&&F(t,c.symbolId,i.relative_path)}}}function F(e,t,n){let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)}function lt(e){return e.filter(t=>"relativePath"in t&&"symbol"in t&&"leaf"in t)}function ct(e){let t=new Map;for(let[n,r]of e)t.set(n,r.map(i=>({...i,chunkId:-1})));return t}function ut(e,t){for(let[n,r]of t){let i=e.get(n);i||(i=new Set,e.set(n,i));for(let s of r)i.add(s)}}export{ft as a,X as b,mt as c,ee as d,ht as e,O as f,Mt as g,Nt as h,vt as i,Ge as j,ie as k,oe as l,Dt as m};
84
+ //# sourceMappingURL=chunk-4X7C236P.js.map
@@ -0,0 +1,2 @@
1
+ import{r as S}from"./chunk-YU25IHJX.js";import{B as x,d as g,o as d,y as h,z as b}from"./chunk-QFZE73XF.js";function B(t,e={}){let{scope:s,minLoc:o=1,limit:i}=e,c=new Map;for(let r of x(t,{scope:s})){if(!r.isFunctionLike||t.isIgnored(r.relativePath))continue;let n=r.endLine-r.startLine+1;if(n<o)continue;let m=L(t,r);if(!m)continue;let u={symbol:r.symbol,shortName:d(r.symbol),file:r.relativePath,startLine:r.startLine,endLine:r.endLine,loc:n},l=c.get(m);l?l.push(u):c.set(m,[u])}let a=[];for(let[r,n]of c)n.length<2||a.push({signature:r,functions:n});return a.sort((r,n)=>{let m=n.functions.length-r.functions.length;if(m!==0)return m;let u=r.functions.reduce((f,p)=>f+p.loc,0);return n.functions.reduce((f,p)=>f+p.loc,0)-u}),i?a.slice(0,i):a}function L(t,e){let s=S(t,e);if(s)return s;let o=$(e.documentation),i=o?v(o):null;return i||w(D(t,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function $(t){return h(b(t))}function D(t,e,s,o,i){let c=g(t,e);if(!c)return null;let a=c.split(/\r?\n/),r=I(a,s,o,i);for(let n of r){let m=Math.min(a.length-1,Math.max(n,n+4)),u="";for(let l=n;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,M(u)))return u}if(u&&u.includes("("))return u}return null}function M(t){let e=t.replace(/\s+/g," ").trim();return!e.includes("(")||P(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function v(t){if(!t||!t.trim())return null;let e=t.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function w(t,e){if(!t||!t.trim())return null;let s=t.replace(/\s+/g," ").trim(),o=s.indexOf("(");if(o===-1)return null;let i=s.slice(0,o),a=new RegExp(`\\b${y(e)}\\b`,"i").exec(i);a&&typeof a.index=="number"&&(i=i.slice(0,a.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let r=z(s.slice(o)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!r.startsWith("("))return null;let n=`${i?`${i} `:""}${r}`.replace(/\s+/g,"").toLowerCase();return n.length>=3?n:null}function z(t){let e=0,s=0,o=0,i=0,c=null,a=!1;for(let r=0;r<t.length;r+=1){let n=t[r];if(c){if(a){a=!1;continue}if(n==="\\"){a=!0;continue}n===c&&(c=null);continue}if(n==='"'||n==="'"||n==="`"){c=n;continue}if(n==="(")e+=1;else if(n===")")e=Math.max(0,e-1);else if(n==="[")o+=1;else if(n==="]")o=Math.max(0,o-1);else if(n==="<")i+=1;else if(n===">")i=Math.max(0,i-1);else if(n==="{"){if(e===0&&o===0&&i===0)return t.slice(0,r);s+=1}else if(n==="}")s=Math.max(0,s-1);else if(n==="="&&t[r+1]===">"&&e===0&&s===0&&o===0&&i===0)return t.slice(0,r)}return t}function I(t,e,s,o){let i=y(o),c=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${i}\\b`,"i"),r=[],n=new Set,m=Math.max(0,Math.min(e,t.length-1)),u=Math.max(m,Math.min(t.length-1,Math.max(s,e+4)));for(let l=m;l<=u;l+=1){let f=t[l]??"";(c.test(f)||a.test(f))&&!n.has(l)&&(n.add(l),r.push(l))}for(let l=0;l<t.length;l+=1){let f=t[l]??"";(c.test(f)||a.test(f))&&!n.has(l)&&(n.add(l),r.push(l))}return r}function P(t){let e=0;for(let s of t)s==="("&&(e+=1),s===")"&&(e-=1);return e}function y(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{B as a};
2
+ //# sourceMappingURL=chunk-5LQ6CVX3.js.map
@@ -0,0 +1,70 @@
1
+ import{a as m}from"./chunk-32R4VYYA.js";import{c as u}from"./chunk-PK4U6NWP.js";import{e as l,f as a}from"./chunk-2ZGHRI2A.js";import{o as d,q as c}from"./chunk-QFZE73XF.js";function C(e,t={}){let{scope:o,limit:r}=t,n=new m(e),i=x([...p(e,o),...f(e,n,o)]);return N(i),r?i.slice(0,r):i}function p(e,t){let o=[];for(let r of R(e,t)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||u(e,r.barrel_path))continue;let n=b(e,r),i=n?.barrel_consumers??0,s=n?.direct_consumers??0;i!==0||s!==0||o.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:d(r.symbol),originalFile:r.original_path,barrelConsumers:i,directConsumers:s})}return o}function R(e,t){let o=t?`AND barrel_d.relative_path LIKE '%${t}%'`:"";return e.all(`SELECT DISTINCT
2
+ barrel_d.id AS barrel_doc_id,
3
+ barrel_d.relative_path AS barrel_path,
4
+ gs.id AS symbol_id,
5
+ gs.symbol AS symbol,
6
+ orig_d.id AS original_doc_id,
7
+ orig_d.relative_path AS original_path
8
+ FROM mentions m
9
+ JOIN chunks c ON m.chunk_id = c.id
10
+ JOIN documents barrel_d ON c.document_id = barrel_d.id
11
+ JOIN global_symbols gs ON m.symbol_id = gs.id
12
+ JOIN (
13
+ SELECT m2.symbol_id, c2.document_id
14
+ FROM mentions m2
15
+ JOIN chunks c2 ON m2.chunk_id = c2.id
16
+ WHERE m2.role = 1
17
+ GROUP BY m2.symbol_id
18
+ ) sym_def ON sym_def.symbol_id = gs.id
19
+ JOIN documents orig_d ON sym_def.document_id = orig_d.id
20
+ WHERE m.role != 1
21
+ AND (barrel_d.relative_path LIKE '%/index.ts'
22
+ OR barrel_d.relative_path LIKE '%/index.js'
23
+ OR barrel_d.relative_path = 'index.ts'
24
+ OR barrel_d.relative_path = 'index.js')
25
+ AND orig_d.id != barrel_d.id
26
+ ${e.pathExclusionsFor("barrel_d","orig_d")}
27
+ ${e.symbolNoiseFor("gs")}
28
+ -- Only function-level symbols (ending with ().), not module-level
29
+ AND gs.symbol LIKE '%().'
30
+ ${o}
31
+ ORDER BY barrel_d.relative_path, gs.symbol`)}function b(e,t){return e.get(`SELECT
32
+ SUM(CASE WHEN uses_barrel = 1 THEN 1 ELSE 0 END) AS barrel_consumers,
33
+ SUM(CASE WHEN uses_barrel = 0 THEN 1 ELSE 0 END) AS direct_consumers
34
+ FROM (
35
+ SELECT
36
+ consumer_d.id AS consumer_doc_id,
37
+ MAX(CASE WHEN EXISTS (
38
+ SELECT 1
39
+ FROM mentions barrel_m
40
+ JOIN chunks barrel_c ON barrel_m.chunk_id = barrel_c.id
41
+ WHERE barrel_c.document_id = consumer_d.id
42
+ AND barrel_m.role != 1
43
+ AND barrel_m.symbol_id IN (
44
+ SELECT m2.symbol_id
45
+ FROM mentions m2
46
+ JOIN chunks c2 ON m2.chunk_id = c2.id
47
+ WHERE c2.document_id = ?
48
+ AND m2.role != 1
49
+ )
50
+ ) THEN 1 ELSE 0 END) AS uses_barrel
51
+ FROM mentions ref_m
52
+ JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
53
+ JOIN documents consumer_d ON ref_c.document_id = consumer_d.id
54
+ WHERE ref_m.symbol_id = ?
55
+ AND ref_m.role != 1
56
+ AND consumer_d.id != ?
57
+ AND consumer_d.id != ?
58
+ ${e.pathExclusionsFor("consumer_d")}
59
+ GROUP BY consumer_d.id
60
+ )`,t.barrel_doc_id,t.symbol_id,t.barrel_doc_id,t.original_doc_id)}function f(e,t,o){let r=[];for(let n of E(e,o))_(e,n,n)>0||r.push(...h(e,t,n));return r}function E(e,t){return e.all(`SELECT relative_path
61
+ FROM documents
62
+ WHERE 1 = 1
63
+ ${t?"AND relative_path LIKE ?":""}
64
+ ${e.pathExclusionsFor("documents")}
65
+ ORDER BY relative_path`,...t?[`%${t}%`]:[]).map(r=>r.relative_path).filter(r=>!e.isIgnored(r)).filter(r=>a(e,r).length>0)}function h(e,t,o){return a(e,o).filter(r=>r.sourcePath&&!e.isIgnored(r.sourcePath)).flatMap(r=>g(e,t,o,r.sourcePath))}function g(e,t,o,r){let n=S(t,r);return n?[{barrelFile:o,symbol:n.symbol,shortName:d(n.symbol),originalFile:r,barrelConsumers:0,directConsumers:_(e,r,o)}]:[]}function _(e,t,o){let r=e.all(`SELECT relative_path
66
+ FROM documents
67
+ WHERE 1 = 1
68
+ ${e.pathExclusionsFor("documents")}
69
+ ORDER BY relative_path`),n=new Set;for(let i of r)if(!(e.isIgnored(i.relative_path)||i.relative_path===o))for(let s of l(e,i.relative_path))s.sourcePath===t&&n.add(i.relative_path);return n.size}function S(e,t){let o=e.definitionsForFile(t);return o.find(r=>c(r.symbol)==="method")??o[0]??null}function x(e){let t=new Set,o=[];for(let r of e){let n=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;t.has(n)||(t.add(n),o.push(r))}return o}function N(e){e.sort((t,o)=>o.directConsumers-t.directConsumers||t.barrelFile.localeCompare(o.barrelFile)||t.shortName.localeCompare(o.shortName))}export{C as a};
70
+ //# sourceMappingURL=chunk-5YYMKE3G.js.map
@@ -0,0 +1,6 @@
1
+ import{a as m}from"./chunk-MO65UK5V.js";import{a as h}from"./chunk-ZHHMG4UC.js";import{o as g}from"./chunk-QFZE73XF.js";import{readFileSync as f}from"fs";import{extname as b,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=R(e);if(r)return L(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?j(t,l,s):null}function R(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function j(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
2
+ `),c=Math.max(0,e.startLine-a),i=Math.min(n.length-1,e.endLine+a),o=n.slice(c,i+1).join(`
3
+ `);return{symbol:e.symbol,shortName:g(e.symbol),relativePath:e.relativePath,startLine:c,endLine:i,language:s?.language??v(e.relativePath),source:o}}function L(t,e,a,s,r){let l=m(t,e);if(!l)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",l);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),i;try{i=f(c,"utf-8")}catch{return null}let o=i.split(`
4
+ `),u=Math.max(0,a-1-r),p=Math.min(o.length-1,s-1+r),y=o.slice(u,p+1).join(`
5
+ `);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:u,endLine:p,language:n.language??v(n.relative_path),source:y}}function v(t){switch(b(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
6
+ //# sourceMappingURL=chunk-7LSCW7NF.js.map
@@ -0,0 +1,2 @@
1
+ import{B as p,n as d,o as f,q as u}from"./chunk-QFZE73XF.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-7X7FLQC5.js.map
@@ -0,0 +1,4 @@
1
+ import{c as S}from"./chunk-WIIZF5FP.js";import{j as d}from"./chunk-4X7C236P.js";import{a as f}from"./chunk-ZHHMG4UC.js";import{d as a,o as s,s as u,y as m,z as g}from"./chunk-QFZE73XF.js";function _(n,o){let e=f(n,o);if(!e)return{definitions:[],referencedBy:[]};let i=n.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",e.symbolId),t=g(i?.documentation??null),c=n.isIgnored(e.relativePath)?[]:[{relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,signature:b(t,i?.display_name??null,e.symbol),source:y(n,e.relativePath,e.startLine,e.endLine)}],l=S(n,e),p=(l.length>0?l:d(n,e)).filter(r=>!n.isIgnored(r.file)).map(r=>({relativePath:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingSymbol?s(r.enclosingSymbol):"(top-level)"}));return{definitions:c,referencedBy:p}}function y(n,o,e,i){let t=a(n,o);if(!t)return null;let l=t.split(`
2
+ `).slice(e,i+1).join(`
3
+ `).trimEnd();return l.length>0?l:null}function b(n,o,e){let i=m(n);if(i&&!h(i))return i;let t=(o??"").trim();return t?u(e)&&!t.endsWith("()")?`${t}()`:t:s(e)}function h(n){return n.startsWith("undefined")||n.includes("|")||n.includes("```")}export{_ as a};
4
+ //# sourceMappingURL=chunk-A5UNS4DR.js.map
@@ -0,0 +1,2 @@
1
+ import{a as g}from"./chunk-32R4VYYA.js";import{c as h}from"./chunk-WIIZF5FP.js";import{h as u,j as p}from"./chunk-4X7C236P.js";import{a as d,b as y}from"./chunk-ZHHMG4UC.js";import{E as S,o as f}from"./chunk-QFZE73XF.js";function j(e,o,r={}){let{direction:c="backward",maxDepth:s=3}=r,t=d(e,o);return t?c==="backward"?w(e,t,s):R(e,t):null}function w(e,o,r){let c=[],s=new Set([o.symbol]),t=[o];for(let a=1;a<=r&&t.length!==0;a++){let n=[];for(let l of t){let i=u(e,l);for(let m of i){if(s.has(m.symbol))continue;s.add(m.symbol),c.push({symbol:m.symbol,shortName:f(m.symbol),file:m.file,relationship:a===1?"referenced within definition (callee)":`depth ${a} callee`});let b=y(e,m.symbol);b&&!e.isIgnored(b.relativePath)&&n.push(b)}}t=n}return{symbol:o.symbol,shortName:f(o.symbol),direction:"backward",connectedSymbols:c}}function R(e,o){let r=h(e,o),c=r.length>0?r:p(e,o),s=new Set,t=[],a=new g(e);for(let n of c){if(t.length>=30)break;if(e.isIgnored(n.file))continue;let l=n.enclosingSymbol??S(a.definitionsForFile(n.file),n.line)?.symbol??null;if(!l||l===o.symbol)continue;let i=y(e,l);!i||e.isIgnored(i.relativePath)||s.has(i.symbol)||(s.add(i.symbol),t.push({symbol:i.symbol,shortName:f(i.symbol),file:i.relativePath,relationship:`references target at ${n.file}:${n.line+1}`}))}return t.sort((n,l)=>n.file.localeCompare(l.file)),{symbol:o.symbol,shortName:f(o.symbol),direction:"forward",connectedSymbols:t}}export{j as a};
2
+ //# sourceMappingURL=chunk-BNCTPTVX.js.map
@@ -1,2 +1,2 @@
1
- import{c as g}from"./chunk-ZZ3F6P3X.js";import{h as c,i as y,j as S}from"./chunk-FT4WPAEX.js";import{a}from"./chunk-MWCN46ZX.js";import{b as r}from"./chunk-5IM4IQ6N.js";function v(l,i){let o=a(l,i);if(!o)return null;let n=[{file:o.relativePath,line:o.startLine}],t=g(l,o),s=(t.length>0?t:S(l,o)).filter(e=>!l.isIgnored(e.file)).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:u,consumers:b}=p(l,o,s);return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:n.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:u.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:b.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function p(l,i,o){let n=m(c(l,i,{limit:30}).map(s=>({symbol:s.symbol,file:s.file}))),t=m(y(l,i,{limit:30})),f=t.length>0?t:m(o.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:n,consumers:f}}function m(l){let i=new Set,o=[];for(let n of l){let t=`${n.symbol}|${n.file}`;i.has(t)||(i.add(t),o.push(n))}return o}export{v as a};
2
- //# sourceMappingURL=chunk-CGAO6FHN.js.map
1
+ import{c as S}from"./chunk-WIIZF5FP.js";import{h as c,i as y,j as g}from"./chunk-4X7C236P.js";import{a}from"./chunk-ZHHMG4UC.js";import{o as r}from"./chunk-QFZE73XF.js";function v(l,i){let o=a(l,i);if(!o)return null;let n=[{file:o.relativePath,line:o.startLine}],t=S(l,o),s=(t.length>0?t:g(l,o)).filter(e=>!l.isIgnored(e.file)).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:u,consumers:b}=p(l,o,s);return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:n.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:u.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:b.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function p(l,i,o){let n=m(c(l,i,{limit:30}).map(s=>({symbol:s.symbol,file:s.file}))),t=m(y(l,i,{limit:30})),f=t.length>0?t:m(o.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:n,consumers:f}}function m(l){let i=new Set,o=[];for(let n of l){let t=`${n.symbol}|${n.file}`;i.has(t)||(i.add(t),o.push(n))}return o}export{v as a};
2
+ //# sourceMappingURL=chunk-C5BFS23M.js.map
@@ -1,2 +1,2 @@
1
- import{c as d}from"./chunk-LORWXBOO.js";import{g as a}from"./chunk-FT4WPAEX.js";function F(t,i={}){let{minSimilarity:f=.5,limit:n=20,scope:o,filePattern:s}=i,u=i.minDeps??(s?1:3),e=g(t,{scope:o,minDeps:u}),p=[];if(s){let r=e.find(l=>l.file.includes(s));if(!r)return[];for(let l of e){if(l.file===r.file)continue;let c=m(r,l,f);c&&p.push(c)}}else for(let r=0;r<e.length;r++){for(let l=r+1;l<e.length;l++){let c=m(e[r],e[l],f);c&&p.push(c)}if(p.length>n*5)break}return p.sort((r,l)=>l.similarity-r.similarity),p.slice(0,n)}function g(t,i){let{scope:f,minDeps:n}=i,o=a(t,f),s=h(o),u=[];for(let[e,p]of o)p.size>=n&&u.push({file:e,deps:new Set([...p].filter(r=>!s.has(r)))});return u}function h(t){let i=new Set,f=t.size;if(f===0)return i;let n=new Map;for(let o of t.values())for(let s of o)n.set(s,(n.get(s)??0)+1);for(let[o,s]of n)s>=5&&s/f>.3&&i.add(o);return i}function m(t,i,f){let n=new Set;for(let e of t.deps)i.deps.has(e)&&n.add(e);if(n.size<3||t.deps.size<4||i.deps.size<4)return null;let o=d(t.deps,i.deps);if(o<f)return null;let s=[];for(let e of t.deps)i.deps.has(e)||s.push(e);let u=[];for(let e of i.deps)t.deps.has(e)||u.push(e);return{fileA:t.file,fileB:i.file,similarity:o,sharedDeps:[...n],uniqueToA:s,uniqueToB:u}}export{F as a};
2
- //# sourceMappingURL=chunk-OOMAS234.js.map
1
+ import{c as d}from"./chunk-RKTDEIHF.js";import{g as a}from"./chunk-4X7C236P.js";function F(t,i={}){let{minSimilarity:f=.5,limit:n=20,scope:o,filePattern:s}=i,u=i.minDeps??(s?1:3),e=g(t,{scope:o,minDeps:u}),p=[];if(s){let r=e.find(l=>l.file.includes(s));if(!r)return[];for(let l of e){if(l.file===r.file)continue;let c=m(r,l,f);c&&p.push(c)}}else for(let r=0;r<e.length;r++){for(let l=r+1;l<e.length;l++){let c=m(e[r],e[l],f);c&&p.push(c)}if(p.length>n*5)break}return p.sort((r,l)=>l.similarity-r.similarity),p.slice(0,n)}function g(t,i){let{scope:f,minDeps:n}=i,o=a(t,f),s=h(o),u=[];for(let[e,p]of o)p.size>=n&&u.push({file:e,deps:new Set([...p].filter(r=>!s.has(r)))});return u}function h(t){let i=new Set,f=t.size;if(f===0)return i;let n=new Map;for(let o of t.values())for(let s of o)n.set(s,(n.get(s)??0)+1);for(let[o,s]of n)s>=5&&s/f>.3&&i.add(o);return i}function m(t,i,f){let n=new Set;for(let e of t.deps)i.deps.has(e)&&n.add(e);if(n.size<3||t.deps.size<4||i.deps.size<4)return null;let o=d(t.deps,i.deps);if(o<f)return null;let s=[];for(let e of t.deps)i.deps.has(e)||s.push(e);let u=[];for(let e of i.deps)t.deps.has(e)||u.push(e);return{fileA:t.file,fileB:i.file,similarity:o,sharedDeps:[...n],uniqueToA:s,uniqueToB:u}}export{F as a};
2
+ //# sourceMappingURL=chunk-DRLWW74T.js.map
@@ -0,0 +1,2 @@
1
+ import{a as p,b as g}from"./chunk-PK4U6NWP.js";import{g as B}from"./chunk-4X7C236P.js";function w(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],a=new Set,l=new Set,f=[];function y(t,o){if(o>c)return;if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),m=u.indexOf(u.reduce(($,x)=>$<x?$:x)),d=[...u.slice(m,-1),...u.slice(0,m),u[m]],S=d.join(" -> ");b.has(S)||(b.add(S),i.push({path:d,kind:R(d)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)y(h,o+1);f.pop(),l.delete(t)}let b=new Set;for(let t of n.keys())a.has(t)||y(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=p(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":g(e)||g(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||p(e)==="entry"||p(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let a=n[n.length-1],l=i[i.length-1];if(a&&a===l)return!0}return!1}export{w as a};
2
+ //# sourceMappingURL=chunk-EB5IVUNU.js.map
@@ -1,4 +1,4 @@
1
- import{a as s}from"./chunk-4HCKXL7T.js";function r(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
1
+ import{a as s}from"./chunk-MO65UK5V.js";function a(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d1 ON c.document_id = d1.id
@@ -14,7 +14,7 @@ import{a as s}from"./chunk-4HCKXL7T.js";function r(e,d){let i=s(e,d);return i?e.
14
14
  WHERE d1.relative_path = ?
15
15
  AND d2.relative_path <> d1.relative_path
16
16
  AND ${e.localSymbolPredicate}
17
- ORDER BY d2.relative_path`,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}function a(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d1.relative_path
17
+ ORDER BY d2.relative_path`,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}function r(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d1.relative_path
18
18
  FROM mentions m
19
19
  JOIN chunks c ON m.chunk_id = c.id
20
20
  JOIN documents d1 ON c.document_id = d1.id
@@ -29,5 +29,5 @@ import{a as s}from"./chunk-4HCKXL7T.js";function r(e,d){let i=s(e,d);return i?e.
29
29
  JOIN documents d2 ON sym_def.document_id = d2.id
30
30
  WHERE d2.relative_path = ?
31
31
  AND d1.relative_path != ?
32
- ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{r as a,a as b};
33
- //# sourceMappingURL=chunk-ZE3BTHTS.js.map
32
+ ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{a,r as b};
33
+ //# sourceMappingURL=chunk-ERRUE5G4.js.map
@@ -0,0 +1,2 @@
1
+ import{a as l}from"./chunk-32R4VYYA.js";import{a as i}from"./chunk-ZHHMG4UC.js";import{o as s,q as m,w as n}from"./chunk-QFZE73XF.js";function c(r,a){let t=i(r,a);return t?new l(r).definitionsForFile(t.relativePath).filter(e=>e.symbol!==t.symbol).filter(e=>n(t.symbol,e.symbol)).sort((e,o)=>e.startLine-o.startLine||e.endLine-o.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:m(e.symbol)??"unknown"})):[]}export{c as a};
2
+ //# sourceMappingURL=chunk-F4KR22Z2.js.map
@@ -0,0 +1,2 @@
1
+ import{a as d}from"./chunk-QRYEOK3M.js";import{a as g}from"./chunk-K6H3XJQW.js";import{b as R}from"./chunk-PBFMZKXE.js";import{a as x}from"./chunk-FVVEIGP3.js";import{a as f}from"./chunk-MTK3JAJT.js";import{a as S}from"./chunk-3UB2DPLP.js";import{a as y}from"./chunk-FHSD5RKF.js";import{a as C}from"./chunk-IJWIYZO5.js";import{a as h}from"./chunk-EB5IVUNU.js";import{a as p}from"./chunk-MO32JMOD.js";import{a as b}from"./chunk-WNMAH3P7.js";import{e as c,f as m}from"./chunk-PK4U6NWP.js";var H=50;function _(e,t={}){let r=v(e,t.scope),u=L(e,r),o=I(r,u);return{score:A(r,u),overview:{documents:r.statsResult.documents,symbols:r.statsResult.symbols,indexSizeBytes:r.statsResult.indexSizeBytes},findings:{deadSymbols:u.trueDeadCount,deadLoc:u.trueDeadLoc,isolatedSymbols:u.trueIsolatedCount,isolatedLoc:u.trueIsolatedLoc,cycles:u.realCycleCount,similarPairs:u.trueSimilarCount,extractionCandidates:r.extractResult.length,wrappers:r.wrapperResult.length,passthroughs:r.passthroughResult.length,staleTypes:u.trueStaleCount,driftedFiles:u.trueDriftCount,complexityHotspotCount:w(r)},actions:o,topComplexity:r.complexResult.slice(0,5).map(l=>({symbol:l.shortName,score:l.score}))}}function v(e,t){return{statsResult:d(e),deadResult:p(e,{scope:t,minLoc:3,skipBarrels:!0}),isolatedResult:f(e,{scope:t,minLoc:3}),cycleResult:h(e,{scope:t}),similarResult:R(e,{scope:t,minSimilarity:.6,limit:50,minCallees:4}),extractResult:C(e,{scope:t,minLoc:15,minCallees:5,limit:50}),wrapperResult:g(e,{scope:t,maxLoc:15,limit:50}),passthroughResult:S(e,{scope:t,maxLoc:15,limit:50}),staleResult:x(e,{scope:t,minLoc:3,limit:50}),driftResult:y(e,{scope:t}),complexResult:b(e,{scope:t,minLoc:10,limit:10})}}function L(e,t){let r=t.deadResult.symbols.filter(o=>!c(e,o.relativePath)&&!m(e,o.symbol,o.relativePath)&&o.kind==="dead-code"),u=t.isolatedResult.filter(o=>!c(e,o.relativePath)&&!m(e,o.symbol,o.relativePath));return{trueDeadCount:r.length,trueDeadLoc:r.reduce((o,i)=>o+i.loc,0),trueIsolatedCount:u.length,trueIsolatedLoc:u.reduce((o,i)=>o+i.loc,0),trueStaleCount:t.staleResult.length,trueDriftCount:t.driftResult.unusedImports+t.driftResult.layerViolations,trueSimilarCount:t.similarResult.length,realCycleCount:t.cycleResult.filter(o=>o.kind==="real").length}}function I(e,t){let r=[];if(t.trueDeadCount>0&&r.push({category:"Dead code",description:`${t.trueDeadCount} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:t.trueDeadCount,locRecoverable:t.trueDeadLoc}),t.trueIsolatedCount>0&&r.push({category:"Isolated symbols",description:`${t.trueIsolatedCount} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:t.trueIsolatedCount,locRecoverable:t.trueIsolatedLoc}),t.realCycleCount>0&&r.push({category:"Circular dependencies",description:`${t.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:t.realCycleCount,locRecoverable:0}),t.trueSimilarCount>0&&r.push({category:"Similar functions",description:`${t.trueSimilarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:t.trueSimilarCount,locRecoverable:0}),e.extractResult.length>0&&r.push({category:"Extraction candidates",description:`${e.extractResult.length} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:e.extractResult.length,locRecoverable:0}),e.wrapperResult.length>0&&r.push({category:"Wrapper functions",description:`${e.wrapperResult.length} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:e.wrapperResult.length,locRecoverable:e.wrapperResult.reduce((i,l)=>i+l.loc,0)}),e.passthroughResult.length>0&&r.push({category:"Passthrough functions",description:`${e.passthroughResult.length} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughResult.length,locRecoverable:e.passthroughResult.reduce((i,l)=>i+l.loc,0)}),t.trueStaleCount>0){let i=e.staleResult.filter(n=>n.consumers===0).length,l=t.trueStaleCount-i,s=[];i>0&&s.push(`${i} unused`),l>0&&s.push(`${l} single-consumer (not in types file)`),r.push({category:"Stale abstractions",description:`${s.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:t.trueStaleCount,locRecoverable:e.staleResult.reduce((n,a)=>n+a.loc,0)})}if(t.trueDriftCount>0){let i=[];e.driftResult.unusedImports>0&&i.push(`${e.driftResult.unusedImports} unused imports`),e.driftResult.layerViolations>0&&i.push(`${e.driftResult.layerViolations} layer violations`),r.push({category:"Structural drift",description:i.join(", "),effort:e.driftResult.layerViolations>0?"medium":"low",impact:e.driftResult.layerViolations>0?"medium":"low",count:t.trueDriftCount,locRecoverable:0})}let u={high:3,medium:2,low:1},o={low:3,medium:2,high:1};return r.sort((i,l)=>{let s=u[i.impact]*o[i.effort];return u[l.impact]*o[l.effort]-s}),r}function A(e,t){let r=Math.max(e.statsResult.documents,1),u=Math.max(e.statsResult.symbols,1),o=100,i=t.trueDeadCount/u;o-=Math.min(20,Math.round(i*200));let l=t.trueIsolatedCount/u;o-=Math.min(10,Math.round(l*200)),o-=Math.min(15,t.realCycleCount*5);let s=t.trueSimilarCount/u*1e3;o-=Math.min(10,Math.round(s));let n=e.extractResult.length/u*1e3;o-=Math.min(5,Math.round(n/2)),o-=Math.min(3,e.wrapperResult.length),o-=Math.min(3,e.passthroughResult.length);let a=t.trueStaleCount/Math.max(u*.1,1);o-=Math.min(8,Math.round(a*10));let M=t.trueDriftCount/r;o-=Math.min(5,Math.round(M*50));let D=w(e);return o-=Math.min(5,D*2),Math.max(0,Math.min(100,o))}function w(e){return e.complexResult.filter(t=>t.score>H).length}export{_ as a};
2
+ //# sourceMappingURL=chunk-FG6A6ZUP.js.map
@@ -0,0 +1,19 @@
1
+ import{a as u,b as g,c as S}from"./chunk-LJ2YWNQF.js";import{a as p}from"./chunk-32R4VYYA.js";import{a as y}from"./chunk-PK4U6NWP.js";import{e as d}from"./chunk-2ZGHRI2A.js";import{n as m}from"./chunk-YU25IHJX.js";import l from"path";function q(t,n){let{scope:r,minDeviation:i=5}=n??{},s=new p(t).fileDependencyGraph(r),c=M(t,r);return R([...D(t,s,c),...v(s),...b(s,i)])}function D(t,n,r){let i=[];for(let[e,s]of n){if(a(e))continue;let c=r.get(e)??new Set;for(let o of s)if(!a(o)&&!c.has(o)){if(F(t,e,o)||w(t,e,o)||L(t,e,o)||$(o)||x(t,e,o)||P(o))continue;i.push({file:e,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o})}}return i}function v(t){let n=[],r=N(t);for(let[i,e]of t){if(a(i))continue;let s=u(i);for(let c of e){if(a(c))continue;let o=u(c);if(s===o)continue;(g(s,o)??r.get(`${s}->${o}`))==="violation"&&n.push({file:i,kind:"layer-violation",description:`Imports from ${o}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${s}/ should not depend on ${o}/`})}}return n}function b(t,n){let r=[];for(let[i,e]of _(t)){let s=e.filter(o=>!a(o));if(s.length<n)continue;let c=k(t,s);for(let o of s)for(let f of t.get(o)??[])a(f)||(c.get(f)??0)===1&&l.dirname(f)!==i&&l.dirname(f)!==l.dirname(i)&&(S(o,f)||r.push({file:o,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${f}`,dep:f}))}return r}function R(t){return{results:t,unusedImports:t.filter(n=>n.kind==="unused-import").length,layerViolations:t.filter(n=>n.kind==="layer-violation").length,patternDeviations:t.filter(n=>n.kind==="pattern-deviation").length}}function _(t){let n=new Map;for(let r of t.keys()){let i=l.dirname(r),e=n.get(i);e||(e=[],n.set(i,e)),e.push(r)}return n}function k(t,n){let r=new Map;for(let i of n)for(let e of t.get(i)??[])a(e)||r.set(e,(r.get(e)??0)+1);return r}function M(t,n){let r=new Map;return E(t,r,n),O(t,r),r}function E(t,n,r){for(let i of I(t,r))h(t,n,i.from_file,i.to_file)}function I(t,n){let r=n?`AND d1.relative_path LIKE '%${n}%'`:"";return t.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d1 ON c.document_id = d1.id
5
+ JOIN global_symbols gs ON m.symbol_id = gs.id
6
+ JOIN (
7
+ SELECT m2.symbol_id, c2.document_id
8
+ FROM mentions m2
9
+ JOIN chunks c2 ON m2.chunk_id = c2.id
10
+ WHERE m2.role = 1
11
+ GROUP BY m2.symbol_id
12
+ ) sym_def ON sym_def.symbol_id = gs.id
13
+ JOIN documents d2 ON sym_def.document_id = d2.id
14
+ WHERE d1.id != d2.id
15
+ AND m.role != 1
16
+ ${t.pathExclusionsFor("d1","d2")}
17
+ ${r}`)}function O(t,n){let r=new p(t),i=t.all(`SELECT relative_path FROM documents
18
+ WHERE 1 = 1 ${t.pathExclusionsFor("documents")}`);r.scanSourceReferences({paths:i.map(e=>e.relative_path),includeRustAttributeNames:!0,identifierResolution:"permissive"},e=>{e.target.relativePath!==e.sourceFile&&(t.isIgnored(e.target.relativePath)||h(t,n,e.sourceFile,e.target.relativePath))})}function h(t,n,r,i){if(t.isIgnored(r)||t.isIgnored(i))return;let e=n.get(r);e||(e=new Set,n.set(r,e)),e.add(i)}function N(t){let n=new Map;for(let[i,e]of t){if(a(i))continue;let s=u(i);for(let c of e){if(a(c))continue;let o=u(c);if(s===o||g(s,o))continue;let f=`${s}->${o}`;n.set(f,(n.get(f)??0)+1)}}let r=new Map;for(let[i,e]of n)r.set(i,e<=2?"violation":"ok");return r}function $(t){return t.includes("types")||t.endsWith(".d.ts")}function F(t,n,r){let i=m(t,n).filter(e=>e.sourcePath===r);return i.length>0&&i.some(e=>e.isUsed)}function w(t,n,r){let i=d(t,n).filter(e=>e.sourcePath===r);return i.length>0&&i.some(e=>e.used)}function L(t,n,r){let i=d(t,n).filter(e=>e.sourcePath===r);return i.length>0&&i.every(e=>e.isTypeOnly===!0)}function P(t){return t.endsWith(".vue")}function x(t,n,r){let i=d(t,n).filter(e=>e.sourcePath===r);return i.length===0?!1:i.every(e=>e.kind==="side-effect"||e.kind==="namespace"&&e.usedMembers.length===0&&!e.used)}function a(t){let n=y(t);return!!(n==="entry"||n==="barrel"||n==="test"||n==="worker"||T(l.basename(t)))}function T(t){return!!(t==="index.ts"||t==="index.js"||t==="cli.ts"||t==="main.ts"||t==="main.rs"||t.includes("worker.")||t.includes("postinstall.")||t==="health.ts"||t==="health.js")}export{q as a};
19
+ //# sourceMappingURL=chunk-FHSD5RKF.js.map