scip-query 0.10.6 → 0.10.8

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 (266) hide show
  1. package/README.md +7 -2
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/{chunk-YQH353VA.js → chunk-24S6MYOC.js} +2 -2
  4. package/dist/{chunk-BNKE4TT5.js → chunk-2H57MJLI.js} +2 -2
  5. package/dist/{chunk-AUVBR62P.js → chunk-2YI45TNM.js} +2 -2
  6. package/dist/{chunk-TM6GVHA6.js → chunk-3FYGJ2GY.js} +2 -2
  7. package/dist/chunk-3LQFMQPY.js +3 -0
  8. package/dist/chunk-4TMJDHC6.js +5 -0
  9. package/dist/{chunk-FNRPGGVI.js → chunk-5G5VI7J4.js} +2 -2
  10. package/dist/chunk-5GVOJOBL.js +2 -0
  11. package/dist/{chunk-4ZUJJRWT.js → chunk-5SMUKUV5.js} +2 -2
  12. package/dist/{chunk-DE7MA6OD.js → chunk-63MSELOP.js} +2 -2
  13. package/dist/{chunk-5FOPAXWY.js → chunk-6BNOACLT.js} +2 -2
  14. package/dist/chunk-6EO3E3IP.js +23 -0
  15. package/dist/{chunk-47UA45TU.js → chunk-6N6QTGSD.js} +2 -2
  16. package/dist/{chunk-QLNGUWR7.js → chunk-6TDOT7B3.js} +2 -2
  17. package/dist/{chunk-MUULWXSJ.js → chunk-7KJBH4IP.js} +2 -2
  18. package/dist/chunk-7XWXGANX.js +4 -0
  19. package/dist/chunk-A536TEU4.js +3 -0
  20. package/dist/{chunk-CJJP64OC.js → chunk-AA7L7GKI.js} +2 -2
  21. package/dist/chunk-AETMKBZR.js +40 -0
  22. package/dist/{chunk-ZQLO2SCU.js → chunk-ANIOISCE.js} +2 -2
  23. package/dist/{chunk-6UFMPECA.js → chunk-B4EHYG6M.js} +2 -2
  24. package/dist/{chunk-OLD6PBU6.js → chunk-BEUQVBE3.js} +2 -2
  25. package/dist/{chunk-EOZIZWW4.js → chunk-BJG67TCR.js} +2 -2
  26. package/dist/{chunk-ICXVNWMI.js → chunk-BJWNO6BU.js} +2 -2
  27. package/dist/chunk-BTCASU5J.js +3 -0
  28. package/dist/{chunk-YUOAAR24.js → chunk-BWL2ECGQ.js} +2 -2
  29. package/dist/{chunk-QUJBXLBY.js → chunk-BZ53S4ZN.js} +2 -2
  30. package/dist/{chunk-EYLXU575.js → chunk-C6BYNIH4.js} +2 -2
  31. package/dist/chunk-C6ROZBJA.js +32 -0
  32. package/dist/chunk-COUFCH64.js +2 -0
  33. package/dist/{chunk-D322LMSA.js → chunk-DS6QEB3G.js} +5 -5
  34. package/dist/{chunk-NVFERV4U.js → chunk-E2CCBFLR.js} +2 -2
  35. package/dist/{chunk-Z4VHYJ5U.js → chunk-EBIQY3RK.js} +2 -2
  36. package/dist/{chunk-5UDFZC4D.js → chunk-EKECQP6Z.js} +2 -2
  37. package/dist/{chunk-O3OKSF6O.js → chunk-FG4NT6VY.js} +2 -2
  38. package/dist/{chunk-X7ZY6FFF.js → chunk-FGTHPJON.js} +2 -2
  39. package/dist/{chunk-QSXQT3NE.js → chunk-FHWEEQVO.js} +2 -2
  40. package/dist/{chunk-CFL2CNIF.js → chunk-FKUCFCLU.js} +2 -2
  41. package/dist/chunk-FVA3NH4P.js +2 -0
  42. package/dist/{chunk-5QJXH6ZL.js → chunk-GZQID3FS.js} +2 -2
  43. package/dist/{chunk-SPE4YCOT.js → chunk-I274B3B3.js} +2 -2
  44. package/dist/{chunk-DAI74TJU.js → chunk-J6ADQKQA.js} +2 -2
  45. package/dist/{chunk-E7KERP7E.js → chunk-JRUKS66S.js} +2 -2
  46. package/dist/{chunk-ZSLT7NWQ.js → chunk-JUIAOOK7.js} +2 -2
  47. package/dist/{chunk-7KCSELEV.js → chunk-JYSAYZNX.js} +2 -2
  48. package/dist/chunk-K7VBTWNR.js +2 -0
  49. package/dist/{chunk-56UN3DMK.js → chunk-KLXVEBVC.js} +2 -2
  50. package/dist/{chunk-E44ZMVNA.js → chunk-KZYHFI2X.js} +2 -2
  51. package/dist/{chunk-FIB4JPEX.js → chunk-L4QKEQ4S.js} +2 -2
  52. package/dist/{chunk-CTCAF3YA.js → chunk-LGX2Y4BA.js} +2 -2
  53. package/dist/{chunk-VAA5FFIW.js → chunk-LM5SHAN4.js} +2 -2
  54. package/dist/{chunk-YYD245WG.js → chunk-LWTML2AN.js} +2 -2
  55. package/dist/{chunk-7OHWPJ5N.js → chunk-MEKSFV6H.js} +2 -2
  56. package/dist/{chunk-5M4TYWVI.js → chunk-N7F5UM6J.js} +2 -2
  57. package/dist/{chunk-YUTRW57I.js → chunk-NWFSC356.js} +2 -2
  58. package/dist/chunk-P3K7LX7M.js +4 -0
  59. package/dist/{chunk-CAWSSEVM.js → chunk-Q34NWRPP.js} +2 -2
  60. package/dist/chunk-QDGKE5HN.js +21 -0
  61. package/dist/{chunk-ESG4HBEF.js → chunk-RHKMQNFI.js} +2 -2
  62. package/dist/chunk-RSKOYTSY.js +3 -0
  63. package/dist/chunk-RY7CAOJF.js +4 -0
  64. package/dist/{chunk-NNDYO2DX.js → chunk-S7YOLFLX.js} +2 -2
  65. package/dist/{chunk-LPLGJ4HO.js → chunk-SHM5D3DQ.js} +2 -2
  66. package/dist/chunk-SOGKYB5I.js +8 -0
  67. package/dist/{chunk-MZ7APUFN.js → chunk-T633QLYF.js} +2 -2
  68. package/dist/{chunk-AW4N6MGC.js → chunk-VAXDTQHE.js} +2 -2
  69. package/dist/chunk-VFLHKRTW.js +2 -0
  70. package/dist/{chunk-77YBOOYT.js → chunk-VMPB52FG.js} +2 -2
  71. package/dist/{chunk-3KLLFNT4.js → chunk-VOYOYC5T.js} +2 -2
  72. package/dist/{chunk-DJMK4DBL.js → chunk-VXT7WVIN.js} +2 -2
  73. package/dist/chunk-W2CBNBEL.js +71 -0
  74. package/dist/{chunk-3UW7VM4H.js → chunk-X3BJUFSN.js} +2 -2
  75. package/dist/chunk-X3Z4MLVL.js +4 -0
  76. package/dist/chunk-XPOZO76D.js +2 -0
  77. package/dist/{chunk-WBJZNPUT.js → chunk-XWC67C3Q.js} +2 -2
  78. package/dist/{chunk-GZCQTZLK.js → chunk-YNSVAJR6.js} +2 -2
  79. package/dist/chunk-YWOOQ4FF.js +2 -0
  80. package/dist/chunk-YZA6PPZL.js +3 -0
  81. package/dist/{chunk-CSWZFD46.js → chunk-ZDR4VTOP.js} +2 -2
  82. package/dist/{chunk-QVCCLDZI.js → chunk-ZL52RLDK.js} +2 -2
  83. package/dist/{chunk-YTR4CO5S.js → chunk-ZMU6IWDK.js} +3 -3
  84. package/dist/cli.js +272 -235
  85. package/dist/{config-types-Bj4sh28g.d.ts → config-types-BDIWAYzr.d.ts} +13 -1
  86. package/dist/{db-CTarohbZ.d.ts → db-BAVwb4Pb.d.ts} +1 -1
  87. package/dist/{health-Bx0x1HAG.d.ts → health-B17sVFYf.d.ts} +6 -2
  88. package/dist/index.d.ts +3 -3
  89. package/dist/index.js +3 -3
  90. package/dist/postinstall.js +1 -1
  91. package/dist/queries/affected.d.ts +2 -2
  92. package/dist/queries/affected.js +1 -1
  93. package/dist/queries/bottlenecks.d.ts +2 -2
  94. package/dist/queries/bottlenecks.js +1 -1
  95. package/dist/queries/by-kind.d.ts +2 -2
  96. package/dist/queries/by-kind.js +1 -1
  97. package/dist/queries/call-graph.d.ts +2 -2
  98. package/dist/queries/call-graph.js +1 -1
  99. package/dist/queries/change-surface.d.ts +2 -2
  100. package/dist/queries/change-surface.js +1 -1
  101. package/dist/queries/cleanup-plan.d.ts +2 -2
  102. package/dist/queries/cleanup-plan.js +1 -1
  103. package/dist/queries/co-change.d.ts +2 -2
  104. package/dist/queries/co-change.js +1 -1
  105. package/dist/queries/code.d.ts +2 -2
  106. package/dist/queries/code.js +1 -1
  107. package/dist/queries/complexity-hotspots.d.ts +2 -2
  108. package/dist/queries/complexity-hotspots.js +1 -1
  109. package/dist/queries/complexity.d.ts +2 -2
  110. package/dist/queries/complexity.js +1 -1
  111. package/dist/queries/convergence.d.ts +2 -2
  112. package/dist/queries/convergence.js +1 -1
  113. package/dist/queries/coupling.d.ts +2 -2
  114. package/dist/queries/coupling.js +1 -1
  115. package/dist/queries/cycles.d.ts +2 -2
  116. package/dist/queries/cycles.js +1 -1
  117. package/dist/queries/dataflow.d.ts +2 -2
  118. package/dist/queries/dataflow.js +1 -1
  119. package/dist/queries/dead.d.ts +2 -2
  120. package/dist/queries/dead.js +1 -1
  121. package/dist/queries/deep-chains.d.ts +2 -2
  122. package/dist/queries/deep-chains.js +1 -1
  123. package/dist/queries/deps.d.ts +2 -2
  124. package/dist/queries/deps.js +1 -1
  125. package/dist/queries/diff-gate.d.ts +8 -5
  126. package/dist/queries/diff-gate.js +1 -1
  127. package/dist/queries/diff-impact.d.ts +7 -3
  128. package/dist/queries/diff-impact.js +1 -1
  129. package/dist/queries/doc-drift.d.ts +2 -2
  130. package/dist/queries/doc-drift.js +1 -1
  131. package/dist/queries/drift.d.ts +2 -2
  132. package/dist/queries/drift.js +1 -1
  133. package/dist/queries/extract-candidates.d.ts +2 -2
  134. package/dist/queries/extract-candidates.js +1 -1
  135. package/dist/queries/fan.d.ts +2 -2
  136. package/dist/queries/fan.js +1 -1
  137. package/dist/queries/files.d.ts +2 -2
  138. package/dist/queries/health.d.ts +3 -3
  139. package/dist/queries/health.js +1 -1
  140. package/dist/queries/hierarchy.d.ts +2 -2
  141. package/dist/queries/hierarchy.js +1 -1
  142. package/dist/queries/hotspots.d.ts +2 -2
  143. package/dist/queries/hotspots.js +1 -1
  144. package/dist/queries/imports.d.ts +2 -2
  145. package/dist/queries/imports.js +1 -1
  146. package/dist/queries/incomplete-migration.d.ts +5 -3
  147. package/dist/queries/incomplete-migration.js +1 -1
  148. package/dist/queries/index.d.ts +3 -3
  149. package/dist/queries/index.js +1 -1
  150. package/dist/queries/isolated.d.ts +2 -2
  151. package/dist/queries/isolated.js +1 -1
  152. package/dist/queries/locality-candidates.d.ts +2 -2
  153. package/dist/queries/locality-candidates.js +1 -1
  154. package/dist/queries/members.d.ts +2 -2
  155. package/dist/queries/members.js +1 -1
  156. package/dist/queries/methods.d.ts +2 -2
  157. package/dist/queries/methods.js +1 -1
  158. package/dist/queries/outline.d.ts +2 -2
  159. package/dist/queries/outline.js +1 -1
  160. package/dist/queries/passthrough-candidates.d.ts +2 -2
  161. package/dist/queries/passthrough-candidates.js +1 -1
  162. package/dist/queries/plan-context.d.ts +2 -2
  163. package/dist/queries/plan-context.js +1 -1
  164. package/dist/queries/react-component-duplicates.d.ts +2 -2
  165. package/dist/queries/react-component-duplicates.js +1 -1
  166. package/dist/queries/react-hook-candidates.d.ts +2 -2
  167. package/dist/queries/react-hook-candidates.js +1 -1
  168. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  169. package/dist/queries/react-large-component-pressure.js +1 -1
  170. package/dist/queries/recent-duplicates.d.ts +2 -2
  171. package/dist/queries/recent-duplicates.js +1 -1
  172. package/dist/queries/redundant-reexports.d.ts +2 -2
  173. package/dist/queries/redundant-reexports.js +1 -1
  174. package/dist/queries/refs.d.ts +2 -2
  175. package/dist/queries/refs.js +1 -1
  176. package/dist/queries/self-audit.d.ts +2 -2
  177. package/dist/queries/self-audit.js +1 -1
  178. package/dist/queries/similar-chains.d.ts +2 -2
  179. package/dist/queries/similar-chains.js +1 -1
  180. package/dist/queries/similar-files.d.ts +2 -2
  181. package/dist/queries/similar-files.js +1 -1
  182. package/dist/queries/similar-signatures.d.ts +2 -2
  183. package/dist/queries/similar-signatures.js +1 -1
  184. package/dist/queries/similar.d.ts +14 -4
  185. package/dist/queries/similar.js +1 -1
  186. package/dist/queries/slice.d.ts +2 -2
  187. package/dist/queries/slice.js +1 -1
  188. package/dist/queries/stale-abstractions.d.ts +2 -2
  189. package/dist/queries/stale-abstractions.js +1 -1
  190. package/dist/queries/stats.d.ts +2 -2
  191. package/dist/queries/surface.d.ts +2 -2
  192. package/dist/queries/surface.js +1 -1
  193. package/dist/queries/symbols.d.ts +2 -2
  194. package/dist/queries/symbols.js +1 -1
  195. package/dist/queries/system.d.ts +2 -2
  196. package/dist/queries/system.js +1 -1
  197. package/dist/queries/trace.d.ts +2 -2
  198. package/dist/queries/trace.js +1 -1
  199. package/dist/queries/unused-imports.d.ts +2 -2
  200. package/dist/queries/unused-imports.js +1 -1
  201. package/dist/queries/unused-params.d.ts +2 -2
  202. package/dist/queries/unused-params.js +1 -1
  203. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  204. package/dist/queries/vue-component-duplicates.js +1 -1
  205. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  206. package/dist/queries/vue-composable-candidates.js +1 -1
  207. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  208. package/dist/queries/vue-large-view-pressure.js +1 -1
  209. package/dist/queries/wrapper-candidates.d.ts +2 -2
  210. package/dist/queries/wrapper-candidates.js +1 -1
  211. package/dist/reindex-worker.js +11 -11
  212. package/dist/reindex.d.ts +11 -2
  213. package/dist/reindex.js +22 -22
  214. package/dist/runtime.d.ts +17 -20
  215. package/dist/runtime.js +2 -2
  216. package/dist/scip-cli-CnK9Va4O.d.ts +56 -0
  217. package/docs/AGENT_GUIDE.md +1 -1
  218. package/docs/COMMAND_REFERENCE.md +4 -3
  219. package/docs/analyzer-inventory.md +2 -2
  220. package/docs/analyzer-validation-ledger.md +2 -2
  221. package/package.json +1 -1
  222. package/skills/concrete-plan/SKILL.md +2 -2
  223. package/skills/scip-adoption/SKILL.md +4 -2
  224. package/skills/scip-ai-cleanup/SKILL.md +1 -1
  225. package/skills/scip-api-impact/SKILL.md +6 -2
  226. package/skills/scip-debloat/SKILL.md +1 -1
  227. package/skills/scip-debug/SKILL.md +6 -2
  228. package/skills/scip-diagram/SKILL.md +3 -1
  229. package/skills/scip-directory-architecture/SKILL.md +7 -3
  230. package/skills/scip-doc-reconcile/SKILL.md +3 -1
  231. package/skills/scip-explore/SKILL.md +2 -2
  232. package/skills/scip-health-audit/SKILL.md +6 -2
  233. package/skills/scip-health-improve/SKILL.md +6 -2
  234. package/skills/scip-hyper-optimization/SKILL.md +97 -0
  235. package/skills/scip-hyper-optimization/agents/openai.yaml +4 -0
  236. package/skills/scip-maintainability/SKILL.md +6 -3
  237. package/skills/scip-query/SKILL.md +14 -6
  238. package/skills/scip-query-setup/SKILL.md +10 -5
  239. package/skills/scip-react-maintainability/SKILL.md +7 -2
  240. package/skills/scip-triage-issue/SKILL.md +4 -2
  241. package/skills/scip-verify/SKILL.md +5 -3
  242. package/skills/scip-vue-maintainability/SKILL.md +7 -2
  243. package/dist/chunk-237YUOPK.js +0 -8
  244. package/dist/chunk-3UVJJ6Z7.js +0 -2
  245. package/dist/chunk-3ZYF3ELZ.js +0 -2
  246. package/dist/chunk-7JOTOWZO.js +0 -4
  247. package/dist/chunk-A3VNUGKJ.js +0 -2
  248. package/dist/chunk-A4L36SZS.js +0 -22
  249. package/dist/chunk-A7RNHUJH.js +0 -20
  250. package/dist/chunk-AYYIZ4BA.js +0 -4
  251. package/dist/chunk-BKDXBJDQ.js +0 -2
  252. package/dist/chunk-C3MZZ2ZN.js +0 -2
  253. package/dist/chunk-CRU42NJU.js +0 -2
  254. package/dist/chunk-ERHOS6AW.js +0 -2
  255. package/dist/chunk-EWC3UK4V.js +0 -3
  256. package/dist/chunk-FOQHUKNZ.js +0 -4
  257. package/dist/chunk-FUPDW5AC.js +0 -3
  258. package/dist/chunk-G3WGZU5Q.js +0 -2
  259. package/dist/chunk-HVTYSC26.js +0 -40
  260. package/dist/chunk-KPHKX4LP.js +0 -71
  261. package/dist/chunk-MA7OVFHI.js +0 -2
  262. package/dist/chunk-OBBDKQAG.js +0 -3
  263. package/dist/chunk-RHTJBYZ5.js +0 -2
  264. package/dist/chunk-UQJGTVHV.js +0 -5
  265. package/dist/chunk-ZFMPHDAT.js +0 -4
  266. package/dist/scip-cli-Bh1M_JPu.d.ts +0 -20
