scip-query 0.10.8 → 0.10.10

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 (227) hide show
  1. package/README.md +3 -1
  2. package/dist/{chunk-E2CCBFLR.js → chunk-2UYQLFVC.js} +2 -2
  3. package/dist/chunk-2VM46FC5.js +8 -0
  4. package/dist/{chunk-24S6MYOC.js → chunk-3DGD6NKW.js} +2 -2
  5. package/dist/chunk-3Q77KKEY.js +2 -0
  6. package/dist/chunk-3VD3JMK2.js +2 -0
  7. package/dist/{chunk-RSKOYTSY.js → chunk-4KTOV4QN.js} +2 -2
  8. package/dist/chunk-4N4WONI4.js +102 -0
  9. package/dist/{chunk-EBIQY3RK.js → chunk-56P7PDST.js} +2 -2
  10. package/dist/{chunk-BWL2ECGQ.js → chunk-5NVUWIAN.js} +2 -2
  11. package/dist/{chunk-BEUQVBE3.js → chunk-5VG7RKEF.js} +2 -2
  12. package/dist/{chunk-C6BYNIH4.js → chunk-65AU3HFZ.js} +2 -2
  13. package/dist/{chunk-NWFSC356.js → chunk-6LNQOOTB.js} +2 -2
  14. package/dist/{chunk-6TDOT7B3.js → chunk-72KY2ZFO.js} +2 -2
  15. package/dist/{chunk-7KJBH4IP.js → chunk-736BLPHR.js} +2 -2
  16. package/dist/chunk-7JRRXGVZ.js +2 -0
  17. package/dist/{chunk-RHKMQNFI.js → chunk-7UQWUVRG.js} +2 -2
  18. package/dist/chunk-A6IDHNMC.js +4 -0
  19. package/dist/chunk-A6TANQNV.js +2 -0
  20. package/dist/{chunk-X3Z4MLVL.js → chunk-AW2QHPLL.js} +2 -2
  21. package/dist/chunk-BSN22NRK.js +9 -0
  22. package/dist/{chunk-ZDR4VTOP.js → chunk-BVRS7RKQ.js} +2 -2
  23. package/dist/{chunk-ANIOISCE.js → chunk-C5CTSJ6X.js} +2 -2
  24. package/dist/{chunk-MEKSFV6H.js → chunk-CCKPYPDI.js} +2 -2
  25. package/dist/chunk-CZ425R2B.js +18 -0
  26. package/dist/{chunk-QDGKE5HN.js → chunk-DQVKIG3D.js} +2 -2
  27. package/dist/chunk-F6ICF7HL.js +40 -0
  28. package/dist/chunk-FAYI6KZ5.js +2 -0
  29. package/dist/{chunk-ZL52RLDK.js → chunk-FDEQIPPK.js} +2 -2
  30. package/dist/chunk-FRPEPTYJ.js +5 -0
  31. package/dist/chunk-GBEYTDY5.js +2 -0
  32. package/dist/{chunk-VFLHKRTW.js → chunk-GRJY65YT.js} +2 -2
  33. package/dist/chunk-HF25DFSC.js +3 -0
  34. package/dist/chunk-HHN2B5KA.js +2 -0
  35. package/dist/{chunk-FKUCFCLU.js → chunk-I46WR7MT.js} +2 -2
  36. package/dist/{chunk-5SMUKUV5.js → chunk-IPQTC36U.js} +2 -2
  37. package/dist/{chunk-FGTHPJON.js → chunk-J7RWXLUL.js} +2 -2
  38. package/dist/{chunk-63MSELOP.js → chunk-KX5PLFZ5.js} +2 -2
  39. package/dist/{chunk-VMPB52FG.js → chunk-LPL4MA6R.js} +2 -2
  40. package/dist/chunk-LZHUWKGD.js +2 -0
  41. package/dist/{chunk-BJWNO6BU.js → chunk-MMLZEGMS.js} +2 -2
  42. package/dist/{chunk-5G5VI7J4.js → chunk-NZ4UDB5N.js} +2 -2
  43. package/dist/{chunk-3LQFMQPY.js → chunk-OBGRLXWF.js} +2 -2
  44. package/dist/chunk-P5RYBRIO.js +4 -0
  45. package/dist/chunk-PKMZCDQD.js +4 -0
  46. package/dist/{chunk-T633QLYF.js → chunk-PTQVNJ4Q.js} +2 -2
  47. package/dist/{chunk-FHWEEQVO.js → chunk-QPU7EXAW.js} +2 -2
  48. package/dist/chunk-QVI3NR7E.js +7 -0
  49. package/dist/{chunk-6EO3E3IP.js → chunk-QX7LLCGB.js} +2 -2
  50. package/dist/{chunk-AA7L7GKI.js → chunk-QYB5P7GL.js} +2 -2
  51. package/dist/chunk-RVWSAMTT.js +2 -0
  52. package/dist/{chunk-SHM5D3DQ.js → chunk-RXRLZFUL.js} +2 -2
  53. package/dist/{chunk-LGX2Y4BA.js → chunk-RYXW3KRC.js} +2 -2
  54. package/dist/{chunk-B4EHYG6M.js → chunk-SGLLBSCV.js} +2 -2
  55. package/dist/{chunk-ZMU6IWDK.js → chunk-SULEXAHO.js} +2 -2
  56. package/dist/{chunk-KZYHFI2X.js → chunk-TH2N6QHW.js} +2 -2
  57. package/dist/{chunk-JRUKS66S.js → chunk-TL6QPNF5.js} +2 -2
  58. package/dist/{chunk-JUIAOOK7.js → chunk-UDGXK2WA.js} +2 -2
  59. package/dist/{chunk-Q34NWRPP.js → chunk-UFX7EPBA.js} +2 -2
  60. package/dist/chunk-UQLFQLAF.js +2 -0
  61. package/dist/{chunk-VXT7WVIN.js → chunk-UWYJDBDW.js} +2 -2
  62. package/dist/{chunk-GZQID3FS.js → chunk-UYD7FJ3K.js} +2 -2
  63. package/dist/{chunk-2YI45TNM.js → chunk-VUKC6F77.js} +2 -2
  64. package/dist/{chunk-L4QKEQ4S.js → chunk-WG6KRH5F.js} +2 -2
  65. package/dist/{chunk-LWTML2AN.js → chunk-XIVO4SDZ.js} +2 -2
  66. package/dist/{chunk-N7F5UM6J.js → chunk-XSNRACLV.js} +2 -2
  67. package/dist/chunk-XUGQU7PM.js +41 -0
  68. package/dist/{chunk-BJG67TCR.js → chunk-XXZXDXTD.js} +2 -2
  69. package/dist/chunk-Y6E3JHC4.js +2 -0
  70. package/dist/{chunk-6BNOACLT.js → chunk-YBEEVDJQ.js} +2 -2
  71. package/dist/chunk-YGHUVQLR.js +2 -0
  72. package/dist/chunk-YWDVDAD7.js +2 -0
  73. package/dist/{chunk-6N6QTGSD.js → chunk-Z4I7BVIU.js} +2 -2
  74. package/dist/{chunk-3FYGJ2GY.js → chunk-ZQO43G2T.js} +2 -2
  75. package/dist/{chunk-JYSAYZNX.js → chunk-ZU6PROUY.js} +2 -2
  76. package/dist/cli.js +256 -205
  77. package/dist/{db-BAVwb4Pb.d.ts → db-Djj3Nqrb.d.ts} +2 -0
  78. package/dist/{health-B17sVFYf.d.ts → health-D5J42g4D.d.ts} +1 -1
  79. package/dist/index.d.ts +3 -2
  80. package/dist/index.js +3 -3
  81. package/dist/queries/affected.d.ts +1 -1
  82. package/dist/queries/affected.js +1 -1
  83. package/dist/queries/bottlenecks.d.ts +1 -1
  84. package/dist/queries/bottlenecks.js +1 -1
  85. package/dist/queries/by-kind.d.ts +1 -1
  86. package/dist/queries/by-kind.js +1 -1
  87. package/dist/queries/call-graph.d.ts +1 -1
  88. package/dist/queries/call-graph.js +1 -1
  89. package/dist/queries/change-surface.d.ts +1 -1
  90. package/dist/queries/change-surface.js +1 -1
  91. package/dist/queries/cleanup-plan.d.ts +1 -1
  92. package/dist/queries/cleanup-plan.js +1 -1
  93. package/dist/queries/co-change.d.ts +1 -1
  94. package/dist/queries/co-change.js +1 -1
  95. package/dist/queries/code.d.ts +1 -1
  96. package/dist/queries/code.js +1 -1
  97. package/dist/queries/complexity-hotspots.d.ts +1 -1
  98. package/dist/queries/complexity-hotspots.js +1 -1
  99. package/dist/queries/complexity.d.ts +1 -1
  100. package/dist/queries/complexity.js +1 -1
  101. package/dist/queries/convergence.d.ts +1 -1
  102. package/dist/queries/convergence.js +1 -1
  103. package/dist/queries/coupling.d.ts +1 -1
  104. package/dist/queries/coupling.js +1 -1
  105. package/dist/queries/cycles.d.ts +1 -1
  106. package/dist/queries/cycles.js +1 -1
  107. package/dist/queries/dataflow.d.ts +1 -1
  108. package/dist/queries/dataflow.js +1 -1
  109. package/dist/queries/dead.d.ts +1 -1
  110. package/dist/queries/dead.js +1 -1
  111. package/dist/queries/deep-chains.d.ts +1 -1
  112. package/dist/queries/deep-chains.js +1 -1
  113. package/dist/queries/deps.d.ts +1 -1
  114. package/dist/queries/deps.js +1 -1
  115. package/dist/queries/diff-gate.d.ts +1 -1
  116. package/dist/queries/diff-gate.js +1 -1
  117. package/dist/queries/diff-impact.d.ts +1 -1
  118. package/dist/queries/diff-impact.js +1 -1
  119. package/dist/queries/doc-drift.d.ts +1 -1
  120. package/dist/queries/doc-drift.js +1 -1
  121. package/dist/queries/drift.d.ts +2 -1
  122. package/dist/queries/drift.js +1 -1
  123. package/dist/queries/extract-candidates.d.ts +1 -1
  124. package/dist/queries/extract-candidates.js +1 -1
  125. package/dist/queries/fan.d.ts +1 -1
  126. package/dist/queries/fan.js +1 -1
  127. package/dist/queries/files.d.ts +1 -1
  128. package/dist/queries/health.d.ts +2 -2
  129. package/dist/queries/health.js +1 -1
  130. package/dist/queries/hierarchy.d.ts +1 -1
  131. package/dist/queries/hierarchy.js +1 -1
  132. package/dist/queries/hotspots.d.ts +1 -1
  133. package/dist/queries/hotspots.js +1 -1
  134. package/dist/queries/imports.d.ts +1 -1
  135. package/dist/queries/imports.js +1 -1
  136. package/dist/queries/incomplete-migration.d.ts +1 -1
  137. package/dist/queries/incomplete-migration.js +1 -1
  138. package/dist/queries/index.d.ts +2 -2
  139. package/dist/queries/index.js +1 -1
  140. package/dist/queries/isolated.d.ts +1 -1
  141. package/dist/queries/isolated.js +1 -1
  142. package/dist/queries/locality-candidates.d.ts +1 -1
  143. package/dist/queries/locality-candidates.js +1 -1
  144. package/dist/queries/members.d.ts +1 -1
  145. package/dist/queries/members.js +1 -1
  146. package/dist/queries/methods.d.ts +1 -1
  147. package/dist/queries/methods.js +1 -1
  148. package/dist/queries/outline.d.ts +1 -1
  149. package/dist/queries/outline.js +1 -1
  150. package/dist/queries/passthrough-candidates.d.ts +1 -1
  151. package/dist/queries/passthrough-candidates.js +1 -1
  152. package/dist/queries/plan-context.d.ts +1 -1
  153. package/dist/queries/plan-context.js +1 -1
  154. package/dist/queries/react-component-duplicates.d.ts +2 -1
  155. package/dist/queries/react-component-duplicates.js +1 -1
  156. package/dist/queries/react-hook-candidates.d.ts +2 -1
  157. package/dist/queries/react-hook-candidates.js +1 -1
  158. package/dist/queries/react-large-component-pressure.d.ts +1 -1
  159. package/dist/queries/react-large-component-pressure.js +1 -1
  160. package/dist/queries/recent-duplicates.d.ts +1 -1
  161. package/dist/queries/recent-duplicates.js +1 -1
  162. package/dist/queries/redundant-reexports.d.ts +1 -1
  163. package/dist/queries/redundant-reexports.js +1 -1
  164. package/dist/queries/refs.d.ts +1 -1
  165. package/dist/queries/refs.js +1 -1
  166. package/dist/queries/self-audit.d.ts +1 -1
  167. package/dist/queries/self-audit.js +1 -1
  168. package/dist/queries/similar-chains.d.ts +1 -1
  169. package/dist/queries/similar-chains.js +1 -1
  170. package/dist/queries/similar-files.d.ts +1 -1
  171. package/dist/queries/similar-files.js +1 -1
  172. package/dist/queries/similar-signatures.d.ts +1 -1
  173. package/dist/queries/similar-signatures.js +1 -1
  174. package/dist/queries/similar.d.ts +2 -1
  175. package/dist/queries/similar.js +1 -1
  176. package/dist/queries/slice.d.ts +1 -1
  177. package/dist/queries/slice.js +1 -1
  178. package/dist/queries/stale-abstractions.d.ts +1 -1
  179. package/dist/queries/stale-abstractions.js +1 -1
  180. package/dist/queries/stats.d.ts +1 -1
  181. package/dist/queries/surface.d.ts +1 -1
  182. package/dist/queries/surface.js +1 -1
  183. package/dist/queries/symbols.d.ts +1 -1
  184. package/dist/queries/symbols.js +1 -1
  185. package/dist/queries/system.d.ts +1 -1
  186. package/dist/queries/system.js +1 -1
  187. package/dist/queries/trace.d.ts +1 -1
  188. package/dist/queries/trace.js +1 -1
  189. package/dist/queries/unused-imports.d.ts +1 -1
  190. package/dist/queries/unused-imports.js +1 -1
  191. package/dist/queries/unused-params.d.ts +1 -1
  192. package/dist/queries/unused-params.js +1 -1
  193. package/dist/queries/vue-component-duplicates.d.ts +2 -1
  194. package/dist/queries/vue-component-duplicates.js +1 -1
  195. package/dist/queries/vue-composable-candidates.d.ts +2 -1
  196. package/dist/queries/vue-composable-candidates.js +1 -1
  197. package/dist/queries/vue-large-view-pressure.d.ts +1 -1
  198. package/dist/queries/wrapper-candidates.d.ts +1 -1
  199. package/dist/queries/wrapper-candidates.js +1 -1
  200. package/docs/analyzer-inventory.md +29 -0
  201. package/docs/analyzer-validation-ledger.md +32 -1
  202. package/package.json +1 -1
  203. package/dist/chunk-2H57MJLI.js +0 -2
  204. package/dist/chunk-4TMJDHC6.js +0 -5
  205. package/dist/chunk-5GVOJOBL.js +0 -2
  206. package/dist/chunk-7XWXGANX.js +0 -4
  207. package/dist/chunk-AETMKBZR.js +0 -40
  208. package/dist/chunk-BTCASU5J.js +0 -3
  209. package/dist/chunk-C6ROZBJA.js +0 -32
  210. package/dist/chunk-COUFCH64.js +0 -2
  211. package/dist/chunk-EKECQP6Z.js +0 -2
  212. package/dist/chunk-FVA3NH4P.js +0 -2
  213. package/dist/chunk-I274B3B3.js +0 -7
  214. package/dist/chunk-J6ADQKQA.js +0 -2
  215. package/dist/chunk-K7VBTWNR.js +0 -2
  216. package/dist/chunk-KLXVEBVC.js +0 -2
  217. package/dist/chunk-KRGBLZT2.js +0 -7
  218. package/dist/chunk-P3K7LX7M.js +0 -4
  219. package/dist/chunk-PVZMPG5I.js +0 -2
  220. package/dist/chunk-RY7CAOJF.js +0 -4
  221. package/dist/chunk-S7YOLFLX.js +0 -2
  222. package/dist/chunk-SOGKYB5I.js +0 -8
  223. package/dist/chunk-VAXDTQHE.js +0 -18
  224. package/dist/chunk-X3BJUFSN.js +0 -62
  225. package/dist/chunk-XPOZO76D.js +0 -2
  226. package/dist/chunk-XWC67C3Q.js +0 -2
  227. package/dist/chunk-YNSVAJR6.js +0 -2