package/README.md CHANGED
@@ -209,7 +209,7 @@ Heuristic detectors carry guardrails learned from real codebases: published `pac
209
209
 
210
210
  ## Agent Skills
211
211
 
212
- `scip-query install-skills` symlinks bundled skills into Claude Code, Codex, and shared agent roots (`~/.agents/skills/`) so they update automatically with the package. The `scip-query` router skill dispatches codebase work to specialists for setup/adoption, health audit and autonomous health improvement, debugging, issue triage, HTML diagrams, API impact, exploration, planning, cleanup, doc reconciliation, maintainability review, React/Vue review, AI-rot cleanup, language playbooks, and post-change verification.
212
+ `scip-query install-skills` symlinks bundled skills into Claude Code, Codex, and shared agent roots (`~/.agents/skills/`) so they update automatically with the package. The `scip-query` router skill dispatches codebase work to specialists for setup/adoption, health audit and autonomous health improvement, hyper optimization, debugging, issue triage, HTML diagrams, API impact, exploration, planning, cleanup, doc reconciliation, maintainability review, React/Vue review, AI-rot cleanup, language playbooks, and post-change verification.
213
213
 
214
214
  Project setup writes reviewable project-local lifecycle hooks for Codex and Claude Code (`.codex/hooks.json` and `.claude/settings.json`). These hooks add scip-query context at session start, route prompts toward the right skill, and run an advisory Stop-hook wrapper around the diff gate only for that repository. The Stop hook warns by default instead of blocking the agent; set `SCIP_QUERY_STOP_HOOK_MODE=feedback` to ask the agent to continue without a hook error, or `SCIP_QUERY_STOP_HOOK_MODE=block` to enforce the gate. Set `SCIP_QUERY_SKIP_HOOK_INSTALL=1` to skip hook installation during setup, or run `scip-query setup-hooks --json` later to repair the current repo's hooks.
215
215
 
@@ -262,6 +262,9 @@ Vue single-file components are handled through the JavaScript/TypeScript indexer
262
262
 
263
263
  By default, indexes live in `~/.cache/scip-query/projects/<hash>/`, keeping project directories clean. Override paths with `.scipquery.json` or `SCIP_QUERY_*` environment variables. Reindexing writes per-language SCIP shards next to the SQLite index, so a mixed-language repo can reuse unchanged language outputs and rerun only the languages whose source/config inputs changed.
264
264
 
265
+ TypeScript monorepos can opt into project sharding with `indexer.typescript.projectMode: "workspace"`. In that mode, `scip-query` discovers repo-local TypeScript project roots, runs one `scip-typescript` process per project with bounded concurrency, merges the shard protobufs, and still publishes one TypeScript language index. Set `indexer.typescript.projects` to an explicit list of project directories or tsconfig paths when automatic discovery is too broad. Set `indexerConcurrency` when a repo needs a persistent worker cap; CLI `--indexer-concurrency` and `SCIP_QUERY_INDEXER_CONCURRENCY` still override ad hoc runs.
266
+ Use `indexer.typescript.pnpmWorkspaces` only with the default single-project mode; workspace mode passes explicit projects instead.
267
+
265
268
  Most read-only commands accept `--json` and use the same envelope:
266
269
 
267
270
  ```json
@@ -281,6 +284,7 @@ It creates `.scipquery.json`:
281
284
  ```json
282
285
  {
283
286
  "languages": ["typescript"],
287
+ "indexerConcurrency": 6,
284
288
  "watch": {
285
289
  "enabled": false,
286
290
  "debounceMs": 30000,
@@ -288,7 +292,8 @@ It creates `.scipquery.json`:
288
292
  },
289
293
  "indexer": {
290
294
  "typescript": {
291
- "pnpmWorkspaces": true
295
+ "projectMode": "workspace",
296
+ "projects": ["apps/api", "apps/web"]
292
297
  }
293
298
  }
294
299
  }
@@ -1,2 +1,2 @@
1
- import{c as t}from"./chunk-KPHKX4LP.js";import{writeFileSync as o}from"fs";import{workerData as s}from"worker_threads";var e=s;try{let r=t({projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,vueFiles:e.vueFiles,tasks:e.tasks});o(e.resultPath,JSON.stringify({ok:!0,result:r}))}catch(r){o(e.resultPath,JSON.stringify({ok:!1,error:r instanceof Error?r.message:String(r)}))}finally{let r=new Int32Array(e.sharedBuffer);Atomics.add(r,0,1),Atomics.notify(r,0)}
1
+ import{c as t}from"./chunk-W2CBNBEL.js";import{writeFileSync as o}from"fs";import{workerData as s}from"worker_threads";var e=s;try{let r=t({projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,vueFiles:e.vueFiles,tasks:e.tasks});o(e.resultPath,JSON.stringify({ok:!0,result:r}))}catch(r){o(e.resultPath,JSON.stringify({ok:!1,error:r instanceof Error?r.message:String(r)}))}finally{let r=new Int32Array(e.sharedBuffer);Atomics.add(r,0,1),Atomics.notify(r,0)}
2
2
  //# sourceMappingURL=augment-vue-worker.js.map
@@ -1,4 +1,4 @@
1
- import{b as l}from"./chunk-CTCAF3YA.js";import{a}from"./chunk-3ZYF3ELZ.js";import{c as i,f as n}from"./chunk-JM72FNGA.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
1
+ import{b as l}from"./chunk-LGX2Y4BA.js";import{a}from"./chunk-XPOZO76D.js";import{c as i,f as n}from"./chunk-JM72FNGA.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d1 ON c.document_id = d1.id
@@ -26,4 +26,4 @@ import{b as l}from"./chunk-CTCAF3YA.js";import{a}from"./chunk-3ZYF3ELZ.js";impor
26
26
  AND ${e.localSymbolPredicate}
27
27
  ${e.pathExclusionsFor("d1")}
28
28
  ORDER BY d1.relative_path`,...r,...r,...r)}function c(e,r){let t=new a(e);return r.flatMap(o=>t.definitionsForFile(o).filter(s=>n(s.symbol)).map(s=>({relative_path:o,symbol:s.symbol})))}function m(e){let r=new Set;return e.filter(t=>{let o=`${t.relative_path}|${t.symbol}`;return r.has(o)?!1:(r.add(o),!0)})}function u(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:i(e.symbol)}}export{_ as a};