@@ -164,3 +164,32 @@ This should pair with `react-large-component-pressure`, `vue-large-view-pressure
164
164
  ## 2026-06-23 Citation Refresh
165
165
 
166
166
  The maintainability-register completion slice rechecked the command and diff-gate guide references above. `src/runtime/commands/query-command-specs.ts` still owns the public query order, now also exporting `orderedQueryCommandDescriptors` so CLI registration can derive from that order. `src/queries/impact/diff-gate.ts` still owns `DIFF_GATE_CHECKS`; the slice only centralized finding emission through a local recorder and did not change the listed check family.
167
+
168
+ ## 2026-06-28 Diff-Gate Echo Follow-Up
169
+
170
+ The diff-gate implementation still owns `DIFF_GATE_CHECKS` and the default
171
+ diff-scoped check family in `src/queries/impact/diff-gate.ts`. The
172
+ hyper-optimization follow-up only adds a callable-symbol prefilter before the
173
+ echo check invokes similarity, so the command surface and check inventory
174
+ described above are unchanged.
175
+
176
+ ## 2026-06-28 Health Drift Performance Follow-Up
177
+
178
+ The `src/queries/health/health.ts` citation remains accurate. The
179
+ hyper-optimization follow-up only skips advisory drift `pattern-deviation` rows
180
+ for health and baseline paths that already hide those rows; health scoring,
181
+ phase inventory, and public `drift` output are unchanged.
182
+
183
+ ## 2026-06-28 Diff-Gate Co-Change Follow-Up
184
+
185
+ The `src/queries/impact/diff-gate.ts` citation remains accurate. Diff-gate
186
+ still owns `DIFF_GATE_CHECKS`; the co-change partner check now compares against
187
+ the raw git changed-path set so changed docs and config files count as present
188
+ even when they are not indexed code files.
189
+
190
+ ## 2026-06-28 Focused Co-Change History Follow-Up
191
+
192
+ The `src/queries/impact/diff-gate.ts` citation remains accurate after the
193
+ focused co-change history optimization. Diff-gate still owns the check list and
194
+ co-change partner gate; the latest change only narrows the git-history read for
195
+ that gate to commits in the bounded analysis window that touched changed files.
@@ -15,7 +15,7 @@ The ledger is anchored to the current tool surface, not memory.
15
15
  | Surface | Source | Why it anchors the ledger |
16
16
  | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
17
17
  | Repo-wide health analysis | `scip-query code health --json` reported `src/queries/health/health.ts:194`, where `health()` runs `runHealthAnalyses()` and `buildHealthReport()`. | Every repo-wide analyzer validation must eventually reconcile with health output and scoring. |
18
- | Change-time gate analysis | `scip-query code diffGate --json` reported `src/queries/impact/diff-gate.ts:94`, where `diffGate()` runs the default diff-scoped checks: `echo`, `incomplete-migration`, `co-change-partner`, `doc-reference`, `unused-params`, and `new-dead`. The baseline ratchet is explicit because it is repo-wide. | Every diff-only analyzer needs a separate validation path from repo-wide health. |
18
+ | Change-time gate analysis | `scip-query code diffGate --json` reported `src/queries/impact/diff-gate.ts:94`, where `diffGate()` runs the default diff-scoped checks: `echo`, `incomplete-migration`, `co-change-partner`, `doc-reference`, `unused-params`, and `new-dead`. The baseline ratchet is explicit because it is repo-wide. | Every diff-only analyzer needs a separate validation path from repo-wide health. |
19
19
  | Public command registry | `scip-query trace queryCommandOrder --json` reported `src/runtime/commands/query-command-specs.ts:10`, where the public query command order starts. `scip-query code queryCommandDescriptor --json` reported `src/runtime/commands/query-command-specs.ts:94`, where command descriptors are resolved by id. | The ledger must not silently miss a public analyzer command. |
20
20
  | Diff-gate check list | `scip-query trace DIFF_GATE_CHECKS --json` reported `src/queries/impact/diff-gate.ts:27`, where the canonical diff-gate check list is exported. | The ledger must cover every change-time check that can block a diff. |
21
21
 
@@ -268,3 +268,34 @@ The maintainability-register completion slice rechecked the ledger's command-sur
268
268
  ## 2026-06-23 Current Sweep Citation Refresh
269
269
 
270
270
  The current maintainability sweep rechecked the `diff-gate.ts` citation again after doc-reference and baseline policy helpers moved into private query modules. The ledger remains accurate because `diffGate()` and `DIFF_GATE_CHECKS` still live in `src/queries/impact/diff-gate.ts`; the baseline policy body remains behind the same entry point, but the repo-wide baseline ratchet is explicit rather than part of default diff-gate execution.
271
+
272
+ ## 2026-06-28 Diff-Gate Echo Follow-Up
273
+
274
+ The `diffGate()` citation remains accurate: default diff-gate execution still
275
+ runs echo, incomplete migration, co-change partner, doc-reference,
276
+ unused-params, and new-dead checks through `src/queries/impact/diff-gate.ts`.
277
+ The performance follow-up only skips non-callable changed symbols before echo
278
+ similarity scoring; baseline ratchet behavior and check configuration remain
279
+ unchanged.
280
+
281
+ ## 2026-06-28 Health Drift Performance Follow-Up
282
+
283
+ The `src/queries/health/health.ts` reference remains accurate after the health
284
+ drift optimization. Health and the baseline ratchet now ask `drift()` to skip
285
+ advisory `pattern-deviation` rows they already exclude from visible output and
286
+ stable finding identities; the repo-wide health score contract is unchanged.
287
+
288
+ ## 2026-06-28 Diff-Gate Co-Change Follow-Up
289
+
290
+ The `diffGate()` citation remains accurate. Default diff-gate still runs the
291
+ same check family; the co-change partner check now uses the raw git changed
292
+ paths when deciding whether a historical partner is already present in the
293
+ diff.
294
+
295
+ ## 2026-06-28 Focused Co-Change History Follow-Up
296
+
297
+ The `diffGate()` citation remains accurate after the focused co-change history
298
+ optimization. Default diff-gate still runs the same check family; the
299
+ co-change partner check now reads only changed-file commits from the same
300
+ bounded git-history window instead of parsing the whole name-only history
301
+ payload.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scip-query",
3
- "version": "0.10.8",
3
+ "version": "0.10.10",
4
4
  "description": "Evidence and verification for AI coding agents: map code, reuse concepts, finish migrations, and gate diffs.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,2 +0,0 @@
1
- import{c as o,d as a}from"./chunk-BZ53S4ZN.js";import{a as p}from"./chunk-PVZMPG5I.js";import{a as c,b as m,c as f}from"./chunk-YWOOQ4FF.js";import{c as u}from"./chunk-YZA6PPZL.js";function D(n,i={}){let{minSimilarity:t=.62,minTokens:e=8,limit:l=20,scope:d,scanLimit:h,filePattern:k}=i,P=g(n,{scope:d,minTokens:e,scanLimit:h});return p({profiles:P,limit:l,filePattern:k,compare:(r,s)=>v(r,s,t),sort:(r,s)=>s.similarity-r.similarity||r.fileA.localeCompare(s.fileA)||r.fileB.localeCompare(s.fileB)})}function g(n,i){return u(n,{scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(t=>({file:t.file,tokens:t.templateTokens,loc:C(t)}))}function C(n){return n.totalLines}function v(n,i,t){let e=c(n.tokens,i.tokens);if(e.size<6||!T(e))return null;let l=f(n.tokens,i.tokens);return l<t?null:{fileA:n.file,fileB:i.file,similarity:l,sharedTokens:a(e),sharedComponents:o(e,"component:"),sharedProps:o(e,"prop:"),sharedEvents:o(e,"event:"),sharedDirectives:o(e,"directive:"),sharedSlots:o(e,"slot:"),sharedIdentifiers:o(e,"id:"),uniqueToA:a(m(n.tokens,i.tokens)).slice(0,25),uniqueToB:a(m(i.tokens,n.tokens)).slice(0,25),locA:n.loc,locB:i.loc}}function T(n){let i=0,t=0;for(let e of n)e.startsWith("component:")&&(i+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("directive:")||e.startsWith("slot:"))&&(t+=1);return i>=1||t>=3}export{D as a};
2
- //# sourceMappingURL=chunk-2H57MJLI.js.map
@@ -1,5 +0,0 @@
1
- import{a as L,b as F,e as D,f as E,g as k,h as z,i as $}from"./chunk-YWOOQ4FF.js";import{b as q}from"./chunk-B75HZHUP.js";import{a as w}from"./chunk-XPOZO76D.js";import{a as B}from"./chunk-ZMU6IWDK.js";import{a as v}from"./chunk-T633QLYF.js";import{c as b,d as R,g as I}from"./chunk-JM72FNGA.js";import{b as N}from"./chunk-DS6QEB3G.js";import{d as C}from"./chunk-7S5E7KWT.js";function Ne(e,n,i={}){let{minSimilarity:t=.4,limit:a=20}=i,s=ie(e,n,{semantic:i.semantic!==!1});if(!s)return[];if(!I(s.symbol))return[];let r=Y(e,s,t,{scanLimit:i.scanLimit,semantic:i.semantic!==!1});return r.length>0?r.slice(0,a):me(e,n,{minSimilarity:t,limit:a})}function Y(e,n,i,t){let a=j(e,{minCallees:3,scanLimit:t.scanLimit,semantic:t.semantic}),s=oe(n,a),r=J(n,a),o=E(r),c=k(n.callees,r),l=[];for(let m of s){if(m.callees.size<3)continue;let p=k(m.callees,r),u=P(n,m,r,{minSimilarity:i,requireSignificantShared:1,requireSharedCount:0,medianIdf:o,magnitudeA:c,magnitudeB:p});u&&l.push(u)}return l.sort((m,p)=>p.similarity-m.similarity),l}function J(e,n){let i=new Map(n.docFreq);for(let t of e.callees)i.set(t,(i.get(t)??0)+1);return D(i,n.corpus.length+1)}function P(e,n,i,t){let a=t.magnitudeA===void 0||t.magnitudeB===void 0?z(e.callees,n.callees,i,{medianIdf:t.medianIdf}):$(e.callees,n.callees,i,{medianIdf:t.medianIdf,magnitudeA:t.magnitudeA,magnitudeB:t.magnitudeB}),{similarity:s,significantShared:r,trivialShared:o}=a;if(s<t.minSimilarity)return null;let c=r.length+o.length;if(r.length<t.requireSignificantShared&&c<t.requireSharedCount)return null;let l=r.length>0?r:o,m=U(l,"callees");return{symbolA:e.symbol,shortNameA:b(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:b(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:l.map(b),uniqueToA:[...F(e.callees,n.callees)].map(b),uniqueToB:[...F(n.callees,e.callees)].map(b),...m}}function Be(e,n={}){let{minSimilarity:i=.5,limit:t=20,scope:a,minCallees:s=4,crossFileOnly:r=!1,scanLimit:o}=n,c=j(e,{minCallees:s,scope:a,scanLimit:o,semantic:n.semantic!==!1}),l=c.corpus,m=[],p=0;for(let u=0;u<l.length;u+=1){let d=l[u],y=c.weightedMagnitudes[u],h=new Set;for(let g of d.callees){let f=c.candidateIndexesByCallee.get(g);if(f)for(let S of f)S>u&&h.add(S)}for(let g of h){let f=l[g];if(r&&d.file===f.file)continue;if(d.paramCount>=0&&f.paramCount>=0){let X=Math.abs(d.paramCount-f.paramCount),Q=Math.max(2,Math.ceil(Math.max(d.paramCount,f.paramCount)*.5));if(X>Q)continue}let S=P(d,f,c.idfWeights,{minSimilarity:i,requireSignificantShared:2,requireSharedCount:4,medianIdf:c.medianIdf,magnitudeA:y,magnitudeB:c.weightedMagnitudes[g]});S&&(ee(m,S,t,p),p+=1)}}return m.sort((u,d)=>d.result.similarity-u.result.similarity||u.order-d.order),m.map(u=>u.result)}function ee(e,n,i,t){if(i<=0)return;if(e.length<i){e.push({result:n,order:t});return}let a=0;for(let r=1;r<e.length;r+=1){let o=e[r],c=e[a];(o.result.similarity<c.result.similarity||o.result.similarity===c.result.similarity&&o.order>c.order)&&(a=r)}let s=e[a];n.similarity<=s.result.similarity||(e[a]={result:n,order:t})}var ne=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function ie(e,n,i){let t=v(e,n),a=new w(e);if(!t)return null;let s=B(e,t,{semantic:i.semantic});return{symbol:t.symbol,file:t.relativePath,callees:G(s.map(r=>r.symbol)),paramCount:a.callableSignature(t)?.paramCount??-1}}var te=C("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),re=C("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function se(e,n){let{minCallees:i,scope:t,excludeSymbol:a,scanLimit:s}=n,r=n.semantic!==!1,o=te.get(e,()=>new Map),c=`${i}|${t??""}|${s??""}|${r}`,l=o.get(c);return l||(l=le(e,{minCallees:i,scope:t,scanLimit:s,semantic:r}),o.set(c,l)),a===void 0?l:l.filter(m=>m.symbol!==a)}function j(e,n){let{minCallees:i,scope:t,scanLimit:a}=n,s=n.semantic!==!1,r=re.get(e,()=>new Map),o=`${i}|${t??""}|${a??""}|${s}`,c=r.get(o);return c||(c=ae(se(e,{minCallees:i,scope:t,scanLimit:a,semantic:s})),r.set(o,c)),c}function ae(e){let n=new Map;for(let r of e)for(let o of r.callees)n.set(o,(n.get(o)??0)+1);let i=Math.max(8,Math.ceil(Math.sqrt(e.length))),t=D(n,e.length),a=e.map(r=>k(r.callees,t)),s=new Map;for(let r=0;r<e.length;r+=1){let o=e[r];for(let c of o.callees){if((n.get(c)??0)>i)continue;let l=s.get(c);l||(l=[],s.set(c,l)),l.push(r)}}return{corpus:e,candidateIndexesByCallee:s,docFreq:n,idfWeights:t,weightedMagnitudes:a,medianIdf:E(t),ubiquityThreshold:i}}function oe(e,n){let i=new Map;for(let t of e.callees)for(let a of n.candidateIndexesByCallee.get(t)??[]){let s=n.corpus[a];s.symbol!==e.symbol&&i.set(s.symbol,s)}return i.size>0?[...i.values()]:n.corpus.filter(t=>t.symbol!==e.symbol)}function le(e,n){let{minCallees:i,scope:t,scanLimit:a,semantic:s}=n,r=new w(e),o=q(r.productionCallableDefinitions({scope:t,minLoc:5,sortByLocDesc:typeof a=="number"&&a>0}),a),c=r.calleeMap(o,{semantic:s});return o.map(l=>({symbol:l.symbol,file:l.relativePath,callees:G((c.get(l.symbolId)??[]).map(m=>m.symbol)),paramCount:r.callableSignature(l)?.paramCount??-1})).filter(l=>l.callees.size>=i)}function G(e){return new Set([...e].filter(n=>!ce(n)))}function ce(e){return ne.some(n=>e.includes(n))}function me(e,n,i){let t=ge(e,n);if(!t||t.tokens.size<3)return[];let a=i.minSimilarity>=.5?i.minSimilarity:.3,s=[],r=Fe(t,he(e));for(let o of r){if(o.symbol===t.symbol||o.tokens.size<3)continue;let c=L(t.tokens,o.tokens);if(c.size<2)continue;let l=new Set([...t.tokens,...o.tokens]),m=l.size>0?c.size/l.size:0;m<a||s.push({symbolA:t.symbol,shortNameA:b(t.symbol),fileA:t.file,symbolB:o.symbol,shortNameB:b(o.symbol),fileB:o.file,similarity:m,similarityBasis:"source-tokens",sharedCallees:[...c].sort(),uniqueToA:[...F(t.tokens,o.tokens)].sort(),uniqueToB:[...F(o.tokens,t.tokens)].sort(),...U([...c],"source-tokens")})}return s.sort((o,c)=>c.similarity-o.similarity||o.shortNameB.localeCompare(c.shortNameB)),s.slice(0,i.limit)}function U(e,n){let i=e.flatMap(T),t=e.flatMap(g=>_(g,n)),a=M(i,V),s=M(i,W),r=M(t,A),o=[...new Set(t.filter(O))],c=e.filter(g=>{let f=_(g,n);return f.some(S=>A.has(S))&&f.some(O)}).length,l=[];a.length>0&&l.push(`access/query scaffolding: ${a.slice(0,5).join(", ")}`),s.length>0&&l.push(`framework/generic scaffolding: ${s.slice(0,5).join(", ")}`),r.length>0&&l.push(`domain behavior verbs: ${r.slice(0,5).join(", ")}`),r.length>0&&o.length>0&&l.push(`domain-specific terms: ${o.slice(0,5).join(", ")}`);let m=n==="source-tokens"&&i.length>0&&i.every(g=>K.has(g));m&&l.push("shared source tokens are generic scaffolding");let p=r.length>0&&o.length>0,u=a.length+s.length>0,d=n==="callees"&&p&&e.length>=4&&o.length>=4&&c>=2,y=d?"domain-behavior":p?u?"mixed":"domain-behavior":a.length>0?"access-query-scaffolding":s.length>0||m?"framework-scaffolding":"structural-overlap";y==="structural-overlap"&&e.length>0&&l.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let h=y==="domain-behavior"&&(e.length>=3||d)?"direct":"signal";return{evidenceClass:y,actionTier:h,evidenceClassReasons:l,recommendation:ue(y,h)}}function ue(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function M(e,n){return[...new Set(e.filter(i=>n.has(i)))]}function T(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function _(e,n){if(n==="source-tokens")return T(e);let i=R(e);return T(i.length>0?i:de(e))}function de(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(t=>t.trim()).filter(t=>/[A-Za-z]/.test(t)).at(-1)?.replace(/\.$/,"")??e}function O(e){return e.length>3&&!A.has(e)&&!V.has(e)&&!W.has(e)&&!K.has(e)&&!fe.has(e)}var A=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),V=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),W=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),K=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),fe=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function ge(e,n){let i=v(e,n);if(!i||!I(i.symbol))return null;let t=pe(e,i);return t?{symbol:i.symbol,file:i.relativePath,tokens:t}:null}function pe(e,n){let i=R(n.symbol),t=Z(e,n.relativePath,n.startLine,n.endLine,i),a=H(t,i);return a.size>0?a:null}var be=C("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),Se=C("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ye(e){return be.get(e,()=>xe(e))}function he(e){return Se.get(e,()=>Ce(ye(e)))}function Ce(e){let n=new Map;for(let a of e)for(let s of a.tokens)n.set(s,(n.get(s)??0)+1);let i=Math.max(8,Math.ceil(Math.sqrt(e.length))),t=new Map;for(let a of e)for(let s of a.tokens){if((n.get(s)??0)>i)continue;let r=t.get(s);r||(r=[],t.set(s,r)),r.push(a)}return{corpus:e,candidateByToken:t,docFreq:n,ubiquityThreshold:i}}function Fe(e,n){let i=new Map;for(let t of e.tokens)for(let a of n.candidateByToken.get(t)??[])a.symbol!==e.symbol&&i.set(a.symbol,a);return i.size>0?[...i.values()]:n.corpus.filter(t=>t.symbol!==e.symbol)}function xe(e){return new w(e).productionCallableDefinitions().map(i=>({symbol:i.symbol,file:i.relativePath,tokens:H(Z(e,i.relativePath,i.startLine,i.endLine,i.leaf),i.leaf)})).filter(i=>i.tokens.size>0)}function Z(e,n,i,t,a){let s=N(e,n);if(s.length===0)return"";if(t>=i&&t-i<=12)return s.slice(i,t+1).join(`
2
- `);let r=[new RegExp(`\\bdef\\s+${x(a)}\\b`),new RegExp(`\\bfun\\s+${x(a)}\\b`),new RegExp(`\\bfn\\s+${x(a)}\\b`),new RegExp(`\\bfunction\\s+${x(a)}\\b`),new RegExp(`\\b${x(a)}\\s*\\(`)],o=s.findIndex(c=>r.some(l=>l.test(c)));if(o>=0){let c=o;for(let l=o+1;l<s.length&&l<=o+8;l++){let m=s[l]??"";if(l>o&&ke(m)||(c=l,m.trim()===""&&l>o+1))break}return s.slice(o,c+1).join(`
3
- `)}return s.slice(i,Math.min(s.length,i+8)).join(`
4
- `)}function H(e,n){if(!e)return new Set;let i=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),t=we(n),s=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(r=>r.trim()).filter(r=>r.length>1).filter(r=>!i.has(r)).filter(r=>!t.has(r));return new Set(s)}function we(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function ke(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{Ne as a,J as b,Be as c,ee as d,se as e,j as f,ae as g,oe as h,G as i,U as j};
5
- //# sourceMappingURL=chunk-4TMJDHC6.js.map
@@ -1,2 +0,0 @@
1
- import{b as y}from"./chunk-B75HZHUP.js";import{a as f}from"./chunk-XPOZO76D.js";import{a as r}from"./chunk-BGBBVSH4.js";import{c as b}from"./chunk-JM72FNGA.js";function x(u,m={}){let{scope:p,minLoc:h=3,scanLimit:i}=m,s=new f(u),c=m.semantic!==!1,o=y(s.productionCallableDefinitions({scope:p,minLoc:h,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,sortByLocDesc:typeof i=="number"&&i>0}),i),I=s.crossFileCallerMap(o,{semantic:!1}),a=new Set(I.keys());for(let e of s.frameworkReferencedSymbolIds(o))a.add(e);let l=s.symbolsWithNonSelfCallees(o,{additive:!1,semantic:!1}),t=o.filter(e=>!a.has(e.symbolId)).filter(e=>!l.has(e.symbolId));if(c&&t.length>0){for(let e of s.crossFileCallerMap(t,{semantic:!0}).keys())a.add(e);for(let e of s.symbolsWithNonSelfCallees(t,{additive:!1,semantic:!0}))l.add(e);t=t.filter(e=>!a.has(e.symbolId)).filter(e=>!l.has(e.symbolId))}let L=s.sourceFallbackCallerFiles(t);for(let e of L.keys())a.add(e);let d=t.filter(e=>!a.has(e.symbolId)),C=s.symbolsWithNonSelfCallees(d,{additive:!0,semantic:c});for(let e of C)l.add(e);return d.filter(e=>!l.has(e.symbolId)).sort((e,n)=>r(n)-r(e)||e.relativePath.localeCompare(n.relativePath)||e.startLine-n.startLine).map(e=>({symbol:e.symbol,shortName:b(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:r(e)}))}export{x as a};
2
- //# sourceMappingURL=chunk-5GVOJOBL.js.map
@@ -1,4 +0,0 @@
1
- import{a as re}from"./chunk-S7YOLFLX.js";import{a as oe}from"./chunk-SOGKYB5I.js";import{a as S}from"./chunk-B32FX5KB.js";import{a as ne}from"./chunk-I274B3B3.js";import{a as te}from"./chunk-X3Z4MLVL.js";import{a as ie}from"./chunk-C2QSK7E7.js";import{a as X,c as ee}from"./chunk-4TMJDHC6.js";import{a as Z}from"./chunk-5GVOJOBL.js";import{a as Q}from"./chunk-63MSELOP.js";import{a as J}from"./chunk-JYSAYZNX.js";import{a as _,c as z,d as O,h as E,i as L}from"./chunk-QDGKE5HN.js";import{a as U,b as v,e as V}from"./chunk-P3K7LX7M.js";import{a as Y}from"./chunk-VAXDTQHE.js";import{b as W}from"./chunk-FVA3NH4P.js";import{a as j,c as M,d as P,e as H}from"./chunk-C6BYNIH4.js";import{g as I}from"./chunk-KRGBLZT2.js";import{a as q}from"./chunk-AA7L7GKI.js";import{a as N}from"./chunk-XPOZO76D.js";import{f as T,g as F}from"./chunk-ANIOISCE.js";import{d as R,e as K}from"./chunk-JM72FNGA.js";import{createHash as Ie}from"crypto";import{existsSync as ue}from"fs";function se(e){let[i,t]=x(e,":"),n=i||"unknown",o=(s={})=>{let r=s.actionTier??ge(n);return{sourceAnalyzer:n,actionTier:r,rootCauseKey:s.rootCauseKey??(t||e),label:s.label??`${n} finding`,relatedFiles:s.relatedFiles??[],why:s.why??[],remediation:s.remediation??me(r,n),file:s.file}};if(!t)return o({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(n)){let[s,r]=x(t,":");return o({file:s,relatedFiles:s?[s]:[],rootCauseKey:r?`${s}:${r}`:t,label:`${n} finding`,why:r?[`Baseline subject: ${r}.`]:[]})}if(n==="cycle"){let s=t.split(">").filter(Boolean);return o({relatedFiles:s,rootCauseKey:t,label:"cycle finding",why:s.length>0?[`Cycle path: ${s.join(" > ")}.`]:[]})}if(n==="similar"){let s=t.split("|").filter(Boolean);return o({relatedFiles:[],rootCauseKey:t,label:"similarity finding",why:s.length>0?[`Similar symbols: ${s.join(" | ")}.`]:[]})}if(n==="drift"){let[s,r]=x(t,":"),[l,a]=x(r,":");return o({actionTier:s==="unused-import"?"direct":"signal",file:l,relatedFiles:[...new Set([l,a].filter(Boolean))],rootCauseKey:t,label:`${s||"drift"} finding`,why:[...s?[`Drift kind: ${s}.`]:[],...a?[`Related dependency: ${a}.`]:[]]})}return o({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function ge(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function me(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function x(e,i){let t=e.indexOf(i);return t<0?[e,""]:[e.slice(0,t),e.slice(t+i.length)]}import{existsSync as pe,readFileSync as ae}from"fs";var w={classifyCitation:ye,citationContexts:be,citationKindLabel:Se,citationRemediation:$e,referenceTargets:De};function ye(e){let i=e.join(`
2
- `).toLowerCase(),t=[],n=v(i,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(n.length>0)return t.push(`configuration/example terms near citation: ${n.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:t};let o=v(i,["accepted","intentional","intentionally","retained","historical"]);if(o.length>0)return t.push(`intentional-record terms near citation: ${o.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:t};let s=v(i,["command","cli","usage","example","run","workflow"]);return s.length>0?(t.push(`guide/reference terms near citation: ${s.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:t}):(t.push(e.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:t})}function be(e,i,t){let n;try{n=ae(`${e.config.projectRoot}/${i}`,"utf-8").split(/\r?\n/)}catch{return[]}let o=t.flatMap(Ce),s=[];for(let r=0;r<n.length;r+=1){let l=n[r]??"";o.some(a=>l.includes(a))&&s.push(U(n,r))}return s}function Ce(e){let i=e.split("/");return[e,`./${e}`,i.slice(-3).join("/"),i.slice(-2).join("/")].filter((t,n,o)=>t.length>0&&o.indexOf(t)===n)}function Se(e){switch(e){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function $e(e,i){switch(e){case"behavioral-claim":return`Re-read ${i} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${i} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${i} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${i} is still meant to name this file.`}}function De(e,i,t){let n=_(t),o=new Set;for(let s of i)we(e,s,n.get(s)??[])&&o.add(s);return o}function we(e,i,t){if(t.length===0)return!1;if(!ke.test(i))return!0;let n=`${e.config.projectRoot}/${i}`;if(!pe(n))return!0;let o=ae(n,"utf-8").split(/\r?\n/),s=Re(o);for(let r of t)for(let l=r.startLine;l<=r.endLine;l+=1)if((o[l]??"").trim()!==""&&!s.has(l))return!0;return!1}var ke=/\.(?:[cm]?[jt]sx?)$/i;function Re(e){let i=new Set,t=!1;for(let n=0;n<e.length;n+=1){let o=e[n].trim();!t&&Te(o)&&(t=!0),t&&(i.add(n),o.endsWith(";")&&(t=!1))}return i}function Te(e){return/^import(?:\s|$)/.test(e)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(e)}import{existsSync as Fe,readFileSync as ve,writeFileSync as xe}from"fs";import{isAbsolute as Ae,join as Ge}from"path";var je=75e3,Ee=5e3,Le=2500;function Be(e){let i=ie(e);return i.symbols>=je||i.documents>=Ee?Le:void 0}var Ke=".scipquery-baseline.json";function A(e,i){return i&&Ae(i)?i:Ge(e.config.projectRoot,i??Ke)}function ce(e,i={}){let{scope:t}=i,n=Be(e),o=[],s=W(e,{scope:t,...S.dead,scanLimit:n});for(let r of s.symbols)T(e,r.relativePath)||F(e,r.symbol,r.relativePath)||r.kind==="dead-code"&&o.push(`dead:${r.relativePath}:${r.shortName}`);for(let r of Z(e,{scope:t,...S.isolated,scanLimit:n}))T(e,r.relativePath)||F(e,r.symbol,r.relativePath)||o.push(`isolated:${r.relativePath}:${r.shortName}`);for(let r of q(e,{scope:t}))r.kind==="real"&&o.push(`cycle:${Ne(r.path)}`);for(let r of ee(e,{scope:t,...S.similar,scanLimit:n}))o.push(`similar:${[r.symbolA,r.symbolB].sort().join("|")}`);for(let r of J(e,{scope:t,...S.extract,scanLimit:n}))o.push(`extract:${r.relativePath}:${r.shortName}`);for(let r of ne(e,{scope:t,...S.wrappers,scanLimit:n}))o.push(`wrapper:${r.file}:${r.shortName}`);for(let r of Q(e,{scope:t,...S.passthroughs,scanLimit:n}))o.push(`passthrough:${r.file}:${r.shortName}`);for(let r of te(e,{scope:t,...S.stale,scanLimit:n}))o.push(`stale:${r.file}:${r.shortName}`);for(let r of Y(e,{scope:t,...S.drift}).results)r.kind!=="pattern-deviation"&&o.push(`drift:${r.kind}:${r.file}:${r.dep}`);return[...new Set(o)].sort()}function Ne(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function Et(e,i={}){let t=ce(e,{scope:i.scope}),n=A(e,i.path);return xe(n,JSON.stringify({version:1,findings:t},null,2)+`
3
- `),{path:n,findingCount:t.length}}function le(e,i={}){let t=A(e,i.path);if(!Fe(t))throw new Error(`No baseline found at ${t}. Create one with: scip-query health --write-baseline`);let n=JSON.parse(ve(t,"utf-8")),o=new Set(n.findings??[]),s=ce(e,{scope:i.scope}),r=new Set(s);return{baselinePath:t,baselineCount:o.size,current:s,newFindings:s.filter(l=>!o.has(l)),fixedFindings:[...o].filter(l=>!r.has(l))}}var Jt=["echo","incomplete-migration","co-change-partner","doc-reference","unused-params","new-dead","baseline"];function Zt(e,i={}){let t=i.base??"HEAD",{minTogether:n=6,minConfidence:o=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:r=Number.POSITIVE_INFINITY,minSimilarity:l=.8,includeBaseline:a=!1,scanLimit:c}=i,y=i.semantic!==!1,u=new Set(i.skip??[]),f=O(e,{base:t}),p=z(e,{base:t,plan:f}),g=p.changedFiles,d=new Set(g),h=new Set(f.changedFileLines),b=E(e.config.projectRoot,t,L(f,g)),C=lt(e.config.projectRoot,t,f,b),m={base:t,changedFiles:g,changedSymbols:p.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],rootCauseGroups:[],note:p.summary.note};if(g.length===0)return m;let $=(B,he)=>{if(u.has(B)){m.skipped.push({check:B,reason:"skipped via --skip"});return}he()};return $("echo",()=>Oe(e,p.changedSymbols,d,C,s,l,c,y,m)),$("incomplete-migration",()=>Xe(e,t,f,r,c,y,b,m)),$("co-change-partner",()=>et(e,d,n,o,m)),$("doc-reference",()=>rt(e,d,h,f.changedRanges,m)),$("unused-params",()=>st(e,g,m)),$("new-dead",()=>at(e,p.changedSymbols,C,m)),a&&$("baseline",()=>ut(e,m)),_e(m,e.config.suppressions??[]),m.rootCauseGroups=Me(m.findings),m}function Me(e){let i=new Map;for(let t of e){let n=t.groupKey??`${t.check}:${t.id}`,o=i.get(n);o||(o={groupKey:n,check:t.check,severity:t.severity,actionTier:t.actionTier,sourceAnalyzer:t.sourceAnalyzer,rootCauseKey:t.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:t.message,remediation:t.remediation},i.set(n,o)),o.count+=1,o.findingIds.push(t.id),o.severity=Pe(o.severity,t.severity),o.actionTier=He(o.actionTier,t.actionTier),t.file&&o.files.add(t.file);for(let s of t.relatedFiles??[])o.relatedFiles.add(s)}return[...i.values()].map(t=>({...t,files:[...t.files].sort(),relatedFiles:[...t.relatedFiles].sort()})).sort((t,n)=>n.count-t.count||G(n.severity)-G(t.severity)||t.groupKey.localeCompare(n.groupKey))}function Pe(e,i){return G(i)>G(e)?i:e}function G(e){return e==="error"?2:e==="warning"?1:0}function He(e,i){return e?i&&fe(i)>fe(e)?i:e:i}function fe(e){return e==="direct"?2:e==="signal"?1:0}function _e(e,i){if(i.length===0||e.findings.length===0)return;let t=[];for(let n of e.findings){let o=i.find(s=>ze(s,n));o?e.suppressed.push({finding:n,suppression:o}):t.push(n)}e.findings=t}function ze(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function k(e,i){e.findings.push({...i,suppressionHint:`scip-query: ignore ${i.check} ${i.id} -- <reason>`})}function Oe(e,i,t,n,o,s,r,l,a){a.checksRun.push("echo");for(let c of i.slice(0,o)){if(n(c))continue;let y=X(e,c.symbol,{minSimilarity:s,limit:5,scanLimit:r,semantic:l}),u=[];for(let d of y){let h=d.fileA===c.file?d.fileB:d.fileA,b=d.fileA===c.file?d.shortNameB:d.shortNameA,C=d.fileA===c.file?d.symbolB:d.symbolA;t.has(h)||u.push({otherFile:h,otherShort:b,otherSymbol:C,similarity:d.similarity,similarityBasis:d.similarityBasis??"callees",sharedEvidence:d.sharedCallees})}if(u.length===0)continue;let f=u[0],p=D("echo",c.symbol,c.file,...u.map(d=>`${d.otherSymbol}|${d.otherFile}`).sort()),g=Ue(c,u);k(a,{id:p,groupKey:p,actionTier:g,check:"echo",severity:"warning",evidence:"heuristic",confidence:f.similarity,file:c.file,symbol:c.symbol,relatedFiles:[...new Set(u.map(d=>d.otherFile))].sort(),message:Je(c,u),why:Ze(c,u),remediation:Qe(g,c.shortName,f.otherShort)})}i.length>o&&a.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${i.length} changed symbols`})}function Ue(e,i){return i.some(n=>Ve(e.symbol,n))?"direct":"signal"}function Ve(e,i){if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let t=R(e),n=R(i.otherSymbol);return!t||!n?!1:t===n?!0:Ye(i.sharedEvidence)?!1:qe(t,n)}function qe(e,i){let t=de(e),n=de(i);if(t.length===0||n.length===0)return!1;let o=new Set(n),s=t.filter(r=>o.has(r)).length;return s>=2&&s/Math.min(t.length,n.length)>=.5}function de(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var We=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function Ye(e){return e.length>=3&&e.every(i=>We.has(i.toLowerCase()))}function Je(e,i){let t=i[0],n=Math.round(t.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${n}% similar to established ${t.otherShort} (${t.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${n}% similar to ${t.otherShort} (${t.otherFile})`}function Ze(e,i){let t=[`${e.shortName} was changed in this diff.`];for(let n of i.slice(0,3))t.push(`${n.otherShort} is outside this diff and scored ${Math.round(n.similarity*100)}% similar by ${n.similarityBasis} evidence.`),t.push(`Shared evidence: ${n.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&t.push(`${i.length-3} additional similar match(es) grouped into this finding.`),t}function Qe(e,i,t){return e==="direct"?`Extract or reuse the shared behavior with ${t}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function Xe(e,i,t,n,o,s,r,l){let a=oe(e,{base:i,maxHelpers:n,diffPlan:t,scanLimit:o,semantic:s,baseContentAt:r});if(!a.available){l.skipped.push({check:"incomplete-migration",reason:"no git history"});return}l.checksRun.push("incomplete-migration"),a.note&&l.skipped.push({check:"incomplete-migration",reason:a.note});for(let c of a.findings){let y=c.leftovers.map(h=>`${h.shortName} (${h.file}, ${Math.round(h.containment*100)}% helper / ${Math.round(h.siteCoverage*100)}% site, ${h.migrationScope})`).join(", "),u=c.leftovers.map(h=>`${h.shortName}: ${h.migrationScope} (${h.migrationScopeReasons[0]})`).join("; "),f=[...c.migratedFiles,...c.leftovers.map(h=>h.file)],p=c.leftovers.length===0?void 0:Math.max(...c.leftovers.map(h=>Math.min(h.containment,h.siteCoverage))),g=c.leftovers.some(h=>h.migrationScope==="possible-subtype"),d=D("incomplete-migration",c.helperSymbol,c.helperFile,f.join("|"));k(l,{id:d,check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:p,file:c.helperFile,symbol:c.helperSymbol,relatedFiles:f,message:`new helper ${c.helperShortName} (${c.helperFile}) is wired into ${c.migratedFiles.length} file(s), but ${c.leftovers.length} similar un-migrated site(s) remain: ${y}`,why:[`${c.helperShortName} is new in this diff and already referenced by ${c.migratedFiles.join(", ")}.`,`Helper shape: ${c.helperShape}; ${c.specificHelperCalleeCount}/${c.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${y}.`,`Migration scope hints: ${u}.`],remediation:g?`Migrate same-scope sites to ${c.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${c.helperShortName}, or confirm they are intentionally different.`})}}function et(e,i,t,n,o){let s=I(e,i,{minTogether:t,minConfidence:0,maxFilesPerCommit:20});if(!s){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let r=new Set,l;for(let a of s){let c=i.has(a.fileA),y=i.has(a.fileB);if(c===y)continue;let u=c?a.fileA:a.fileB,f=c?a.fileB:a.fileA,p=c?a.changesA:a.changesB,g=p>0?a.together/p:0;if(g<n||j(f)||j(u)||!ue(`${e.config.projectRoot}/${f}`))continue;let d=`${u}|${f}`;if(r.has(d))continue;r.add(d);let h=D("co-change-partner",u,f,String(a.together)),b=M(u,f),C=P({fileA:u,fileB:f,together:a.together,confidence:g,commitScope:a.commitScope,recency:a.recency,subjectContext:a.subjectContext},b,(l??=H(e))(u,f)),m=[u,f].sort().join("|");o.findings.push({id:h,check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${m}`,confidence:g,file:u,relatedFiles:[f],sourceAnalyzer:"co-change",rootCauseKey:m,partnerClass:b.partnerClass,partnerClassReasons:b.reasons,commitScope:a.commitScope,recency:a.recency,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:a.broadCommitRatio,lastTogetherAt:a.lastTogetherAt,recentTogether:a.recentTogether,subjectContext:a.subjectContext,...C?{declaredCouplingSuggestion:C}:{},message:`${u} changed, but ${f} did not \u2014 they change together ${a.together}x (${Math.round(g*100)}% of the time)`,why:[`${u} is in this diff and ${f} is not.`,`Git history shows ${a.together} co-change(s), which is ${Math.round(g*100)}% of changes to the edited side.`,`History context: ${tt(a)}.`,`Subject context: ${it(a.subjectContext)}.`,...nt(a),`Partner class: ${b.partnerClass} (${b.reasons.join("; ")}).`],remediation:C?`Update ${f} alongside this change, declare the coupling "${C.name}", or confirm the coupling no longer holds.`:`Update ${f} alongside this change, or confirm the coupling no longer holds.`})}}function tt(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${ot(e.lastTogetherAt)}`}function it(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",t=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",n=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(o=>`"${o}"`).join("; "):"none";return`labels ${i}; refs ${t}; samples ${n}; external issue/PR labels ${e.externalIssueLabelStatus}`}function nt(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function ot(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}function rt(e,i,t,n,o){o.checksRun.push("doc-reference");let s=w.referenceTargets(e,i,n);if(s.size!==0)for(let r of V(e,s)){if(t.has(r.doc))continue;let l=r.citedClaims.length>0?r.citedClaims:w.citationContexts(e,r.doc,r.cited),a=w.classifyCitation(l),c=D("doc-reference",r.doc,r.cited.join("|"));k(o,{id:c,check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:a.actionTier,confidence:1,file:r.doc,relatedFiles:r.cited,citationKind:a.citationKind,citationKindReasons:a.reasons,citedClaims:l,message:`${r.doc} cites ${r.cited.join(", ")} as ${w.citationKindLabel(a.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${r.cited.join(", ")} changed in this diff.`,`${r.doc} cites the changed file(s) but was not updated in the same diff.`,...a.reasons.map(y=>`Citation kind evidence: ${y}`)],remediation:w.citationRemediation(a.citationKind,r.doc)})}}function st(e,i,t){t.checksRun.push("unused-params");for(let n of re(e,{files:i,limit:50})){let o=D("unused-params",n.symbol,n.file,n.unusedTrailing.join("|"));k(t,{id:o,check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:n.file,startLine:n.startLine,endLine:n.endLine,symbol:n.symbol,message:`${n.shortName} (${n.file}) has trailing unused parameter(s): ${n.unusedTrailing.join(", ")}`,why:[`${n.shortName} is in a changed file.`,`The trailing parameter(s) ${n.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments."})}}function at(e,i,t,n){n.checksRun.push("new-dead");let o=new N(e);for(let s of i){if(t(s)||s.fanIn>0||o.fileKind(s.file)==="test"||T(e,s.file)||F(e,s.symbol,s.file)||ct(s.symbol))continue;let r=D("new-dead",s.symbol,s.file);k(n,{id:r,check:"new-dead",severity:"warning",evidence:"graph-fact",confidence:.9,file:s.file,symbol:s.symbol,message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,why:[`${s.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:"Wire it up, or remove it before it becomes permanent dead code."})}}function ct(e){if(K(e)!=="type")return!1;let i=R(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function lt(e,i,t,n){let o=new Map(t.renamedFiles.map(r=>[r.to,r.from])),s=n??E(e,i,L(t));return r=>{let l=o.get(r.file)??r.file,a=R(r.symbol);if(!a)return!1;let c=s(l);return c!==null&&ft(c,a)}}function ft(e,i){return new RegExp(`\\b${dt(i)}\\b`).test(e)}function dt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ut(e,i){if(!ue(A(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=le(e);for(let n of t.newFindings){let o=se(n),s=D("baseline",n);k(i,{id:s,groupKey:`baseline:${o.sourceAnalyzer}:${o.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:o.actionTier,confidence:1,file:o.file,relatedFiles:o.relatedFiles.length>0?o.relatedFiles:void 0,sourceAnalyzer:o.sourceAnalyzer,rootCauseKey:o.rootCauseKey,message:`new ${o.label} vs committed baseline: ${n}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${o.sourceAnalyzer}.`,`Inherited action tier: ${o.actionTier}.`,`Root cause key: ${o.rootCauseKey}.`,...o.why],remediation:o.remediation})}}function D(e,...i){return`SQ${Ie("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{ce as a,Et as b,le as c,Jt as d,Zt as e,lt as f};
4
- //# sourceMappingURL=chunk-7XWXGANX.js.map
@@ -1,40 +0,0 @@
1
- import{d as k}from"./chunk-RSKOYTSY.js";import{c as _}from"./chunk-T633QLYF.js";import{b as h}from"./chunk-RY7CAOJF.js";import{u as v}from"./chunk-3LQFMQPY.js";import{f as y,k as R}from"./chunk-X3BJUFSN.js";import{d as m}from"./chunk-JM72FNGA.js";import{a as S}from"./chunk-6TDOT7B3.js";import{a as w}from"./chunk-BTCASU5J.js";import{a as u}from"./chunk-DS6QEB3G.js";import{c as L}from"./chunk-A536TEU4.js";import{c as b,d as D}from"./chunk-7S5E7KWT.js";function I(e,r,n,t={}){if(!n)return[];let i=u(e,r);return i?i.indexOf(n)===-1?[]:(E(e,r).get(n)??[]).filter(s=>!z(s,t)):[]}function z(e,r){return typeof r.excludeStartLine=="number"&&typeof r.excludeEndLine=="number"&&e>=r.excludeStartLine&&e<=r.excludeEndLine}var Z=b("file-identifiers",{clearGroups:["whole-project","source-file"]});function F(e,r){let n=S(e,r);return n?n.fileIdentifiers:Z.get(e,r,()=>new Set(E(e,r).keys()))}var U=b("file-ident-lines",{clearGroups:["whole-project","source-file"]});function E(e,r){let n=S(e,r);return n?n.identifierLineMap:U.get(e,r,()=>Y(e,r))}var W=b("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function fe(e,r){let n=S(e,r);return n?n.identifiersByLine:W.get(e,r,()=>{let t=E(e,r),i=0;for(let s of t.values()){let o=s[s.length-1];o!==void 0&&o>i&&(i=o)}let a=new Array(i+1);for(let s=0;s<=i;s+=1)a[s]=new Set;for(let[s,o]of t)for(let c of o)a[c].add(s);return a})}function Y(e,r){let n=new Map,t=(o,c)=>{let l=n.get(o);if(!l){n.set(o,[c]);return}l[l.length-1]!==c&&l.push(c)},i=u(e,r);if(!i)return n;let a=v(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let o=0;o<a.length;o+=1){let c=a[o]??"";for(let l of c.matchAll(s))l[1]&&t(l[1],o)}return n}function A(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function d(e,r){return A(e)===A(r)}function T(e,r){let n=new Map;for(let t of h(e,r)){if(!t.sourcePath)continue;let i=t.localName??t.importedName;if(i&&O(n,i,t.sourcePath),t.kind==="namespace")for(let a of t.usedMembers)O(n,a,t.sourcePath)}return n}function O(e,r,n){let t=e.get(r);t||(t=new Set,e.set(r,t)),t.add(n)}function ge(e,r){return x(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
2
- m.symbol_id,
3
- d.relative_path,
4
- COUNT(*) AS ref_count
5
- FROM mentions m
6
- JOIN chunks c ON m.chunk_id = c.id
7
- JOIN documents d ON c.document_id = d.id
8
- WHERE m.role != 1
9
- ${t}
10
- ${e.pathExclusionsFor("d")}
11
- GROUP BY m.symbol_id, d.relative_path`,...n??[])})}function be(e,r){return x(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
12
- FROM mentions m
13
- JOIN chunks c ON m.chunk_id = c.id
14
- JOIN documents d ON c.document_id = d.id
15
- WHERE m.role != 1
16
- ${t}
17
- ${e.pathExclusionsFor("d")}`,...n??[])}).filter(n=>n.symbol_id!==null)}function P(e,r){return x(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
18
- c.start_line AS chunk_start, c.end_line AS chunk_end
19
- FROM mentions m
20
- JOIN chunks c ON m.chunk_id = c.id
21
- JOIN documents d ON c.document_id = d.id
22
- WHERE m.role != 1
23
- ${t}
24
- ${e.pathExclusionsFor("d")}
25
- ORDER BY d.relative_path, c.start_line`,...n??[])})}function x(e,r,n){if(!r)return n();if(r.length===0)return[];let t=[];for(let i=0;i<r.length;i+=750)t.push(...n(r.slice(i,i+750)));return t}function Le(e,r){let n=$(e);return n?r.filter(t=>$(t.file)===n):r}function Ee(e,r,n,t){let i=n.find(a=>a.file===r);if(i)return i;if(t){let a=new Set(h(e,r).map(s=>s.sourcePath).filter(s=>!!s));for(let s of n)for(let o of a)if(d(o,s.file))return s;return null}return n.length===1?n[0]:null}function $(e){let r=w(e);return r?r==="typescript"||r==="tsx"||r==="javascript"?"javascript-family":r:null}var Q=D("global-leaf-index",{clearGroups:["whole-project"]});function N(e){return Q.get(e,()=>{let r=e.all(`SELECT gs.id, gs.symbol,
26
- COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
27
- FROM global_symbols gs
28
- LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
29
- LEFT JOIN documents der_doc ON der_doc.id = der.document_id
30
- LEFT JOIN (
31
- SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
32
- FROM mentions m
33
- JOIN chunks c ON m.chunk_id = c.id
34
- JOIN documents d ON c.document_id = d.id
35
- WHERE m.role = 1
36
- GROUP BY m.symbol_id
37
- ) mention_doc ON mention_doc.symbol_id = gs.id
38
- WHERE 1 = 1
39
- ${e.symbolNoiseFor("gs")}`),n=new Map;for(let t of r){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let i=m(t.symbol);if(!i)continue;let a=n.get(i);a||(a=[],n.set(i,a)),a.some(s=>s.symbolId===t.id)||a.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}var j=/[A-Za-z_$][A-Za-z0-9_$]*/g,V=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function C(e){let r=[],n=!1;for(let t of e)t&&(n=!0,V.test(t)||r.push(t));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:r}}function B(e,r){let n=X(r)?r:C(r);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;j.lastIndex=0;let t;for(;(t=j.exec(e))!==null;)if(n.candidateNames.has(t[0]))return!0;for(let i of n.nonIdentifierNames)if(e.includes(i))return!0;return!1}function X(e){return"candidateNames"in e}function M(e,r,n){let t=N(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[p(t[0])];let i=t.filter(c=>c.file===r);if(i.length>0)return i.map(p);let a=T(e,r),s=a.get(n);if(s)for(let c of s){let l=t.filter(f=>d(c,f.file));if(l.length>0)return l.map(p)}let o=new Set;for(let c of a.values())for(let l of c)o.add(l);for(let c of o){let l=t.filter(f=>d(c,f.file));if(l.length>0&&l.length===t.length)return l.map(p)}return[]}function $e(e,r,n){let t=M(e,r,n);if(t.length>0)return t;let i=N(e).get(n);return!i||i.length===0?[]:i.map(p)}function H(e,r,n={}){let t=_(e,r);if(!t)return[];let i=m(t.symbol);if(!i)return[];if(n.semantic!==!1){let s=k(e,{...t,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let o=new Map;for(let c of s){let l=o.get(c.file)??[];l.push(c.line),o.set(c.file,l)}return G(e,o)}}let a=new Map;for(let s of L(e)){let o=u(e,s);if(!o||o.indexOf(i)===-1||s!==t.relativePath&&!M(e,s,i).some(f=>f.symbolId===t.symbolId))continue;let c=I(e,s,i,s===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});c.length>0&&a.set(s,c)}return G(e,a)}function je(e,r){let n=new Map;for(let o of r){if(!o.leaf)continue;let c=n.get(o.leaf)??[];c.push(o),n.set(o.leaf,c)}if(n.size===0)return new Map;let t=new Set(r.map(o=>o.symbolId)),i=new Set(n.keys()),a=C(i),s=new Map;for(let o of L(e)){if(!B(u(e,o),a))continue;let c=F(e,o);if(c.size!==0){for(let l of c)if(n.has(l))for(let f of M(e,o,l)){if(!t.has(f.symbolId)||o===f.relativePath)continue;let g=s.get(f.symbolId);g||(g=new Set,s.set(f.symbolId,g)),g.add(o)}}}return s}function p(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function G(e,r){let n=[],t=new Set;for(let[i,a]of r){let s=y(e,i);for(let o of a){let c=R(s,o),l=`${i}|${o}|${c?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:o,enclosingSymbol:c?.symbol??null}))}}return n}function q(e,r){let n=ie(e,r);return n?oe(e,ee(e,n.match,n.identifier)):[]}function We(e,r,n={}){return K(e,r,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function K(e,r,n={}){let t=H(e,r,{semantic:n.semantic}),i=t.length>0?J(t,"source-attribution"):J(q(e,r),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(a=>!e.isIgnored(a.file))}function J(e,r){return e.map(n=>({...n,provenance:r}))}function ee(e,r,n){let t=new Map;for(let[i,a]of ne(e,r.symbolId))t.set(i,te(e,i,a,r,n));return t}function ne(e,r){let n=new Map;for(let t of P(e,[r])){if(e.isIgnored(t.relative_path))continue;let i=n.get(t.relative_path);i||(i=[],n.set(t.relative_path,i)),i.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function te(e,r,n,t,i){let a=r===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},s=i?I(e,r,i,a):[];return n.flatMap(o=>re(s,o))}function re(e,r){let n=e.filter(t=>t>=r.start_line&&t<=r.end_line);return n.length>0?n:[r.start_line]}function ie(e,r){let n=_(e,r);return n?{match:n,identifier:m(n.symbol)||null}:null}function oe(e,r){let n=[],t=new Set;for(let[i,a]of r){let s=y(e,i);for(let o of a){let c=R(s,o),l=`${i}|${o}|${c?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:o,enclosingSymbol:c?.symbol??null}))}}return n}export{E as a,fe as b,ge as c,be as d,P as e,d as f,Le as g,Ee as h,N as i,C as j,B as k,T as l,M as m,$e as n,je as o,q as p,We as q};
40
- //# sourceMappingURL=chunk-AETMKBZR.js.map
@@ -1,3 +0,0 @@
1
- import{a as u,b as h,e as m,g as N,i as x}from"./chunk-DS6QEB3G.js";import{c as S}from"./chunk-A536TEU4.js";import{e as f,f as g}from"./chunk-7S5E7KWT.js";import{extname as y}from"path";var F={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"};function p(e){return F[y(e).toLowerCase()]??null}function k(e){return y(e).toLowerCase()===".vue"}import{extname as $}from"path";import{parse as E}from"@vue/compiler-sfc";function v(e){let t=E(e),n=t.descriptor.scriptSetup??t.descriptor.script;if(!n||n.src)return null;let s=N(n.lang??null);return s?{body:n.content,startLine:Math.max(0,n.loc.start.line-1),language:s}:null}var b=g("ast-trees",{clearGroups:["whole-project","source-file"]});function _(e,t){if(k(t))return B(e,t);let n=p(t);if(!n)return null;let s=u(e,t);return s?b.get(e,t,s,()=>m(n,s)):null}function B(e,t){let n=u(e,t);return n?b.get(e,t,n,()=>{let s=v(n);if(!s)return null;let r=`
2
- `.repeat(s.startLine)+s.body;return m(s.language,r)}):null}var O=[".tsx",".jsx"],C=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),P=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),J=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),q=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),D=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),I=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),V=new Set(["children","className","false","key","null","style","true","undefined"]),Z=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),z=f("react-component-behavior-profiles");function je(e,t={}){let n=S(e,{extensions:O}).filter(r=>!t.scope||r.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(r=>H(e,r)).filter(r=>(t.minJsxTokens===void 0||r.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||r.behaviorTokens.size>=t.minBehaviorTokens))}function H(e,t){let n=t.replace(/\\/g,"/"),s=u(e,n);return z.get(e,n,s,()=>M(e,n)).map(K)}function M(e,t){let n=U(t);if(!n)return[];let s=_(e,t);if(!s)return[];let r=h(e,t).length;return W(s.rootNode,n).filter(o=>o.kind==="hook"||j(o.bodyNode)).map(o=>{let i=ee(o.bodyNode),l=oe(o.bodyNode,n);return{file:t,name:o.name,kind:o.kind,startLine:o.node.startPosition.row,endLine:o.node.endPosition.row,loc:Math.max(1,o.node.endPosition.row-o.node.startPosition.row+1),fileLines:r,jsxTokens:i.tokens,behaviorTokens:l.tokens,componentNames:c(i.componentNames),nativeTags:c(i.nativeTags),propNames:c(i.propNames),eventNames:c(i.eventNames),hookNames:c(l.hookNames),requestNames:c(l.requestNames),stateNames:c(l.stateNames),effectNames:c(l.effectNames),handlerNames:c(l.handlerNames)}})}function K(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function U(e){let t=$(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:p(e)}function W(e,t){let n=[],s=new Set,r=a=>{let o=G(a);if(o&&!X(a)){let i=`${o.name}:${o.node.startIndex}:${o.node.endIndex}`;s.has(i)||(s.add(i),n.push(o));return}for(let i of a.namedChildren)r(i)};return(t==="tsx"||t==="javascript")&&r(e),n}function G(e){if(e.type==="function_declaration"){let a=R(e);return!a||!T(a)?null:{name:a,kind:L(a),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),s=d(t);if(!s||!n||!T(s))return null;let r=Q(n);return r?{name:s,kind:L(s),node:e,bodyNode:r}:null}function T(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function L(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function Q(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=Y(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(r=>r.type==="arguments")?.namedChildren.find(r=>r.type==="arrow_function"||r.type==="function_expression")??null}function X(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function R(e){return d(e.childForFieldName("name")??e.namedChild(0))}function Y(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function j(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(j)}function ee(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=s=>{s.type==="jsx_opening_element"||s.type==="jsx_self_closing_element"?te(s,t):s.type==="jsx_expression"?ne(s,t):s.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let r of s.namedChildren)n(r)};return n(e),t}function te(e,t){let n=se(e),s=!1;if(n){let r=w(n);s=ue(r),s?(t.componentNames.add(r),t.tokens.add(`component:${r}`)):(t.nativeTags.add(r),t.tokens.add(`native:${r}`))}for(let r of e.namedChildren)if(r.type==="jsx_attribute"){let a=re(r);if(!a)continue;let o=w(a);if(o.startsWith("on")&&o.length>2){let i=o.slice(2).replace(/^[A-Z]/,l=>l.toLowerCase());t.eventNames.add(i),t.tokens.add(`event:${i}`)}else Z.has(o)||(t.propNames.add(o),t.tokens.add(`${s?"prop":"native-prop"}:${o}`))}else r.type==="jsx_spread_attribute"&&t.tokens.add("prop:spread")}function ne(e,t){let n=e.text;(n.includes("&&")||n.includes("?"))&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let s of de(n))V.has(s)||t.tokens.add(`binding:${s}`)}function se(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function re(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function oe(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},s=r=>{if(r.type==="call_expression"){let a=x(r,t);a&&ae(a.calleeLeaf,n)}else if(r.type==="variable_declarator")ce(r,n);else if(r.type==="function_declaration"){let a=R(r);a&&A(a,n)}for(let a of r.namedChildren)s(a)};return s(e),n}function ae(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!C.has(e)&&!q.has(e)&&t.tokens.add(`hook:${e}`)),C.has(e)&&t.tokens.add(`react-hook:${e}`),P.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),J.has(e)&&t.tokens.add(`state-hook:${e}`),ie(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function ie(e){if(D.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function ce(e,t){let n=e.childForFieldName("name")??e.namedChild(0),s=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&s?.text.includes("useState")){let a=n.namedChildren.find(i=>d(i)),o=d(a);o&&(t.stateNames.add(o),t.tokens.add(`state:${o}`))}let r=d(n);r&&A(r,t)}function A(e,t){let n=le(e);!n||!I.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function le(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function ue(e){return/^[A-Z]/.test(e)||e.includes(".")}function w(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function d(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function de(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let s=n[0];t.includes(s)||t.push(s)}return t}function c(e){return[...e].sort()}export{p as a,k as b,v as c,_ as d,je as e};
3
- //# sourceMappingURL=chunk-BTCASU5J.js.map
@@ -1,32 +0,0 @@
1
- import{c as d}from"./chunk-7S5E7KWT.js";import{createHash as h}from"crypto";import{readFileSync as T}from"fs";import{createRequire as m}from"module";import{dirname as E,join as g}from"path";import v from"better-sqlite3";var N=m(import.meta.url),S="evidence.db",p=new WeakMap,y=d("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),_=d("evidence-project-fingerprint",{clearGroups:["whole-project"]});function L(){for(let n of["../package.json","../../package.json"])try{return N(n).version}catch{}return"0.0.0"}var s=L();function f(n){return h("sha256").update(n).digest("hex")}function w(n,t,e){return y.get(n,t,()=>f(e))}function F(n){return _.get(n,"current",()=>{try{let t=JSON.parse(T(g(E(n.config.dbPath),"meta.json"),"utf-8"));if(t.version!==2&&t.version!==3||t.status!=="complete"||t.fingerprint===void 0)return null;let e=Array.isArray(t.indexedLanguages)?[...t.indexedLanguages].sort():[];return f(JSON.stringify({fingerprint:t.fingerprint,indexedLanguages:e}))}catch(t){return u("project fingerprint unavailable",t),null}})}function u(n,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${n}: ${t instanceof Error?t.message:String(t)}`)}function c(n){if(p.has(n))return p.get(n)??null;let t=null;try{let e=new v(g(E(n.config.dbPath),S));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.exec(`
2
- CREATE TABLE IF NOT EXISTS file_evidence (
3
- kind TEXT NOT NULL,
4
- relative_path TEXT NOT NULL,
5
- content_hash TEXT NOT NULL,
6
- version TEXT NOT NULL,
7
- payload TEXT NOT NULL,
8
- PRIMARY KEY (kind, relative_path)
9
- );
10
- CREATE TABLE IF NOT EXISTS semantic_callees (
11
- relative_path TEXT NOT NULL,
12
- symbol TEXT NOT NULL,
13
- content_hash TEXT NOT NULL,
14
- deps_digest TEXT NOT NULL,
15
- version TEXT NOT NULL,
16
- payload TEXT NOT NULL,
17
- PRIMARY KEY (relative_path, symbol)
18
- );
19
- CREATE TABLE IF NOT EXISTS semantic_references (
20
- relative_path TEXT NOT NULL,
21
- symbol TEXT NOT NULL,
22
- project_fingerprint TEXT NOT NULL,
23
- version TEXT NOT NULL,
24
- payload TEXT NOT NULL,
25
- PRIMARY KEY (relative_path, symbol)
26
- );
27
- `),t={evidence:e,readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
28
- WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
29
- (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
30
- WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
31
- (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE project_fingerprint != ?")}}catch(e){u("disabled (open failed)",e)}return p.set(n,t),t}function o(n,t,e){u(`disabled (${t})`,e),p.set(n,null)}function x(n,t,e,a){let r=c(n);if(!r)return null;try{return r.readFileEvidence.get(t,e,a,s)?.payload??null}catch(i){return o(n,"file_evidence read",i),null}}function I(n,t,e,a,r){let i=c(n);if(i)try{i.writeFileEvidence.run(t,e,a,s,r)}catch(l){o(n,"file_evidence write",l)}}function U(n,t,e,a,r){let i=c(n);if(!i)return null;try{return i.readCallees.get(t,e,a,r,s)?.payload??null}catch(l){return o(n,"semantic_callees read",l),null}}function j(n,t,e,a){let r=c(n);if(!r)return null;try{return r.readReferences.get(t,e,a,s)?.payload??null}catch(i){return o(n,"semantic_references read",i),null}}function X(n,t){if(t.length===0)return;let e=c(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t){let i=`${r.relativePath}\0${r.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(r.relativePath,r.contentHash)),e.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,s,r.payload)}})()}catch(a){o(n,"semantic_callees write",a)}}function P(n,t){if(t.length===0)return;let e=c(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t)a.has(r.projectFingerprint)||(a.add(r.projectFingerprint),e.dropStaleReferences.run(r.projectFingerprint)),e.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,s,r.payload)})()}catch(a){o(n,"semantic_references write",a)}}export{f as a,w as b,F as c,x as d,I as e,U as f,j as g,X as h,P as i};
32
- //# sourceMappingURL=chunk-C6ROZBJA.js.map
@@ -1,2 +0,0 @@
1
- import{b as r}from"./chunk-LGX2Y4BA.js";import{i as e}from"./chunk-X3BJUFSN.js";function l(t,s){let o=r(t,s);return e(t,o).map(({relativePath:n,...a})=>a)}export{l as a};
2
- //# sourceMappingURL=chunk-COUFCH64.js.map
@@ -1,2 +0,0 @@
1
- import{a as C,b as k,c as a,d as m}from"./chunk-BZ53S4ZN.js";import{a as V}from"./chunk-PVZMPG5I.js";import{a as B,b}from"./chunk-YWOOQ4FF.js";import{c as y}from"./chunk-YZA6PPZL.js";function L(e,s={}){let{minSimilarity:h=.45,minSharedBehaviors:o=6,limit:r=20,scope:t,scanLimit:l,filePattern:c}=s,d=y(e,{scope:t,minBehaviorTokens:Math.max(3,o),scanLimit:l}).map(n=>({file:n.file,tokens:n.behaviorTokens,profile:n}));return V({profiles:d,limit:r,filePattern:c,compare:(n,i)=>R(n,i,h,o),sort:(n,i)=>i.similarity-n.similarity||n.fileA.localeCompare(i.fileA)||n.fileB.localeCompare(i.fileB)})}function R(e,s,h,o){let r=B(e.tokens,s.tokens);if(r.size<o||!P(r))return null;let t=k(e.tokens,s.tokens);if(t<h)return null;let l=a(r,"composable:"),c=a(r,"store:"),d=a(r,"reactivity:"),n=a(r,"lifecycle:"),i=a(r,"request:"),f=a(r,"function:"),g=a(r,"function-verb:"),v=a(r,"template-binding:"),p=a(r,"template-event:"),u=T({sharedComposables:l,sharedStores:c,sharedReactivity:d,sharedLifecycle:n,sharedRequests:i,sharedFunctions:f,sharedFunctionVerbs:g,sharedBindings:v,sharedTemplateEvents:p});return{fileA:e.file,fileB:s.file,similarity:t,sharedTokens:m(r),sharedComposables:l,sharedStores:c,sharedReactivity:d,sharedLifecycle:n,sharedRequests:i,sharedFunctions:f,sharedFunctionVerbs:g,sharedBindings:v,sharedTemplateEvents:p,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:m(b(e.tokens,s.tokens)).slice(0,25),uniqueToB:m(b(s.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:l,sharedStores:c,sharedRequests:i,sharedLifecycle:n,sharedFunctions:f,sharedFunctionVerbs:g,sharedBindings:v}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function T(e){return C({genericWords:q,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:F})}function F(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e){let s=0,h=0,o=0,r=0,t=0,l=0,c=0;for(let i of e)i.startsWith("composable:")?s+=1:i.startsWith("store:")?h+=1:i.startsWith("request:")?o+=1:i.startsWith("lifecycle:")?r+=1:i.startsWith("function:")?t+=1:i.startsWith("reactivity:")?l+=1:(i.startsWith("function-verb:")||i.startsWith("template-binding:")||i.startsWith("template-event:"))&&(c+=1);let d=s+h,n=d+o+r+t+c;return o>=1&&n>=4||r>=1&&t>=2&&n>=4||d>=2&&(o>=1||t>=2)&&n>=5||t>=2&&l>=1&&n>=4}function S(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}var q=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{L as a};
2
- //# sourceMappingURL=chunk-EKECQP6Z.js.map
@@ -1,2 +0,0 @@
1
- import{b as G}from"./chunk-B75HZHUP.js";import{a as v}from"./chunk-XPOZO76D.js";import{b as B,e as W,f as U,g as H}from"./chunk-ANIOISCE.js";import{a as $}from"./chunk-YNSVAJR6.js";import{c as K,d as V,f as E,l as q}from"./chunk-AETMKBZR.js";import{e as Z}from"./chunk-RSKOYTSY.js";import{b as F}from"./chunk-RY7CAOJF.js";import{f as z,m as x}from"./chunk-X3BJUFSN.js";import{c as k,f as T,g as A,h as M,i as O,j}from"./chunk-JM72FNGA.js";import{a as N,d as S}from"./chunk-BTCASU5J.js";import{a as P}from"./chunk-DS6QEB3G.js";import{a as g}from"./chunk-64MNV6AB.js";import{b as _}from"./chunk-7S5E7KWT.js";var h=new WeakMap;function X(e,t){let n=N(t);return n==="rust"?Re(e,t):n==="typescript"||n==="tsx"||n==="javascript"?ye(e,t):[]}var me=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),pe=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,be=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function ye(e,t){let n=P(e,t);if(!n||!ge(n))return[];let r=S(e,t);if(!r)return[];let s=h.get(r);if(s)return s;let o=!1,i=r.rootNode;for(let c of i.namedChildren){if(c.type!=="expression_statement")continue;let l=c.namedChild(0);if(!l||l.type!=="call_expression")continue;let a=l.namedChild(0);if(!a)continue;let d=a.type==="member_expression"?a.namedChild(a.namedChildCount-1)?.text:a.text;if(d&&me.has(d)){o=!0;break}}let u=[];o&&u.push({startLine:0,endLine:i.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"});for(let c of i.namedChildren){let l=null,a=null;if(c.type==="function_declaration")l=c.namedChild(0)?.text??null,a=c;else if(c.type==="export_statement"){let d=c.namedChild(0);d?.type==="function_declaration"&&(l=d.namedChild(0)?.text??null,a=d)}else if(c.type==="lexical_declaration"){let d=c.namedChild(0);if(d?.type==="variable_declarator"){let m=d.namedChild(0)?.text,b=d.namedChild(1);m&&(b?.type==="arrow_function"||b?.type==="function_expression")&&(l=m,a=d)}}l&&/^use[A-Z]/.test(l)&&a&&u.push({startLine:a.startPosition.row,endLine:a.endPosition.row,reason:"React custom hook (use*)"})}return u.push(...Q(r,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),h.set(r,u),u}function ge(e){return e.includes("scip-query")||pe.test(e)||be.test(e)}var he=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function xe(e){return he.test(e)}function Q(e,t,n){let r=[],s=o=>{if(t.has(o.type)&&o.parent){let u=o.parent.children,c=-1;for(let l=0;l<u.length;l+=1)if(u[l].startIndex===o.startIndex&&u[l].type===o.type){c=l;break}if(c>0)for(let l=c-1;l>=0;l-=1){let a=u[l];if(n.has(a.type)){if(xe(a.text)){r.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(a.type==="attribute_item"||a.type==="inner_attribute_item"))break}}for(let i of o.namedChildren)s(i)};return s(e.rootNode),r}function Re(e,t){let n=S(e,t);if(!n)return[];let r=h.get(n);if(r)return r;let s=[],o=_e(n);return o?(h.set(n,o),o):(Y(n.rootNode,s,!1,!1),s.push(...Q(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"]))),s.push(...Ie(n.rootNode)),h.set(n,s),s)}function _e(e){return Pe(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function Y(e,t,n,r){let s=n,o=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")&&(o=!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"?Se(e,t,n,r):r&&we(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"?Ee(e,t,n):e.type==="mod_item"&&C(e).some(i=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(i))&&(s=!0);for(let i of e.namedChildren)Y(i,t,s,o)}function Se(e,t,n,r){let s=C(e),o=null;r?o="trait impl method (dynamic dispatch)":n&&(o="inside #[cfg(test)] mod");for(let i of s){let u=Ce(i);if(u){o=u;break}if(ee(i)){o="#[allow(dead_code)]";break}}o&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o})}function Ee(e,t,n){let r=C(e),s=e.namedChildren.find(o=>o.type==="type_identifier")?.text;r.some(Le)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:s}),r.some(ee)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:s}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:s})}function C(e){let t=e.parent;if(!t)return[];let n=t.children,r=-1;for(let o=0;o<n.length;o+=1)if(n[o].startIndex===e.startIndex&&n[o].type===e.type){r=o;break}if(r<=0)return[];let s=[];for(let o=r-1;o>=0;o-=1){let i=n[o];if(i.type==="attribute_item"||i.type==="inner_attribute_item")s.push(i.text);else{if(i.type==="line_comment"||i.type==="block_comment")continue;break}}return s}var ve=[{re:/#\[\s*tauri::command\b/,reason:"#[tauri::command]"},{re:/#\[\s*command\b/,reason:"#[command]"},{re:/#\[\s*test\b/,reason:"#[test]"},{re:/#\[\s*bench\b/,reason:"#[bench]"},{re:/#\[\s*tokio::test\b/,reason:"#[tokio::test]"},{re:/#\[\s*async_std::test\b/,reason:"#[async_std::test]"},{re:/#\[\s*wasm_bindgen\b/,reason:"#[wasm_bindgen]"},{re:/#\[\s*no_mangle\b/,reason:"#[no_mangle]"},{re:/#\[\s*napi\b/,reason:"#[napi]"},{re:/#\[\s*pyfunction\b/,reason:"#[pyfunction]"},{re:/#\[\s*pymethod\b/,reason:"#[pymethod]"},{re:/#\[\s*pyo3\b/,reason:"#[pyo3]"},{re:/#\[\s*cfg\s*\(\s*test\s*\)/,reason:"#[cfg(test)]"},{re:/#\[\s*doc\s*\(\s*hidden\s*\)/,reason:"#[doc(hidden)]"}];function Ce(e){return ve.find(({re:t})=>t.test(e))?.reason??null}var De=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function Le(e){return/#\[\s*derive\s*\(/.test(e)?De.some(t=>t.test(e)):!1}function ee(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function we(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ie(e){let t=Fe(e);if(t.size===0)return[];let n=[];for(let r of e.descendantsOfType("mod_item")){let s=r.childForFieldName("name")?.text;s&&t.has(s)&&n.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:s})}return n}function Pe(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 Ne=/^#!?\[\s*serde\s*\(/,J=/\bwith\s*=\s*"([^"]+)"/g;function Fe(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!Ne.test(n.text))continue;J.lastIndex=0;let r;for(;(r=J.exec(n.text))!==null;){let s=r[1],o=s.split("::").pop()??s;o&&t.add(o)}}return t}function te(e){let t=new Map,n=r=>{let s=t.get(r);if(s)return s;let o=X(e,r);return s={ranges:o.map(i=>({startLine:i.startLine,endLine:i.endLine})),containers:new Set(o.map(i=>i.containerName).filter(i=>!!i))},t.set(r,s),s};return(r,s,o,i)=>{let u=n(r);for(let c of u.ranges)if(s>=c.startLine&&s<=c.endLine)return!0;if(i&&u.containers.has(i))return!0;for(let c of x(o))if(u.containers.has(c))return!0;return!1}}function et(e,t={}){_(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function D(e,t,n={}){_(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function re(e,t){return t.isIgnoredPath(e.relativePath)?p("ignored-file"):M(e.symbol)?p("module-like-symbol"):ne(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&ne(e.enclosingSymbol)?p("nested-non-callable-value"):!t.includeTests&&!L(e.relativePath)?p("test-file"):!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?p("excluded-file-region"):O(e.symbol)?p("rust-trait-impl-member"):j(e.symbol)?p("rust-test-module"):!t.includeMembers&&!ke(e)?p("member"):e.endLine-e.startLine+1<t.minLoc?p("below-min-loc"):{accepted:!0}:p("non-value-symbol")}function L(e){return B(e)!=="test"}function p(e){return{accepted:!1,rejectionReason:e}}function ne(e){return A(e)||e.endsWith("().")||e.endsWith(".")}function ke(e){return T(e.symbol)||x(e.symbol).length===0}function se(){return new Map}function oe(e,t,n){let r=new Map;for(let s of K(e,n))e.isIgnored(s.relative_path)||t.has(s.relative_path)||R(r,s.symbol_id,s.relative_path,s.ref_count,"scip-mention");return r}function ie(e,t,n){let r=new Set;for(let s of V(e,t))e.isIgnored(s.relative_path)||n.has(s.relative_path)||r.add(s.symbol_id);return r}function w(e,t){let n=e.get(t);if(!n)return!1;for(let r of n.values())if(r.occurrences>0)return!0;return!1}function I(e,t,n){let r=e.get(t);if(!r)return!1;for(let[s,o]of r)if(s!==n&&o.occurrences>0)return!0;return!1}function ae(e){return e?.occurrences??0}function R(e,t,n,r,s="source-fallback"){if(r<=0)return;let o=le(e,t,n);o.occurrences+=r,o.sources.add(s)}function ce(e,t,n,r,s){if(r<=0)return;let o=le(e,t,n);o.occurrences=Math.max(r,o.occurrences),o.sources.add(s)}function le(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let s=r.get(n);return s||(s={occurrences:0,sources:new Set},r.set(n,s)),s}var Te=3e3,Ae=1e3;function Et(e,t={}){let{scope:n,minLoc:r=1,includeTests:s=!1,skipBarrels:o=!1,includeMembers:i=!1,deadCodeOnly:u=!1,scanLimit:c,semantic:l=!0}=t,a=G(Me(e,{scope:n,minLoc:r,includeTests:s,includeMembers:i}),c),d=o?new Set(W(e)):new Set,m=u?se():oe(e,d,a.map(f=>f.symbolId)),b=u?ie(e,a.map(f=>f.symbolId),d):new Set,y=u?a.filter(f=>!b.has(f.symbolId)):a.filter(f=>!I(m,f.symbolId,f.relativePath));u?Ue(e,y,m,d):We(e,y,m,d);let de=u?y.filter(f=>!w(m,f.symbolId)):y.filter(f=>!I(m,f.symbolId,f.relativePath));Ze(e,de,m,{includeTests:s,inactiveBarrelPaths:d,includeSemantic:!u&&l});let fe=u?y.filter(f=>!w(m,f.symbolId)):a;return Be(e,Oe(fe,m))}function Me(e,t){let n=te(e),r=[];for(let s of g(e,{scope:t.scope}))try{for(let o of z(e,s))re(o,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:u=>e.isIgnored(u),isExcludedRegion:n}).accepted&&r.push(o)}finally{D(e,s,{definitions:!0})}return r}function Oe(e,t){return e.map(n=>je(n,t)).filter(n=>n.cross_file_refs===0).sort((n,r)=>r.loc-n.loc||n.relative_path.localeCompare(r.relative_path)||n.start_line-r.start_line)}function je(e,t){let n=t.get(e.symbolId)??new Map,r=ae(n.get(e.relativePath)),s=0;for(let[o,i]of n)o!==e.relativePath&&(s+=i.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:r,cross_file_refs:s}}function Be(e,t){let n=[],r=0,s=0,o=0;for(let i of t){if(e.isIgnored(i.relative_path)||U(e,i.relative_path)||H(e,i.symbol,i.relative_path))continue;let u=i.same_file_refs===0?"dead-code":"file-internal";u==="dead-code"?r++:s++,o+=i.loc,n.push({relativePath:i.relative_path,startLine:i.start_line,endLine:i.end_line,loc:i.loc,symbol:i.symbol,shortName:k(i.symbol),sameFileRefs:i.same_file_refs,kind:u})}return{symbols:n,counts:{total:n.length,deadCode:r,fileInternal:s,loc:o},totalCount:n.length,deadCodeCount:r,fileInternalCount:s,totalLoc:o}}function We(e,t,n,r){if(t.length===0)return;let s=new v(e),o=new Set(t.map(c=>c.symbolId)),i=new Set(t.map(c=>c.leaf).filter(Boolean)),u=new Set(s.sourceFiles());for(let c of g(e))u.add(c);s.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:i,skipPath:c=>r.has(c)},c=>{o.has(c.target.symbolId)&&(Ke(e,c)||R(n,c.target.symbolId,c.sourceFile,Ve(c),"source-fallback"))})}function Ue(e,t,n,r){if(t.length===0)return;let s=new v(e),o=He(t),i=new Set(s.sourceFiles());for(let a of g(e))i.add(a);let u=new Set(o.keys()),c=new Map,l=a=>{let d=c.get(a);return d||(d=q(e,a),c.set(a,d)),d};s.scanSourceReferences({paths:i,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:a=>r.has(a),resolveTargets:({sourceFile:a,name:d,kind:m})=>{let b=o.get(d);return b?ze(a,d,b,l(a),{permissive:m!=="cross-language-dispatch"}):[]},afterPath:a=>{c.delete(a),D(e,a)}},a=>{let d=a.kind==="identifier"&&a.sourceFile===a.target.relativePath?Math.max(0,a.occurrences-1):a.occurrences;a.kind==="identifier"&&ue(e,{sourceFile:a.sourceFile,name:a.name,target:a.target,occurrences:d})||R(n,a.target.symbolId,a.sourceFile,d,"source-fallback")})}function He(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let r=t.get(n.leaf)??[];r.push(n),t.set(n.leaf,r)}return t}function ze(e,t,n,r,s){let o=n.filter(c=>c.relativePath===e);if(o.length>0)return o;if(!s.permissive&&n.length===1)return[...n];let i=r.get(t);if(i)for(let c of i){let l=n.filter(a=>E(c,a.relativePath));if(l.length>0)return l}let u=new Set;for(let c of r.values())for(let l of c)u.add(l);for(let c of u){let l=n.filter(a=>E(c,a.relativePath));if(l.length>0&&l.length===n.length)return l}return s.permissive?[...n]:[]}function Ke(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&ue(e,t)}function Ve(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function ue(e,t){return t.occurrences>1?!1:F(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function Ze(e,t,n,r){let s=r.includeSemantic!==!1,o=s&&t.length>=Te&&g(e).length>=Ae,i=(c,l)=>{l===c.relativePath||e.isIgnored(l)||r.inactiveBarrelPaths.has(l)||!r.includeTests&&!L(l)||ce(n,c.symbolId,l,1,"caller-map")};for(let c of t){let l=$(e,c,{semantic:s&&!o});if(l.length!==0)for(let a of l)i(c,a.file)}if(!o)return;let u=Z(e,t);for(let c of t){let l=u.get(c.symbolId);if(l)for(let a of l)i(c,a)}}export{et as a,Et as b};
2
- //# sourceMappingURL=chunk-FVA3NH4P.js.map
@@ -1,7 +0,0 @@
1
- import{a as L,b as M}from"./chunk-VFLHKRTW.js";import{a as F}from"./chunk-LM5SHAN4.js";import{a as D}from"./chunk-PFOCOG57.js";import{a as x}from"./chunk-B75HZHUP.js";import{a as h}from"./chunk-XPOZO76D.js";import{a as C}from"./chunk-BGBBVSH4.js";import{a as I}from"./chunk-AETMKBZR.js";import{k as b}from"./chunk-X3BJUFSN.js";import{c as f,d as p,j as g}from"./chunk-JM72FNGA.js";import{basename as u,extname as d}from"path";function K(r,n){let{scope:e,maxLoc:t=15,limit:a=30,scanLimit:o}=n??{},i=new h(r),l=E(i.fileDependencyGraph(e));return D({candidates:()=>v(i,e,t),orderCandidates:x,scanLimit:o,prepare:s=>({callerFileMap:L(i,s,{semantic:n?.semantic!==!1}),reverseFanIn:l}),evaluate:(s,c)=>S(r,i,s,c),orderResults:(s,c)=>c.callerFanIn-s.callerFanIn||c.loc-s.loc,limit:a})}function S(r,n,e,t){let a=y(r,n,e,t.callerFileMap);if(a.length!==1)return null;let o=a[0],i=P(r,e.symbolId,o);if(!i)return null;let l=w(n,r,o,e.symbol,i);if(l&&g(l.symbol))return null;let{fanIn:s,source:c}=_(t.callerFileMap,t.reverseFanIn,o,l);if(c==="function"?s<=3:s<=5)return null;let m=j(r,e,o,l);return{symbol:e.symbol,shortName:f(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:C(e),singleCaller:l?.symbol??"",singleCallerShort:l?.isFunctionLike?f(l.symbol):u(o),callerFanIn:s,actionTier:m.length>0?"signal":"direct",boundaryEvidence:m}}function v(r,n,e){return r.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0})}function y(r,n,e,t){let a=u(e.relativePath,d(e.relativePath)),o=[...t.get(e.symbolId)??[]].filter(i=>i!==e.relativePath).filter(i=>u(i,d(i))!==a).filter(i=>{let l=n.fileKind(i);return l!=="barrel"&&l!=="entry"&&l!=="test"});return M(r,e,o).realConsumers}function P(r,n,e){return r.get(`SELECT c.start_line, c.end_line
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d ON c.document_id = d.id
5
- WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
- LIMIT 1`,n,e)}function w(r,n,e,t,a){let o=r.definitionsForFile(e),i=k(n,e,t,a.start_line,a.end_line);return b(o,i)}function _(r,n,e,t){if(t?.isFunctionLike){let a=[...r.get(t.symbolId)??[]].filter(o=>o!==t.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:N(n,e),source:"file"}}function k(r,n,e,t,a){let o=p(e);if(!o)return t;let i=I(r,n).get(o);if(!i||i.length===0)return t;for(let l of i)if(l>=t&&l<=a)return l;return t}function E(r){let n=new Map;for(let[e,t]of r){n.has(e)||n.set(e,n.get(e)??0);for(let a of t)n.set(a,(n.get(a)??0)+1)}return n}function N(r,n){let e=r.get(n)??0;if(e>0)return e;let t=u(n,d(n)),a=0;for(let[o,i]of r)o!==n&&u(o,d(o))===t&&i>a&&(a=i);return a}function j(r,n,e,t){return F(r,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:f(n.symbol)},{label:"caller name",value:t?.symbol?f(t.symbol):u(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{K as a};
7
- //# sourceMappingURL=chunk-I274B3B3.js.map
@@ -1,2 +0,0 @@
1
- import{a as u}from"./chunk-PFOCOG57.js";import{a as p}from"./chunk-XPOZO76D.js";import{c as i}from"./chunk-JM72FNGA.js";function x(e,r){let{scope:m,minLoc:o=10,limit:c=30,scanLimit:a}=r??{},s=new p(e);return u({candidates:()=>s.productionCallableDefinitions({scope:m,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,prepare:t=>({callerMap:s.crossFileCallerMap(t,{semantic:r?.semantic!==!1}),calleeMap:s.calleeMap(t,{semantic:r?.semantic!==!1})}),evaluate:(t,n)=>b(t,n,o),orderResults:(t,n)=>n.score-t.score||n.loc-t.loc,limit:c})}function b(e,r,m){let o=e.endLine-e.startLine+1;if(o<m)return null;let c=r.callerMap.get(e.symbolId)?.size??0,a=r.calleeMap.get(e.symbolId)??[],s=a.filter(l=>l.file!==e.relativePath),t=new Set(s.map(l=>`${l.symbol}|${l.file}`)).size,n=new Set(a.map(l=>`${l.symbol}|${l.file}`)).size;return{symbol:e.symbol,shortName:i(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o,fanIn:c,fanOut:t,calleeCount:n,score:Math.round(o/50*(c/5)*Math.max(t/5,1)*100)/100}}export{x as a};
2
- //# sourceMappingURL=chunk-J6ADQKQA.js.map
@@ -1,2 +0,0 @@
1
- import{a as C}from"./chunk-EKECQP6Z.js";import{a as D}from"./chunk-2H57MJLI.js";import{a as f}from"./chunk-XWC67C3Q.js";import{a as g}from"./chunk-KLXVEBVC.js";import{c as y}from"./chunk-4TMJDHC6.js";import{e as h}from"./chunk-KRGBLZT2.js";import{d as p}from"./chunk-A536TEU4.js";var F=.7,S=.62,R=.45;function $(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=h(i);if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let d=A(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic}).map(r=>I(r,s,e)).filter(r=>r!==null);d.sort((r,c)=>(r.kind===c.kind?0:r.kind==="echo"?-1:1)||c.similarity-r.similarity||r.echoFile.localeCompare(c.echoFile)||r.echoSymbol.localeCompare(c.echoSymbol)||r.domain.localeCompare(c.domain));let b=d.slice(0,n).map(w);return{available:!0,windowCommits:e,findings:b,rootCauseGroups:T(b)}}function A(i,t){let e=K(t.limit),n=[...B(i,{scope:t.scope,minSimilarity:t.minSimilarity??F,limit:e,scanLimit:t.scanLimit,semantic:t.semantic})],a=p(i,{scope:t.scope});return a.react&&n.push(...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit}),...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit})),a.vue&&n.push(...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit}),...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit})),n}function B(i,t){return y(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic}).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function k(i,t){return u(i,t,{query:f,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:P(...e.evidenceBuckets(n)),sharedCallees:[]}))}function L(i,t){return u(i,t,{query:g,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}function E(i,t){return u(i,t,{query:D,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function x(i,t){return u(i,t,{query:C,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function I(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let l=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:l?i.symbolA:i.symbolB,echoFile:l?i.fileA:i.fileB,echoAgeCommits:(l?n:a)??0,establishedSymbol:l?i.symbolB:i.symbolA,establishedFile:l?i.fileB:i.fileA,establishedAgeCommits:l?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function w(i){let t=v(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function v(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function T(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??v(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:N(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let l of n.sharedEvidence)s.sharedEvidence.add(l)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function N(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function P(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{$ as a};
2
- //# sourceMappingURL=chunk-K7VBTWNR.js.map
@@ -1,2 +0,0 @@
1
- import{a as p,b as H,c as l,d as m}from"./chunk-BZ53S4ZN.js";import{a as b}from"./chunk-PVZMPG5I.js";import{a as R,b as g}from"./chunk-YWOOQ4FF.js";import{e as v}from"./chunk-BTCASU5J.js";function V(e,s={}){let{minSimilarity:d=.45,minSharedBehaviors:i=6,limit:o=20,scope:n,scanLimit:a,filePattern:c}=s,h=v(e,{scope:n,minBehaviorTokens:Math.max(3,i),scanLimit:a}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r}));return b({profiles:h,limit:o,filePattern:c,compare:(r,t)=>y(r,t,d,i),sort:(r,t)=>t.similarity-r.similarity||r.fileA.localeCompare(t.fileA)||r.componentA.localeCompare(t.componentA)||r.fileB.localeCompare(t.fileB)||r.componentB.localeCompare(t.componentB)})}function y(e,s,d,i){let o=R(e.tokens,s.tokens);if(o.size<i||!A(o))return null;let n=H(e.tokens,s.tokens);if(n<d)return null;let a=l(o,"hook:"),c=l(o,"react-hook:"),h=l(o,"effect:"),r=l(o,"state:"),t=l(o,"request:"),u=l(o,"handler:"),k=l(o,"handler-verb:"),f=B({sharedHooks:a,sharedReactHooks:c,sharedEffects:h,sharedState:r,sharedRequests:t,sharedHandlers:u,sharedHandlerVerbs:k});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:n,sharedTokens:m(o),sharedHooks:a,sharedReactHooks:c,sharedEffects:h,sharedState:r,sharedRequests:t,sharedHandlers:u,sharedHandlerVerbs:k,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:m(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:m(g(s.tokens,e.tokens)).slice(0,25),reason:E({sharedHooks:a,sharedReactHooks:c,sharedEffects:h,sharedState:r,sharedRequests:t,sharedHandlers:u,sharedHandlerVerbs:k}),locA:e.profile.loc,locB:s.profile.loc}}function B(e){return p({genericWords:P,stripPrefixes:S,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:C})}function C(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function A(e){let s=0,d=0,i=0,o=0,n=0,a=0,c=0;for(let t of e)t.startsWith("hook:")?s+=1:t.startsWith("react-hook:")?d+=1:t.startsWith("effect:")?i+=1:t.startsWith("request:")?o+=1:t.startsWith("handler:")||t.startsWith("handler-verb:")?n+=1:t.startsWith("state:")?a+=1:t.startsWith("state-hook:")&&(c+=1);let h=a+c,r=s+d+i+o+n+h;return o>=1&&r>=4||s>=1&&(o>=1||a>=1||n>=2)&&r>=5||a>=1&&n>=2&&(i>=1||d>=2)&&r>=5}function E(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var P=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),S=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
2
- //# sourceMappingURL=chunk-KLXVEBVC.js.map
@@ -1,7 +0,0 @@
1
- import{d as y}from"./chunk-7S5E7KWT.js";import{execFileSync as H}from"child_process";var F=2e3,E=50,j=8,M=3,D=2160*60*60,L=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,O=3,B=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,I=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function S(e){let t=y(e,{clearGroups:["whole-project"]});return(n,r)=>{let i=v(n.config.projectRoot);if(!i)return null;let s=t.has(n)?t.get(n,()=>({head:"",value:null})):null;return s&&s.head===i?s.value:(t.invalidate(n),t.get(n,()=>({head:i,value:r(n.config.projectRoot,i)})).value)}}var N=S("git-commit-history");function x(e){return N(e,k)}function v(e){try{return A(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function A(e,t){return H("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function k(e,t){let n;try{n=A(e,["log","--no-merges","--name-only","-n",String(F),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let r=[],i=0;for(let s of n.split("")){if(s.trim()==="")continue;let a=s.indexOf(`
2
- `),d=a>=0?s.slice(0,a):s,[g,f,C]=d.split("\0");if(!g||!f)continue;let c=a>=0?s.slice(a+1).split(`
3
- `).map(o=>o.trim()).filter(o=>o!==""):[];if(c.length>E){i+=1;continue}r.push({hash:g,timestamp:Number(f)||0,subject:C??"",files:c})}return{head:t,commits:r,skippedBulkCommits:i}}function z(e){return L.test(e.subject)}function Y(e){let t=x(e);if(!t)return null;let n=new Map;for(let r of t.commits){let i=z(r);for(let s of r.files){let a=n.get(s)??{changes:0,fixChanges:0,lastChangedAt:0};a.changes+=1,i&&(a.fixChanges+=1),r.timestamp>a.lastChangedAt&&(a.lastChangedAt=r.timestamp),n.set(s,a)}}return n}function ee(e){let t=x(e);if(!t||t.commits.length===0)return null;let n=t.commits.map(r=>r.files.length).filter(r=>r>0).sort((r,i)=>r-i);return n.length===0?null:{medianFilesPerCommit:R(n,.5),p90FilesPerCommit:R(n,.9),commitsAnalyzed:n.length}}function R(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var G=S("git-tracked-files");function te(e){return G(e,t=>{try{let n=A(t,["ls-files"]);return new Set(n.split(`
4
- `).map(r=>r.trim()).filter(r=>r!==""))}catch{return null}})}var U=S("git-file-adds");function ne(e){return U(e,t=>J(t))}function J(e){let t;try{t=A(e,["log","--no-merges","--diff-filter=A","--name-only","-n",String(F),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,r=-1;for(let i of t.split("")){if(i.trim()==="")continue;r+=1;let s=i.indexOf(`
5
- `),a=s>=0?i.slice(0,s):i,[,d]=a.split("\0"),g=Number(d)||0;if(!(s<0))for(let f of i.slice(s+1).split(`
6
- `)){let C=f.trim();C!==""&&n.set(C,{commitsAgo:r,addedAt:g})}}return n}function re(e,t={}){let n=x(e);return n?P(n,t):null}function oe(e,t,n={}){let r=x(e);return r?t.size===0?[]:P(r,n,t):null}function P(e,t,n){let{minTogether:r=4,minConfidence:i=.6,maxFilesPerCommit:s=E}=t,a=new Map,d=new Map,g=0;for(let c of e.commits){let o=[...new Set(c.files)].sort();if(o.length>s)continue;c.timestamp>g&&(g=c.timestamp);let u=V(o),p=n===void 0||o.some(l=>n.has(l));for(let l of o)a.set(l,(a.get(l)??0)+1);if(p)for(let l=0;l<o.length;l++)for(let h=l+1;h<o.length;h++){if(n&&!n.has(o[l])&&!n.has(o[h]))continue;let b=`${o[l]}\0${o[h]}`,m=d.get(b)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};m.together+=1,u?m.broadTogether+=1:m.focusedTogether+=1,c.timestamp>m.lastTogetherAt&&(m.lastTogetherAt=c.timestamp),m.timestamps.push(c.timestamp),m.subjects.push(c.subject),d.set(b,m)}}let f=[],C=g-D;for(let[c,o]of d){let u=o.together;if(u<r)continue;let[p,l]=c.split("\0"),h=a.get(p)??u,b=a.get(l)??u,m=Math.max(u/h,u/b);if(m<i)continue;let _=o.broadTogether/u,T=o.timestamps.filter(w=>w>=C).length;f.push({fileA:p,fileB:l,together:u,confidence:m,changesA:h,changesB:b,focusedTogether:o.focusedTogether,broadTogether:o.broadTogether,broadCommitRatio:_,lastTogetherAt:o.lastTogetherAt,recentTogether:T,commitScope:W(o.broadTogether,u),recency:T>0?"recent":"stale",subjectContext:X(o.subjects)})}return f.sort((c,o)=>o.together-c.together||o.confidence-c.confidence||c.fileA.localeCompare(o.fileA)),f}function V(e){return e.length>=j?!0:K(e).size>=M}function K(e){let t=new Set;for(let n of e){let r=n.indexOf("/");t.add(r>=0?n.slice(0,r):".")}return t}function W(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function X(e){let t=new Set,n=[],r=[];for(let i of e){!r.includes(i)&&r.length<O&&r.push(i);for(let s of Z(i))t.add(s);for(let s of i.match(B)??[])n.includes(s)||n.push(s)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:r,externalIssueLabelStatus:"unavailable"}}function Z(e){let t=new Set,n=I.exec(e)?.[1]?.toLowerCase();return n&&t.add($(n)),/\b(?:feat|feature)\b/i.test(e)&&t.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(e)&&t.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(e)&&t.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(e)&&t.add("refactor"),/\btests?\b/i.test(e)&&t.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(e)&&t.add("release"),/\bchore\b/i.test(e)&&t.add("chore"),/\bbuild\b/i.test(e)&&t.add("build"),/\bci\b/i.test(e)&&t.add("ci"),/\bperf(?:ormance)?\b/i.test(e)&&t.add("perf"),[...t]}function $(e){return e==="feat"?"feature":e}export{x as a,Y as b,ee as c,te as d,ne as e,re as f,oe as g};
7
- //# sourceMappingURL=chunk-KRGBLZT2.js.map
@@ -1,4 +0,0 @@
1
- import{a as j,d as k}from"./chunk-KRGBLZT2.js";import{b as v,d as N,e as E}from"./chunk-C6ROZBJA.js";import{existsSync as X,readFileSync as _}from"fs";import{join as C}from"path";function F(t,n){let e=W(t,n)??G(t,n)??Z(t,n)??J(t,n);return q(t,e,n)}function W(t,n){let e=-1,i=null;for(let o=0;o<=n;o+=1){let r=M(t[o]??"");r&&(i===null?(i=r,e=o):r===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let o=n+1;o<t.length;o+=1)if(M(t[o]??"")===i)return{start:e,end:o+1};return{start:e,end:t.length}}function M(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function G(t,n){if(!T(t[n]??""))return null;let e=n;for(;e>0&&T(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&T(t[i]??"");)i+=1;return{start:e,end:i}}function T(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function Z(t,n){let e=n;for(;e>=0;){let r=t[e]??"";if(x(r)!==null)break;if(w(r)!==null)return null;e-=1}if(e<0)return null;let i=x(t[e]??"");if(i===null)return null;let o=e+1;for(;o<t.length;){let r=t[o]??"",c=x(r);if(c!==null){if(c<=i)break;o+=1;continue}if(w(r)!==null)break;o+=1}return{start:e,end:o}}function x(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function J(t,n){let e=t[n]??"";if(L(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&O(t[i-1]??"");)i-=1;let o=n+1;for(;o<t.length&&O(t[o]??"");)o+=1;return{start:i,end:o}}function O(t){return w(t)===null}function w(t){return t.trim().length===0?"blank":L(t)?"heading":M(t)?"fence":T(t)?"table":x(t)!==null?"list":null}function L(t){return/^#{1,6}\s+/.test(t.trim())}function q(t,n,e){let{start:i,end:o}=n;if(o-i>40){let c=Math.floor(20);i=Math.max(i,e-c),o=Math.min(o,i+40),i=Math.max(n.start,o-40)}let r=t.slice(i,o).join(`
2
- `).trim();return r.length<=2e3?r:`${r.slice(0,2e3).trimEnd()}...`}function R(t,n){return n.filter(e=>t.includes(e))}var S=/\.(?:md|mdx|rst|txt)$/i;function K(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var Q=3,H=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function dt(t,n={}){let{doc:e,limit:i=20,minCoupling:o=Q}=n,r=tt(t);if(!r)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let s of r.docFiles){if(e!==void 0&&!s.includes(e)||e===void 0&&!B(t,s)||e!==void 0&&!X(C(t.config.projectRoot,s)))continue;let f=Math.max(0,...r.changeTimes.get(s)??[]),d=V(t,s),l=new Map,{resolved:a,broken:u,citations:h}=it(t,s,r.tracked,r.trackedBySuffix,r.everSeenInHistory),p=new Map(h.map(g=>[g.file,g.contexts]));for(let g of a){if(g===s||S.test(g))continue;let m=(r.changeTimes.get(g)??[]).filter(b=>b>f).length;m!==0&&l.set(g,{file:g,evidence:"reference",coChanges:0,changesSinceDocUpdate:m,...A("reference",d),citationContexts:p.get(g)})}for(let[g,m]of r.coupling.get(s)??[]){if(m<o||!r.tracked.has(g))continue;let b=(r.changeTimes.get(g)??[]).filter($=>$>f).length;if(b===0)continue;let y=l.get(g);y?(y.evidence="both",y.coChanges=m,Object.assign(y,A("both",d))):l.set(g,{file:g,evidence:"co-change",coChanges:m,changesSinceDocUpdate:b,...A("co-change",d)})}if(l.size===0&&u.length===0)continue;let D=[...l.values()].sort((g,m)=>m.changesSinceDocUpdate-g.changesSinceDocUpdate);c.push({doc:s,docLastChangedAt:f,staleness:D.reduce((g,m)=>g+m.changesSinceDocUpdate,0)+u.length*10,subjects:D.slice(0,8),brokenReferences:u})}return c.sort((s,f)=>f.staleness-s.staleness),{available:!0,commitsAnalyzed:r.historyCommitCount,docsScanned:r.docFiles.length,findings:c.slice(0,i)}}function V(t,n){let e;try{e=_(C(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
3
- ${e}`.toLowerCase(),o=R(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(o.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${o.join(", ")}`]};let r=R(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return r.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${r.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function A(t,n){return{actionTier:Y(t,n.docIntent),docIntent:n.docIntent,docIntentReasons:n.reasons}}function Y(t,n){return n==="historical-note"?"support":t==="co-change"?"signal":"direct"}function tt(t){let n=j(t);if(!n)return null;let e=k(t)??new Set,i=new Map,o=new Map,r=new Set;for(let c of n.commits){let s=[...new Set(c.files)],f=s.filter(l=>S.test(l)),d=s.filter(l=>!S.test(l));for(let l of s){r.add(l);let a=i.get(l)??[];a.push(c.timestamp),i.set(l,a)}for(let l of f){let a=o.get(l);a||(a=new Map,o.set(l,a));for(let u of d)a.set(u,(a.get(u)??0)+1)}}return{changeTimes:i,coupling:o,docFiles:[...e].filter(c=>S.test(c)),everSeenInHistory:r,historyCommitCount:n.commits.length,tracked:e,trackedBySuffix:z(e)}}function ht(t,n){if(n.size===0)return[];let e=k(t)??new Set,i=z(e),o=nt(n,i),r=[];for(let c of e){if(!B(t,c))continue;let s=U(t,c);if(!s)continue;let f=et(s,n,o,e,i);if(f.size===0)continue;let d=[...new Set([...f.values()].flatMap(h=>[...h]))],l=P(t,c,d),a=[...f].map(([h,p])=>({file:h,contexts:I([...p].flatMap(D=>l.get(D)??[])).slice(0,3)})).filter(h=>h.contexts.length>0),u=[...f.keys()];if(u.length>0){let h=u.sort();r.push({doc:c,cited:h,citations:a,citedClaims:I(a.flatMap(p=>p.contexts)).slice(0,3)})}}return r}function B(t,n){return S.test(n)&&!K(n)&&X(C(t.config.projectRoot,n))}function z(t){let n=new Map;for(let e of t){let i=e.split("/");for(let o of[2,3]){if(i.length<o)continue;let r=i.slice(-o).join("/"),c=n.get(r)??[];c.push(e),n.set(r,c)}}return n}function nt(t,n){let e=new Set(t);for(let i of t){let o=i.split("/");for(let r of[2,3]){if(o.length<r)continue;let c=o.slice(-r).join("/"),s=n.get(c);s?.length===1&&s[0]===i&&e.add(c)}}return e}function et(t,n,e,i,o){let r=new Map;for(let c of t){if(!e.has(c))continue;let s;if(i.has(c))s=c;else{let d=o.get(c);d?.length===1&&(s=d[0])}if(!s||!n.has(s))continue;let f=r.get(s)??new Set;f.add(c),r.set(s,f)}return r}function it(t,n,e,i,o){let r=new Set,c=new Set,s=U(t,n);if(!s)return{resolved:r,broken:[],citations:[]};let f=P(t,n,s),d=new Map,l=(a,u)=>{let h=f.get(u);if(!h||h.length===0)return;let p=d.get(a)??[];p.push(...h),d.set(a,I(p).slice(0,3))};for(let a of s){if(e.has(a)){r.add(a),l(a,a);continue}let u=i.get(a);if(u&&u.length===1){r.add(u[0]),l(u[0],a);continue}u&&u.length>1||o.has(a)&&c.add(a)}return{resolved:r,broken:[...c],citations:[...d].map(([a,u])=>({file:a,contexts:u}))}}function P(t,n,e){let i;try{i=_(C(t.config.projectRoot,n),"utf-8").split(/\r?\n/)}catch{return new Map}let o=new Set(e),r=new Map;for(let c=0;c<i.length;c+=1){let s=i[c]??"";for(let f of s.matchAll(H)){let d=f[0].replace(/^\.?\//,"");if(!o.has(d))continue;let l=F(i,c);if(l.length===0)continue;let a=r.get(d)??[];a.push(l),r.set(d,I(a).slice(0,3))}}return r}function I(t){let n=[];for(let e of new Set(t))n.some(i=>rt(i,e))||n.push(e);return n}function rt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0),i=n.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0),o=Math.min(e.length,i.length);if(o===0)return!1;if(o<3)return t.includes(n)||n.includes(t);let r=new Set(i),c=e.filter(s=>r.has(s)).length;return c>=3&&c/o>=.6}function U(t,n){let e;try{e=_(C(t.config.projectRoot,n),"utf-8")}catch{return null}let i=v(t,n,e),o=N(t,"doc-path-tokens",n,i);if(o!==null)try{return JSON.parse(o)}catch{}let r=[...new Set([...e.matchAll(H)].map(c=>c[0].replace(/^\.?\//,"")))];return E(t,"doc-path-tokens",n,i,JSON.stringify(r)),r}export{F as a,R as b,K as c,dt as d,ht as e};
4
- //# sourceMappingURL=chunk-P3K7LX7M.js.map
@@ -1,2 +0,0 @@
1
- function f(e){let t=[];if(e.filePattern){let r=e.profiles.find(i=>i.file.includes(e.filePattern));if(!r)return[];for(let i of e.profiles){if(i.file===r.file)continue;let l=e.compare(r,i);l&&t.push(l)}}else{let r=typeof e.overrunFactor=="number"&&Number.isFinite(e.limit)?e.limit*e.overrunFactor:Number.POSITIVE_INFINITY;for(let i=0;i<e.profiles.length;i+=1){for(let l=i+1;l<e.profiles.length;l+=1){let n=e.compare(e.profiles[i],e.profiles[l]);n&&t.push(n)}if(t.length>r)break}}return t.sort(e.sort??((r,i)=>i.similarity-r.similarity)),t.slice(0,e.limit)}export{f as a};
2
- //# sourceMappingURL=chunk-PVZMPG5I.js.map
@@ -1,4 +0,0 @@
1
- import{a as ne,b as oe,c as P,d as ie,e as ae,f as pe,g as j,h as ce,i as F,j as me,k as le,l as _,m as U,n as T,o as H,p as V,q as S,r as Q,s as ue,t as J,v as C,w as h,x as M,y as G}from"./chunk-3LQFMQPY.js";import{b as ge}from"./chunk-YZA6PPZL.js";import{a as de,b as fe,d as R}from"./chunk-BTCASU5J.js";import{a as v}from"./chunk-DS6QEB3G.js";import{b as te,d as re,e as se}from"./chunk-C6ROZBJA.js";import{c as L}from"./chunk-7S5E7KWT.js";import{basename as Se}from"path";var je=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(t){let r=[],e=0,s=0;for(let n=0;n<t.length;n++){let o=t[n];(o==="{"||o==="["||o==="(")&&e++,(o==="}"||o==="]"||o===")")&&e--,o===","&&e===0&&(r.push(t.slice(s,n)),s=n+1)}return r.push(t.slice(s)),r}function x(t,r){for(let e of t.namedChildren)if(e.type===r)return e;return null}function g(t,r){let e=new Set,s=(n,o)=>{let i=o||r.has(n.type);!i&&je.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function b(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,le(r)),kind:"named",used:h(e,o),usedMembers:[]}}function f(t,r,e,s,n="named",o={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function $(t,r,e,s,n="named",o=[],i={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s,usedMembers:o,isTypeOnly:i.isTypeOnly}}function O(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function D(t,r,e={}){return{importedName:t,localName:e.localName??null,sourcePath:r,kind:"namespace",used:e.used??!0,usedMembers:e.usedMembers??[],isTypeOnly:e.isTypeOnly}}function N(t,r,e){let s=[];for(let n of t.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=C(t,n.index,n.index+o.length);for(let a of e(n,i))s.push(a)}return s}function I(t,r,e,s){let n=R(t,r);if(n){let o=e(n);if(o)return o}return s()}function X(t,r,e,s){let n=R(t,r),o=de(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function he(t,r,e){return I(t,r,s=>Me(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=Se(o).replace(/\.[^.]+$/,"");return[$(o,i,V(t,r,o),h(n,i))]})}function Me(t,r,e){let s=g(e,new Set(["preproc_include"])),n=[];for(let o of e.rootNode.descendantsOfType("preproc_include")){let i=null;for(let p of o.namedChildren){if(p.type==="system_lib_string"){i=p.text.replace(/^<|>$/g,"");break}if(p.type==="string_literal"){i=p.namedChildren.find(c=>c.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=Se(i).replace(/\.[^.]+$/,"");n.push(f(i,a,V(t,r,i),s))}return n}function ye(t,r,e){let s=[];for(let n of e.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 p=C(e,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:Q(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function xe(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:Q(t,r,o)})}return s}function Ne(t,r,e){return X(t,r,{csharp:s=>qe(t,r,s),vb:s=>$e(t,r,s)},()=>{let s=me(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(e,s,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let[a,p]=i.split(/\s*=\s*/),m=!!p,c=(m?p:a)?.trim()??i,l=c.split(".").pop()??c,u=m?a?.trim()??l:l;return[b(t,r,o,c,l,u,S(t,c,j))]})})}function $e(t,r,e){let s=g(e,new Set(["imports_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(u=>u.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],p=i.length>1?i[0]:null,m=a.text,c=m.split(".").pop()??m,l=p?.text??c;n.push(f(c,l,S(t,m,j),s,p?"namespace":"named"))}return n}function qe(t,r,e){let s=g(e,new Set(["using_directive"])),n=[];for(let o of e.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,p;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],p=i[1]):p=i[i.length-1];let m=p.text,c=m.split(".").pop()??m,l=a?.text??c;n.push(f(c,l,S(t,m,j),s,a?"namespace":"named"))}return n}var Fe=L("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Ie(t,r){return Fe.get(t,r,()=>{let e=new Set,s=v(t,r);if(!s)return e;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))e.add(i[0]);return e})}function Y(t,r,e){return I(t,r,s=>We(t,r,s),()=>Ue(t,r,e))}function Ue(t,r,e){return Ze(e).flatMap(s=>et(t,r,s.clause,s.specifier,s.start,s.end,e))}function We(t,r,e){let s=Je(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...Xe(t,r,e,o,s));return n}function Je(t,r,e){let s=g(e,new Set(["import_statement"]));if(fe(r))for(let n of Ie(t,r))s.add(n);return s}function Xe(t,r,e,s,n){let o=Qe(s);if(!o)return[];let i=_(t,r,o),a=x(s,"import_clause");return a?ze(e,a,i,n,Ge(s.text)):[O("*",i)]}function ze(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Be(i.text,e,s,n));else if(i.type==="namespace_import"){let a=He(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Ve(i,e,s,n));return o}function Be(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function He(t,r,e,s,n){let i=x(r,"identifier")?.text??"";if(!i)return null;let a=Ke(t,i);return D("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Ve(t,r,e,s){let n=[];for(let o of t.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let p=i.text,m=a?.text??p;n.push(f(p,m,r,e,"named",{isTypeOnly:s||Ye(o.text)}))}return n}function Qe(t){let r=x(t,"string");if(!r)return null;let e=x(r,"string_fragment");return e?e.text:null}function Ge(t){return/^\s*import\s+type\b/.test(t)}function Ye(t){return/^\s*type\b/.test(t.trim())}function Ke(t,r){let e=new Set;for(let s of t.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")&&e.add(o.text)}return[...e]}function Ze(t){let r=[],e=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(e)){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 t.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 et(t,r,e,s,n,o,i){let a=_(t,r,s),p=C(i,n,o);return e?tt(e).map(c=>({...c,sourcePath:a})).map(c=>{if(c.kind==="namespace"){let l=M(p,c.localName);return D(c.importedName,c.sourcePath,{localName:c.localName,usedMembers:l,used:l.length>0||h(p,c.localName),isTypeOnly:c.isTypeOnly})}return c.kind==="side-effect"?O(c.importedName,c.sourcePath):$(c.importedName,c.localName??"",c.sourcePath,c.localName?h(p,c.localName):!1,c.kind,[],{isTypeOnly:c.isTypeOnly})}):[O("*",a)]}function tt(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=rt(s),i=[];return n&&i.push(...Pe(n,e)),o&&i.push(...Pe(o,e)),i}function Pe(t,r){let e=t.trim();if(!e)return[];if(e.startsWith("{")){let s=e.slice(1,-1).trim();return s?y(s).map(n=>{let o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[p,m]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(m??p).trim(),kind:"named",isTypeOnly:i}}):[]}return e.startsWith("* as ")?[{importedName:"*",localName:e.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:e,kind:"default",isTypeOnly:r}]}function rt(t){let r=0;for(let e=0;e<t.length;e++){let s=t[e];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[t.slice(0,e).trim(),t.slice(e+1).trim()]}return[t.trim(),null]}function K(t,r,e){let s=R(t,r);return s?pt(t,r,s):st(t,r,e)}function st(t,r,e){return[...nt(t,r,e),...ot(t,r,e),...it(t,r,e)]}function nt(t,r,e){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",p=y(i).map(l=>at(l.trim())).filter(l=>!!l),m=q(e,o.index),c=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:_(t,r,a),names:p,startLine:m,endLine:c})}return s}function ot(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function it(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star",sourcePath:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function at(t){if(!t)return null;let r=t.replace(/^type\s+/,"").trim();if(!r)return null;let e=r.match(/^(\w+)\s+as\s+(\w+)$/);if(e)return e[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function q(t,r){let e=0;for(let s=0;s<r&&s<t.length;s++)t.charCodeAt(s)===10&&e++;return e}function pt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=ct(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=mt(n,o,i,a);s.push(p)}return s}function ct(t,r,e){let s=x(e,"string");if(!s)return;let n=x(s,"string_fragment");if(n)return _(t,r,n.text)}function mt(t,r,e,s){let n=x(t,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let p=a.namedChild(0),m=a.namedChild(1);p&&i.push((m??p).text)}return{kind:"named",sourcePath:r,names:i,startLine:e,endLine:s}}return x(t,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:e,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:e,endLine:s}}function be(t,r,e){return X(t,r,{java:s=>lt(t,r,s),kotlin:s=>ut(t,r,s),scala:s=>dt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?ft(t,r,o,n):[]}))}function lt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(l=>l.type==="asterisk"),p=o.namedChildren.find(l=>l.type==="scoped_identifier")??o.namedChildren.find(l=>l.type==="identifier");if(!p)continue;let m=p.text;if(i){n.push(D("*",S(t,m,P)));continue}let c=m.split(".").pop()??m;n.push(f(c,c,S(t,m,P),s))}return n}function ut(t,r,e){let s=g(e,new Set(["import_header","import_list"])),n=[];for(let o of e.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"),p=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push(D("*",S(t,i.text,P)));continue}let m=i.text,c=m.split(".").pop()??m,u=p?.namedChild(0)?.text??c;n.push(f(c,u,S(t,m,P),s))}return n}function dt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(l=>l.type==="namespace_selectors"||l.type==="namespace_wildcard"),a=o.namedChildren.filter(l=>l!==i&&(l.type==="identifier"||l.type==="stable_identifier")),p=a.map(l=>l.text).join(".");if(!p)continue;if(i?.type==="namespace_wildcard"){n.push(D("*",S(t,p,P)));continue}if(i?.type==="namespace_selectors"){for(let l of i.namedChildren)if(l.type==="arrow_renamed_identifier"){let[u,d]=l.namedChildren;if(!u)continue;let E=u.text,A=d?.text??E;if(E==="_")continue;n.push(f(E,A,S(t,`${p}.${E}`,P),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,P),s))}continue}let m=a[a.length-1]?.text??p,c=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(m,m,S(t,c&&a.length>1?`${c}.${m}`:p,P),s))}return n}function ft(t,r,e,s){if(e.includes("{")&&e.includes("}")){let n=e.slice(0,e.indexOf("{")).replace(/\.$/,"").trim(),o=e.slice(e.indexOf("{")+1,e.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),c=p?.trim();if(!c||c==="_")return[];let l=(m??c.split(".").pop()??c).trim(),u=c==="_"?n:`${n}.${c}`.replace(/\.\./g,".");return[b(t,r,s,u,c,l)]})}return[b(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function _e(t,r,e){return I(t,r,s=>gt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.split(/\s+as\s+/i),c=p?.trim()??a,l=c.split("\\").pop()??c,u=(m??l).trim();return[b(t,r,n,c,l,u,S(t,c.replace(/\\/g,"."),F))]}):[]}))}function gt(t,r,e){let s=g(e,new Set(["namespace_use_declaration"])),n=[],o=(i,a,p)=>{n.push(f(a,p,S(t,i.replace(/\\/g,"."),F),s))};for(let i of e.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(p=>p.type==="namespace_use_group");if(a){let p=i.namedChildren.find(m=>m.type==="namespace_name")?.text??"";for(let m of a.namedChildren){if(m.type!=="namespace_use_clause")continue;let{importedName:c,localName:l,qualified:u}=Ee(m,p);c&&o(u,c,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:m,localName:c,qualified:l}=Ee(p,"");m&&o(l,m,c)}}return n}function Ee(t,r){let e=t.namedChildren.find(m=>m.type==="qualified_name"),s=t.namedChildren.filter(m=>m.type==="name"),n="";e?n=e.text:s.length>=1&&(n=s[0].text);let o=e&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,p=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:p}}function Ce(t,r,e){return I(t,r,s=>St(t,r,s),()=>yt(e).flatMap(s=>Nt(t,r,s,e)))}function St(t,r,e){let s=g(e,new Set(["import_statement","import_from_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Te(i);if(!a)continue;let p=U(t,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:p,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of e.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ht(i);if(a===null)continue;let p=U(t,r,a);for(let m=1;m<o.namedChildCount;m+=1){let c=o.namedChild(m);if(c.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=Te(c);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Te(t){if(t.type==="aliased_import"){let r=t.namedChild(0),e=t.namedChild(1);return!r||!e?null:{qualifiedName:r.text,localName:e.text}}if(t.type==="dotted_name"){let r=t.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return t.type==="identifier"?{qualifiedName:t.text,localName:t.text}:null}function ht(t){if(t.type==="dotted_name")return t.text;if(t.type==="relative_import"){let r=x(t,"import_prefix")?.text??"",e=x(t,"dotted_name")?.text??"";return`${r}${e}`}return null}function yt(t){let r=t.split(`
2
- `),e=[],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 p=o,m=a+o.length,c=G(o);for(;n+1<r.length&&(c>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
3
- ${u}`,m+=1+u.length,c+=G(u),s+=u.length+1}let l=xt(p);l&&e.push({...l,start:a,end:m})}return e}function xt(t){let r=t.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let e=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!e)return null;let s=e[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:e[1],clause:s}}function Nt(t,r,e,s){let n=C(s,e.start,e.end),o=e.clause.replace(/\n/g," ").trim();if(e.kind==="import")return y(o).flatMap(p=>{let m=p.trim().replace(/,$/,"");if(!m)return[];let[c,l]=m.split(/\s+as\s+/),u=c.trim(),d=(l??u.split(".")[0]??u).trim(),E=U(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:E,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?U(t,r,e.module):null,a=[];for(let p of y(o)){let m=p.trim().replace(/,$/,"");if(!m)continue;if(m==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[c,l]=m.split(/\s+as\s+/),u=(l??c).trim();a.push({importedName:c.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as It}from"path";function Re(t,r,e){return I(t,r,s=>bt(t,r,s),()=>Pt(t,r,e))}function Pt(t,r,e){return N(e,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(s,n)=>{let o=s[1],i=s[2];if(!o||!i)return[];let a=o==="require_relative"?H(t,r,i):null;if(a){let p=Oe(i);return[$(p,p,a,h(n,p))]}return[O(i,a)]})}function bt(t,r,e){let s=g(e,new Set([])),n=[],o=new Set(["require","require_relative","load"]);for(let i of e.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let m=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!m||m.type!=="string")continue;let l=m.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?H(t,r,l):null;if(u){let d=Oe(l);n.push(f(d,d,u,s))}else n.push(O(l,u))}return n}function Oe(t){return ge(It(t).replace(/\.[^.]+$/,""),/_/)}function De(t,r,e){return I(t,r,s=>Et(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?_t(t,r,o,n):[]}))}function Et(t,r,e){let s=g(e,new Set(["use_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of W(i,"")){if(!a.importedName||a.importedName==="*")continue;let p=T(t,r,a.qualifiedName)??T(t,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push(f(a.importedName,a.localName,p,s))}}return n}function W(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:z(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:z(r,e),importedName:s,localName:s}]}case"scoped_use_list":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=z(r,e.text),o=[];for(let i of s.namedChildren)o.push(...W(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...W(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=W(e,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let e=t.namedChild(0),s=e?e.text:"";return[{qualifiedName:z(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function z(t,r){return t?r?`${t}::${r}`:t:r}function _t(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let c=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),l=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(l).flatMap(u=>{let d=u.trim();if(!d||d==="self")return[];let[E,A]=d.split(/\s+as\s+/),w=E?.trim();if(!w)return[];let we=(A??w.split("::").pop()??w).trim(),Le=`${c}::${w}`.replace(/::::/g,"::");return[b(t,r,s,Le,w.split("::").pop()??w,we,T(t,r,c))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),m=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[b(t,r,s,a,a.split("::").pop()??a,p,m)]}function ke(t,r,e){let s=R(t,r);if(s)return Tt(t,r,s);let n=[];for(let o of e.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(...Rt(t,r,i))}return n}function Tt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!Ct(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of W(o,""))i.importedName&&s.push(Z(t,r,i.qualifiedName))}return s}function Ct(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Rt(t,r,e){let s=e.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 y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[p]=a.split(/\s+as\s+/),m=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[Z(t,r,m)]})}return[Z(t,r,s)]}function Z(t,r,e){return{specifier:e,sourcePath:T(t,r,e)??T(t,r,e.split("::").slice(0,-1).join("::"))}}function k({language:t,extensions:r,imports:e,parseImports:s}){return{language:t,extensions:r,capabilities:{imports:e},parseImports:s}}function Ae(t,r){let e=r.toLowerCase();for(let s of t)for(let n of s.extensions)if(e.endsWith(n))return s;return null}var Ot={language:"javascript",extensions:ne,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Y,parseReExports:K},Dt=k({language:"python",extensions:oe,imports:"ast-with-regex-fallback",parseImports:Ce}),kt=k({language:"jvm",extensions:P,imports:"ast-dispatch-with-regex-fallback",parseImports:be}),At={language:"rust",extensions:ie,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:De,parseExports:ke},wt=k({language:"ruby",extensions:ae,imports:"ast-with-regex-fallback",parseImports:Re}),Lt=k({language:"c/cpp",extensions:pe,imports:"ast-with-regex-fallback",parseImports:he}),jt=k({language:"dotnet",extensions:j,imports:"ast-dispatch-with-regex-fallback",parseImports:Ne}),vt={language:"dart",extensions:ce,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:ye,parseExports:xe},Mt=k({language:"php",extensions:F,imports:"ast-with-regex-fallback",parseImports:_e}),$t=[Ot,Dt,kt,At,wt,Lt,jt,vt,Mt];function B(t){return Ae($t,t)}var ee={clearGroups:["whole-project","source-file"]},qt=L("source-imports",ee),Ft=L("source-exports",ee),Ut=L("source-reexports",ee);function ns(t,r){let e=J(r);return Ut.get(t,e,()=>{let s=B(e);if(!s?.parseReExports)return[];let n=v(t,e);return n?s.parseReExports(t,e,n):[]})}function os(t,r){let e=J(r);return qt.get(t,e,()=>{let s=B(e);if(!s)return[];let n=v(t,e);if(!n)return[];let o=te(t,e,n),i=ue(t),a=re(t,"source-imports",e,o);if(a!==null)try{let m=JSON.parse(a);if(m.resolutionFingerprint===i&&Array.isArray(m.imports))return m.imports}catch{}let p=s.parseImports(t,e,n);return se(t,"source-imports",e,o,JSON.stringify({resolutionFingerprint:i,imports:p})),p})}function is(t,r){let e=J(r);return Ft.get(t,e,()=>{let s=B(e);if(!s?.parseExports)return[];let n=v(t,e);return n?s.parseExports(t,e,n):[]})}export{ns as a,os as b,is as c};
4
- //# sourceMappingURL=chunk-RY7CAOJF.js.map
@@ -1,2 +0,0 @@
1
- import{a as b}from"./chunk-PFOCOG57.js";import{a as g}from"./chunk-XPOZO76D.js";import{a as d}from"./chunk-AETMKBZR.js";import{c as p}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-6TDOT7B3.js";import{a as o}from"./chunk-BTCASU5J.js";function T(t,r={}){let{scope:l,limit:s=30,scanLimit:f}=r,u=r.files===void 0?null:new Set(r.files),L=new g(t);return b({candidates:()=>L.productionCallableDefinitions({scope:l,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>h(e.relativePath)&&(u===null||u.has(e.relativePath))),scanLimit:f,evaluate:e=>{let n=c(t,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(a=>!a.simple)||n.paramsEndLine>=n.endLine)return null;let y=d(t,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||P(y.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function h(t){let r=o(t);return r==="typescript"||r==="tsx"||r==="javascript"}function P(t,r,l){return t?t.some(s=>s>r&&s<=l):!1}export{T as a};
2
- //# sourceMappingURL=chunk-S7YOLFLX.js.map