29
- //# sourceMappingURL=chunk-YQH353VA.js.map
29
+ //# sourceMappingURL=chunk-24S6MYOC.js.map
@@ -1,2 +1,2 @@
1
- import{c as o,d as a}from"./chunk-QUJBXLBY.js";import{a as p}from"./chunk-PVZMPG5I.js";import{a as c,b as m,c as f}from"./chunk-3UVJJ6Z7.js";import{c as u}from"./chunk-ERHOS6AW.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-BNKE4TT5.js.map
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,4 +1,4 @@
1
- import{b as c}from"./chunk-FOQHUKNZ.js";import{a}from"./chunk-64MNV6AB.js";import{c as d}from"./chunk-7S5E7KWT.js";var g=d("file-dep-graph",{clearGroups:["whole-project"]});function p(e,i){return g.get(e,i??"",()=>{let s=new Map,n=new Set(a(e,{includeIgnored:!1})),r=(t,o)=>f(e,s,n,t,o);for(let t of m(e,i))r(t.from_file,t.to_file);for(let t of n)if(!(i&&!t.includes(i)))for(let o of c(e,t))o.sourcePath&&r(t,o.sourcePath);return s})}function m(e,i){let s=i?`AND d1.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT DISTINCT
1
+ import{b as c}from"./chunk-RY7CAOJF.js";import{a}from"./chunk-64MNV6AB.js";import{c as d}from"./chunk-7S5E7KWT.js";var g=d("file-dep-graph",{clearGroups:["whole-project"]});function p(e,i){return g.get(e,i??"",()=>{let s=new Map,n=new Set(a(e,{includeIgnored:!1})),r=(t,o)=>f(e,s,n,t,o);for(let t of m(e,i))r(t.from_file,t.to_file);for(let t of n)if(!(i&&!t.includes(i)))for(let o of c(e,t))o.sourcePath&&r(t,o.sourcePath);return s})}function m(e,i){let s=i?`AND d1.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT DISTINCT
2
2
  d1.relative_path AS from_file,
3
3
  d2.relative_path AS to_file
4
4
  FROM mentions m
@@ -17,4 +17,4 @@ import{b as c}from"./chunk-FOQHUKNZ.js";import{a}from"./chunk-64MNV6AB.js";impor
17
17
  AND m.role != 1
18
18
  ${e.pathExclusionsFor("d1","d2")}
19
19
  ${s}`)}function f(e,i,s,n,r){if(n===r||e.isIgnored(n)||e.isIgnored(r)||!s.has(r))return;let t=i.get(n);t||(t=new Set,i.set(n,t)),t.add(r)}export{p as a};
20
- //# sourceMappingURL=chunk-AUVBR62P.js.map
20
+ //# sourceMappingURL=chunk-2YI45TNM.js.map
@@ -1,4 +1,4 @@
1
- import{a as f}from"./chunk-CTCAF3YA.js";import{a as d}from"./chunk-3ZYF3ELZ.js";import{e as c}from"./chunk-FUPDW5AC.js";import{c as u}from"./chunk-JM72FNGA.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
1
+ import{a as f}from"./chunk-LGX2Y4BA.js";import{a as d}from"./chunk-XPOZO76D.js";import{e as c}from"./chunk-RSKOYTSY.js";import{c as u}from"./chunk-JM72FNGA.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
2
2
  WHERE relative_path = ?
3
3
  ${e.pathExclusionsFor("documents")}
4
4
  LIMIT 1`,n)??null}function g(e,n){return new d(e).definitionsForFile(n).sort((i,t)=>i.startLine-t.startLine||i.endLine-t.endLine)}function S(e,n,i,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
@@ -8,4 +8,4 @@ import{a as f}from"./chunk-CTCAF3YA.js";import{a as d}from"./chunk-3ZYF3ELZ.js";
8
8
  WHERE m.symbol_id = ?
9
9
  AND m.role != 1
10
10
  AND c.document_id != ?`,i.symbolId,n.id);return new Set([...r.map(s=>s.relative_path),...[...t].filter(s=>s!==n.relative_path)]).size}function b(e){return e>10?"high":e>0?"medium":"low"}export{L as a};
11
- //# sourceMappingURL=chunk-TM6GVHA6.js.map
11
+ //# sourceMappingURL=chunk-3FYGJ2GY.js.map
@@ -0,0 +1,3 @@
1
+ import{a as w}from"./chunk-C6ROZBJA.js";import{a as v}from"./chunk-64MNV6AB.js";import{a as O,d as D,f as P}from"./chunk-7S5E7KWT.js";function V(t){return t.replace(/'''[\s\S]*?'''/g,f).replace(/"""[\s\S]*?"""/g,f).replace(/#.*$/gm,f).replace(/\/\/.*$/gm,f).replace(/\/\*[\s\S]*?\*\//g,f).replace(/`(?:\\[\s\S]|[^`])*`/g,f).replace(/'(?:\\.|[^'\\\r\n])*'/g,f).replace(/"(?:\\.|[^"\\\r\n])*"/g,f)}function f(t){return t.replace(/[^\r\n]/g," ")}var Rt=P("stripped-lines",{clearGroups:["whole-project","source-file"]});O({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{_=null,h=""},clearFile:()=>{_=null,h=""}});var _=null,h="";function Y(t){return _===t||(_=t,h=V(t)),h}function Ct(t,n,e){let r=Y(t);return`${r.slice(0,n)}${" ".repeat(e-n)}${r.slice(e)}`}function $t(t,n){return new RegExp(`\\b${X(n)}\\b`,"m").test(t)}function jt(t,n){let e=new Set,r=new RegExp(`\\b${X(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let o of t.matchAll(r)){let s=o[1];s&&e.add(s)}return[...e]}function X(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yt(t){let n=0;for(let e of t)e==="("&&(n+=1),e===")"&&(n-=1);return n}import{existsSync as T}from"fs";import{basename as K,dirname as S,extname as p,join as g,relative as m,resolve as u}from"path";var Q=D("indexed-paths",{clearGroups:[]}),Z=D("indexed-path-digest",{clearGroups:[]}),I=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],b=[".py",".pyi"],k=[".java",".scala",".kt",".kts"],A=[".rs"],L=[".rb"],W=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],H=[".cs",".vb"],U=[".dart"],G=[".php"],q=new Set(I),R=new Set(b),J=new Set(k),C=new Set(A),$=new Set(L),M=new Set(W),B=new Set(H),j=new Set(U),F=new Set(G),tt=[{extensions:I,lookup:q},{extensions:b,lookup:R},{extensions:k,lookup:J},{extensions:A,lookup:C},{extensions:L,lookup:$},{extensions:W,lookup:M},{extensions:H,lookup:B},{extensions:U,lookup:j},{extensions:G,lookup:F}];function x(t,n){return n.has(p(t).toLowerCase())}function nt(t){return x(t,R)}function et(t){return x(t,J)}function rt(t){return x(t,C)}function ot(t){return x(t,$)}function st(t){return x(t,M)}function it(t){return x(t,B)}function kt(t){return p(t).toLowerCase()===".vb"}function ct(t){return x(t,j)}function at(t){return x(t,F)}function lt(t){let n=p(t).toLowerCase();for(let e of tt)if(e.lookup.has(n))return e.extensions;return I}function ut(t){return et(t)||it(t)||at(t)}function At(t,n,e){return nt(n)?pt(t,n,e):rt(n)?ft(t,n,e):ot(n)?St(t,n,e):st(n)?xt(t,n,e):ut(n)?dt(t,e.replace(/\\/g,"."),lt(n)):ct(n)?Et(t,n,e):gt(t,n,e)}function gt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=E(t);for(let c of _t(o)){let a=d(m(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(m(t.config.projectRoot,o))}function pt(t,n,e){let r=E(t),o;if(e.startsWith(".")){let s=e.match(/^(\.+)(.*)$/);if(!s)return null;let c=s[1].length,a=s[2].replace(/^\./,""),i=S(g(t.config.projectRoot,n));for(let l=1;l<c;l++)i=S(i);o=a?u(i,a.replace(/\./g,"/")):i}else o=u(t.config.projectRoot,e.replace(/\./g,"/"));for(let s of ht(o)){let c=d(m(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function ft(t,n,e){if(!e)return null;let r=e.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=S(g(t.config.projectRoot,n)),s;return r.startsWith("crate::")?s=u(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=u(o,r.slice(6).replace(/::/g,"/")):s=u(S(o),r.slice(7).replace(/::/g,"/")),y(t,mt(s))}function St(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return y(t,It(o))}function xt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=[u(r,e),u(t.config.projectRoot,e),u(t.config.projectRoot,"include",e),u(t.config.projectRoot,"src",e)];return y(t,o)}function dt(t,n,e){let r=E(t),o=n.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),c=o.split(".").pop()??o;for(let i of e){let l=`${s}${i}`,N=[...r].find(z=>z.endsWith(l));if(N)return N}for(let i of e){let l=[...r].find(N=>K(N)===`${c}${i}`);if(l)return l}let a=[...r].filter(i=>e.includes(p(i).toLowerCase())).filter(i=>i.includes(`/${s}/`)||i.includes(`/${c}/`)).sort((i,l)=>i.localeCompare(l));return a.length===1?a[0]:null}function Et(t,n,e){let r=E(t);if(e.startsWith("package:")){let c=e.slice(8),a=c.indexOf("/");if(a<0)return null;let i=c.slice(a+1),l=d(i.startsWith("lib/")?i:`lib/${i}`);return r.has(l)?l:null}let o=S(g(t.config.projectRoot,n)),s=u(o,e);for(let c of Nt(s)){let a=d(m(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function ht(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function y(t,n){let e=E(t);for(let r of n){let o=d(m(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function mt(t){let n=p(t);return C.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function It(t){let n=p(t);return $.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function Nt(t){let n=p(t);return j.has(n)?[t]:[`${t}.dart`,t]}function _t(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of I)e.add(t.slice(0,-n.length)+r)}else for(let r of I)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function E(t){return Q.get(t,()=>new Set(v(t,{includeIgnored:!1}).map(d)))}function Lt(t){return Z.get(t,()=>w([...E(t)].sort().join(`
2
+ `)))}function d(t){return t.replace(/\\/g,"/")}export{I as a,b,k as c,A as d,L as e,W as f,H as g,U as h,G as i,kt as j,lt as k,At as l,pt as m,ft as n,St as o,xt as p,dt as q,Et as r,Lt as s,d as t,V as u,Ct as v,$t as w,jt as x,yt as y};
3
+ //# sourceMappingURL=chunk-3LQFMQPY.js.map
@@ -0,0 +1,5 @@
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 +1,2 @@
1
- import{b as y}from"./chunk-B75HZHUP.js";import{a as f}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-FUPDW5AC.js";import{x as d}from"./chunk-CRU42NJU.js";import{c as h,d as S,g as x}from"./chunk-3UW7VM4H.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as g}from"./chunk-D322LMSA.js";function F(n,e={}){let{scope:s,minLoc:t=1,limit:i,scanLimit:a}=e,o=e.semantic!==!1,l=M(n,$(n,{scope:s,minLoc:t,scanLimit:a}),{semantic:o}),r=I(l);return i?r.slice(0,i):r}function $(n,e){let s=x(n,{scope:e.scope}).filter(t=>t.isFunctionLike&&!n.isIgnored(t.relativePath)).filter(t=>f(t)>=e.minLoc);return typeof e.scanLimit=="number"&&e.scanLimit>0&&s.sort((t,i)=>f(i)-f(t)||t.relativePath.localeCompare(i.relativePath)),y(s,e.scanLimit)}function M(n,e,s){let t=new Map;for(let i of e){let a=w(n,i,s);if(!a)continue;let o=t.get(a)??[];o.push(v(i)),t.set(a,o)}return t}function v(n){return{symbol:n.symbol,shortName:b(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:f(n)}}function I(n){let e=[];for(let[s,t]of n)t.length>=2&&e.push({signature:s,functions:t});return e.sort((s,t)=>{let i=t.functions.length-s.functions.length;if(i!==0)return i;let a=s.functions.reduce((l,r)=>l+r.loc,0);return t.functions.reduce((l,r)=>l+r.loc,0)-a}),e}function w(n,e,s){if(s.semantic){let a=L(n,e);if(a)return a}let t=G(e.documentation),i=t?A(t):null;return i||R(P(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function G(n){return h(S(n))}function P(n,e,s,t,i){let a=g(n,e);if(!a)return null;let o=a.split(/\r?\n/),l=E(o,s,t,i);for(let r of l){let p=Math.min(o.length-1,Math.max(r,r+4)),u="";for(let c=r;c<=p;c+=1){let m=o[c]?.trim();if(m&&(u=u?`${u} ${m}`:m,z(u)))return u}if(u&&u.includes("("))return u}return null}function z(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||d(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function A(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(n,e){if(!n||!n.trim())return null;let s=n.replace(/\s+/g," ").trim(),t=s.indexOf("(");if(t===-1)return null;let i=s.slice(0,t),o=new RegExp(`\\b${D(e)}\\b`,"i").exec(i);o&&typeof o.index=="number"&&(i=i.slice(0,o.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let l=C(s.slice(t)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!l.startsWith("("))return null;let r=`${i?`${i} `:""}${l}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function C(n){let e=0,s=0,t=0,i=0,a=null,o=!1;for(let l=0;l<n.length;l+=1){let r=n[l];if(a){if(o){o=!1;continue}if(r==="\\"){o=!0;continue}r===a&&(a=null);continue}if(r==='"'||r==="'"||r==="`"){a=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")t+=1;else if(r==="]")t=Math.max(0,t-1);else if(r==="<")i+=1;else if(r===">")i=Math.max(0,i-1);else if(r==="{"){if(e===0&&t===0&&i===0)return n.slice(0,l);s+=1}else if(r==="}")s=Math.max(0,s-1);else if(r==="="&&n[l+1]===">"&&e===0&&s===0&&t===0&&i===0)return n.slice(0,l)}return n}function E(n,e,s,t){let i=D(t),a=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),o=new RegExp(`\\bdef\\s+${i}\\b`,"i"),l=[],r=new Set,p=Math.max(0,Math.min(e,n.length-1)),u=Math.max(p,Math.min(n.length-1,Math.max(s,e+4)));for(let c=p;c<=u;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}for(let c=0;c<n.length;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}return l}function D(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{F as a};
2
- //# sourceMappingURL=chunk-FNRPGGVI.js.map
1
+ import{b as y}from"./chunk-B75HZHUP.js";import{a as f}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-RSKOYTSY.js";import{y as d}from"./chunk-3LQFMQPY.js";import{c as h,d as S,g as x}from"./chunk-X3BJUFSN.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as g}from"./chunk-DS6QEB3G.js";function F(n,e={}){let{scope:s,minLoc:t=1,limit:i,scanLimit:a}=e,o=e.semantic!==!1,l=M(n,$(n,{scope:s,minLoc:t,scanLimit:a}),{semantic:o}),r=I(l);return i?r.slice(0,i):r}function $(n,e){let s=x(n,{scope:e.scope}).filter(t=>t.isFunctionLike&&!n.isIgnored(t.relativePath)).filter(t=>f(t)>=e.minLoc);return typeof e.scanLimit=="number"&&e.scanLimit>0&&s.sort((t,i)=>f(i)-f(t)||t.relativePath.localeCompare(i.relativePath)),y(s,e.scanLimit)}function M(n,e,s){let t=new Map;for(let i of e){let a=w(n,i,s);if(!a)continue;let o=t.get(a)??[];o.push(v(i)),t.set(a,o)}return t}function v(n){return{symbol:n.symbol,shortName:b(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:f(n)}}function I(n){let e=[];for(let[s,t]of n)t.length>=2&&e.push({signature:s,functions:t});return e.sort((s,t)=>{let i=t.functions.length-s.functions.length;if(i!==0)return i;let a=s.functions.reduce((l,r)=>l+r.loc,0);return t.functions.reduce((l,r)=>l+r.loc,0)-a}),e}function w(n,e,s){if(s.semantic){let a=L(n,e);if(a)return a}let t=G(e.documentation),i=t?A(t):null;return i||R(P(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function G(n){return h(S(n))}function P(n,e,s,t,i){let a=g(n,e);if(!a)return null;let o=a.split(/\r?\n/),l=E(o,s,t,i);for(let r of l){let p=Math.min(o.length-1,Math.max(r,r+4)),u="";for(let c=r;c<=p;c+=1){let m=o[c]?.trim();if(m&&(u=u?`${u} ${m}`:m,z(u)))return u}if(u&&u.includes("("))return u}return null}function z(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||d(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function A(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(n,e){if(!n||!n.trim())return null;let s=n.replace(/\s+/g," ").trim(),t=s.indexOf("(");if(t===-1)return null;let i=s.slice(0,t),o=new RegExp(`\\b${D(e)}\\b`,"i").exec(i);o&&typeof o.index=="number"&&(i=i.slice(0,o.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let l=C(s.slice(t)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!l.startsWith("("))return null;let r=`${i?`${i} `:""}${l}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function C(n){let e=0,s=0,t=0,i=0,a=null,o=!1;for(let l=0;l<n.length;l+=1){let r=n[l];if(a){if(o){o=!1;continue}if(r==="\\"){o=!0;continue}r===a&&(a=null);continue}if(r==='"'||r==="'"||r==="`"){a=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")t+=1;else if(r==="]")t=Math.max(0,t-1);else if(r==="<")i+=1;else if(r===">")i=Math.max(0,i-1);else if(r==="{"){if(e===0&&t===0&&i===0)return n.slice(0,l);s+=1}else if(r==="}")s=Math.max(0,s-1);else if(r==="="&&n[l+1]===">"&&e===0&&s===0&&t===0&&i===0)return n.slice(0,l)}return n}function E(n,e,s,t){let i=D(t),a=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),o=new RegExp(`\\bdef\\s+${i}\\b`,"i"),l=[],r=new Set,p=Math.max(0,Math.min(e,n.length-1)),u=Math.max(p,Math.min(n.length-1,Math.max(s,e+4)));for(let c=p;c<=u;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}for(let c=0;c<n.length;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}return l}function D(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{F as a};
2
+ //# sourceMappingURL=chunk-5G5VI7J4.js.map
@@ -0,0 +1,2 @@
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 +1,4 @@
1
- import{a as s}from"./chunk-CTCAF3YA.js";function m(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
1
+ import{a as s}from"./chunk-LGX2Y4BA.js";function m(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d1 ON c.document_id = d1.id
@@ -30,4 +30,4 @@ import{a as s}from"./chunk-CTCAF3YA.js";function m(e,d){let i=s(e,d);return i?e.
30
30
  WHERE d2.relative_path = ?
31
31
  AND d1.relative_path != ?
32
32
  ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{m as a,o as b};
33
- //# sourceMappingURL=chunk-4ZUJJRWT.js.map
33
+ //# sourceMappingURL=chunk-5SMUKUV5.js.map
@@ -1,3 +1,3 @@
1
- import{a as P}from"./chunk-VAA5FFIW.js";import{a as x}from"./chunk-PFOCOG57.js";import{a as v}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-3ZYF3ELZ.js";import{a as g,g as p}from"./chunk-ZQLO2SCU.js";import{a as h}from"./chunk-BGBBVSH4.js";import{c as l,d as m,g as u}from"./chunk-JM72FNGA.js";import{b as f}from"./chunk-QLNGUWR7.js";import{b as d}from"./chunk-D322LMSA.js";import{basename as y,extname as L}from"path";function X(n,e){let{scope:i,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new b(n);return x({candidates:()=>A(a,i,t),orderCandidates:v,scanLimit:s,prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>S(n,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function S(n,e,i){let t=R(i);if(t.size!==1||!f(n,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=I(n,e,o),a=T(n,e),r=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:D(r,s,a)}}function I(n,e,i){return P(n,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(i.symbol)},{label:"passthrough module",value:y(e.relativePath,L(e.relativePath))},{label:"callee module",value:y(i.file,L(i.file))}])}function D(n,e,i){if(n==="signal"){if(i.length>0)return`Review the public API before inlining; public-facade evidence: ${i.slice(0,2).join("; ")}.`;let t=e.filter(C);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(n,e){return E(n,e)?g(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:p(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function E(n,e){let i=d(n,e.relativePath);if(i.length===0)return!1;let t=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
1
+ import{a as P}from"./chunk-LM5SHAN4.js";import{a as x}from"./chunk-PFOCOG57.js";import{a as v}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-XPOZO76D.js";import{a as g,g as p}from"./chunk-ANIOISCE.js";import{a as h}from"./chunk-BGBBVSH4.js";import{c as l,d as m,g as u}from"./chunk-JM72FNGA.js";import{b as f}from"./chunk-6TDOT7B3.js";import{b as d}from"./chunk-DS6QEB3G.js";import{basename as y,extname as L}from"path";function X(n,e){let{scope:i,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new b(n);return x({candidates:()=>A(a,i,t),orderCandidates:v,scanLimit:s,prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>S(n,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function S(n,e,i){let t=R(i);if(t.size!==1||!f(n,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=I(n,e,o),a=T(n,e),r=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:D(r,s,a)}}function I(n,e,i){return P(n,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(i.symbol)},{label:"passthrough module",value:y(e.relativePath,L(e.relativePath))},{label:"callee module",value:y(i.file,L(i.file))}])}function D(n,e,i){if(n==="signal"){if(i.length>0)return`Review the public API before inlining; public-facade evidence: ${i.slice(0,2).join("; ")}.`;let t=e.filter(C);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(n,e){return E(n,e)?g(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:p(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function E(n,e){let i=d(n,e.relativePath);if(i.length===0)return!1;let t=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
2
2
  `);return j.test(t)?!0:w(i,m(e.symbol))}function w(n,e){if(!e)return!1;let i=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${F(e)}\\b`);return n.some(t=>i.test(t))}function C(n){return n.includes("public surface")}function F(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function R(n){let e=n.some(t=>u(t.symbol))?n.filter(t=>u(t.symbol)):n,i=new Map;for(let t of e)i.has(t.symbol)||i.set(t.symbol,t);return i}function A(n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:3,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0})}var j=/^\s*export\s+(?:default\s+)?(?:(?:async\s+)?function\b|(?:const|let|var)\b)/m;export{X as a};
3
- //# sourceMappingURL=chunk-DE7MA6OD.js.map
3
+ //# sourceMappingURL=chunk-63MSELOP.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-3ZYF3ELZ.js";import{a as l}from"./chunk-MZ7APUFN.js";import{d as o,f as a}from"./chunk-JM72FNGA.js";import{basename as d}from"path";function M(t,c){let n=l(t,c);if(!n)return[];let r=o(n.symbol),s=new m(t).definitionsForFile(n.relativePath).filter(e=>a(e.symbol)),i=s.filter(e=>e.parentTypeName===r||e.symbol.includes(r));return(i.length>0?i:p(d(n.relativePath))===r?s.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:o(e.symbol)}))}function p(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
2
- //# sourceMappingURL=chunk-5FOPAXWY.js.map
1
+ import{a as m}from"./chunk-XPOZO76D.js";import{a as l}from"./chunk-T633QLYF.js";import{d as o,f as a}from"./chunk-JM72FNGA.js";import{basename as d}from"path";function M(t,c){let n=l(t,c);if(!n)return[];let r=o(n.symbol),s=new m(t).definitionsForFile(n.relativePath).filter(e=>a(e.symbol)),i=s.filter(e=>e.parentTypeName===r||e.symbol.includes(r));return(i.length>0?i:p(d(n.relativePath))===r?s.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:o(e.symbol)}))}function p(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
2
+ //# sourceMappingURL=chunk-6BNOACLT.js.map
@@ -0,0 +1,23 @@
1
+ import{g as p}from"./chunk-X3BJUFSN.js";import{a as f,c as g,e as l}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-64MNV6AB.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},d=new Map;for(let[e,r]of Object.entries(m))d.set(r.toLowerCase(),Number(e));var b=500;function _(e){let r=parseInt(e,10);if(!isNaN(r))return r;let t=e.toLowerCase(),n=d.get(t);if(n!==void 0)return n;for(let[i,o]of d)if(i.includes(t))return o;return null}function O(e,r,t={}){let{scope:n,limit:i=100}=t,o=_(r);return o===null?[]:h(e,n).map(s=>({row:s,resolvedKind:N(s)})).filter(s=>s.resolvedKind===o).slice(0,i).map(({row:s,resolvedKind:u})=>({symbol:s.symbol,shortName:g(s.symbol),kind:u,kindName:m[u]??"Unknown",relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line}))}function P(e,r={}){let t=k(e,r.scope);for(let n of S(e,r.scope)){let i=N(n);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((n,i)=>i[1]-n[1]||n[0]-i[0]).map(([n,i])=>({kind:n,kindName:m[n]??"Unknown",count:i}))}function h(e,r){return p(e,{scope:r}).map(K)}function k(e,r){let t=new Map;for(let n of y(c(e,{scope:r,includeIgnored:!1}))){let i=n.map(()=>"?").join(", "),o=e.all(`SELECT gs.kind AS kind, COUNT(*) AS count
2
+ FROM defn_enclosing_ranges der
3
+ JOIN global_symbols gs ON der.symbol_id = gs.id
4
+ JOIN documents d ON der.document_id = d.id
5
+ WHERE gs.kind IS NOT NULL
6
+ AND gs.kind != 0
7
+ AND gs.symbol NOT LIKE '%#'
8
+ AND d.relative_path IN (${i})
9
+ GROUP BY gs.kind`,...n);for(let a of o)t.set(a.kind,(t.get(a.kind)??0)+a.count)}return t}function S(e,r){let t=[];for(let n of y(c(e,{scope:r,includeIgnored:!1}))){let i=n.map(()=>"?").join(", ");t.push(...e.all(`SELECT gs.symbol,
10
+ gs.kind,
11
+ gs.documentation,
12
+ gs.enclosing_symbol,
13
+ d.relative_path,
14
+ der.start_line,
15
+ der.end_line
16
+ FROM defn_enclosing_ranges der
17
+ JOIN global_symbols gs ON der.symbol_id = gs.id
18
+ JOIN documents d ON der.document_id = d.id
19
+ WHERE (gs.kind IS NULL OR gs.kind = 0 OR gs.symbol LIKE '%#')
20
+ ${e.symbolNoiseFor("gs")}
21
+ AND d.relative_path IN (${i})
22
+ ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...n))}return t}function y(e){let r=[];for(let t=0;t<e.length;t+=b)r.push(e.slice(t,t+b));return r}function K(e){return{symbol:e.symbol,kind:e.kind,documentation:e.documentation,enclosing_symbol:e.enclosingSymbol,relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine}}function N(e){return e.kind!==null&&e.kind!==0?M(e.kind,e.symbol,e.documentation):R(e.symbol,e.documentation,e.enclosing_symbol)}function M(e,r,t){let n=(t??"").toLowerCase();if(l(r)==="type"){if(n.includes("type "))return 76;if(n.includes("interface "))return 27;if(n.includes("struct "))return 68;if(n.includes("trait "))return 73;if(n.includes("class "))return 9}return e}function R(e,r,t){let n=f(e);if("kind"in n)return null;let i=n.descriptors,o=i[i.length-2]??null,a=l(e),s=(r??"").toLowerCase();return a==="type"?s.includes("type ")?76:s.includes("interface ")?27:s.includes("struct ")?68:s.includes("trait ")?73:(s.includes("class "),9):a==="method"?o?.suffix==="type"?33:23:a==="namespace"?39:a!=="term"?null:s.includes("async def ")||s.includes("def ")?23:(t?l(t):o?.suffix??null)==="type"?21:83}export{O as a,P as b};
23
+ //# sourceMappingURL=chunk-6EO3E3IP.js.map
@@ -1,3 +1,3 @@
1
- import{a as d}from"./chunk-MZ7APUFN.js";import{a as g,c as m}from"./chunk-JM72FNGA.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
1
+ import{a as d}from"./chunk-T633QLYF.js";import{a as g,c as m}from"./chunk-JM72FNGA.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
2
  WHERE id = ? LIMIT 1`,a.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],e=t.enclosing_symbol,r=1,c=new Set([t.symbol]);for(;e&&!c.has(e)&&r<20;){c.add(e);let s=n.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",e);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:r}),e=s.enclosing_symbol,r++}if(o.length>1)return o;let y=g(t.symbol);if("kind"in y)return o;let l=y.descriptors;if(l.length<=1)return o;let b=[o[0]];for(let s=l.length-2,h=1;s>=0;s--,h++){let p=l.slice(0,s+1).map(i=>i.suffix==="method"?`${i.name}()`:i.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");b.push({symbol:p,shortName:p,depth:h})}return b}export{_ as a};
3
- //# sourceMappingURL=chunk-47UA45TU.js.map
3
+ //# sourceMappingURL=chunk-6N6QTGSD.js.map
@@ -1,2 +1,2 @@
1
- import{a as C}from"./chunk-ERHOS6AW.js";import{a as m,b as d,c as L,d as g}from"./chunk-EWC3UK4V.js";import{a as h,i as A,j as S}from"./chunk-D322LMSA.js";import{b as x,c as _,d as N}from"./chunk-A4L36SZS.js";import{f as b}from"./chunk-7S5E7KWT.js";var k=new Set(["identifier","type_identifier","field_identifier"]),v=new Set(["identifier"]),B=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),V=new Set(["rust","python"]),j=/\{([^{}]*)\}/g,O=/\b([A-Za-z_][\w]*)\b/g;function F(e,t){return P(t).has(e.type)}function R(e,t){return V.has(t)&&e.type==="string_content"}function y(e){let t=0;for(let n of e.values()){let c=n[n.length-1];c!==void 0&&c>t&&(t=c)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,c]of e)for(let u of c)r[u].add(n);return r}function P(e){return e==="rust"?k:e==="python"?v:B}function w(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(j)){let c=n[1]??"";for(let u of c.matchAll(O))u[1]&&t(u[1],r)}}var H=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],z=/^#!?\[\s*serde\s*\(/,U=/^#!?\[\s*schemars\s*\(/,G=/^#!?\[\s*validate\s*\(/,K=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function T(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let c=S(n);if(!c||!K.has(c))return;let u=e.namedChildren.find(i=>i.type==="arguments");if(!u)return;let a=u.namedChild(0);if(!a||a.type!=="string")return;let o=a.namedChildren.find(i=>i.type==="string_fragment");o&&r.add(o.text)}function D(e,t){let r=z.test(e),n=U.test(e),c=G.test(e);if(!(!r&&!n&&!c))for(let u of H){u.lastIndex=0;let a;for(;(a=u.exec(e))!==null;){let o=a[1],i=o.split("::").pop()??o;i==="is_none"&&/\bOption\b/.test(o)||i==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||i&&t.add(i)}}}function E(e,t){let r=new Map,n=(a,o)=>{if(a===o)return;let i=r.get(a);i||(i=new Set,r.set(a,i)),i.add(o)},c=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),u=(a,o)=>{let i=s=>{c.has(s.type)&&s.text!==o&&n(s.text,o);for(let l of s.children)i(l)};for(let s of a.children)i(s)};if(t==="rust")for(let a of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=a.namedChildren.find(s=>s.type==="type_identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="field_declaration_list"||s.type==="enum_variant_list"||s.type==="ordered_field_declaration_list");i&&u(i,o),a.type==="type_item"&&u(a,o)}else if(t==="python")for(let a of e.rootNode.descendantsOfType("class_definition")){let o=a.namedChildren.find(s=>s.type==="identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="block");if(i)for(let s of i.descendantsOfType("type"))for(let l of s.descendantsOfType("identifier"))l.text!==o&&n(l.text,o)}else for(let a of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=a.namedChildren.find(i=>i.type==="type_identifier")?.text;o&&u(a,o)}return r}var Y=b("source-facts",{clearGroups:["whole-project","source-file"]});function f(e,t){let r=h(e,t);if(!r)return null;let n=J(t,r);return n?Y.get(e,t,r,()=>Q(e,t,n,r)):null}function J(e,t){return d(e)?L(t)?.language??null:m(e)}function Q(e,t,r,n){let c=x(e,t,n),u=_(e,"source-facts",t,c);if(u){let i=q(u);if(i&&i.language===r)return i}let a=g(e,t);if(!a)return null;let o=$(a,r);return N(e,"source-facts",t,c,Z(o)),o}function Z(e){let t={language:e.language,callables:e.callables,callSites:e.callSites,typeContainerMap:[...e.typeContainerMap.entries()].map(([r,n])=>[r,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function q(e){try{let t=JSON.parse(e),r=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,typeContainerMap:new Map(t.typeContainerMap.map(([n,c])=>[n,new Set(c)])),identifierLineMap:r,identifiersByLine:y(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function W(e,t,r,n){let c=f(e,t);return c?X(c,r,n)?.isLiteralPassthrough??!0:!0}function X(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function $(e,t){let r=[],n=[],c=new Set,u=new Set,a=new Map,o=(s,l)=>{let p=a.get(s);if(!p){a.set(s,[l]);return}p[p.length-1]!==l&&p.push(l)},i=s=>{let l=C(s,t);l&&r.push(l);let p=A(s,t);p&&n.push(p),T(s,t,u),t==="rust"&&(s.type==="attribute_item"||s.type==="inner_attribute_item")&&D(s.text,c),F(s,t)&&o(s.text,s.startPosition.row),R(s,t)&&w(s,o);for(let M of s.children)i(M)};return i(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:E(e,t),identifierLineMap:a,identifiersByLine:y(a),fileIdentifiers:new Set(a.keys()),rustAttrReferencedNames:c,crossLanguageDispatchNames:u}}var I=new Set(["rust","typescript","tsx","javascript","python"]);function ee(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function te(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callSites}function re(e,t){return f(e,t)?.typeContainerMap??new Map}function ne(e,t,r={}){let n=f(e,t);if(!n)return[];let c=[];if(r.includeCrossLanguageDispatchNames)for(let u of n.crossLanguageDispatchNames)c.push({name:u,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let u of n.rustAttrReferencedNames)c.push({name:u,kind:"rust-attribute",occurrences:1});return c}export{f as a,W as b,ee as c,te as d,re as e,ne as f};
2
- //# sourceMappingURL=chunk-QLNGUWR7.js.map
1
+ import{a as C}from"./chunk-YZA6PPZL.js";import{a as m,b as d,c as _,d as g}from"./chunk-BTCASU5J.js";import{a as x,i as N,j as S}from"./chunk-DS6QEB3G.js";import{b as h,d as L,e as A}from"./chunk-C6ROZBJA.js";import{f as b}from"./chunk-7S5E7KWT.js";var k=new Set(["identifier","type_identifier","field_identifier"]),v=new Set(["identifier"]),B=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),V=new Set(["rust","python"]),j=/\{([^{}]*)\}/g,O=/\b([A-Za-z_][\w]*)\b/g;function F(e,t){return P(t).has(e.type)}function R(e,t){return V.has(t)&&e.type==="string_content"}function y(e){let t=0;for(let n of e.values()){let c=n[n.length-1];c!==void 0&&c>t&&(t=c)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,c]of e)for(let u of c)r[u].add(n);return r}function P(e){return e==="rust"?k:e==="python"?v:B}function w(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(j)){let c=n[1]??"";for(let u of c.matchAll(O))u[1]&&t(u[1],r)}}var H=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],z=/^#!?\[\s*serde\s*\(/,U=/^#!?\[\s*schemars\s*\(/,G=/^#!?\[\s*validate\s*\(/,K=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function T(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let c=S(n);if(!c||!K.has(c))return;let u=e.namedChildren.find(i=>i.type==="arguments");if(!u)return;let a=u.namedChild(0);if(!a||a.type!=="string")return;let o=a.namedChildren.find(i=>i.type==="string_fragment");o&&r.add(o.text)}function D(e,t){let r=z.test(e),n=U.test(e),c=G.test(e);if(!(!r&&!n&&!c))for(let u of H){u.lastIndex=0;let a;for(;(a=u.exec(e))!==null;){let o=a[1],i=o.split("::").pop()??o;i==="is_none"&&/\bOption\b/.test(o)||i==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||i&&t.add(i)}}}function E(e,t){let r=new Map,n=(a,o)=>{if(a===o)return;let i=r.get(a);i||(i=new Set,r.set(a,i)),i.add(o)},c=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),u=(a,o)=>{let i=s=>{c.has(s.type)&&s.text!==o&&n(s.text,o);for(let l of s.children)i(l)};for(let s of a.children)i(s)};if(t==="rust")for(let a of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=a.namedChildren.find(s=>s.type==="type_identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="field_declaration_list"||s.type==="enum_variant_list"||s.type==="ordered_field_declaration_list");i&&u(i,o),a.type==="type_item"&&u(a,o)}else if(t==="python")for(let a of e.rootNode.descendantsOfType("class_definition")){let o=a.namedChildren.find(s=>s.type==="identifier")?.text;if(!o)continue;let i=a.namedChildren.find(s=>s.type==="block");if(i)for(let s of i.descendantsOfType("type"))for(let l of s.descendantsOfType("identifier"))l.text!==o&&n(l.text,o)}else for(let a of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=a.namedChildren.find(i=>i.type==="type_identifier")?.text;o&&u(a,o)}return r}var Y=b("source-facts",{clearGroups:["whole-project","source-file"]});function f(e,t){let r=x(e,t);if(!r)return null;let n=J(t,r);return n?Y.get(e,t,r,()=>Q(e,t,n,r)):null}function J(e,t){return d(e)?_(t)?.language??null:m(e)}function Q(e,t,r,n){let c=h(e,t,n),u=L(e,"source-facts",t,c);if(u){let i=q(u);if(i&&i.language===r)return i}let a=g(e,t);if(!a)return null;let o=$(a,r);return A(e,"source-facts",t,c,Z(o)),o}function Z(e){let t={language:e.language,callables:e.callables,callSites:e.callSites,typeContainerMap:[...e.typeContainerMap.entries()].map(([r,n])=>[r,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function q(e){try{let t=JSON.parse(e),r=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,typeContainerMap:new Map(t.typeContainerMap.map(([n,c])=>[n,new Set(c)])),identifierLineMap:r,identifiersByLine:y(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function W(e,t,r,n){let c=f(e,t);return c?X(c,r,n)?.isLiteralPassthrough??!0:!0}function X(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function $(e,t){let r=[],n=[],c=new Set,u=new Set,a=new Map,o=(s,l)=>{let p=a.get(s);if(!p){a.set(s,[l]);return}p[p.length-1]!==l&&p.push(l)},i=s=>{let l=C(s,t);l&&r.push(l);let p=N(s,t);p&&n.push(p),T(s,t,u),t==="rust"&&(s.type==="attribute_item"||s.type==="inner_attribute_item")&&D(s.text,c),F(s,t)&&o(s.text,s.startPosition.row),R(s,t)&&w(s,o);for(let M of s.children)i(M)};return i(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:E(e,t),identifierLineMap:a,identifiersByLine:y(a),fileIdentifiers:new Set(a.keys()),rustAttrReferencedNames:c,crossLanguageDispatchNames:u}}var I=new Set(["rust","typescript","tsx","javascript","python"]);function ee(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function te(e,t){let r=f(e,t);return!r||!I.has(r.language)?null:r.callSites}function re(e,t){return f(e,t)?.typeContainerMap??new Map}function ne(e,t,r={}){let n=f(e,t);if(!n)return[];let c=[];if(r.includeCrossLanguageDispatchNames)for(let u of n.crossLanguageDispatchNames)c.push({name:u,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let u of n.rustAttrReferencedNames)c.push({name:u,kind:"rust-attribute",occurrences:1});return c}export{f as a,W as b,ee as c,te as d,re as e,ne as f};
2
+ //# sourceMappingURL=chunk-6TDOT7B3.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-3ZYF3ELZ.js";import{a as f}from"./chunk-GZCQTZLK.js";import{a as c}from"./chunk-YTR4CO5S.js";import{c as m}from"./chunk-JM72FNGA.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
2
- //# sourceMappingURL=chunk-MUULWXSJ.js.map
1
+ import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-XPOZO76D.js";import{a as f}from"./chunk-YNSVAJR6.js";import{a as c}from"./chunk-ZMU6IWDK.js";import{c as m}from"./chunk-JM72FNGA.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
2
+ //# sourceMappingURL=chunk-7KJBH4IP.js.map
@@ -0,0 +1,4 @@
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
@@ -0,0 +1,3 @@
1
+ import{a as d}from"./chunk-64MNV6AB.js";import{c as S}from"./chunk-7S5E7KWT.js";import{readdirSync as p}from"fs";import{execFileSync as x}from"child_process";import{extname as l,join as y}from"path";var m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],F=[".vue"],f=[".tsx",".jsx"],g=[".vue"],_=[...f,...g],h=new Set(f),C=new Set(g),E=new Set(m.map(e=>e.toLowerCase())),O=[...E].sort().join(","),I=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function R(e,n={}){let o=n.includeIndexed??!0,s=n.includeAuxiliary??!0,t=n.extensions?.map(c=>c.toLowerCase()),i=t?new Set(t):E,u=t?[...i].sort().join(","):O,r=`${o?"1":"0"}|${s?"1":"0"}|${u}`;return N.get(e,r,()=>{let c=new Set;if(o)for(let a of d(e,{includeIgnored:!1}))i.has(l(a).toLowerCase())&&c.add(a);if(s)for(let a of w(e.config.projectRoot,i))e.isIgnored(a)||o&&c.has(a)||c.add(a);return[...c].sort()})}function X(e,n={}){let o=!1,s=!1;for(let t of R(e,{extensions:_})){if(n.scope&&!t.includes(n.scope))continue;let i=l(t).toLowerCase();if(o||=h.has(i),s||=C.has(i),o&&s)break}return{react:o,vue:s}}var N=S("source-files",{clearGroups:[]});function w(e,n){return T(e,n)??v(e,n)}function T(e,n){try{let o=x("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}),s=new Set;for(let t of o.split(`
2
+ `)){let i=t.trim();i&&n.has(l(i).toLowerCase())&&s.add(i)}return s}catch{return null}}function v(e,n){let o=new Set,s=t=>{let i=t?y(e,t):e,u;try{u=p(i,{withFileTypes:!0})}catch{return}for(let r of u)if(!I.has(r.name)){if(r.isDirectory()){s(t?`${t}/${r.name}`:r.name);continue}n.has(l(r.name).toLowerCase())&&o.add(t?`${t}/${r.name}`:r.name)}};return s(""),o}export{F as a,I as b,R as c,X as d};
3
+ //# sourceMappingURL=chunk-A536TEU4.js.map
@@ -1,2 +1,2 @@
1
- import{b as d,c as m}from"./chunk-ZQLO2SCU.js";import{a as B}from"./chunk-AUVBR62P.js";function F(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],a=new Set,l=new Set,f=[];function y(t,o){if(o>c)return;if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),g=u.indexOf(u.reduce((x,$)=>x<$?x:$)),p=[...u.slice(g,-1),...u.slice(0,g),u[g]],S=p.join(" -> ");b.has(S)||(b.add(S),i.push({path:p,kind:R(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)y(h,o+1);f.pop(),l.delete(t)}let b=new Set;for(let t of n.keys())a.has(t)||y(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=d(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":m(e)||m(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||d(e)==="entry"||d(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let a=n[n.length-1],l=i[i.length-1];if(a&&a===l)return!0}return!1}export{F as a};
2
- //# sourceMappingURL=chunk-CJJP64OC.js.map
1
+ import{b as d,c as m}from"./chunk-ANIOISCE.js";import{a as B}from"./chunk-2YI45TNM.js";function F(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],a=new Set,l=new Set,f=[];function y(t,o){if(o>c)return;if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),g=u.indexOf(u.reduce((x,$)=>x<$?x:$)),p=[...u.slice(g,-1),...u.slice(0,g),u[g]],S=p.join(" -> ");b.has(S)||(b.add(S),i.push({path:p,kind:R(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)y(h,o+1);f.pop(),l.delete(t)}let b=new Set;for(let t of n.keys())a.has(t)||y(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=d(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":m(e)||m(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||d(e)==="entry"||d(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let a=n[n.length-1],l=i[i.length-1];if(a&&a===l)return!0}return!1}export{F as a};
2
+ //# sourceMappingURL=chunk-AA7L7GKI.js.map
@@ -0,0 +1,40 @@
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,6 +1,6 @@
1
- import{a as E}from"./chunk-AUVBR62P.js";import{d as _}from"./chunk-JM72FNGA.js";import{a as b}from"./chunk-QLNGUWR7.js";import{c as P}from"./chunk-OBBDKQAG.js";import{d as p}from"./chunk-7S5E7KWT.js";import{existsSync as d,readFileSync as D,readdirSync as y}from"fs";import{join as l}from"path";var R={files:new Set,pathPrefixes:[]},x=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,F=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,j=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],C=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),I=4,M=p("package-surface",{clearGroups:["whole-project"]});function X(t){return M.get(t,()=>W(t.config.projectRoot))}function T(t,e){let r=X(t);return r.files.has(e)?!0:r.pathPrefixes.some(s=>e.startsWith(s))}function W(t){let e=new Set,r=[];for(let{manifest:s,packageRoot:i}of U(t))for(let n of B(s))G(t,i,n,e,r);return e.size===0&&r.length===0?R:{files:e,pathPrefixes:r}}function U(t){let e=[],r=k(t,"");return r&&e.push({manifest:r,packageRoot:""}),w(t,"",e,0),e}function w(t,e,r,s){if(s>=I)return;let i=l(t,e);if(d(i))for(let n of y(i,{withFileTypes:!0})){if(!n.isDirectory()||C.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name,o=k(t,a);o&&r.push({manifest:o,packageRoot:a}),w(t,a,r,s+1)}}function k(t,e){try{let r=D(l(t,e,"package.json"),"utf-8"),s=JSON.parse(r);return s&&typeof s=="object"?s:null}catch{return null}}function B(t){let e=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&e.push(t[s]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let s of Object.values(r))typeof s=="string"&&e.push(s);return $(t.exports,e),e}function $(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))$(r,e)}function G(t,e,r,s,i){let n=r.replace(/\\/g,"/").replace(/^\.\//,"");if(n===""||n.startsWith(".."))return;let a=n.indexOf("*");if(a>=0){let c=n.slice(0,a);for(let u of m(c))u!==""&&i.push(f(e,u));return}let o=n.replace(F,"");for(let c of m(o)){c===o&&c===n&&s.add(f(e,n));for(let u of j)L(t,s,e,c+u)}s.add(f(e,n))}function m(t){let e=[t];return x.test(t)&&(e.push(t.replace(x,"src/")),e.push(t.replace(x,""))),e}function L(t,e,r,s){let i=f(r,s);if(e.add(i),!s.startsWith("src/")||d(l(t,i)))return;let n=j.find(h=>s.endsWith(h));if(!n)return;let a=s.slice(0,-n.length);V(t,e,r,a,n);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),u=a.slice(o+1);for(let h of v(t,r,c,`${u}${n}`))e.add(h)}function V(t,e,r,s,i){let n=f(r,`${s}/index${i}`);d(l(t,n))&&e.add(n)}function v(t,e,r,s){let i=l(t,e,r);if(!d(i))return[];let n=[];for(let a of y(i,{withFileTypes:!0})){let o=`${r}/${a.name}`;a.isDirectory()?n.push(...v(t,e,o,s)):a.isFile()&&a.name===s&&n.push(f(e,o))}return n}function f(t,e){return t?`${t}/${e}`:e}function S(t){let e=g(t);return ct(e)?"test":ut(e)?"worker":ft(e)?"entry":gt(e)?"barrel":"source"}function H(t){return S(t)==="barrel"}function N(t){return K.get(t,()=>{let e=E(t),r=P(t).filter(n=>{let a=S(n);return a==="entry"||a==="worker"}),s=new Set,i=new Set;for(;r.length>0;){let n=r.shift();if(!s.has(n)){s.add(n),S(n)==="barrel"&&i.add(n);for(let a of e.get(n)??[])s.has(a)||r.push(a)}}return i})}var K=p("live-barrels",{clearGroups:["whole-project"]});function J(t,e){return N(t).has(g(e))}function yt(t){let e=N(t);return P(t).filter(r=>H(r)&&!e.has(r)&&!Q(t,r))}function Q(t,e){let r=g(e),s=b(t,r)?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
1
+ import{a as E}from"./chunk-2YI45TNM.js";import{d as _}from"./chunk-JM72FNGA.js";import{a as b}from"./chunk-6TDOT7B3.js";import{c as P}from"./chunk-A536TEU4.js";import{d as p}from"./chunk-7S5E7KWT.js";import{existsSync as d,readFileSync as D,readdirSync as y}from"fs";import{join as l}from"path";var R={files:new Set,pathPrefixes:[]},x=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,F=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,j=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],C=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),I=4,M=p("package-surface",{clearGroups:["whole-project"]});function X(t){return M.get(t,()=>W(t.config.projectRoot))}function T(t,e){let r=X(t);return r.files.has(e)?!0:r.pathPrefixes.some(s=>e.startsWith(s))}function W(t){let e=new Set,r=[];for(let{manifest:s,packageRoot:i}of U(t))for(let n of B(s))G(t,i,n,e,r);return e.size===0&&r.length===0?R:{files:e,pathPrefixes:r}}function U(t){let e=[],r=k(t,"");return r&&e.push({manifest:r,packageRoot:""}),w(t,"",e,0),e}function w(t,e,r,s){if(s>=I)return;let i=l(t,e);if(d(i))for(let n of y(i,{withFileTypes:!0})){if(!n.isDirectory()||C.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name,o=k(t,a);o&&r.push({manifest:o,packageRoot:a}),w(t,a,r,s+1)}}function k(t,e){try{let r=D(l(t,e,"package.json"),"utf-8"),s=JSON.parse(r);return s&&typeof s=="object"?s:null}catch{return null}}function B(t){let e=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&e.push(t[s]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let s of Object.values(r))typeof s=="string"&&e.push(s);return $(t.exports,e),e}function $(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))$(r,e)}function G(t,e,r,s,i){let n=r.replace(/\\/g,"/").replace(/^\.\//,"");if(n===""||n.startsWith(".."))return;let a=n.indexOf("*");if(a>=0){let c=n.slice(0,a);for(let u of m(c))u!==""&&i.push(f(e,u));return}let o=n.replace(F,"");for(let c of m(o)){c===o&&c===n&&s.add(f(e,n));for(let u of j)L(t,s,e,c+u)}s.add(f(e,n))}function m(t){let e=[t];return x.test(t)&&(e.push(t.replace(x,"src/")),e.push(t.replace(x,""))),e}function L(t,e,r,s){let i=f(r,s);if(e.add(i),!s.startsWith("src/")||d(l(t,i)))return;let n=j.find(h=>s.endsWith(h));if(!n)return;let a=s.slice(0,-n.length);V(t,e,r,a,n);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),u=a.slice(o+1);for(let h of v(t,r,c,`${u}${n}`))e.add(h)}function V(t,e,r,s,i){let n=f(r,`${s}/index${i}`);d(l(t,n))&&e.add(n)}function v(t,e,r,s){let i=l(t,e,r);if(!d(i))return[];let n=[];for(let a of y(i,{withFileTypes:!0})){let o=`${r}/${a.name}`;a.isDirectory()?n.push(...v(t,e,o,s)):a.isFile()&&a.name===s&&n.push(f(e,o))}return n}function f(t,e){return t?`${t}/${e}`:e}function S(t){let e=g(t);return ct(e)?"test":ut(e)?"worker":ft(e)?"entry":gt(e)?"barrel":"source"}function H(t){return S(t)==="barrel"}function N(t){return K.get(t,()=>{let e=E(t),r=P(t).filter(n=>{let a=S(n);return a==="entry"||a==="worker"}),s=new Set,i=new Set;for(;r.length>0;){let n=r.shift();if(!s.has(n)){s.add(n),S(n)==="barrel"&&i.add(n);for(let a of e.get(n)??[])s.has(a)||r.push(a)}}return i})}var K=p("live-barrels",{clearGroups:["whole-project"]});function J(t,e){return N(t).has(g(e))}function yt(t){let e=N(t);return P(t).filter(r=>H(r)&&!e.has(r)&&!Q(t,r))}function Q(t,e){let r=g(e),s=b(t,r)?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
2
2
  FROM defn_enclosing_ranges der
3
3
  JOIN documents d ON d.id = der.document_id
4
4
  WHERE d.relative_path = ?
5
5
  AND der.end_line - der.start_line >= 2`,r)?.n??0)>0}function jt(t,e){let r=S(e);return r==="entry"||r==="worker"||J(t,e)}function Tt(t,e,r){let s=g(r);if(T(t,s)||et(e,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>g(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(g(n)))||i.qualifiedVars?.some(n=>lt(e,n))||i.symbolPatterns?.some(n=>{try{return new RegExp(n).test(e)}catch{return!1}})):!1}var A=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Y=new Set(["default","generateMetadata","generateStaticParams"]),Z=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),q=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),z=new Set(["load","actions","entries",...A]),tt=new Set(["default"]);function et(t,e){let r=_(t);return r===""?!1:rt(e)?A.has(r):st(e)?Y.has(r):nt(e)?Z.has(r):it(e)?q.has(r):at(e)?z.has(r):ot(e)?tt.has(r):!1}function rt(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function nt(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function it(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function at(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function ot(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function ct(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function ut(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function ft(t){let e=t.split("/"),r=e[e.length-1]??t;return r==="cli.ts"||r==="cli.js"||r==="postinstall.ts"||r==="postinstall.js"||r==="main.ts"||r==="main.js"||r==="main.rs"||r==="main.go"||r==="main.py"||r==="build.rs"||r==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:r==="index.ts"||r==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:e.length<=2:!1}function gt(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function g(t){return t.replace(/\\/g,"/")}function lt(t,e){let r=e.lastIndexOf("/");if(r<0)return!1;let s=e.slice(0,r),i=e.slice(r+1);return t.includes(O(s)+"/")&&t.includes(O(i)+".")}function O(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{T as a,S as b,H as c,J as d,yt as e,jt as f,Tt as g};
6
- //# sourceMappingURL=chunk-ZQLO2SCU.js.map
6
+ //# sourceMappingURL=chunk-ANIOISCE.js.map
@@ -1,2 +1,2 @@
1
- import{a as I}from"./chunk-ICXVNWMI.js";import{a as H}from"./chunk-X7ZY6FFF.js";import{a as p}from"./chunk-FIB4JPEX.js";import{a as T}from"./chunk-YQH353VA.js";import{a as G}from"./chunk-3KLLFNT4.js";import{a as k}from"./chunk-EOZIZWW4.js";import{a as v,b as F}from"./chunk-4ZUJJRWT.js";import{b as D}from"./chunk-EYLXU575.js";import{b as S}from"./chunk-KRGBLZT2.js";import{a as j}from"./chunk-ESG4HBEF.js";import{a as w}from"./chunk-CFL2CNIF.js";import{a as P}from"./chunk-Z4VHYJ5U.js";import{a as A}from"./chunk-TM6GVHA6.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?P(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?k(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,C=s?w(t,e,{maxDepth:o,scope:n.scope}):[],i=A(t,e,{semantic:l}),d=v(t,e),g=F(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||C.length>0,file:i!==null||d.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:C,changeSurface:i,deps:d,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=S(t);if(!o)return n;let r=D(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:G(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
2
- //# sourceMappingURL=chunk-6UFMPECA.js.map
1
+ import{a as I}from"./chunk-BJWNO6BU.js";import{a as H}from"./chunk-FGTHPJON.js";import{a as p}from"./chunk-L4QKEQ4S.js";import{a as T}from"./chunk-24S6MYOC.js";import{a as G}from"./chunk-VOYOYC5T.js";import{a as k}from"./chunk-BJG67TCR.js";import{a as v,b as F}from"./chunk-5SMUKUV5.js";import{b as D}from"./chunk-C6BYNIH4.js";import{b as S}from"./chunk-KRGBLZT2.js";import{a as j}from"./chunk-RHKMQNFI.js";import{a as w}from"./chunk-FKUCFCLU.js";import{a as P}from"./chunk-EBIQY3RK.js";import{a as A}from"./chunk-3FYGJ2GY.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?P(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?k(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,C=s?w(t,e,{maxDepth:o,scope:n.scope}):[],i=A(t,e,{semantic:l}),d=v(t,e),g=F(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||C.length>0,file:i!==null||d.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:C,changeSurface:i,deps:d,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=S(t);if(!o)return n;let r=D(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:G(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
2
+ //# sourceMappingURL=chunk-B4EHYG6M.js.map
@@ -1,7 +1,7 @@
1
- import{b as k}from"./chunk-C3MZZ2ZN.js";import{a as D}from"./chunk-3ZYF3ELZ.js";import{f as y,g as v}from"./chunk-ZQLO2SCU.js";import{n as S}from"./chunk-HVTYSC26.js";import{f as L}from"./chunk-3UW7VM4H.js";import{c as h}from"./chunk-JM72FNGA.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||y(e,l.relativePath)||v(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(y(e,t.relativePath)||v(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
1
+ import{b as k}from"./chunk-FVA3NH4P.js";import{a as D}from"./chunk-XPOZO76D.js";import{f as y,g as v}from"./chunk-ANIOISCE.js";import{p as S}from"./chunk-AETMKBZR.js";import{f as L}from"./chunk-X3BJUFSN.js";import{c as h}from"./chunk-JM72FNGA.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||y(e,l.relativePath)||v(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(y(e,t.relativePath)||v(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
2
2
  FROM global_symbols gs
3
3
  JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
4
4
  JOIN documents d ON d.id = der.document_id
5
5
  WHERE gs.symbol = ?
6
6
  LIMIT 1`,n);return s?L(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=L(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
7
- //# sourceMappingURL=chunk-OLD6PBU6.js.map
7
+ //# sourceMappingURL=chunk-BEUQVBE3.js.map
@@ -1,2 +1,2 @@
1
- import{c as m}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-GZCQTZLK.js";import{a as g}from"./chunk-YTR4CO5S.js";import{o as y}from"./chunk-HVTYSC26.js";import{a as c}from"./chunk-MZ7APUFN.js";import{c as r}from"./chunk-JM72FNGA.js";function v(l,t,n={}){let o=c(l,t);if(!o)return null;let a=[{file:o.relativePath,line:o.startLine}],s=y(l,o,{semantic:n.semantic}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:i}=S(l,o,s,{semantic:n.semantic!==!1});return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:a.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:f.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:i.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function S(l,t,n,o){let a=m(g(l,t,{limit:30,semantic:o.semantic}).map(i=>({symbol:i.symbol,file:i.file}))),s=m(b(l,t,{limit:30,semantic:o.semantic})),f=s.length>0?s:m(n.map(i=>({symbol:i.enclosingSymbol==="(top-level)"?i.file:i.enclosingSymbol,file:i.file})));return{producers:a,consumers:f}}export{v as a};
2
- //# sourceMappingURL=chunk-EOZIZWW4.js.map
1
+ import{c as m}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-YNSVAJR6.js";import{a as g}from"./chunk-ZMU6IWDK.js";import{q as y}from"./chunk-AETMKBZR.js";import{a as c}from"./chunk-T633QLYF.js";import{c as r}from"./chunk-JM72FNGA.js";function v(l,t,n={}){let o=c(l,t);if(!o)return null;let a=[{file:o.relativePath,line:o.startLine}],s=y(l,o,{semantic:n.semantic}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:i}=S(l,o,s,{semantic:n.semantic!==!1});return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:a.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:f.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:i.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function S(l,t,n,o){let a=m(g(l,t,{limit:30,semantic:o.semantic}).map(i=>({symbol:i.symbol,file:i.file}))),s=m(b(l,t,{limit:30,semantic:o.semantic})),f=s.length>0?s:m(n.map(i=>({symbol:i.enclosingSymbol==="(top-level)"?i.file:i.enclosingSymbol,file:i.file})));return{producers:a,consumers:f}}export{v as a};
2
+ //# sourceMappingURL=chunk-BJG67TCR.js.map
@@ -1,4 +1,4 @@
1
- import{b as m}from"./chunk-CTCAF3YA.js";import{i as o}from"./chunk-3UW7VM4H.js";function h(t,l){let s=m(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
1
+ import{b as m}from"./chunk-LGX2Y4BA.js";import{i as o}from"./chunk-X3BJUFSN.js";function h(t,l){let s=m(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
2
2
  WHERE relative_path IN (${d})
3
3
  ORDER BY relative_path`,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e)),n=o(t,i,{onlyDocumented:!0,sort:!0}).map(({relativePath:e,...c})=>c),a=t.all(`SELECT DISTINCT d2.relative_path
4
4
  FROM mentions m
@@ -32,4 +32,4 @@ import{b as m}from"./chunk-CTCAF3YA.js";import{i as o}from"./chunk-3UW7VM4H.js";
32
32
  WHERE d2.relative_path IN (${d})
33
33
  AND d1.relative_path NOT IN (${d})
34
34
  ORDER BY d1.relative_path`,...s,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e));return{files:i,symbols:n,dependsOn:a,dependedOnBy:r}}export{h as a};
35
- //# sourceMappingURL=chunk-ICXVNWMI.js.map
35
+ //# sourceMappingURL=chunk-BJWNO6BU.js.map