scip-query 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +2 -1
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/{chunk-ECVXWZ4Q.js → chunk-27HMTUJE.js} +2 -2
  5. package/dist/{chunk-2LQWMYG4.js → chunk-27XEGMCT.js} +2 -2
  6. package/dist/{chunk-NKT5EMEX.js → chunk-2TPCIPYA.js} +2 -2
  7. package/dist/{chunk-ZOIPAYRP.js → chunk-2XRXEIRK.js} +2 -2
  8. package/dist/{chunk-Q3B3FNCU.js → chunk-3AMWF6V5.js} +2 -2
  9. package/dist/{chunk-BVNO67DB.js → chunk-3H5OSDF7.js} +2 -2
  10. package/dist/{chunk-D64L53WX.js → chunk-43GKP6LI.js} +2 -2
  11. package/dist/{chunk-F5BJSNU5.js → chunk-44P4SJFN.js} +2 -2
  12. package/dist/{chunk-T7VQG55Q.js → chunk-5JRMZMLM.js} +2 -2
  13. package/dist/{chunk-72MFTCU5.js → chunk-5VY3RIEI.js} +2 -2
  14. package/dist/{chunk-D7J6GZAG.js → chunk-6JUAGXR4.js} +2 -2
  15. package/dist/{chunk-NQ75OVUU.js → chunk-6KDOYKCB.js} +2 -2
  16. package/dist/chunk-6KMTPNZL.js +3 -0
  17. package/dist/{chunk-TTMKELT7.js → chunk-72FR7KEZ.js} +2 -2
  18. package/dist/{chunk-FXG3PHVW.js → chunk-7COVQPQQ.js} +6 -6
  19. package/dist/{chunk-MBKJ7GHT.js → chunk-7TVFPOD7.js} +2 -2
  20. package/dist/{chunk-M72ZFN6E.js → chunk-A6KSEIRN.js} +2 -2
  21. package/dist/{chunk-52Q4JFDW.js → chunk-AAMURYOK.js} +2 -2
  22. package/dist/{chunk-XEMQUN3Z.js → chunk-BP7S6V3M.js} +2 -2
  23. package/dist/{chunk-ETU2I5JM.js → chunk-BRBF3E5X.js} +2 -2
  24. package/dist/{chunk-V7CVBPWX.js → chunk-BUNDZ6K2.js} +2 -2
  25. package/dist/{chunk-NAH5EAZS.js → chunk-BZXE3HO4.js} +2 -2
  26. package/dist/{chunk-AZLKLZ5S.js → chunk-CXQQOXSI.js} +2 -2
  27. package/dist/{chunk-RIQED5OU.js → chunk-EDSD3VJK.js} +2 -2
  28. package/dist/chunk-EVZSAR3S.js +2 -0
  29. package/dist/{chunk-L2CX5GHZ.js → chunk-GMOEX7EV.js} +2 -2
  30. package/dist/{chunk-O3WDE26W.js → chunk-GUDKRIGW.js} +2 -2
  31. package/dist/{chunk-MKM7NBZK.js → chunk-GULVO6NF.js} +2 -2
  32. package/dist/{chunk-V3Z3IOWO.js → chunk-GY3HAWUA.js} +2 -2
  33. package/dist/{chunk-G2UBOONK.js → chunk-HV27H2V2.js} +2 -2
  34. package/dist/chunk-HZZQKNVE.js +2 -0
  35. package/dist/{chunk-T6NGEV5I.js → chunk-I4R3SNMR.js} +2 -2
  36. package/dist/{chunk-UAHZ57BR.js → chunk-IMQFJ53K.js} +2 -2
  37. package/dist/{chunk-NJJ7AS4F.js → chunk-IUSSGHJO.js} +2 -2
  38. package/dist/{chunk-OVMUVXKQ.js → chunk-JJUX2OAP.js} +2 -2
  39. package/dist/chunk-JZBGTSAB.js +13 -0
  40. package/dist/{chunk-YPKBZ77R.js → chunk-K5N5RNGM.js} +2 -2
  41. package/dist/{chunk-OSWF3HSF.js → chunk-K7SPOJHZ.js} +2 -2
  42. package/dist/{chunk-BCNT6ODA.js → chunk-KSJ544IV.js} +2 -2
  43. package/dist/{chunk-HSU3M25J.js → chunk-KYB7FPXT.js} +2 -2
  44. package/dist/{chunk-ORBRX2QJ.js → chunk-LY7NMOBW.js} +2 -2
  45. package/dist/{chunk-CW3KZ7UF.js → chunk-M7EEHYSU.js} +2 -2
  46. package/dist/{chunk-U7I373V4.js → chunk-N23FT4EZ.js} +2 -2
  47. package/dist/{chunk-ZRIOGL7F.js → chunk-N2OTJWC2.js} +2 -2
  48. package/dist/{chunk-PH7ZFK6L.js → chunk-NCVFKOLB.js} +2 -2
  49. package/dist/{chunk-2QGE5AEP.js → chunk-NOKUZU56.js} +2 -2
  50. package/dist/{chunk-BP2NAIAZ.js → chunk-OXTM2RX3.js} +2 -2
  51. package/dist/{chunk-RA5MTIOO.js → chunk-PEHDARNC.js} +2 -2
  52. package/dist/chunk-PESEPWZO.js +2 -0
  53. package/dist/{chunk-LFM3O5KX.js → chunk-PMY4UFGV.js} +2 -2
  54. package/dist/{chunk-H7NSJ7L2.js → chunk-Q7PWDXL5.js} +2 -2
  55. package/dist/{chunk-FBCOFKEC.js → chunk-QVGFVRKD.js} +2 -2
  56. package/dist/{chunk-Q7S2DADC.js → chunk-QYOPMTZ6.js} +2 -2
  57. package/dist/{chunk-VYF5HA76.js → chunk-QZOAOLLZ.js} +2 -2
  58. package/dist/{chunk-NLMRJ7SI.js → chunk-R7U2I55B.js} +2 -2
  59. package/dist/{chunk-64PRNLKP.js → chunk-RLB6SG25.js} +2 -2
  60. package/dist/{chunk-MJKJMWIM.js → chunk-SFDVBARK.js} +2 -2
  61. package/dist/{chunk-B4VYXRCQ.js → chunk-TYCZ7S4I.js} +2 -2
  62. package/dist/{chunk-4D54JIU3.js → chunk-U3VMUDXJ.js} +2 -2
  63. package/dist/chunk-UHPWZCYQ.js +3 -0
  64. package/dist/{chunk-OPE5YXFE.js → chunk-V5W7H7V4.js} +2 -2
  65. package/dist/{chunk-YDDGCJJG.js → chunk-WMO2VZZK.js} +2 -2
  66. package/dist/chunk-WPZPB42I.js +2 -0
  67. package/dist/{chunk-EXKLAEB4.js → chunk-X3DTIEMU.js} +2 -2
  68. package/dist/chunk-X5C43YVI.js +2 -0
  69. package/dist/{chunk-FERAXG6Y.js → chunk-X7CHWTZ2.js} +1 -1
  70. package/dist/{chunk-IRJDYTNZ.js → chunk-XC2PJOVM.js} +2 -2
  71. package/dist/{chunk-Z3IPJKJP.js → chunk-XDESMVOL.js} +2 -2
  72. package/dist/{chunk-KSUZS77X.js → chunk-XZBLZHXL.js} +2 -2
  73. package/dist/{chunk-7ITCOJGD.js → chunk-YQKECTPV.js} +2 -2
  74. package/dist/chunk-YTVKPJXW.js +2 -0
  75. package/dist/{chunk-75X52JTA.js → chunk-ZEO4CXQR.js} +2 -2
  76. package/dist/cli.js +259 -246
  77. package/dist/index.js +1 -1
  78. package/dist/queries/affected.js +1 -1
  79. package/dist/queries/bottlenecks.js +1 -1
  80. package/dist/queries/by-kind.js +1 -1
  81. package/dist/queries/call-graph.js +1 -1
  82. package/dist/queries/change-surface.js +1 -1
  83. package/dist/queries/cleanup-plan.js +1 -1
  84. package/dist/queries/co-change.js +1 -1
  85. package/dist/queries/code.js +1 -1
  86. package/dist/queries/complexity-hotspots.js +1 -1
  87. package/dist/queries/complexity.js +1 -1
  88. package/dist/queries/convergence.js +1 -1
  89. package/dist/queries/coupling.js +1 -1
  90. package/dist/queries/cycles.js +1 -1
  91. package/dist/queries/dataflow.js +1 -1
  92. package/dist/queries/dead.js +1 -1
  93. package/dist/queries/decorative-checkers.d.ts +34 -0
  94. package/dist/queries/decorative-checkers.js +2 -0
  95. package/dist/queries/deep-chains.js +1 -1
  96. package/dist/queries/deps.js +1 -1
  97. package/dist/queries/diff-gate.js +1 -1
  98. package/dist/queries/diff-impact.js +1 -1
  99. package/dist/queries/doc-drift.js +1 -1
  100. package/dist/queries/drift.js +1 -1
  101. package/dist/queries/duplicate-bodies.js +1 -1
  102. package/dist/queries/extract-candidates.js +1 -1
  103. package/dist/queries/fan.js +1 -1
  104. package/dist/queries/health.js +1 -1
  105. package/dist/queries/hierarchy.js +1 -1
  106. package/dist/queries/hotspots.js +1 -1
  107. package/dist/queries/imports.js +1 -1
  108. package/dist/queries/incomplete-migration.js +1 -1
  109. package/dist/queries/index.d.ts +3 -0
  110. package/dist/queries/index.js +1 -1
  111. package/dist/queries/isolated.js +1 -1
  112. package/dist/queries/locality-candidates.js +1 -1
  113. package/dist/queries/members.js +1 -1
  114. package/dist/queries/methods.js +1 -1
  115. package/dist/queries/not-implemented.d.ts +33 -0
  116. package/dist/queries/not-implemented.js +2 -0
  117. package/dist/queries/outline.js +1 -1
  118. package/dist/queries/passthrough-candidates.js +1 -1
  119. package/dist/queries/plan-context.js +1 -1
  120. package/dist/queries/recent-duplicates.js +1 -1
  121. package/dist/queries/redundant-reexports.js +1 -1
  122. package/dist/queries/refs.js +1 -1
  123. package/dist/queries/self-audit.js +1 -1
  124. package/dist/queries/similar-chains.js +1 -1
  125. package/dist/queries/similar-files.js +1 -1
  126. package/dist/queries/similar-signatures.js +1 -1
  127. package/dist/queries/similar.js +1 -1
  128. package/dist/queries/slice.js +1 -1
  129. package/dist/queries/stale-abstractions.js +1 -1
  130. package/dist/queries/surface.js +1 -1
  131. package/dist/queries/symbols.js +1 -1
  132. package/dist/queries/system.js +1 -1
  133. package/dist/queries/test-quality.d.ts +56 -0
  134. package/dist/queries/test-quality.js +2 -0
  135. package/dist/queries/trace.js +1 -1
  136. package/dist/queries/twin-ab.js +1 -1
  137. package/dist/queries/twin-drift.d.ts +23 -1
  138. package/dist/queries/twin-drift.js +1 -1
  139. package/dist/queries/unused-imports.js +1 -1
  140. package/dist/queries/unused-params.js +1 -1
  141. package/dist/queries/wrapper-candidates.js +1 -1
  142. package/dist/reindex-worker.js +12 -11
  143. package/dist/reindex.js +20 -19
  144. package/dist/runtime.js +1 -1
  145. package/docs/COMMAND_REFERENCE.md +4 -1
  146. package/docs/analyzer-inventory.md +16 -0
  147. package/package.json +14 -2
  148. package/skills/_shared/SKILL.md +4 -1
  149. package/skills/scip-calibrate/SKILL.md +124 -0
  150. package/skills/scip-calibrate/agents/openai.yaml +4 -0
  151. package/skills/scip-integrity-audit/SKILL.md +32 -0
  152. package/skills/scip-tla-model-system/SKILL.md +7 -9
  153. package/dist/chunk-EDB7Y442.js +0 -2
  154. package/dist/chunk-EZ5WDZ2Q.js +0 -3
  155. package/dist/chunk-H2NMIZFD.js +0 -2
  156. package/dist/chunk-HXXMPYEF.js +0 -2
  157. package/dist/chunk-PXHPCWX5.js +0 -2
  158. package/dist/chunk-T2FQ4GHD.js +0 -9
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to `scip-query` are documented here. This file starts at 0.11.0; everything below covers behavior changes made since the 0.10.12 release.
4
4
 
5
+ ## [0.14.0]
6
+
7
+ ### Breaking (behavior change for one config key)
8
+
9
+ - **A non-empty `indexer.typescript.projects` list is now authoritative.** When set, exactly the listed projects are indexed: automatic tsconfig discovery does not run and the repo root is no longer re-added alongside the list (even when the root tsconfig covers subdirectories). Files covered only by an excluded root tsconfig (e.g. shared ambient `.d.ts` files) drop out of the index — pick the list deliberately. An empty or absent list falls back to full discovery, unchanged. Previously the configured list was merged additively with discovery, which made it impossible to exclude a whole-repo root shard.
10
+
11
+ ### Notable (new capabilities)
12
+
13
+ - **Per-project TypeScript shard caching in workspace mode.** With `indexer.typescript.projectMode: "workspace"`, each tsconfig project shard now has its own fingerprint and cached SCIP artifact (`language-indexes/typescript-projects/`); a reindex after an edit reruns only the changed projects and their dependents instead of every shard. Dependency edges come from workspace `package.json` dependencies and tsconfig `paths`/`references` targets (resolved through `extends` chains); unparseable manifests fail toward depend-on-everything, so the cache can over-invalidate but never serve a stale shard. Every per-project reuse decision appears in `reindex --json` shard diagnostics with an explicit miss reason (`typescript:<project>` entries). Metadata stays v3-additive: older binaries ignore the new field, and older metadata simply classifies every project as a miss. Measured on a 2,438-file four-package monorepo: full rebuild 57s (single mode) → 27s; reindex after an edit in a leaf package 35s → 9.5s.
14
+
5
15
  ## [0.11.0]
6
16
 
7
17
  ### Breaking (one-way doors — read before upgrading)
package/README.md CHANGED
@@ -294,6 +294,7 @@ One-line "essential difference" per skill — read this table before the Routes
294
294
  | `scip-cleanup-improve` | Autonomously fix confirmed findings. |
295
295
  | `scip-maintainability` | Is this well-organized (scattered concepts, accidental variation)? |
296
296
  | `scip-integrity-audit` | Is this real (decorative checkers, faked implementations, dead fallback-hidden paths)? |
297
+ | `scip-calibrate` | Measure detector precision on a repo before trusting scores or gating anyone. |
297
298
  | `scip-twin-drift` | Same-name implementations that drifted apart. |
298
299
  | `scip-claim-audit` | Status words derived vs asserted. |
299
300
  | `scip-probe-reachability` | Prove parser/AST branches actually fire. |
@@ -379,7 +380,7 @@ Vue single-file components are handled through the JavaScript/TypeScript indexer
379
380
 
380
381
  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.
381
382
 
382
- 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.
383
+ 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. When `projects` is set to a non-empty list, it is authoritative: only the listed projects are indexed, automatic discovery does not run, and the repo root is not re-added alongside them (even if the root tsconfig covers subdirectories) — files that are only covered by an excluded root tsconfig (e.g. shared ambient `.d.ts` files) drop out of the index, so pick the list deliberately. An empty or absent `projects` falls back to full discovery, unchanged. Workspace mode also caches each project shard: reindexing after an edit reruns only the changed projects and their dependents (workspace `package.json` dependencies and tsconfig `paths`/`references` targets count as dependencies), serves untouched projects from `language-indexes/typescript-projects/`, and reports every reuse decision in `reindex --json` shard diagnostics. Set `indexerConcurrency` when a repo needs a persistent worker cap; CLI `--indexer-concurrency` and `SCIP_QUERY_INDEXER_CONCURRENCY` still override ad hoc runs.
383
384
  Use `indexer.typescript.pnpmWorkspaces` only with the default single-project mode; workspace mode passes explicit projects instead.
384
385
 
385
386
  Clojure projects can pass a project-local `scip-clojure` config file through `.scipquery.json`:
@@ -1,2 +1,2 @@
1
- import{e as t}from"./chunk-FERAXG6Y.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{e as t}from"./chunk-X7CHWTZ2.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,3 +1,3 @@
1
- import{a as y,b as d,e as b,n as C}from"./chunk-MBKJ7GHT.js";import{c as M,d as L,e as Q,g as I,h as E,i as K}from"./chunk-HXXMPYEF.js";function se(e,n){return O(e,n).match}function O(e,n){let t=z(e,n.trim()).filter(r=>!e.isIgnored(r.relative_path));if(t.length>0)return S(e,t);let o=G(e,n);if(o&&!e.isIgnored(o.relative_path))return S(e,[o]);let i=W(e,n);return i.length>0?S(e,i):X(e,n)}function W(e,n){let t=N(n),o=x(t);if(!o)return[];let i=`%${o.path}%`,r=o.leaf;return j(e,i,r,t)}function j(e,n,t,o){let i=b([],[...q(e,n,t),...T(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>f(r,o)>1);return i.sort((r,a)=>f(a,o)-f(r,o)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),i}function q(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function T(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function X(e,n){let t=N(n),o=P(n),i=V(e,o),r=ee(i,n,t).filter(s=>!e.isIgnored(s.relative_path));if(r.length>0)return S(e,r);let a=[];for(let s of i){if(e.isIgnored(s.relative_path))continue;let c=Y(s,n,t,o);c<=0||a.push({row:s,score:c})}return a.sort((s,c)=>c.score-s.score||s.row.end_line-s.row.start_line-(c.row.end_line-c.row.start_line)||s.row.relative_path.localeCompare(c.row.relative_path)||s.row.symbol.localeCompare(c.row.symbol)),S(e,a.map(s=>s.row))}function S(e,n){let t=n.map(i=>C(e,i)),o=t[0]??null;return{match:o,candidates:o?Z(t,o):[],total:t.length}}function Z(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let i of e){let r=`${i.symbolId}:${i.relativePath}:${i.startLine}`;if(!t.has(r)&&(t.add(r),o.push({symbol:i.symbol,shortName:L(i.symbol),relativePath:i.relativePath,startLine:i.startLine}),o.length>=5))break}return o}function G(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return;let[,o,i,r]=t,a=Math.max(0,parseInt(i,10)-1),s=Math.max(a,parseInt(r,10)-1);return H(e,o,a,s)??J(e,o,a,s)}function H(e,n,t,o){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function J(e,n,t,o){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function le(e,n){let t=z(e,n).find(o=>!e.isIgnored(o.relative_path));return t?C(e,t):null}function z(e,n){let t=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return b(t,o)}function ce(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=U(e,n.symbolId)[0];return t?C(e,t):null}function U(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return b(t,o)}function V(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(s=>{let c=`%${s}%`;return[c,c,c]}),i=t.join(`
1
+ import{a as y,b as d,e as b,n as C}from"./chunk-7TVFPOD7.js";import{c as M,d as L,e as Q,g as I,h as E,i as K}from"./chunk-X5C43YVI.js";function se(e,n){return O(e,n).match}function O(e,n){let t=z(e,n.trim()).filter(r=>!e.isIgnored(r.relative_path));if(t.length>0)return S(e,t);let o=G(e,n);if(o&&!e.isIgnored(o.relative_path))return S(e,[o]);let i=W(e,n);return i.length>0?S(e,i):X(e,n)}function W(e,n){let t=N(n),o=x(t);if(!o)return[];let i=`%${o.path}%`,r=o.leaf;return j(e,i,r,t)}function j(e,n,t,o){let i=b([],[...q(e,n,t),...T(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>f(r,o)>1);return i.sort((r,a)=>f(a,o)-f(r,o)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),i}function q(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function T(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function X(e,n){let t=N(n),o=P(n),i=V(e,o),r=ee(i,n,t).filter(s=>!e.isIgnored(s.relative_path));if(r.length>0)return S(e,r);let a=[];for(let s of i){if(e.isIgnored(s.relative_path))continue;let c=Y(s,n,t,o);c<=0||a.push({row:s,score:c})}return a.sort((s,c)=>c.score-s.score||s.row.end_line-s.row.start_line-(c.row.end_line-c.row.start_line)||s.row.relative_path.localeCompare(c.row.relative_path)||s.row.symbol.localeCompare(c.row.symbol)),S(e,a.map(s=>s.row))}function S(e,n){let t=n.map(i=>C(e,i)),o=t[0]??null;return{match:o,candidates:o?Z(t,o):[],total:t.length}}function Z(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let i of e){let r=`${i.symbolId}:${i.relativePath}:${i.startLine}`;if(!t.has(r)&&(t.add(r),o.push({symbol:i.symbol,shortName:L(i.symbol),relativePath:i.relativePath,startLine:i.startLine}),o.length>=5))break}return o}function G(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return;let[,o,i,r]=t,a=Math.max(0,parseInt(i,10)-1),s=Math.max(a,parseInt(r,10)-1);return H(e,o,a,s)??J(e,o,a,s)}function H(e,n,t,o){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function J(e,n,t,o){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function le(e,n){let t=z(e,n).find(o=>!e.isIgnored(o.relative_path));return t?C(e,t):null}function z(e,n){let t=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return b(t,o)}function ce(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=U(e,n.symbolId)[0];return t?C(e,t):null}function U(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return b(t,o)}function V(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(s=>{let c=`%${s}%`;return[c,c,c]}),i=t.join(`
2
2
  AND `),r=y(e,{where:i,params:o,limit:200}),a=d(e,{where:i,params:o,limit:200});return b(r,a)}function Y(e,n,t,o){let i=n.trim(),r=t,a=r.replace(/\(\)$/,""),s=n.toLowerCase(),c=t.toLowerCase(),h=c.replace(/\(\)$/,""),k=e.symbol,v=L(e.symbol),g=Q(e.symbol),A=e.display_name??"",w=e.symbol.toLowerCase(),m=v.toLowerCase(),u=g.toLowerCase(),D=A.toLowerCase(),p=e.relative_path.toLowerCase(),F=/[/:.]/.test(t),$=x(t),_=$?.leaf.toLowerCase(),l=0;return(k===i||k===r)&&(l+=1150),(v===i||v===r)&&(l+=1100),A===a&&(l+=1180),g===a&&(l+=1160),(`${g}()`===i||`${g}()`===r)&&(l+=955),(w===s||w===c)&&(l+=1e3),(m===s||m===c)&&(l+=950),(p===s||p===c)&&(l+=925),(p.endsWith(`/${c}`)||p.endsWith(`/${s}`))&&(l+=875),D===h&&(l+=850),u===h&&(l+=825),(`${u}()`===s||`${u}()`===c)&&(l+=820),(m.endsWith(`:${c}`)||m.endsWith(`:${h}`)||m.endsWith(`:${h}()`))&&(l+=800),w.includes(c)&&(l+=120),m.includes(c)&&(l+=140),p.includes(c)&&(l+=140),D.includes(c)&&(l+=110),o.every(B=>{let R=B.toLowerCase();return w.includes(R)||m.includes(R)||p.includes(R)||D.includes(R)})&&(l+=100+o.length*15),$&&p.includes($.path.toLowerCase())&&(l+=360,_&&(u===_||`${u}()`===_||`${u}()`==`${_}()`)&&(l+=700),I(e.symbol)&&(l+=180)),E(e.symbol)&&u===h&&(l+=60),!F&&K(e.symbol)&&(l-=160),l-=Math.min(50,Math.max(0,e.end_line-e.start_line)),l}function x(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let o=n.slice(t+1).replace(/\(\)$/,"");return!o||o.includes(".")?null:{path:n.slice(0,t),leaf:o}}function N(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function P(e){let n=N(e),t=n.split(/[^A-Za-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>0);return t.length>0?[...new Set(t)]:[n]}function ee(e,n,t){let o=n.trim(),i=e.filter(r=>{let a=L(r.symbol),s=(r.display_name??"").trim();return r.symbol===o||a===o||a===t||s===o||s===t||`${s}()`===o||f(r,t)>1||r.relative_path===o});return i.length===0?[]:(i.sort((r,a)=>f(a,t)-f(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),i)}function f(e,n){let t=x(n);if(!t)return 0;let o=e.relative_path.toLowerCase(),i=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return o.includes(r)?i!==a?1:I(e.symbol)?M(e.symbol)===null?5:4:M(e.symbol)===null?3:2:0}export{se as a,O as b,le as c,ce as d};
3
- //# sourceMappingURL=chunk-ECVXWZ4Q.js.map
3
+ //# sourceMappingURL=chunk-27HMTUJE.js.map
@@ -1,7 +1,7 @@
1
- import{a as j}from"./chunk-QARYU7R3.js";import{a as N,b as g,c as W}from"./chunk-T6NGEV5I.js";import{a as _}from"./chunk-K6UI6EBZ.js";import{a as E}from"./chunk-B75HZHUP.js";import{a as P}from"./chunk-UAHZ57BR.js";import{a as k}from"./chunk-BGBBVSH4.js";import{g as C}from"./chunk-72MFTCU5.js";import{a as w}from"./chunk-MKM7NBZK.js";import{m as L}from"./chunk-MBKJ7GHT.js";import{d,e as y,k as v}from"./chunk-HXXMPYEF.js";import{g as x}from"./chunk-T2FQ4GHD.js";import{l as S}from"./chunk-WS3Z6W3M.js";import{basename as m,extname as b}from"path";function ae(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new P(t),s=z(r.fileDependencyGraph(e));return _({candidates:()=>B(t,r,e,i),orderCandidates:E,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:l=>({callerFileMap:A(t,r,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>O(t,r,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function A(t,n,e,i){let a=N(t,n),o=g(a.forDefinitions(e,{semantic:!1,sourceFallback:!1})),r=[];i.semantic&&S("wrapper.semantic-candidates",()=>{r=e.filter(c=>F(t,n,c,o).length<=1)},()=>({symbols:e.length,semanticCandidates:r.length}));let s=r.length===0?new Map:g(a.forDefinitions(r,{semantic:!0,sourceFallback:!1})),l=s.size===0?o:C(o,s),u=new Map(e.map(c=>[c.symbolId,c])),f=new Map;for(let c of e){let I=F(t,n,c,l);if(I.length>1||(f.set(c.symbolId,c),I.length!==1))continue;let D=I[0],M=R(t,c.symbolId,D);if(!M)continue;let p=T(n,t,D,c.symbol,M);p?.isFunctionLike&&u.has(p.symbolId)&&f.set(p.symbolId,u.get(p.symbolId))}let h=[...f.values()];return h.length===0?l:C(l,g(a.forDefinitions(h,{semantic:!1,sourceFallback:!0})))}function O(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=R(t,e.symbolId,o);if(!r)return null;let s=T(n,t,o,e.symbol,r);if(s&&v(s.symbol))return null;let{fanIn:l,source:u}=J(i.callerFileMap,i.reverseFanIn,o,s);if(u==="function"?l<=3:l<=5)return null;let f=H(t,e,o,s);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:k(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?d(s.symbol):m(o),callerFanIn:l,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function B(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0}).filter(a=>!x(t,a))}function F(t,n,e,i){let a=m(e.relativePath,b(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>m(r,b(r))!==a).filter(r=>{let s=n.fileKind(r);return s!=="barrel"&&s!=="entry"&&s!=="test"});return W(t,e,o).realConsumers}function R(t,n,e){return t.get(`SELECT c.start_line, c.end_line
1
+ import{a as j}from"./chunk-QARYU7R3.js";import{a as N,b as g,c as W}from"./chunk-I4R3SNMR.js";import{a as _}from"./chunk-K6UI6EBZ.js";import{a as E}from"./chunk-B75HZHUP.js";import{a as P}from"./chunk-IMQFJ53K.js";import{a as k}from"./chunk-BGBBVSH4.js";import{g as C}from"./chunk-5VY3RIEI.js";import{a as w}from"./chunk-GULVO6NF.js";import{m as L}from"./chunk-7TVFPOD7.js";import{d,e as y,k as v}from"./chunk-X5C43YVI.js";import{i as x}from"./chunk-JZBGTSAB.js";import{l as S}from"./chunk-WS3Z6W3M.js";import{basename as m,extname as b}from"path";function ae(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new P(t),s=z(r.fileDependencyGraph(e));return _({candidates:()=>B(t,r,e,i),orderCandidates:E,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:l=>({callerFileMap:A(t,r,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>O(t,r,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function A(t,n,e,i){let a=N(t,n),o=g(a.forDefinitions(e,{semantic:!1,sourceFallback:!1})),r=[];i.semantic&&S("wrapper.semantic-candidates",()=>{r=e.filter(c=>F(t,n,c,o).length<=1)},()=>({symbols:e.length,semanticCandidates:r.length}));let s=r.length===0?new Map:g(a.forDefinitions(r,{semantic:!0,sourceFallback:!1})),l=s.size===0?o:C(o,s),u=new Map(e.map(c=>[c.symbolId,c])),f=new Map;for(let c of e){let I=F(t,n,c,l);if(I.length>1||(f.set(c.symbolId,c),I.length!==1))continue;let D=I[0],M=R(t,c.symbolId,D);if(!M)continue;let p=T(n,t,D,c.symbol,M);p?.isFunctionLike&&u.has(p.symbolId)&&f.set(p.symbolId,u.get(p.symbolId))}let h=[...f.values()];return h.length===0?l:C(l,g(a.forDefinitions(h,{semantic:!1,sourceFallback:!0})))}function O(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=R(t,e.symbolId,o);if(!r)return null;let s=T(n,t,o,e.symbol,r);if(s&&v(s.symbol))return null;let{fanIn:l,source:u}=J(i.callerFileMap,i.reverseFanIn,o,s);if(u==="function"?l<=3:l<=5)return null;let f=H(t,e,o,s);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:k(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?d(s.symbol):m(o),callerFanIn:l,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function B(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0}).filter(a=>!x(t,a))}function F(t,n,e,i){let a=m(e.relativePath,b(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>m(r,b(r))!==a).filter(r=>{let s=n.fileKind(r);return s!=="barrel"&&s!=="entry"&&s!=="test"});return W(t,e,o).realConsumers}function R(t,n,e){return t.get(`SELECT c.start_line, c.end_line
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d ON c.document_id = d.id
5
5
  WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
6
  LIMIT 1`,n,e)}function T(t,n,e,i,a){let o=t.definitionsForFile(e),r=q(n,e,i,a.start_line,a.end_line);return L(o,r)}function J(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:G(n,e),source:"file"}}function q(t,n,e,i,a){let o=y(e);if(!o)return i;let r=w(t,n).get(o);if(!r||r.length===0)return i;for(let s of r)if(s>=i&&s<=a)return s;return i}function z(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function G(t,n){let e=t.get(n)??0;if(e>0)return e;let i=m(n,b(n)),a=0;for(let[o,r]of t)o!==n&&m(o,b(o))===i&&r>a&&(a=r);return a}function H(t,n,e,i){return j(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):m(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ae as a};
7
- //# sourceMappingURL=chunk-2LQWMYG4.js.map
7
+ //# sourceMappingURL=chunk-27XEGMCT.js.map
@@ -1,2 +1,2 @@
1
- import{a as f}from"./chunk-UAHZ57BR.js";import{a as L}from"./chunk-ECVXWZ4Q.js";import{d as i,e as b,f as u,l as c}from"./chunk-HXXMPYEF.js";import{d as l}from"./chunk-T2FQ4GHD.js";import{x as a}from"./chunk-ISLWJ4PY.js";function S(o,s){let t=L(o,s);if(!t)return[];let e=new f(o).definitionsForFile(t.relativePath).filter(r=>r.symbol!==t.symbol).filter(r=>c(t.symbol,r.symbol)).sort((r,m)=>r.startLine-m.startLine||r.endLine-m.endLine).map(r=>({symbol:r.symbol,shortName:i(r.symbol),startLine:r.startLine,endLine:r.endLine,kind:u(r.symbol)??"unknown"}));return a(t.relativePath)!=="clojure"?e:d(e,y(o,t))}function y(o,s){let t=b(s.symbol);if(!t)return[];let n=i(s.symbol);return(l(o,s.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({symbol:`${s.symbol}${e.memberName}().`,shortName:`${n}:${e.memberName}()`,startLine:e.startLine,endLine:e.endLine,kind:e.memberKind}))}function d(o,s){let t=new Map;for(let n of[...o,...s])t.set(`${n.shortName}:${n.startLine}:${n.endLine}`,n);return[...t.values()].sort((n,e)=>n.startLine-e.startLine||n.endLine-e.endLine)}export{S as a};
2
- //# sourceMappingURL=chunk-NKT5EMEX.js.map
1
+ import{a as f}from"./chunk-IMQFJ53K.js";import{a as L}from"./chunk-27HMTUJE.js";import{d as i,e as b,f as u,l as c}from"./chunk-X5C43YVI.js";import{f as l}from"./chunk-JZBGTSAB.js";import{x as a}from"./chunk-ISLWJ4PY.js";function S(o,s){let t=L(o,s);if(!t)return[];let e=new f(o).definitionsForFile(t.relativePath).filter(r=>r.symbol!==t.symbol).filter(r=>c(t.symbol,r.symbol)).sort((r,m)=>r.startLine-m.startLine||r.endLine-m.endLine).map(r=>({symbol:r.symbol,shortName:i(r.symbol),startLine:r.startLine,endLine:r.endLine,kind:u(r.symbol)??"unknown"}));return a(t.relativePath)!=="clojure"?e:d(e,y(o,t))}function y(o,s){let t=b(s.symbol);if(!t)return[];let n=i(s.symbol);return(l(o,s.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({symbol:`${s.symbol}${e.memberName}().`,shortName:`${n}:${e.memberName}()`,startLine:e.startLine,endLine:e.endLine,kind:e.memberKind}))}function d(o,s){let t=new Map;for(let n of[...o,...s])t.set(`${n.shortName}:${n.startLine}:${n.endLine}`,n);return[...t.values()].sort((n,e)=>n.startLine-e.startLine||n.endLine-e.endLine)}export{S as a};
2
+ //# sourceMappingURL=chunk-2TPCIPYA.js.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-K6UI6EBZ.js";import{a as m}from"./chunk-UAHZ57BR.js";import{a as d}from"./chunk-BGBBVSH4.js";import{d as u}from"./chunk-HXXMPYEF.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
- //# sourceMappingURL=chunk-ZOIPAYRP.js.map
1
+ import{a as g}from"./chunk-K6UI6EBZ.js";import{a as m}from"./chunk-IMQFJ53K.js";import{a as d}from"./chunk-BGBBVSH4.js";import{d as u}from"./chunk-X5C43YVI.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
+ //# sourceMappingURL=chunk-2XRXEIRK.js.map
@@ -1,3 +1,3 @@
1
- import{b as p}from"./chunk-FXG3PHVW.js";import{b as B}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-BGBBVSH4.js";import{g}from"./chunk-MBKJ7GHT.js";import{d as f}from"./chunk-HXXMPYEF.js";import{b as y}from"./chunk-T2FQ4GHD.js";import{p as d}from"./chunk-WS3Z6W3M.js";import{createHash as C}from"crypto";var b=3;function w(n,t={}){let{scope:e,maxLoc:o=15,minLoc:i=b,limit:r,scanLimit:a}=t,l=p(n),u=L(n,{scope:e,maxLoc:o,scanLimit:a}).map(s=>h(n,s,l,i)).filter(s=>s!==null),c=I(u);return r?c.slice(0,r):c}function H(n,t,e={}){let{scope:o,maxLoc:i=15,minLoc:r=b,scanLimit:a}=e,l=p(n),u=L(n,{scope:o,maxLoc:i,scanLimit:a}).map(s=>h(n,s,l,r)).filter(s=>s!==null),c=u.find(s=>s.symbol===t);return c?u.filter(s=>s.symbol!==c.symbol&&s.normalizedBody===c.normalizedBody&&s.file!==c.file).sort(z).map(({normalizedBody:s,...S})=>S):[]}function A(n){let t=E(n);return y(t).replace(/\s+/g,"")}function I(n){let t=new Map;for(let o of n){if(o.normalizedBody.length<8)continue;let i=W(o.normalizedBody),r=t.get(i)??[];r.push(o),t.set(i,r)}let e=[];for(let[o,i]of t){let r=new Set(i.map(l=>l.file));if(i.length<2||r.size<2)continue;let a=[...i].sort(z).map(({normalizedBody:l,...u})=>u);e.push({hash:o,canonical:a[0],functions:a})}return e.sort((o,i)=>{let r=i.functions.length-o.functions.length;if(r!==0)return r;let a=D(i)-D(o);return a!==0?a:o.canonical.file.localeCompare(i.canonical.file)}),e}function L(n,t){let e=g(n,{scope:t.scope}).filter(o=>o.isFunctionLike&&!n.isIgnored(o.relativePath)).filter(o=>m(o)<=t.maxLoc);return e.sort((o,i)=>m(i)-m(o)||o.relativePath.localeCompare(i.relativePath)),B(e,t.scanLimit)}function h(n,t,e,o){let i=x(n,t);if(!i||P(i)<o)return null;let r=v(n,t);return r?{symbol:t.symbol,shortName:f(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:e?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function v(n,t){let e=x(n,t);return e&&A(e)||null}function x(n,t){let e=d(n,t.relativePath);return e?e.split(/\r?\n/).slice(t.startLine,t.endLine+1).join(`
1
+ import{c as p}from"./chunk-7COVQPQQ.js";import{b as B}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-BGBBVSH4.js";import{g}from"./chunk-7TVFPOD7.js";import{d as f}from"./chunk-X5C43YVI.js";import{b as y}from"./chunk-JZBGTSAB.js";import{p as d}from"./chunk-WS3Z6W3M.js";import{createHash as C}from"crypto";var b=3;function w(n,t={}){let{scope:e,maxLoc:o=15,minLoc:i=b,limit:r,scanLimit:a}=t,l=p(n),u=L(n,{scope:e,maxLoc:o,scanLimit:a}).map(s=>h(n,s,l,i)).filter(s=>s!==null),c=I(u);return r?c.slice(0,r):c}function H(n,t,e={}){let{scope:o,maxLoc:i=15,minLoc:r=b,scanLimit:a}=e,l=p(n),u=L(n,{scope:o,maxLoc:i,scanLimit:a}).map(s=>h(n,s,l,r)).filter(s=>s!==null),c=u.find(s=>s.symbol===t);return c?u.filter(s=>s.symbol!==c.symbol&&s.normalizedBody===c.normalizedBody&&s.file!==c.file).sort(z).map(({normalizedBody:s,...S})=>S):[]}function A(n){let t=E(n);return y(t).replace(/\s+/g,"")}function I(n){let t=new Map;for(let o of n){if(o.normalizedBody.length<8)continue;let i=W(o.normalizedBody),r=t.get(i)??[];r.push(o),t.set(i,r)}let e=[];for(let[o,i]of t){let r=new Set(i.map(l=>l.file));if(i.length<2||r.size<2)continue;let a=[...i].sort(z).map(({normalizedBody:l,...u})=>u);e.push({hash:o,canonical:a[0],functions:a})}return e.sort((o,i)=>{let r=i.functions.length-o.functions.length;if(r!==0)return r;let a=D(i)-D(o);return a!==0?a:o.canonical.file.localeCompare(i.canonical.file)}),e}function L(n,t){let e=g(n,{scope:t.scope}).filter(o=>o.isFunctionLike&&!n.isIgnored(o.relativePath)).filter(o=>m(o)<=t.maxLoc);return e.sort((o,i)=>m(i)-m(o)||o.relativePath.localeCompare(i.relativePath)),B(e,t.scanLimit)}function h(n,t,e,o){let i=x(n,t);if(!i||P(i)<o)return null;let r=v(n,t);return r?{symbol:t.symbol,shortName:f(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:e?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function v(n,t){let e=x(n,t);return e&&A(e)||null}function x(n,t){let e=d(n,t.relativePath);return e?e.split(/\r?\n/).slice(t.startLine,t.endLine+1).join(`
2
2
  `):null}function E(n){let t=n.indexOf("{"),e=n.lastIndexOf("}");if(t>=0&&e>t)return n.slice(t+1,e);let o=n.indexOf("=>");return o>=0?n.slice(o+2).replace(/;+\s*$/,""):n}function P(n){return E(n).split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0).length}function W(n){return C("sha256").update(n).digest("hex").slice(0,16)}function z(n,t){let e=n.ageCommits??-1;return(t.ageCommits??-1)-e||n.file.localeCompare(t.file)||n.startLine-t.startLine}function D(n){return n.functions.reduce((t,e)=>t+e.loc,0)}export{w as a,H as b,A as c,I as d,v as e,x as f,E as g};
3
- //# sourceMappingURL=chunk-Q3B3FNCU.js.map
3
+ //# sourceMappingURL=chunk-3AMWF6V5.js.map
@@ -1,2 +1,2 @@
1
- import{c as m}from"./chunk-B75HZHUP.js";import{a as g,c as b}from"./chunk-72MFTCU5.js";import{q as y}from"./chunk-MKM7NBZK.js";import{a as c}from"./chunk-ECVXWZ4Q.js";import{d as r}from"./chunk-HXXMPYEF.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-BVNO67DB.js.map
1
+ import{c as m}from"./chunk-B75HZHUP.js";import{a as g,c as b}from"./chunk-5VY3RIEI.js";import{q as y}from"./chunk-GULVO6NF.js";import{a as c}from"./chunk-27HMTUJE.js";import{d as r}from"./chunk-X5C43YVI.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-3H5OSDF7.js.map
@@ -1,3 +1,3 @@
1
- import{a as d}from"./chunk-ECVXWZ4Q.js";import{b as g,d as m}from"./chunk-HXXMPYEF.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-27HMTUJE.js";import{b as g,d as m}from"./chunk-X5C43YVI.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-D64L53WX.js.map
3
+ //# sourceMappingURL=chunk-43GKP6LI.js.map
@@ -1,6 +1,6 @@
1
- import{a as m}from"./chunk-OSWF3HSF.js";import{a as h}from"./chunk-ECVXWZ4Q.js";import{d as g}from"./chunk-HXXMPYEF.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let i=h(t,e);return i?R(t,i,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),i;try{i=f(r,"utf-8")}catch{return null}let n=i.split(`
1
+ import{a as m}from"./chunk-K7SPOJHZ.js";import{a as h}from"./chunk-27HMTUJE.js";import{d as g}from"./chunk-X5C43YVI.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let i=h(t,e);return i?R(t,i,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),i;try{i=f(r,"utf-8")}catch{return null}let n=i.split(`
2
2
  `),c=Math.max(0,e.startLine-a),l=Math.min(n.length-1,e.endLine+a),u=n.slice(c,l+1).join(`
3
3
  `);return{symbol:e.symbol,shortName:g(e.symbol),relativePath:e.relativePath,startLine:c,endLine:l,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let i=m(t,e);if(!i)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",i);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),l;try{l=f(c,"utf-8")}catch{return null}let u=l.split(`
4
4
  `),o=Math.max(0,a-1-r),p=Math.min(u.length-1,s-1+r),b=u.slice(o,p+1).join(`
5
5
  `);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:p,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
6
- //# sourceMappingURL=chunk-F5BJSNU5.js.map
6
+ //# sourceMappingURL=chunk-44P4SJFN.js.map
@@ -1,2 +1,2 @@
1
- import{a as u}from"./chunk-UAHZ57BR.js";import{a as h}from"./chunk-72MFTCU5.js";import{q as S}from"./chunk-MKM7NBZK.js";import{a as d,c as b}from"./chunk-ECVXWZ4Q.js";import{m as y}from"./chunk-MBKJ7GHT.js";import{d as m}from"./chunk-HXXMPYEF.js";function v(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=d(e,o);return r?c==="backward"?w(e,r,s,{semantic:l.semantic!==!1}):M(e,r,{semantic:l.semantic!==!1}):null}function w(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let p of t){let g=h(e,p,{semantic:c.semantic});for(let a of g){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function M(e,o,l){let c=new Set,s=[],r=new u(e);for(let t of S(e,o,{semantic:l.semantic})){if(s.length>=30)break;let n=t.enclosingSymbol??y(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{v as a};
2
- //# sourceMappingURL=chunk-T7VQG55Q.js.map
1
+ import{a as u}from"./chunk-IMQFJ53K.js";import{a as h}from"./chunk-5VY3RIEI.js";import{q as S}from"./chunk-GULVO6NF.js";import{a as d,c as b}from"./chunk-27HMTUJE.js";import{m as y}from"./chunk-7TVFPOD7.js";import{d as m}from"./chunk-X5C43YVI.js";function v(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=d(e,o);return r?c==="backward"?w(e,r,s,{semantic:l.semantic!==!1}):M(e,r,{semantic:l.semantic!==!1}):null}function w(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let p of t){let g=h(e,p,{semantic:c.semantic});for(let a of g){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function M(e,o,l){let c=new Set,s=[],r=new u(e);for(let t of S(e,o,{semantic:l.semantic})){if(s.length>=30)break;let n=t.enclosingSymbol??y(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{v as a};
2
+ //# sourceMappingURL=chunk-5JRMZMLM.js.map
@@ -1,4 +1,4 @@
1
- import{b as oe,f as ie,g as A,h as N,i as x,o as me,p as de}from"./chunk-MKM7NBZK.js";import{a as ae,b as se,d as le,e as re,f as ce}from"./chunk-YDDGCJJG.js";import{a as q}from"./chunk-XEMQUN3Z.js";import{d as ue,e as fe}from"./chunk-MTDBHTSF.js";import{f as ee,g as v,l as ne,m as te}from"./chunk-MBKJ7GHT.js";import{e as E,g as X}from"./chunk-HXXMPYEF.js";import{i as w,k as Y,m as Z}from"./chunk-T2FQ4GHD.js";import{x as I}from"./chunk-ISLWJ4PY.js";import{a as J,b as P,d as W,f as V,k as z,l as L,p as T}from"./chunk-WS3Z6W3M.js";import{c as U}from"./chunk-GNG622H3.js";import{a as Q}from"./chunk-64MNV6AB.js";import{c as K,d as B}from"./chunk-7S5E7KWT.js";function un(e,n,t={}){let o=ye(e,[n],{additive:t.additive,semantic:t.semantic}),i=t.callableOnly?(o.get(n.symbolId)??[]).filter(a=>X(a.symbol)||a.source==="ast-callsite"):o.get(n.symbolId)??[];return typeof t.limit=="number"?i.slice(0,t.limit):i}function be(e,n,t={}){let o=Re(e)?Ie(e,n,{semantic:t.semantic!==!1}):_e(e).get(n.symbolId)??[];return typeof t.limit=="number"?o.slice(0,t.limit):o}var Ce=B("caller-rows",{clearGroups:["whole-project"]}),Me=2e4;function Re(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Me}function _e(e){return Ce.get(e,()=>{let n=v(e),t=ye(e,n),o=new Map;for(let s of n)o.set(s.symbol,s.symbolId);let i=new Map,a=new Map;for(let s of n){let l=t.get(s.symbolId);if(!(!l||l.length===0))for(let c of l){let m=o.get(c.symbol);if(m===void 0||m===s.symbolId)continue;let d=i.get(m);d||(d=[],i.set(m,d),a.set(m,new Set));let f=`${s.symbol}|${s.relativePath}`;a.get(m).has(f)||(a.get(m).add(f),d.push({symbol:s.symbol,file:s.relativePath,source:"caller-map-inversion"}))}}return i})}function Ie(e,n,t){let o=[],i=new Set,a=l=>{if(l.symbol===n.symbol)return;let c=`${l.symbol}|${l.file}`;i.has(c)||(i.add(c),o.push(l))};for(let l of de(e,n))l.file!==n.relativePath&&a({symbol:l.enclosingSymbol??l.file,file:l.file,source:"resolved-reference"});let s=t.semantic?Le(e,n):null;if(s)for(let l of le(e,s)){if(l.file===n.relativePath||e.isIgnored(l.file))continue;let c=te(ee(e,l.file),l.line);a({symbol:c?.symbol??l.file,file:l.file,source:"semantic-reference"})}return o}function Le(e,n){let t=ue().join(", "),o=fe().join(", ");return e.get(`SELECT
1
+ import{b as oe,f as ie,g as A,h as N,i as x,o as me,p as de}from"./chunk-GULVO6NF.js";import{a as ae,b as se,d as le,e as re,f as ce}from"./chunk-WMO2VZZK.js";import{a as q}from"./chunk-BP7S6V3M.js";import{d as ue,e as fe}from"./chunk-MTDBHTSF.js";import{f as ee,g as v,l as ne,m as te}from"./chunk-7TVFPOD7.js";import{e as E,g as X}from"./chunk-X5C43YVI.js";import{k as w,m as Y,o as Z}from"./chunk-JZBGTSAB.js";import{x as I}from"./chunk-ISLWJ4PY.js";import{a as J,b as P,d as W,f as V,k as z,l as L,p as T}from"./chunk-WS3Z6W3M.js";import{c as U}from"./chunk-GNG622H3.js";import{a as Q}from"./chunk-64MNV6AB.js";import{c as K,d as B}from"./chunk-7S5E7KWT.js";function un(e,n,t={}){let o=ye(e,[n],{additive:t.additive,semantic:t.semantic}),i=t.callableOnly?(o.get(n.symbolId)??[]).filter(a=>X(a.symbol)||a.source==="ast-callsite"):o.get(n.symbolId)??[];return typeof t.limit=="number"?i.slice(0,t.limit):i}function be(e,n,t={}){let o=Re(e)?Ie(e,n,{semantic:t.semantic!==!1}):_e(e).get(n.symbolId)??[];return typeof t.limit=="number"?o.slice(0,t.limit):o}var Ce=B("caller-rows",{clearGroups:["whole-project"]}),Me=2e4;function Re(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Me}function _e(e){return Ce.get(e,()=>{let n=v(e),t=ye(e,n),o=new Map;for(let s of n)o.set(s.symbol,s.symbolId);let i=new Map,a=new Map;for(let s of n){let l=t.get(s.symbolId);if(!(!l||l.length===0))for(let c of l){let m=o.get(c.symbol);if(m===void 0||m===s.symbolId)continue;let d=i.get(m);d||(d=[],i.set(m,d),a.set(m,new Set));let f=`${s.symbol}|${s.relativePath}`;a.get(m).has(f)||(a.get(m).add(f),d.push({symbol:s.symbol,file:s.relativePath,source:"caller-map-inversion"}))}}return i})}function Ie(e,n,t){let o=[],i=new Set,a=l=>{if(l.symbol===n.symbol)return;let c=`${l.symbol}|${l.file}`;i.has(c)||(i.add(c),o.push(l))};for(let l of de(e,n))l.file!==n.relativePath&&a({symbol:l.enclosingSymbol??l.file,file:l.file,source:"resolved-reference"});let s=t.semantic?Le(e,n):null;if(s)for(let l of le(e,s)){if(l.file===n.relativePath||e.isIgnored(l.file))continue;let c=te(ee(e,l.file),l.line);a({symbol:c?.symbol??l.file,file:l.file,source:"semantic-reference"})}return o}function Le(e,n){let t=ue().join(", "),o=fe().join(", ");return e.get(`SELECT
2
2
  d.id AS documentId,
3
3
  gs.id AS symbolId,
4
4
  gs.symbol,
@@ -35,4 +35,4 @@ import{b as oe,f as ie,g as A,h as N,i as x,o as me,p as de}from"./chunk-MKM7NBZ
35
35
  ) def_chunk ON def_chunk.symbol_id = gs.id
36
36
  WHERE gs.id IN (${r.map(()=>"?").join(",")})`,...r,...r)),l=j([...n.map(r=>r.documentId),...s.flatMap(r=>r.document_id===null?[]:[r.document_id])]),c=new Map(l.flatMap(r=>e.all(`SELECT id, relative_path FROM documents
37
37
  WHERE id IN (${r.map(()=>"?").join(",")})`,...r).map(u=>[u.id,u.relative_path]))),m=new Map;for(let r of s)m.has(r.symbol_id)||m.set(r.symbol_id,{symbol:r.symbol,file:r.document_id!==null?c.get(r.document_id)??"":""});let d=new Map,f=c,R=Oe(n);for(let[r,u]of R){let g=[...i.get(r)??[]].sort((p,h)=>p.start_line-h.start_line||p.end_line-h.end_line),D=[...u].sort((p,h)=>p.startLine-h.startLine||p.endLine-h.endLine),M=new Set,S=0;for(let p of D){for(;S<g.length&&g[S].start_line<=p.endLine;)M.add(g[S]),S+=1;for(let y of M)y.end_line<p.startLine&&M.delete(y);let h=new Set,$=[],F=null,Se=()=>{if(F)return F;let y=f.get(p.documentId)??"",C=new Set;if(y){let O=oe(e,y),k=Math.max(0,p.startLine),G=Math.min(O.length-1,p.endLine);for(let _=k;_<=G;_+=1)for(let he of O[_])C.add(he)}return F=C,C};for(let y of M){if(y.symbol_id===p.symbolId)continue;let C=m.get(y.symbol_id);if(!C)continue;if(!(y.start_line>=p.startLine&&y.end_line<=p.endLine)){if(!(y.start_line<=p.endLine&&y.end_line>=p.startLine))continue;let _=E(C.symbol);if(!_||!Se().has(_))continue}let k=`${C.symbol}|${y.chunk_id}`;h.has(k)||(h.add(k),$.push({...C,chunkId:y.chunk_id,source:"scip-chunk"}))}d.set(p.symbolId,$)}}return d}var pe=500;function j(e){let n=[...new Set(e)],t=[];for(let o=0;o<n.length;o+=pe)t.push(n.slice(o,o+pe));return t}function Oe(e){let n=new Map;for(let t of e){let o=n.get(t.documentId);o?o.push(t):n.set(t.documentId,[t])}return n}function Pe(e){let n=new Map;for(let[t,o]of e){let i=[];for(let a of o)i.push({symbol:a.symbol,file:a.file,chunkId:-1,source:"semantic-callee"});n.set(t,i)}return n}function ge(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let i=Q(e,{includeIgnored:!1}),a=x(e),s=n??v(e),l=new Set(s.map(m=>m.symbolId)),c=Be(s);return Te(e,o,i,a,l,c),je(e,o,s,l),Ke(e,o,i,a,l,c),t.semantic!==!1&&We(o,re(e,Je(s))),o}function Te(e,n,t,o,i,a){for(let s of t){if(!I(s))continue;let l=w(e,s);if(l)for(let c of l){if(a&&!a.has(c.calleeLeaf))continue;let m=A(s,o.get(c.calleeLeaf)??[]);if(!m||m.length===0)continue;let d=N(e,s,m,c.memberAccess);d&&i.has(d.symbolId)&&d.file!==s&&H(n,d.symbolId,s)}}}function je(e,n,t,o){let i=$e(t);for(let a of He(e,o))e.isIgnored(a.relative_path)||Ge(a,i.get(a.symbol_id))||H(n,a.symbol_id,a.relative_path)}function He(e,n){return ie(e,n?[...n]:void 0)}function $e(e){let n=new Map;for(let t of e)n.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return n}function Ge(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function Ke(e,n,t,o,i,a){for(let s of t){if(I(s)!=="rust")continue;let l=Y(e,s,{includeRustAttributeNames:!0});if(l.length!==0)for(let{name:c}of l){if(a&&!a.has(c))continue;let m=o.get(c);if(m)for(let d of m)i.has(d.symbolId)&&d.file!==s&&H(n,d.symbolId,s)}}}function H(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function Be(e){let n=new Set;for(let t of e){let o="leaf"in t&&typeof t.leaf=="string"?t.leaf:"symbol"in t&&typeof t.symbol=="string"?E(t.symbol):"";o&&n.add(o)}return n.size>0?n:null}function Je(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function We(e,n){for(let[t,o]of n){let i=e.get(t);i||(i=new Set,e.set(t,i));for(let a of o)i.add(a)}}function Ln(e,n,t={}){return be(e,n,t)}function Ve(e,n,t={}){return ge(e,n,t)}function Qe(e,n,t={}){return me(e,n,t)}function wn(e,n,t={}){let o=Ve(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:Ue(o,Qe(e,n))}function Ue(e,n){let t=new Map;for(let[o,i]of e)t.set(o,new Set(i));for(let[o,i]of n){let a=t.get(o)??new Set;for(let s of i)a.add(s);t.set(o,a)}return t}export{un as a,ye as b,Ln as c,Ve as d,Qe as e,wn as f,Ue as g};
38
- //# sourceMappingURL=chunk-72MFTCU5.js.map
38
+ //# sourceMappingURL=chunk-5VY3RIEI.js.map
@@ -1,4 +1,4 @@
1
- import{a as I,b as D,c as $,d as B}from"./chunk-T6NGEV5I.js";import{a as K}from"./chunk-K6UI6EBZ.js";import{a as A}from"./chunk-UAHZ57BR.js";import{b as M,g as R}from"./chunk-NAH5EAZS.js";import{a as b}from"./chunk-BGBBVSH4.js";import{g as x}from"./chunk-72MFTCU5.js";import{b as F,d as w,e as p}from"./chunk-HXXMPYEF.js";import{j as k}from"./chunk-T2FQ4GHD.js";import{p as h}from"./chunk-WS3Z6W3M.js";function me(t,e){let{scope:n,minLoc:s=3,maxLoc:i=80,limit:r=30,includeLowConfidence:o=!1,scanLimit:l}=e??{},d=e?.semantic!==!1,a=new A(t),m=a.scopedDefinitions(n),g=Q(a,n),T={high:0,medium:1,low:2};return K({candidates:()=>O(t,a,m,{minLoc:s,maxLoc:i}),orderCandidates:(u,c)=>b(c)-b(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:l,profile:{name:"stale-abstractions"},prepare:u=>{let c=W(u),f=U(t,a,u,c,{semantic:d}),y=u.filter(P=>{let S=C(t,P,f,c);return S.realConsumers.length<=1&&!S.transitivelyReachable&&j(P,S.realConsumers.length,g)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,y,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=C(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!j(f.definition,f.realConsumers.length,g))return null;let y=z(t,f);return!o&&y.confidence==="low"?null:y},orderResults:(u,c)=>T[u.confidence]-T[c.confidence]||c.loc-u.loc||u.file.localeCompare(c.file)||u.startLine-c.startLine,limit:r})}function O(t,e,n,s){return n.filter(i=>i.isTypeLike&&b(i)>=s.minLoc).filter(i=>b(i)<=s.maxLoc).filter(i=>!t.isIgnored(i.relativePath)).filter(i=>M(i.relativePath)!=="test").filter(i=>!R(t,i.symbol,i.relativePath)).filter(i=>!X(i.symbol)).filter(i=>!e.hasSuppressionComment(i))}function v(t,e,n,s){return D(I(t,e).forDefinitions(n,{semantic:s.semantic,sourceFallback:s.sourceFallback}))}function U(t,e,n,s,i){let r=v(t,e,n,{semantic:!1,sourceFallback:!1}),o=n.filter(a=>{let m=C(t,a,r,s);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&L(a.relativePath))}),l=i.semantic&&o.length>0?x(r,v(t,e,o,{semantic:!0,sourceFallback:!1})):r,d=o.filter(a=>C(t,a,l,s).realConsumers.length<=1);return x(l,v(t,e,d,{semantic:!1,sourceFallback:!0}))}function W(t){let e=new Map;for(let n of t){let s=e.get(n.relativePath);s||(s=new Map,e.set(n.relativePath,s));let i=p(n.symbol);i&&s.set(i,n)}return e}function C(t,e,n,s){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:o,barrelConsumers:l,importOnlyConsumers:d}=$(t,e,r),a=Y(t,e,n,s);return{definition:e,realConsumers:o,barrelConsumers:l+d,transitivelyReachable:a}}function z(t,e){let n=E(t,e.definition.relativePath,e.definition.startLine),s=L(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:i,reason:r}=ne(e.realConsumers.length,n,s),o=V(e.realConsumers.length,n,s);return{symbol:e.definition.symbol,shortName:w(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:b(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:s,confidence:i,reason:r,actionTier:o.actionTier,stalenessKind:o.stalenessKind,recommendation:o.recommendation}}function V(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,s,i){let r=_(t,Z(n),s),o=r.map(a=>a.singleton);if(r.length===0)return new Set;let l=D(I(t,e).forDefinitions(o,{semantic:i.semantic,sourceFallback:!0})),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,l)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let s=p(n.symbol);s&&e.set(N(n.relativePath,s),n)}return e}function _(t,e,n){let s=[];for(let i of n){let r=q(t,e,i);r&&s.push({singleton:r,classId:i.symbolId})}return s}function q(t,e,n){if(E(t,n.relativePath,n.startLine)!=="class")return null;let s=p(n.symbol);if(!s)return null;let i=J(t,n.relativePath,s);return i?e.get(N(n.relativePath,i))??null:null}function G(t,e,n){let s=p(e.symbol),i=n.get(e.symbolId);return!s||!i?!1:[...i].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!B(t,r,s))}function N(t,e){return`${t}\0${e}`}function J(t,e,n){let s=h(t,e);if(!s)return null;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${i}\\s*\\(`);return s.match(r)?.[1]??null}function Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=F(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let s=n[n.length-1],i=n[n.length-2];return s?.suffix==="type"&&i?.suffix==="type"}function L(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(L(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,s){let i=k(t,e.relativePath),r=p(e.symbol);if(!r)return!1;let o=i.get(r);if(!o||o.size===0)return!1;let l=s.get(e.relativePath);if(!l)return!1;for(let d of o){let a=l.get(d);if(!a)continue;let m=n.get(a.symbolId);if(m){for(let g of m)if(g!==e.relativePath&&!t.isIgnored(g))return!0}}return!1}function E(t,e,n){let s=h(t,e);if(!s)return"other";let i=s.split(`
1
+ import{a as I,b as D,c as $,d as B}from"./chunk-I4R3SNMR.js";import{a as K}from"./chunk-K6UI6EBZ.js";import{a as A}from"./chunk-IMQFJ53K.js";import{b as M,g as R}from"./chunk-BZXE3HO4.js";import{a as b}from"./chunk-BGBBVSH4.js";import{g as x}from"./chunk-5VY3RIEI.js";import{b as F,d as w,e as p}from"./chunk-X5C43YVI.js";import{l as k}from"./chunk-JZBGTSAB.js";import{p as h}from"./chunk-WS3Z6W3M.js";function me(t,e){let{scope:n,minLoc:s=3,maxLoc:i=80,limit:r=30,includeLowConfidence:o=!1,scanLimit:l}=e??{},d=e?.semantic!==!1,a=new A(t),m=a.scopedDefinitions(n),g=Q(a,n),T={high:0,medium:1,low:2};return K({candidates:()=>O(t,a,m,{minLoc:s,maxLoc:i}),orderCandidates:(u,c)=>b(c)-b(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:l,profile:{name:"stale-abstractions"},prepare:u=>{let c=W(u),f=U(t,a,u,c,{semantic:d}),y=u.filter(P=>{let S=C(t,P,f,c);return S.realConsumers.length<=1&&!S.transitivelyReachable&&j(P,S.realConsumers.length,g)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,y,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=C(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!j(f.definition,f.realConsumers.length,g))return null;let y=z(t,f);return!o&&y.confidence==="low"?null:y},orderResults:(u,c)=>T[u.confidence]-T[c.confidence]||c.loc-u.loc||u.file.localeCompare(c.file)||u.startLine-c.startLine,limit:r})}function O(t,e,n,s){return n.filter(i=>i.isTypeLike&&b(i)>=s.minLoc).filter(i=>b(i)<=s.maxLoc).filter(i=>!t.isIgnored(i.relativePath)).filter(i=>M(i.relativePath)!=="test").filter(i=>!R(t,i.symbol,i.relativePath)).filter(i=>!X(i.symbol)).filter(i=>!e.hasSuppressionComment(i))}function v(t,e,n,s){return D(I(t,e).forDefinitions(n,{semantic:s.semantic,sourceFallback:s.sourceFallback}))}function U(t,e,n,s,i){let r=v(t,e,n,{semantic:!1,sourceFallback:!1}),o=n.filter(a=>{let m=C(t,a,r,s);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&L(a.relativePath))}),l=i.semantic&&o.length>0?x(r,v(t,e,o,{semantic:!0,sourceFallback:!1})):r,d=o.filter(a=>C(t,a,l,s).realConsumers.length<=1);return x(l,v(t,e,d,{semantic:!1,sourceFallback:!0}))}function W(t){let e=new Map;for(let n of t){let s=e.get(n.relativePath);s||(s=new Map,e.set(n.relativePath,s));let i=p(n.symbol);i&&s.set(i,n)}return e}function C(t,e,n,s){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:o,barrelConsumers:l,importOnlyConsumers:d}=$(t,e,r),a=Y(t,e,n,s);return{definition:e,realConsumers:o,barrelConsumers:l+d,transitivelyReachable:a}}function z(t,e){let n=E(t,e.definition.relativePath,e.definition.startLine),s=L(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:i,reason:r}=ne(e.realConsumers.length,n,s),o=V(e.realConsumers.length,n,s);return{symbol:e.definition.symbol,shortName:w(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:b(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:s,confidence:i,reason:r,actionTier:o.actionTier,stalenessKind:o.stalenessKind,recommendation:o.recommendation}}function V(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,s,i){let r=_(t,Z(n),s),o=r.map(a=>a.singleton);if(r.length===0)return new Set;let l=D(I(t,e).forDefinitions(o,{semantic:i.semantic,sourceFallback:!0})),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,l)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let s=p(n.symbol);s&&e.set(N(n.relativePath,s),n)}return e}function _(t,e,n){let s=[];for(let i of n){let r=q(t,e,i);r&&s.push({singleton:r,classId:i.symbolId})}return s}function q(t,e,n){if(E(t,n.relativePath,n.startLine)!=="class")return null;let s=p(n.symbol);if(!s)return null;let i=J(t,n.relativePath,s);return i?e.get(N(n.relativePath,i))??null:null}function G(t,e,n){let s=p(e.symbol),i=n.get(e.symbolId);return!s||!i?!1:[...i].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!B(t,r,s))}function N(t,e){return`${t}\0${e}`}function J(t,e,n){let s=h(t,e);if(!s)return null;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${i}\\s*\\(`);return s.match(r)?.[1]??null}function Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=F(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let s=n[n.length-1],i=n[n.length-2];return s?.suffix==="type"&&i?.suffix==="type"}function L(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(L(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,s){let i=k(t,e.relativePath),r=p(e.symbol);if(!r)return!1;let o=i.get(r);if(!o||o.size===0)return!1;let l=s.get(e.relativePath);if(!l)return!1;for(let d of o){let a=l.get(d);if(!a)continue;let m=n.get(a.symbolId);if(m){for(let g of m)if(g!==e.relativePath&&!t.isIgnored(g))return!0}}return!1}function E(t,e,n){let s=h(t,e);if(!s)return"other";let i=s.split(`
2
2
  `),r=Math.max(0,n-2),o=Math.min(i.length-1,n+2);for(let l=r;l<=o;l++){let a=(i[l]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function ee(t,e){let n=h(t,e.relativePath);if(!n)return!1;let s=p(e.symbol);if(!s)return!1;let i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${i}\\b`),o=n.split(`
3
3
  `);for(let l=0;l<o.length;l++)if(!(l>=e.startLine&&l<=e.endLine)&&r.test(o[l]??""))return!0;return!1}function ne(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{me as a};
4
- //# sourceMappingURL=chunk-D7J6GZAG.js.map
4
+ //# sourceMappingURL=chunk-6JUAGXR4.js.map
@@ -1,4 +1,4 @@
1
- import{b as w}from"./chunk-EZ5WDZ2Q.js";import{b as g}from"./chunk-ECVXWZ4Q.js";import{c as h,d as f}from"./chunk-MTDBHTSF.js";import{c as b,d as p}from"./chunk-MBKJ7GHT.js";import{d as u,e as c,h as m}from"./chunk-HXXMPYEF.js";import{dirname as $,relative as T,resolve as k}from"path";var A=new Set(f());function O(t,n){return`tests/generated/twin-ab/${y(t)}-vs-${y(n)}.test.ts`}function y(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function I(t,n,a,e){let o=d(t,n);if(!o.ok)return o;let i=d(t,a);if(!i.ok)return i;let r=o.symbol.paramCount===null||i.symbol.paramCount===null?null:o.symbol.paramCount===i.symbol.paramCount,s=v(o.symbol,i.symbol,t.config.projectRoot,e,r);return{ok:!0,a:o.symbol,b:i.symbol,signatureCompatible:r,testSource:s}}function d(t,n){let e=g(t,n).match;if(!e)return{ok:!1,reason:`${n} does not resolve to an indexed symbol.`};let i=t.get("SELECT kind FROM global_symbols WHERE id = ?",e.symbolId)?.kind??null;if(!(i!==null?A.has(i):m(e.symbol)))return{ok:!1,reason:`${n} resolves to ${u(e.symbol)}${i!==null?` with SCIP kind ${h(i)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!w(t,e))return{ok:!1,reason:`${n} (${u(e.symbol)} at ${e.relativePath}:${e.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let s=t.get("SELECT documentation FROM global_symbols WHERE id = ?",e.symbolId),l=b(p(s?.documentation??null));return{ok:!0,symbol:{ref:n,symbol:e.symbol,shortName:c(e.symbol)||u(e.symbol),file:e.relativePath,startLine:e.startLine,signature:l,paramCount:l?x(l):null}}}function x(t){let n=t.indexOf("(");if(n===-1)return null;let a=0,e=-1;for(let s=n;s<t.length;s+=1){let l=t[s];if(l==="(")a+=1;else if(l===")"&&(a-=1,a===0)){e=s;break}}if(e===-1)return null;let o=t.slice(n+1,e).trim();if(!o)return 0;let i=1,r=0;for(let s of o)s==="("||s==="["||s==="{"?r+=1:s===")"||s==="]"||s==="}"?r=Math.max(0,r-1):s===","&&r===0&&(i+=1);return i}function S(t,n,a){let e=$(n),o=k(t,a),r=T(e,o).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function v(t,n,a,e,o){let i=S(a,e,t.file),r=S(a,e,n.file),s=o===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":o?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
1
+ import{b as w}from"./chunk-6KMTPNZL.js";import{b as g}from"./chunk-27HMTUJE.js";import{c as h,d as f}from"./chunk-MTDBHTSF.js";import{c as b,d as p}from"./chunk-7TVFPOD7.js";import{d as u,e as c,h as m}from"./chunk-X5C43YVI.js";import{dirname as $,relative as T,resolve as k}from"path";var A=new Set(f());function O(t,n){return`tests/generated/twin-ab/${y(t)}-vs-${y(n)}.test.ts`}function y(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function I(t,n,a,e){let o=d(t,n);if(!o.ok)return o;let i=d(t,a);if(!i.ok)return i;let r=o.symbol.paramCount===null||i.symbol.paramCount===null?null:o.symbol.paramCount===i.symbol.paramCount,s=v(o.symbol,i.symbol,t.config.projectRoot,e,r);return{ok:!0,a:o.symbol,b:i.symbol,signatureCompatible:r,testSource:s}}function d(t,n){let e=g(t,n).match;if(!e)return{ok:!1,reason:`${n} does not resolve to an indexed symbol.`};let i=t.get("SELECT kind FROM global_symbols WHERE id = ?",e.symbolId)?.kind??null;if(!(i!==null?A.has(i):m(e.symbol)))return{ok:!1,reason:`${n} resolves to ${u(e.symbol)}${i!==null?` with SCIP kind ${h(i)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!w(t,e))return{ok:!1,reason:`${n} (${u(e.symbol)} at ${e.relativePath}:${e.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let s=t.get("SELECT documentation FROM global_symbols WHERE id = ?",e.symbolId),l=b(p(s?.documentation??null));return{ok:!0,symbol:{ref:n,symbol:e.symbol,shortName:c(e.symbol)||u(e.symbol),file:e.relativePath,startLine:e.startLine,signature:l,paramCount:l?x(l):null}}}function x(t){let n=t.indexOf("(");if(n===-1)return null;let a=0,e=-1;for(let s=n;s<t.length;s+=1){let l=t[s];if(l==="(")a+=1;else if(l===")"&&(a-=1,a===0)){e=s;break}}if(e===-1)return null;let o=t.slice(n+1,e).trim();if(!o)return 0;let i=1,r=0;for(let s of o)s==="("||s==="["||s==="{"?r+=1:s===")"||s==="]"||s==="}"?r=Math.max(0,r-1):s===","&&r===0&&(i+=1);return i}function S(t,n,a){let e=$(n),o=k(t,a),r=T(e,o).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function v(t,n,a,e,o){let i=S(a,e,t.file),r=S(a,e,n.file),s=o===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":o?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
2
2
  * Generated by 'scip-query twin-ab'. scip-integrity-audit drill 5
3
3
  * ("cross-examine same-concept twins"): where one concept is computed in
4
4
  * more than one place, feed both the same input and require the same
@@ -37,4 +37,4 @@ describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${n.shortName}'
37
37
  });
38
38
  });
39
39
  `}export{O as a,I as b};
40
- //# sourceMappingURL=chunk-NQ75OVUU.js.map
40
+ //# sourceMappingURL=chunk-6KDOYKCB.js.map
@@ -0,0 +1,3 @@
1
+ import{a as S}from"./chunk-QARYU7R3.js";import{a as y}from"./chunk-K6UI6EBZ.js";import{a as P}from"./chunk-B75HZHUP.js";import{a as x}from"./chunk-IMQFJ53K.js";import{a as h,g as b}from"./chunk-BZXE3HO4.js";import{a as v}from"./chunk-BGBBVSH4.js";import{d as l,e as p,h as u}from"./chunk-X5C43YVI.js";import{a as f,h as m,i as g}from"./chunk-JZBGTSAB.js";import{q as d}from"./chunk-WS3Z6W3M.js";import{basename as L,extname as D}from"path";function H(i,e){let{scope:n,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new x(i);return y({candidates:()=>A(i,a,n,t),orderCandidates:P,scanLimit:s,profile:{name:"passthrough-candidates"},prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>I(i,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function I(i,e,n){let t=j(n);if(t.size!==1||!m(i,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=T(i,e,o),a=w(i,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:v(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:E(r,s,a)}}function T(i,e,n){return S(i,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(n.symbol)},{label:"passthrough module",value:L(e.relativePath,D(e.relativePath))},{label:"callee module",value:L(n.file,D(n.file))}])}function E(i,e,n){if(i==="signal"){if(n.length>0)return`Review the public API before inlining; public-facade evidence: ${n.slice(0,2).join("; ")}.`;let t=e.filter(F);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 w(i,e){return C(i,e)?h(i,e.relativePath)?["exported passthrough is declared on the package public surface"]:b(i,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(i,e){let n=d(i,e.relativePath);if(n.length===0)return!1;let t=n.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
2
+ `);return M.test(t)?!0:R(n,p(e.symbol))}function R(i,e){if(!e)return!1;let n=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${f(e)}\\b`);return i.some(t=>n.test(t))}function F(i){return i.includes("public surface")}function j(i){let e=i.some(t=>u(t.symbol))?i.filter(t=>u(t.symbol)):i,n=new Map;for(let t of e)n.has(t.symbol)||n.set(t.symbol,t);return n}function A(i,e,n,t){return e.productionCallableDefinitions({scope:n,minLoc:3,maxLoc:t,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(o=>!g(i,o))}var M=/^\s*export\s+(?:default\s+)?(?:(?:async\s+)?function\b|(?:const|let|var)\b)/m;export{H as a,C as b};
3
+ //# sourceMappingURL=chunk-6KMTPNZL.js.map
@@ -1,4 +1,4 @@
1
- import{a as _}from"./chunk-OSWF3HSF.js";import{a as r}from"./chunk-ECVXWZ4Q.js";import{a as l}from"./chunk-XEMQUN3Z.js";import{d as c}from"./chunk-HXXMPYEF.js";function y(e,s){let o=r(e,s);if(!o)return[];let t=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
1
+ import{a as _}from"./chunk-K7SPOJHZ.js";import{a as r}from"./chunk-27HMTUJE.js";import{a as l}from"./chunk-BP7S6V3M.js";import{d as c}from"./chunk-X5C43YVI.js";function y(e,s){let o=r(e,s);if(!o)return[];let t=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN (
@@ -68,4 +68,4 @@ import{a as _}from"./chunk-OSWF3HSF.js";import{a as r}from"./chunk-ECVXWZ4Q.js";
68
68
  GROUP BY d.id
69
69
  ORDER BY symbol_count DESC
70
70
  LIMIT ?`,...m,o).filter(i=>!e.isIgnored(i.relative_path)).map(i=>({name:i.relative_path,count:i.symbol_count}))}export{y as a,p as b,b as c,E as d};
71
- //# sourceMappingURL=chunk-TTMKELT7.js.map
71
+ //# sourceMappingURL=chunk-72FR7KEZ.js.map
@@ -1,9 +1,9 @@
1
- import{m as v,o as D}from"./chunk-WS3Z6W3M.js";import{d as F}from"./chunk-7S5E7KWT.js";import{execFileSync as B}from"child_process";var S=2e3,x=50,I=64,$=8,U=3,K=2160*60*60,J=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,V=3,W=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,X=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function R(e){let t=F(e,{clearGroups:["whole-project"]});return(n,i)=>{let r=P(n.config.projectRoot);if(!r)return null;let o=t.has(n)?t.get(n,()=>({head:"",value:null})):null;return o&&o.head===r?o.value:(t.invalidate(n),t.get(n,()=>({head:r,value:i(n.config.projectRoot,r)})).value)}}function M(e){let t=F(e,{clearGroups:["whole-project"]});return(n,i,r)=>{let o=P(n.config.projectRoot);if(!o)return null;let a=t.has(n)?t.get(n,()=>({head:"",values:new Map})):null;(!a||a.head!==o)&&t.invalidate(n);let l=t.get(n,()=>({head:o,values:new Map}));if(l.values.has(i))return l.values.get(i)??null;let u=r(n.config.projectRoot,o);return l.values.set(i,u),u}}var Y=R("git-commit-history");function Z(e){return{capability:t=>q(e,t),commitHistory:()=>A(e),fileChurn:()=>te(e),changeAmplification:()=>ne(e),trackedFiles:()=>re(e),fileAddRecords:()=>se(e),coChangePairs:(t={})=>de(e,t),coChangePairsForFiles:(t,n={})=>j(e,t,n),directionalCoChangePairsForFiles:(t,n={})=>fe(e,t,n)}}function A(e){return Y(e,Q)}function q(e,t){let n=P(e.config.projectRoot);return n?{slot:t,available:!0,head:n}:{slot:t,available:!1,head:null,reason:"git history is unavailable for this project"}}function P(e){try{return C(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function C(e,t){return B("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function Q(e,t){let n;try{n=C(e,["log","--no-merges","--name-only","-n",String(S),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}return{head:t,...E(n,x)}}function ee(e){return J.test(e.subject)}function te(e){let t=A(e);if(!t)return null;let n=new Map;for(let i of t.commits){let r=ee(i);for(let o of i.files){let a=n.get(o)??{changes:0,fixChanges:0,lastChangedAt:0};a.changes+=1,r&&(a.fixChanges+=1),i.timestamp>a.lastChangedAt&&(a.lastChangedAt=i.timestamp),n.set(o,a)}}return n}function ne(e){let t=A(e);if(!t||t.commits.length===0)return null;let n=t.commits.map(i=>i.files.length).filter(i=>i>0).sort((i,r)=>i-r);return n.length===0?null:{medianFilesPerCommit:k(n,.5),p90FilesPerCommit:k(n,.9),commitsAnalyzed:n.length}}function k(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var ie=R("git-tracked-files");function re(e){return ie(e,t=>{try{let n=C(t,["ls-files"]);return new Set(n.split(`
2
- `).map(i=>i.trim()).filter(i=>i!==""))}catch{return null}})}var oe=R("git-file-adds"),O="__git__/file-adds",_=v({kind:"git-file-adds",invalidation:D("git-file-adds"),serialize:ce,deserialize:le});function we(e){return Z(e).fileAddRecords()}function se(e){return oe(e,(t,n)=>ae(e,t,n))}function ae(e,t,n){let i=_.read(e,O,n);if(i)return i;let r=ue(t);return r&&_.write(e,O,n,r),r}function ce(e){return JSON.stringify([...e.entries()])}function le(e){if(!e)return null;try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=new Map;for(let i of t){if(!Array.isArray(i)||i.length!==2||typeof i[0]!="string")return null;let r=i[1];if(!r||typeof r.commitsAgo!="number"||!Number.isFinite(r.commitsAgo)||typeof r.addedAt!="number"||!Number.isFinite(r.addedAt))return null;n.set(i[0],{commitsAgo:r.commitsAgo,addedAt:r.addedAt})}return n}catch{return null}}function ue(e){let t;try{t=C(e,["log","--no-merges","--find-renames","--name-status","-n",String(S),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,i=new Map,r=-1;for(let o of t.split("")){if(o.trim()==="")continue;r+=1;let a=o.indexOf(`
1
+ import{m as v,o as D}from"./chunk-WS3Z6W3M.js";import{d as F}from"./chunk-7S5E7KWT.js";import{execFileSync as B}from"child_process";var x=2e3,S=50,I=64,$=8,U=3,K=2160*60*60,J=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,V=3,W=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,X=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function R(e){let t=F(e,{clearGroups:["whole-project"]});return(n,i)=>{let r=P(n.config.projectRoot);if(!r)return null;let o=t.has(n)?t.get(n,()=>({head:"",value:null})):null;return o&&o.head===r?o.value:(t.invalidate(n),t.get(n,()=>({head:r,value:i(n.config.projectRoot,r)})).value)}}function M(e){let t=F(e,{clearGroups:["whole-project"]});return(n,i,r)=>{let o=P(n.config.projectRoot);if(!o)return null;let a=t.has(n)?t.get(n,()=>({head:"",values:new Map})):null;(!a||a.head!==o)&&t.invalidate(n);let l=t.get(n,()=>({head:o,values:new Map}));if(l.values.has(i))return l.values.get(i)??null;let u=r(n.config.projectRoot,o);return l.values.set(i,u),u}}var Y=R("git-commit-history");function Z(e){return{capability:t=>q(e,t),commitHistory:()=>A(e),fileChurn:()=>te(e),changeAmplification:()=>ne(e),trackedFiles:()=>re(e),fileAddRecords:()=>se(e),coChangePairs:(t={})=>de(e,t),coChangePairsForFiles:(t,n={})=>j(e,t,n),directionalCoChangePairsForFiles:(t,n={})=>fe(e,t,n)}}function A(e){return Y(e,Q)}function q(e,t){let n=P(e.config.projectRoot);return n?{slot:t,available:!0,head:n}:{slot:t,available:!1,head:null,reason:"git history is unavailable for this project"}}function P(e){try{return C(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function C(e,t){return B("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function Q(e,t){let n;try{n=C(e,["log","--no-merges","--name-only","-n",String(x),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}return{head:t,...E(n,S)}}function ee(e){return J.test(e.subject)}function te(e){let t=A(e);if(!t)return null;let n=new Map;for(let i of t.commits){let r=ee(i);for(let o of i.files){let a=n.get(o)??{changes:0,fixChanges:0,lastChangedAt:0};a.changes+=1,r&&(a.fixChanges+=1),i.timestamp>a.lastChangedAt&&(a.lastChangedAt=i.timestamp),n.set(o,a)}}return n}function ne(e){let t=A(e);if(!t||t.commits.length===0)return null;let n=t.commits.map(i=>i.files.length).filter(i=>i>0).sort((i,r)=>i-r);return n.length===0?null:{medianFilesPerCommit:k(n,.5),p90FilesPerCommit:k(n,.9),commitsAnalyzed:n.length}}function k(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var ie=R("git-tracked-files");function re(e){return ie(e,t=>{try{let n=C(t,["ls-files"]);return new Set(n.split(`
2
+ `).map(i=>i.trim()).filter(i=>i!==""))}catch{return null}})}var oe=R("git-file-adds"),O="__git__/file-adds",_=v({kind:"git-file-adds",invalidation:D("git-file-adds"),serialize:ce,deserialize:le});function we(e){return Z(e).fileAddRecords()}function se(e){return oe(e,(t,n)=>ae(e,t,n))}function ae(e,t,n){let i=_.read(e,O,n);if(i)return i;let r=ue(t);return r&&_.write(e,O,n,r),r}function ce(e){return JSON.stringify([...e.entries()])}function le(e){if(!e)return null;try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=new Map;for(let i of t){if(!Array.isArray(i)||i.length!==2||typeof i[0]!="string")return null;let r=i[1];if(!r||typeof r.commitsAgo!="number"||!Number.isFinite(r.commitsAgo)||typeof r.addedAt!="number"||!Number.isFinite(r.addedAt))return null;n.set(i[0],{commitsAgo:r.commitsAgo,addedAt:r.addedAt})}return n}catch{return null}}function ue(e){let t;try{t=C(e,["log","--no-merges","--find-renames","--name-status","-n",String(x),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,i=new Map,r=-1;for(let o of t.split("")){if(o.trim()==="")continue;r+=1;let a=o.indexOf(`
3
3
  `),l=a>=0?o.slice(0,a):o,[,u]=l.split("\0"),f=Number(u)||0;if(!(a<0))for(let h of o.slice(a+1).split(`
4
- `)){let s=me(h);if(!s)continue;if(s.status==="R"&&s.from&&s.to){let m=i.get(s.to)??new Set([s.to]);i.set(s.from,m);continue}if(s.status!=="A"||!s.to)continue;let c={commitsAgo:r,addedAt:f};n.set(s.to,c);for(let m of i.get(s.to)??[])n.set(m,c)}}return n}function me(e){let t=e.trim().split(" "),n=t[0]??"";if(!n)return null;let i=n[0]??"";if(i==="R"){let o=t[1],a=t[2];return o&&a?{status:i,from:o,to:a}:null}let r=t[1];return r?{status:i,to:r}:null}var G=M("git-co-change-pairs"),ge=M("git-directional-co-change-pairs");function de(e,t){let n=`all\0${T(t)}`,i=G(e,n,()=>{let r=A(e);return r?w(r,t):null});return i&&[...i]}function j(e,t,n){if(t.size===0)return[];let i=`files\0${z(t)}\0${T(n)}`,r=G(e,i,()=>{let o=A(e);return o?w(o,n,t):null});return r&&[...r]}function fe(e,t,n){if(t.size===0)return[];let i=n.maxFilesPerCommit??x;if(t.size>I)return j(e,t,n);let r=`directional\0${z(t)}\0${T({...n,maxFilesPerCommit:i})}`,o=ge(e,r,(a,l)=>{let u=he(a,l,t,i);return u?w(u,n,t):null});return o&&[...o]}function T(e){let t=e.minTogether??4,n=e.minConfidence??.6,i=e.maxFilesPerCommit??x;return`${t}\0${n}\0${i}`}function z(e){return[...e].sort().join("\0")}function w(e,t,n){let{minTogether:i=4,minConfidence:r=.6,maxFilesPerCommit:o=x}=t,a=new Map,l=new Map,u=e.newestAnalyzedAt??0;for(let s of e.commits){let c=[...new Set(s.files)].sort();if(c.length>o)continue;e.newestAnalyzedAt===void 0&&s.timestamp>u&&(u=s.timestamp);let m=be(c),y=n===void 0||c.some(g=>n.has(g));for(let g of c)a.set(g,(a.get(g)??0)+1);if(y)for(let g=0;g<c.length;g++)for(let p=g+1;p<c.length;p++){if(n&&!n.has(c[g])&&!n.has(c[p]))continue;let b=`${c[g]}\0${c[p]}`,d=l.get(b)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};d.together+=1,m?d.broadTogether+=1:d.focusedTogether+=1,s.timestamp>d.lastTogetherAt&&(d.lastTogetherAt=s.timestamp),d.timestamps.push(s.timestamp),d.subjects.push(s.subject),l.set(b,d)}}let f=[],h=u-K;for(let[s,c]of l){let m=c.together;if(m<i)continue;let[y,g]=s.split("\0"),p=a.get(y)??m,b=a.get(g)??m,d=Math.max(m/p,m/b);if(d<r)continue;let L=c.broadTogether/m,H=c.timestamps.filter(N=>N>=h).length;f.push({fileA:y,fileB:g,together:m,confidence:d,changesA:p,changesB:b,focusedTogether:c.focusedTogether,broadTogether:c.broadTogether,broadCommitRatio:L,lastTogetherAt:c.lastTogetherAt,recentTogether:H,commitScope:ye(c.broadTogether,m),recency:H>0?"recent":"stale",subjectContext:Se(c.subjects)})}return f.sort((s,c)=>c.together-s.together||c.confidence-s.confidence||s.fileA.localeCompare(c.fileA)),f}function he(e,t,n,i){let r;try{r=Ce(e)}catch{return null}if(r.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:0};let o;try{o=C(e,["log","--no-merges","--format=%H","-n",String(S),"--",...[...n].sort()])}catch{return null}let a=new Set(r.map(s=>s.hash)),l=o.split(`
5
- `).map(s=>s.trim()).filter(s=>s!==""&&a.has(s)),u=pe(e,r,i);if(l.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:u};let f;try{f=C(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...l])}catch{return null}let h=E(f,i);return{head:t,...h,newestAnalyzedAt:u}}function Ce(e){return C(e,["log","--no-merges","--format=%H%x00%ct","-n",String(S)]).split(`
4
+ `)){let s=me(h);if(!s)continue;if(s.status==="R"&&s.from&&s.to){let m=i.get(s.to)??new Set([s.to]);i.set(s.from,m);continue}if(s.status!=="A"||!s.to)continue;let c={commitsAgo:r,addedAt:f};n.set(s.to,c);for(let m of i.get(s.to)??[])n.set(m,c)}}return n}function me(e){let t=e.trim().split(" "),n=t[0]??"";if(!n)return null;let i=n[0]??"";if(i==="R"){let o=t[1],a=t[2];return o&&a?{status:i,from:o,to:a}:null}let r=t[1];return r?{status:i,to:r}:null}var G=M("git-co-change-pairs"),ge=M("git-directional-co-change-pairs");function de(e,t){let n=`all\0${T(t)}`,i=G(e,n,()=>{let r=A(e);return r?w(r,t):null});return i&&[...i]}function j(e,t,n){if(t.size===0)return[];let i=`files\0${z(t)}\0${T(n)}`,r=G(e,i,()=>{let o=A(e);return o?w(o,n,t):null});return r&&[...r]}function fe(e,t,n){if(t.size===0)return[];let i=n.maxFilesPerCommit??S;if(t.size>I)return j(e,t,n);let r=`directional\0${z(t)}\0${T({...n,maxFilesPerCommit:i})}`,o=ge(e,r,(a,l)=>{let u=he(a,l,t,i);return u?w(u,n,t):null});return o&&[...o]}function T(e){let t=e.minTogether??4,n=e.minConfidence??.6,i=e.maxFilesPerCommit??S;return`${t}\0${n}\0${i}`}function z(e){return[...e].sort().join("\0")}function w(e,t,n){let{minTogether:i=4,minConfidence:r=.6,maxFilesPerCommit:o=S}=t,a=new Map,l=new Map,u=e.newestAnalyzedAt??0;for(let s of e.commits){let c=[...new Set(s.files)].sort();if(c.length>o)continue;e.newestAnalyzedAt===void 0&&s.timestamp>u&&(u=s.timestamp);let m=be(c),y=n===void 0||c.some(g=>n.has(g));for(let g of c)a.set(g,(a.get(g)??0)+1);if(y)for(let g=0;g<c.length;g++)for(let p=g+1;p<c.length;p++){if(n&&!n.has(c[g])&&!n.has(c[p]))continue;let b=`${c[g]}\0${c[p]}`,d=l.get(b)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};d.together+=1,m?d.broadTogether+=1:d.focusedTogether+=1,s.timestamp>d.lastTogetherAt&&(d.lastTogetherAt=s.timestamp),d.timestamps.push(s.timestamp),d.subjects.push(s.subject),l.set(b,d)}}let f=[],h=u-K;for(let[s,c]of l){let m=c.together;if(m<i)continue;let[y,g]=s.split("\0"),p=a.get(y)??m,b=a.get(g)??m,d=Math.max(m/p,m/b);if(d<r)continue;let L=c.broadTogether/m,H=c.timestamps.filter(N=>N>=h).length;f.push({fileA:y,fileB:g,together:m,confidence:d,changesA:p,changesB:b,focusedTogether:c.focusedTogether,broadTogether:c.broadTogether,broadCommitRatio:L,lastTogetherAt:c.lastTogetherAt,recentTogether:H,commitScope:ye(c.broadTogether,m),recency:H>0?"recent":"stale",subjectContext:xe(c.subjects)})}return f.sort((s,c)=>c.together-s.together||c.confidence-s.confidence||s.fileA.localeCompare(c.fileA)),f}function he(e,t,n,i){let r;try{r=Ce(e)}catch{return null}if(r.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:0};let o;try{o=C(e,["log","--no-merges","--format=%H","-n",String(x),"--",...[...n].sort()])}catch{return null}let a=new Set(r.map(s=>s.hash)),l=o.split(`
5
+ `).map(s=>s.trim()).filter(s=>s!==""&&a.has(s)),u=pe(e,r,i);if(l.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:u};let f;try{f=C(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...l])}catch{return null}let h=E(f,i);return{head:t,...h,newestAnalyzedAt:u}}function Ce(e){return C(e,["log","--no-merges","--format=%H%x00%ct","-n",String(x)]).split(`
6
6
  `).map(n=>n.trim()).filter(n=>n!=="").map(n=>{let[i,r]=n.split("\0");return{hash:i??"",timestamp:Number(r)||0}}).filter(n=>n.hash!=="")}function pe(e,t,n){for(let r=0;r<t.length;r+=20){let o=t.slice(r,r+20),a;try{a=C(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...o.map(u=>u.hash)])}catch{return t[0]?.timestamp??0}let l=E(a,n);if(l.commits.length>0)return l.commits[0].timestamp}return 0}function E(e,t){let n=[],i=0;for(let r of e.split("")){if(r.trim()==="")continue;let o=r.indexOf(`
7
7
  `),a=o>=0?r.slice(0,o):r,[l,u,f]=a.split("\0");if(!l||!u)continue;let h=o>=0?r.slice(o+1).split(`
8
- `).map(s=>s.trim()).filter(s=>s!==""):[];if(h.length>t){i+=1;continue}n.push({hash:l,timestamp:Number(u)||0,subject:f??"",files:h})}return{commits:n,skippedBulkCommits:i}}function be(e){return e.length>=$?!0:Ae(e).size>=U}function Ae(e){let t=new Set;for(let n of e){let i=n.indexOf("/");t.add(i>=0?n.slice(0,i):".")}return t}function ye(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function Se(e){let t=new Set,n=[],i=[];for(let r of e){!i.includes(r)&&i.length<V&&i.push(r);for(let o of xe(r))t.add(o);for(let o of r.match(W)??[])n.includes(o)||n.push(o)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:i,externalIssueLabelStatus:"unavailable"}}function xe(e){let t=new Set,n=X.exec(e)?.[1]?.toLowerCase();return n&&t.add(Fe(n)),/\b(?:feat|feature)\b/i.test(e)&&t.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(e)&&t.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(e)&&t.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(e)&&t.add("refactor"),/\btests?\b/i.test(e)&&t.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(e)&&t.add("release"),/\bchore\b/i.test(e)&&t.add("chore"),/\bbuild\b/i.test(e)&&t.add("build"),/\bci\b/i.test(e)&&t.add("ci"),/\bperf(?:ormance)?\b/i.test(e)&&t.add("perf"),[...t]}function Fe(e){return e==="feat"?"feature":e}export{Z as a,we as b};
9
- //# sourceMappingURL=chunk-FXG3PHVW.js.map
8
+ `).map(s=>s.trim()).filter(s=>s!==""):[];if(h.length>t){i+=1;continue}n.push({hash:l,timestamp:Number(u)||0,subject:f??"",files:h})}return{commits:n,skippedBulkCommits:i}}function be(e){return e.length>=$?!0:Ae(e).size>=U}function Ae(e){let t=new Set;for(let n of e){let i=n.indexOf("/");t.add(i>=0?n.slice(0,i):".")}return t}function ye(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function xe(e){let t=new Set,n=[],i=[];for(let r of e){!i.includes(r)&&i.length<V&&i.push(r);for(let o of Se(r))t.add(o);for(let o of r.match(W)??[])n.includes(o)||n.push(o)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:i,externalIssueLabelStatus:"unavailable"}}function Se(e){let t=new Set,n=X.exec(e)?.[1]?.toLowerCase();return n&&t.add(Fe(n)),/\b(?:feat|feature)\b/i.test(e)&&t.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(e)&&t.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(e)&&t.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(e)&&t.add("refactor"),/\btests?\b/i.test(e)&&t.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(e)&&t.add("release"),/\bchore\b/i.test(e)&&t.add("chore"),/\bbuild\b/i.test(e)&&t.add("build"),/\bci\b/i.test(e)&&t.add("ci"),/\bperf(?:ormance)?\b/i.test(e)&&t.add("perf"),[...t]}function Fe(e){return e==="feat"?"feature":e}export{Z as a,C as b,we as c};
9
+ //# sourceMappingURL=chunk-7COVQPQQ.js.map
@@ -1,4 +1,4 @@
1
- import{a as f,b as N,c as m,d as E,e as M,f as p,h as k}from"./chunk-HXXMPYEF.js";import{h as R}from"./chunk-T2FQ4GHD.js";import{b as g,c as D,i as x,m as h,o as F}from"./chunk-WS3Z6W3M.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as y}from"./chunk-7S5E7KWT.js";function ge(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
1
+ import{a as f,b as N,c as m,d as E,e as M,f as p,h as k}from"./chunk-X5C43YVI.js";import{j as R}from"./chunk-JZBGTSAB.js";import{b as g,c as D,i as x,m as h,o as F}from"./chunk-WS3Z6W3M.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as y}from"./chunk-7S5E7KWT.js";function ge(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
2
2
  FROM global_symbols gs
3
3
  JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
4
  JOIN documents d ON der.document_id = d.id
@@ -99,4 +99,4 @@ import{a as f,b as N,c as m,d as E,e as M,f as p,h as k}from"./chunk-HXXMPYEF.js
99
99
  ${e.symbolNoiseFor("gs")}
100
100
  GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
101
101
  ORDER BY d.relative_path, start_line, end_line`,...o)}function ie(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function z(e,n){return n==="callable"?ie(e):re(e)}function re(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function Q(e){let n=new Map;for(let t of e){let r=n.get(t.relative_path);r?r.push(t):n.set(t.relative_path,[t])}return n}function Te(e,n,t={}){if(n.length===0)return[];let r=n.flatMap(i=>L(e,i)).filter(i=>!e.isIgnored(i.relativePath));return t.onlyDocumented&&(r=r.filter(i=>i.documentation!==null&&i.documentation!=="")),t.sort&&(r=r.sort((i,o)=>i.relativePath.localeCompare(o.relativePath)||i.startLine-o.startLine||i.endLine-o.endLine)),r.map(i=>({startLine:i.startLine,endLine:i.endLine,symbol:i.symbol,shortName:E(i.symbol),signature:$(T(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function oe(e){let n=new Map,t=e.map((r,i)=>({definition:r,index:i,span:r.endLine-r.startLine})).sort((r,i)=>r.span-i.span||r.index-i.index);for(let{definition:r}of t)for(let i=r.startLine;i<=r.endLine;i+=1)n.has(i)||n.set(i,r);return n}function Ae(e,n){let t=A.get(e);return t||(t=oe(e),A.set(e,t)),t.get(n)??null}function Qe(e,n){let t=L(e,n.relative_path).find(r=>r.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,endLine:t.endLine,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,endLine:n.end_line,relativePath:n.relative_path}}function j(e,n,t){let r=f(e).forFile(n,{text:!0}).text,i=R(e,n);return i?me(t,i,r):r?se(t,r):t}function se(e,n){let t=n.split(/\r?\n/),r=le(e,t),i=ae(e,r),o=ce(i,t);return de(e,o)}function le(e,n){let t=e.some(i=>b(i.symbol))?pe(n):null,r=new Map;for(let i of e)r.set(i.symbolId,fe(n,t,i));return r}function ae(e,n){return e.filter(t=>b(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,r)=>t.startLine-r.startLine||t.definition.startLine-r.definition.startLine||t.definition.symbol.localeCompare(r.definition.symbol))}function ce(e,n){let t=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],o=e[r+1],s=o?Math.max(i.startLine,o.startLine-1):n.length-1;t.set(i.definition.symbolId,{startLine:i.startLine,endLine:be(n,i.definition,i.startLine,s)})}return t}function de(e,n){return e.map(t=>{let r=n.get(t.symbolId);return r?{...t,startLine:r.startLine,endLine:r.endLine}:t})}function me(e,n,t=null){let r=new Map;for(let i of n){let o=r.get(i.name);o?o.push(i):r.set(i.name,[i])}return e.map(i=>{if(!ue(i)||!i.leaf)return P(i,t);let o=r.get(i.leaf);if(!o||o.length===0)return P(i,t);let s=o[0],l=Math.abs(s.startLine-i.startLine);for(let a=1;a<o.length;a+=1){let c=o[a],d=Math.abs(c.startLine-i.startLine);d<l&&(s=c,l=d)}return{...i,startLine:s.startLine,endLine:s.endLine}})}function ue(e){return b(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function P(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),o=n.split(/\r?\n/).findIndex(s=>r.test(s));return o>=0?{...e,startLine:o,endLine:o}:e}function fe(e,n,t){if(!b(t.symbol))return t.startLine;let r=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return r;let i=n.get(t.leaf);if(!i||i.length===0)return r;let o=null;for(let s of i){let l=Math.abs(s-t.startLine);(!o||l<o.distance)&&(o={line:s,distance:l})}return o?.line??r}function pe(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,i=/\b([A-Za-z_$][\w$]*)\s*\(/g,o=new Map,s=(l,a)=>{let c=o.get(l);if(!c){o.set(l,[a]);return}c[c.length-1]!==a&&c.push(a)};for(let l=0;l<e.length;l+=1){let a=e[l]??"";for(let d of a.matchAll(n))d[1]&&s(d[1],l);for(let d of a.matchAll(t))d[1]&&s(d[1],l);let c=a.match(r);c?.[1]&&s(c[1],l);for(let d of a.matchAll(i))d[1]&&s(d[1],l)}return o}function be(e,n,t,r){let i=Math.max(t,Math.min(e.length-1,r)),o=Math.max(t,Math.min(i,n.endLine)),s=0,l=0,a=!1;for(let c=t;c<=i;c+=1){let d=ye(e[c]??"");for(let u of d)u==="{"?(s+=1,a=!0):u==="}"?s=Math.max(0,s-1):u==="("?l+=1:u===")"&&(l=Math.max(0,l-1));if(a&&s===0||!a&&l===0&&c>=o)return c}return o}function ye(e){let n="",t=null,r=!1;for(let i=0;i<e.length;i+=1){let o=e[i],s=e[i+1];if(!t&&o==="/"&&s==="/"){n+=" ".repeat(e.length-i);break}if(t){if(r){r=!1,n+=" ";continue}if(o==="\\"){r=!0,n+=" ";continue}o===t&&(t=null),n+=" ";continue}if(o==='"'||o==="'"||o==="`"){t=o,n+=" ";continue}n+=o}return n}function b(e){return e.includes("().")}function Pe(e){let n=N(e);if("kind"in n)return[];let t=[];for(let r=n.descriptors.length-2;r>=0;r-=1){let i=n.descriptors[r];i?.suffix==="type"&&i.name&&t.push(i.name)}return t}export{ge as a,De as b,$ as c,T as d,_ as e,L as f,we as g,ee as h,Ce as i,$e as j,Te as k,oe as l,Ae as m,Qe as n,Pe as o};
102
- //# sourceMappingURL=chunk-MBKJ7GHT.js.map
102
+ //# sourceMappingURL=chunk-7TVFPOD7.js.map
@@ -1,4 +1,4 @@
1
- import{a as R}from"./chunk-UAHZ57BR.js";import{a as _,d as f}from"./chunk-NAH5EAZS.js";import{d,f as p}from"./chunk-HXXMPYEF.js";import{l as c,m,n as s}from"./chunk-T2FQ4GHD.js";import{p as l}from"./chunk-WS3Z6W3M.js";import{a}from"./chunk-64MNV6AB.js";function P(e,o={}){let{scope:n,limit:r}=o,t=new R(e),i=C([...h(e,n),...N(e,t,n)]);return D(i),r?i.slice(0,r):i}function h(e,o){let n=[];for(let r of E(e,o)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||f(e,r.barrel_path)||l(e,r.barrel_path)&&s(e,r.barrel_path).length===0)continue;let t=S(e,r),i=t?.barrel_consumers??0,u=t?.direct_consumers??0;i!==0||u!==0||n.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:d(r.symbol),originalFile:r.original_path,barrelConsumers:i,directConsumers:u,...g(e,r.barrel_path)})}return n}function E(e,o){let n=o?"AND barrel_d.relative_path LIKE ?":"",r=o?[`%${o}%`]:[];return e.all(`SELECT DISTINCT
1
+ import{a as R}from"./chunk-IMQFJ53K.js";import{a as _,d as f}from"./chunk-BZXE3HO4.js";import{d,f as p}from"./chunk-X5C43YVI.js";import{n as c,o as m,p as s}from"./chunk-JZBGTSAB.js";import{p as l}from"./chunk-WS3Z6W3M.js";import{a}from"./chunk-64MNV6AB.js";function P(e,o={}){let{scope:n,limit:r}=o,t=new R(e),i=C([...h(e,n),...N(e,t,n)]);return D(i),r?i.slice(0,r):i}function h(e,o){let n=[];for(let r of E(e,o)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||f(e,r.barrel_path)||l(e,r.barrel_path)&&s(e,r.barrel_path).length===0)continue;let t=S(e,r),i=t?.barrel_consumers??0,u=t?.direct_consumers??0;i!==0||u!==0||n.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:d(r.symbol),originalFile:r.original_path,barrelConsumers:i,directConsumers:u,...g(e,r.barrel_path)})}return n}function E(e,o){let n=o?"AND barrel_d.relative_path LIKE ?":"",r=o?[`%${o}%`]:[];return e.all(`SELECT DISTINCT
2
2
  barrel_d.id AS barrel_doc_id,
3
3
  barrel_d.relative_path AS barrel_path,
4
4
  gs.id AS symbol_id,
@@ -58,4 +58,4 @@ import{a as R}from"./chunk-UAHZ57BR.js";import{a as _,d as f}from"./chunk-NAH5EA
58
58
  ${e.pathExclusionsFor("consumer_d")}
59
59
  GROUP BY consumer_d.id
60
60
  )`,o.barrel_doc_id,o.symbol_id,o.barrel_doc_id,o.original_doc_id)}function N(e,o,n){let r=[];for(let t of y(e,n))x(e,t,t)>0||r.push(...I(e,o,t));return r}function y(e,o){return a(e,{scope:o,includeIgnored:!1}).filter(n=>s(e,n).length>0||c(e,n).length>0)}function I(e,o,n){let r=s(e,n).filter(i=>i.sourcePath&&!e.isIgnored(i.sourcePath)).flatMap(i=>b(e,o,n,i.sourcePath)),t=c(e,n).filter(i=>i.sourcePath&&!e.isIgnored(i.sourcePath)).flatMap(i=>b(e,o,n,i.sourcePath));return[...r,...t]}function b(e,o,n,r){let t=O(o,r);return t?[{barrelFile:n,symbol:t.symbol,shortName:d(t.symbol),originalFile:r,barrelConsumers:0,directConsumers:x(e,r,n),...g(e,n)}]:[]}function g(e,o){return _(e,o)?{actionTier:"signal",surfaceEvidence:["barrel file is declared on the package public surface"],recommendation:"Review the package API before removing this re-export; local consumers are zero, but external consumers may import through the public barrel."}:{actionTier:"direct",surfaceEvidence:[],recommendation:"Remove this unused re-export when the barrel is not part of an external API surface."}}function x(e,o,n){let r=new Set;for(let t of a(e,{includeIgnored:!1}))if(t!==n)for(let i of m(e,t))i.sourcePath===o&&r.add(t);return r.size}function O(e,o){let n=e.definitionsForFile(o);return n.find(r=>p(r.symbol)==="method")??n[0]??null}function C(e){let o=new Set,n=[];for(let r of e){let t=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;o.has(t)||(o.add(t),n.push(r))}return n}function D(e){e.sort((o,n)=>n.directConsumers-o.directConsumers||o.barrelFile.localeCompare(n.barrelFile)||o.shortName.localeCompare(n.shortName))}export{P as a};
61
- //# sourceMappingURL=chunk-M72ZFN6E.js.map
61
+ //# sourceMappingURL=chunk-A6KSEIRN.js.map
@@ -1,4 +1,4 @@
1
- import{q as f}from"./chunk-MKM7NBZK.js";import{a as d}from"./chunk-ECVXWZ4Q.js";import{c as m,d as g}from"./chunk-MBKJ7GHT.js";import{d as s,h as u}from"./chunk-HXXMPYEF.js";import{p as c}from"./chunk-WS3Z6W3M.js";function E(e,r,i={}){let n=d(e,r);if(!n)return{definitions:[],referencedBy:[]};let t=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),a=g(t?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:y(a,t?.display_name??null,n.symbol),source:S(e,n.relativePath,n.startLine,n.endLine)}],b=f(e,n,{semantic:i.semantic}).map(l=>({relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?s(l.enclosingSymbol):"(top-level)"}));return{definitions:o,referencedBy:b}}function S(e,r,i,n){let t=c(e,r);if(!t)return null;let o=t.split(`
1
+ import{q as f}from"./chunk-GULVO6NF.js";import{a as d}from"./chunk-27HMTUJE.js";import{c as m,d as g}from"./chunk-7TVFPOD7.js";import{d as s,h as u}from"./chunk-X5C43YVI.js";import{p as c}from"./chunk-WS3Z6W3M.js";function E(e,r,i={}){let n=d(e,r);if(!n)return{definitions:[],referencedBy:[]};let t=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),a=g(t?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:y(a,t?.display_name??null,n.symbol),source:S(e,n.relativePath,n.startLine,n.endLine)}],b=f(e,n,{semantic:i.semantic}).map(l=>({relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?s(l.enclosingSymbol):"(top-level)"}));return{definitions:o,referencedBy:b}}function S(e,r,i,n){let t=c(e,r);if(!t)return null;let o=t.split(`
2
2
  `).slice(i,n+1).join(`
3
3
  `).trimEnd();return o.length>0?o:null}function y(e,r,i){let n=m(e);if(n&&!p(n))return n;let t=(r??"").trim();return t?u(i)&&!t.endsWith("()")?`${t}()`:t:s(i)}function p(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{E as a};
4
- //# sourceMappingURL=chunk-52Q4JFDW.js.map
4
+ //# sourceMappingURL=chunk-AAMURYOK.js.map
@@ -1,4 +1,4 @@
1
- import{m as P}from"./chunk-T2FQ4GHD.js";import{a as E,c as F,l,n as I,o as _}from"./chunk-WS3Z6W3M.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as h}from"./chunk-7S5E7KWT.js";var D=I({kind:"file-dependency-graph",invalidation:_("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:w}),C=h("file-dep-graph",{clearGroups:["whole-project"]});function T(e,r){return C.get(e,r??"",()=>{let i=new Set(S(e,{includeIgnored:!1})),n=F(e),s=A(r),o=0,a=0,u=null,m=!1,c=0,f=0;return l("file-dep-graph.product",()=>{if(n){let t=D.read(e,s,n);if(t){m=!0;let p=b(t);return o=t.sourceFileCount,a=t.sourceEdgeCount,c=t.scipEdgeCount,f=p.size,u=t.sourceImportFingerprint,p}}let d=l("file-dep-graph.source-imports",()=>{let t=N(e,i,r);return o=t.files.length,a=t.edges.length,u=t.fingerprint,t},()=>({scope:r??null,files:o,edges:a})),g=new Map,y=(t,p)=>J(e,g,i,t,p);l("file-dep-graph.scip-edges",()=>{for(let t of k(e,r))c+=1,y(t.from_file,t.to_file)},()=>({scope:r??null,edges:c}));for(let t of d.edges)y(t.fromFile,t.toFile);return f=g.size,n&&D.write(e,s,n,{sourceImportFingerprint:d.fingerprint,sourceFileCount:d.files.length,sourceEdgeCount:d.edges.length,scipEdgeCount:c,graph:G(g)}),g},()=>({scope:r??null,available:n!==null,hit:m,files:o,sourceEdges:a,scipEdges:c,graphFiles:f,sourceImportFingerprint:u}))})}function N(e,r,i){let n=[],s=[];for(let o of r)if(!(i&&!o.includes(i))){n.push(o);for(let a of P(e,o))a.sourcePath&&s.push({fromFile:o,toFile:a.sourcePath})}return{files:n,edges:s,fingerprint:O(n,s)}}function O(e,r){let i=r.map(n=>`${n.fromFile}\0${n.toFile}`).sort();return E(JSON.stringify({files:e,edges:i}))}function A(e){return e??"<all>"}function G(e){return[...e].map(([r,i])=>[r,[...i]])}function b(e){return new Map(e.graph.map(([r,i])=>[r,new Set(i)]))}function w(e){let r=JSON.parse(e);return v(r)?r:null}function v(e){if(!e||typeof e!="object")return!1;let r=e;return typeof r.sourceImportFingerprint=="string"&&typeof r.sourceFileCount=="number"&&typeof r.sourceEdgeCount=="number"&&typeof r.scipEdgeCount=="number"&&Array.isArray(r.graph)&&r.graph.every(R)}function R(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(r=>typeof r=="string")}function k(e,r){let i=r?"AND d1.relative_path LIKE ?":"",n=r?[`%${r}%`]:[];return e.all(`SELECT DISTINCT
1
+ import{o as P}from"./chunk-JZBGTSAB.js";import{a as E,c as F,l,n as I,o as _}from"./chunk-WS3Z6W3M.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as h}from"./chunk-7S5E7KWT.js";var D=I({kind:"file-dependency-graph",invalidation:_("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:w}),C=h("file-dep-graph",{clearGroups:["whole-project"]});function T(e,r){return C.get(e,r??"",()=>{let i=new Set(S(e,{includeIgnored:!1})),n=F(e),s=A(r),o=0,a=0,u=null,m=!1,c=0,f=0;return l("file-dep-graph.product",()=>{if(n){let t=D.read(e,s,n);if(t){m=!0;let p=b(t);return o=t.sourceFileCount,a=t.sourceEdgeCount,c=t.scipEdgeCount,f=p.size,u=t.sourceImportFingerprint,p}}let d=l("file-dep-graph.source-imports",()=>{let t=N(e,i,r);return o=t.files.length,a=t.edges.length,u=t.fingerprint,t},()=>({scope:r??null,files:o,edges:a})),g=new Map,y=(t,p)=>J(e,g,i,t,p);l("file-dep-graph.scip-edges",()=>{for(let t of k(e,r))c+=1,y(t.from_file,t.to_file)},()=>({scope:r??null,edges:c}));for(let t of d.edges)y(t.fromFile,t.toFile);return f=g.size,n&&D.write(e,s,n,{sourceImportFingerprint:d.fingerprint,sourceFileCount:d.files.length,sourceEdgeCount:d.edges.length,scipEdgeCount:c,graph:G(g)}),g},()=>({scope:r??null,available:n!==null,hit:m,files:o,sourceEdges:a,scipEdges:c,graphFiles:f,sourceImportFingerprint:u}))})}function N(e,r,i){let n=[],s=[];for(let o of r)if(!(i&&!o.includes(i))){n.push(o);for(let a of P(e,o))a.sourcePath&&s.push({fromFile:o,toFile:a.sourcePath})}return{files:n,edges:s,fingerprint:O(n,s)}}function O(e,r){let i=r.map(n=>`${n.fromFile}\0${n.toFile}`).sort();return E(JSON.stringify({files:e,edges:i}))}function A(e){return e??"<all>"}function G(e){return[...e].map(([r,i])=>[r,[...i]])}function b(e){return new Map(e.graph.map(([r,i])=>[r,new Set(i)]))}function w(e){let r=JSON.parse(e);return v(r)?r:null}function v(e){if(!e||typeof e!="object")return!1;let r=e;return typeof r.sourceImportFingerprint=="string"&&typeof r.sourceFileCount=="number"&&typeof r.sourceEdgeCount=="number"&&typeof r.scipEdgeCount=="number"&&Array.isArray(r.graph)&&r.graph.every(R)}function R(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(r=>typeof r=="string")}function k(e,r){let i=r?"AND d1.relative_path LIKE ?":"",n=r?[`%${r}%`]:[];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{m as P}from"./chunk-T2FQ4GHD.js";import{a as E,c as F,l,n as I,o as _}fro
17
17
  AND m.role != 1
18
18
  ${e.pathExclusionsFor("d1","d2")}
19
19
  ${i}`,...n)}function J(e,r,i,n,s){if(n===s||e.isIgnored(n)||e.isIgnored(s)||!i.has(s))return;let o=r.get(n);o||(o=new Set,r.set(n,o)),o.add(s)}export{T as a};
20
- //# sourceMappingURL=chunk-XEMQUN3Z.js.map
20
+ //# sourceMappingURL=chunk-BP7S6V3M.js.map
@@ -1,4 +1,4 @@
1
- import{a as _}from"./chunk-OSWF3HSF.js";import{c as f}from"./chunk-YDDGCJJG.js";import{a as d}from"./chunk-ECVXWZ4Q.js";import{d as a,e as I,i as b}from"./chunk-HXXMPYEF.js";import{m as c}from"./chunk-T2FQ4GHD.js";import{x as h}from"./chunk-ISLWJ4PY.js";import{b as u}from"./chunk-GNG622H3.js";import{a as g}from"./chunk-64MNV6AB.js";function j(e,r,t={}){return N(e,r,t)?.map(o=>({symbol:o.symbol,shortName:o.shortName,fromFile:o.fromFile}))??[]}function B(e,r){let t=d(e,r),o=E(e,r);if(o.length>0&&!R(t))return o;let s=y(e,r,t);return p(r)&&s.length>0?s:O([...o,...s])}function W(e,r,t={}){return N(e,r,t)?.filter(o=>!o.used).map(o=>({symbol:o.symbol,shortName:o.shortName,importedIn:o.importer}))??[]}function E(e,r){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
1
+ import{a as _}from"./chunk-K7SPOJHZ.js";import{c as f}from"./chunk-WMO2VZZK.js";import{a as d}from"./chunk-27HMTUJE.js";import{d as a,e as I,i as b}from"./chunk-X5C43YVI.js";import{o as c}from"./chunk-JZBGTSAB.js";import{x as h}from"./chunk-ISLWJ4PY.js";import{b as u}from"./chunk-GNG622H3.js";import{a as g}from"./chunk-64MNV6AB.js";function j(e,r,t={}){return N(e,r,t)?.map(o=>({symbol:o.symbol,shortName:o.shortName,fromFile:o.fromFile}))??[]}function B(e,r){let t=d(e,r),o=E(e,r);if(o.length>0&&!R(t))return o;let s=y(e,r,t);return p(r)&&s.length>0?s:O([...o,...s])}function W(e,r,t={}){return N(e,r,t)?.filter(o=>!o.used).map(o=>({symbol:o.symbol,shortName:o.shortName,importedIn:o.importer}))??[]}function E(e,r){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d ON c.document_id = d.id
@@ -32,4 +32,4 @@ import{a as _}from"./chunk-OSWF3HSF.js";import{c as f}from"./chunk-YDDGCJJG.js";
32
32
  WHERE imp_d.relative_path = ?
33
33
  AND m.role = 2
34
34
  ORDER BY def_d.relative_path, gs.symbol`,r).filter(n=>!e.isIgnored(n.importer));if(s.length>0){let n=t.semantic===!1?[]:f(e,r);return s.map(i=>({symbol:i.symbol,shortName:a(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||n.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function L(e,r){let t=f(e,r);return t.length>0?t.map(o=>{let s=S(o.importedName,o.localName,o.kind);return{symbol:s,shortName:s,fromFile:o.sourcePath??"(external)",importer:r,used:o.kind==="side-effect"?!0:o.isUsed}}):null}function T(e,r){return c(e,r).map(t=>{let o=S(t.importedName,t.localName,t.kind),s=t.kind==="side-effect"?!0:t.used;return{symbol:o,shortName:o,fromFile:t.sourcePath??"(external)",importer:r,used:s}})}function S(e,r,t){return t==="namespace"&&e==="*"&&r?`* as ${r}`:t==="default"&&r?`default as ${r}`:t==="side-effect"?"(side effect import)":r&&r!==e?`${e} as ${r}`:e}function M(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{j as a,B as b,W as c};
35
- //# sourceMappingURL=chunk-ETU2I5JM.js.map
35
+ //# sourceMappingURL=chunk-BRBF3E5X.js.map
@@ -1,4 +1,4 @@
1
- import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{g as p}from"./chunk-MBKJ7GHT.js";import{b as f,d as g,f as d}from"./chunk-HXXMPYEF.js";import{a as c}from"./chunk-64MNV6AB.js";import{SymbolInformation_Kind as o}from"@c4312/scip";var _=500;function K(n){let s=parseInt(n,10);if(!isNaN(s))return s;let t=n.toLowerCase(),e=y.get(t);if(e!==void 0)return e;for(let[i,l]of b)if(l.toLowerCase().includes(t))return i;return null}function v(n,s,t={}){let{scope:e,limit:i=100}=t,l=K(s);return l===null?[]:h(n,e).map(r=>({row:r,resolvedKind:k(r)})).filter(r=>r.resolvedKind===l).slice(0,i).map(({row:r,resolvedKind:a})=>({symbol:r.symbol,shortName:g(r.symbol),kind:a,kindName:m(a),relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line}))}function T(n,s={}){let t=I(n,s.scope);for(let e of S(n,s.scope)){let i=k(e);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:m(e),count:i}))}function h(n,s){return p(n,{scope:s}).map(R)}function I(n,s){let t=new Map;for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", "),l=n.all(`SELECT gs.kind AS kind, COUNT(*) AS count
1
+ import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{g as p}from"./chunk-7TVFPOD7.js";import{b as f,d as g,f as d}from"./chunk-X5C43YVI.js";import{a as c}from"./chunk-64MNV6AB.js";import{SymbolInformation_Kind as o}from"@c4312/scip";var _=500;function K(n){let s=parseInt(n,10);if(!isNaN(s))return s;let t=n.toLowerCase(),e=y.get(t);if(e!==void 0)return e;for(let[i,l]of b)if(l.toLowerCase().includes(t))return i;return null}function v(n,s,t={}){let{scope:e,limit:i=100}=t,l=K(s);return l===null?[]:h(n,e).map(r=>({row:r,resolvedKind:k(r)})).filter(r=>r.resolvedKind===l).slice(0,i).map(({row:r,resolvedKind:a})=>({symbol:r.symbol,shortName:g(r.symbol),kind:a,kindName:m(a),relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line}))}function T(n,s={}){let t=I(n,s.scope);for(let e of S(n,s.scope)){let i=k(e);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:m(e),count:i}))}function h(n,s){return p(n,{scope:s}).map(R)}function I(n,s){let t=new Map;for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", "),l=n.all(`SELECT gs.kind AS kind, COUNT(*) AS count
2
2
  FROM defn_enclosing_ranges der
3
3
  JOIN global_symbols gs ON der.symbol_id = gs.id
4
4
  JOIN documents d ON der.document_id = d.id
@@ -20,4 +20,4 @@ import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{g as p}from"./chunk
20
20
  ${n.symbolNoiseFor("gs")}
21
21
  AND d.relative_path IN (${i})
22
22
  ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...e))}return t}function N(n){let s=[];for(let t=0;t<n.length;t+=_)s.push(n.slice(t,t+_));return s}function R(n){return{symbol:n.symbol,kind:n.kind,documentation:n.documentation,enclosing_symbol:n.enclosingSymbol,relative_path:n.relativePath,start_line:n.startLine,end_line:n.endLine}}function k(n){return n.kind!==null&&n.kind!==0?D(n.kind,n.symbol,n.documentation):C(n.symbol,n.documentation,n.enclosing_symbol)}function D(n,s,t){let e=(t??"").toLowerCase();if(d(s)==="type"){if(e.includes("type "))return o.TypeAlias;if(e.includes("interface "))return o.Interface;if(e.includes("struct "))return o.Struct;if(e.includes("trait "))return o.Trait;if(e.includes("class "))return o.Class}return n}function C(n,s,t){let e=f(n);if("kind"in e)return null;let i=e.descriptors,l=i[i.length-2]??null,u=d(n),r=(s??"").toLowerCase();return u==="type"?r.includes("type ")?o.TypeAlias:r.includes("interface ")?o.Interface:r.includes("struct ")?o.Struct:r.includes("trait ")?o.Trait:r.includes("class ")?o.Class:o.Class:u==="method"?l?.suffix==="type"?o.Method:o.Function:u==="namespace"?o.Module:u!=="term"?null:r.includes("async def ")||r.includes("def ")?o.Function:(t?d(t):l?.suffix??null)==="type"?o.Field:o.Variable}export{v as a,T as b};
23
- //# sourceMappingURL=chunk-V7CVBPWX.js.map
23
+ //# sourceMappingURL=chunk-BUNDZ6K2.js.map
@@ -1,6 +1,6 @@
1
- import{a as b}from"./chunk-XEMQUN3Z.js";import{a as E,e as _}from"./chunk-HXXMPYEF.js";import{b as u}from"./chunk-GNG622H3.js";import{a as P}from"./chunk-64MNV6AB.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)\//,I=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,j=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],F=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),C=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>=C)return;let i=l(t,e);if(d(i))for(let n of y(i,{withFileTypes:!0})){if(!n.isDirectory()||F.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 f of m(c))f!==""&&i.push(g(e,f));return}let o=n.replace(I,"");for(let c of m(o)){c===o&&c===n&&s.add(g(e,n));for(let f of j)L(t,s,e,c+f)}s.add(g(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=g(r,s);if(e.add(i),!s.startsWith("src/")||d(l(t,i)))return;let n=j.find(S=>s.endsWith(S));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),f=a.slice(o+1);for(let S of v(t,r,c,`${f}${n}`))e.add(S)}function V(t,e,r,s,i){let n=g(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(g(e,o))}return n}function g(t,e){return t?`${t}/${e}`:e}function h(t){let e=u(t);return ct(e)?"test":ut(e)?"worker":ft(e)?"entry":gt(e)?"barrel":"source"}function H(t){return h(t)==="barrel"}function N(t){return K.get(t,()=>{let r=P(t,{includeIgnored:!1}).filter(a=>{let o=h(a);return o==="entry"||o==="worker"});if(r.length===0)return new Set;let s=b(t),i=new Set,n=new Set;for(;r.length>0;){let a=r.shift();if(!i.has(a)){i.add(a),h(a)==="barrel"&&n.add(a);for(let o of s.get(a)??[])i.has(o)||r.push(o)}}return n})}var K=p("live-barrels",{clearGroups:["whole-project"]});function J(t,e){return N(t).has(u(e))}function jt(t){let e=N(t);return P(t,{includeIgnored:!1}).filter(r=>H(r)&&!e.has(r)&&!Q(t,r))}function Q(t,e){let r=u(e),s=E(t).forFile(r,{facts:!0}).facts?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
1
+ import{a as b}from"./chunk-BP7S6V3M.js";import{a as E,e as _}from"./chunk-X5C43YVI.js";import{b as u}from"./chunk-GNG622H3.js";import{a as P}from"./chunk-64MNV6AB.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)\//,I=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,j=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],F=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),C=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>=C)return;let i=l(t,e);if(d(i))for(let n of y(i,{withFileTypes:!0})){if(!n.isDirectory()||F.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 f of m(c))f!==""&&i.push(g(e,f));return}let o=n.replace(I,"");for(let c of m(o)){c===o&&c===n&&s.add(g(e,n));for(let f of j)L(t,s,e,c+f)}s.add(g(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=g(r,s);if(e.add(i),!s.startsWith("src/")||d(l(t,i)))return;let n=j.find(S=>s.endsWith(S));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),f=a.slice(o+1);for(let S of v(t,r,c,`${f}${n}`))e.add(S)}function V(t,e,r,s,i){let n=g(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(g(e,o))}return n}function g(t,e){return t?`${t}/${e}`:e}function h(t){let e=u(t);return ct(e)?"test":ut(e)?"worker":ft(e)?"entry":gt(e)?"barrel":"source"}function H(t){return h(t)==="barrel"}function N(t){return K.get(t,()=>{let r=P(t,{includeIgnored:!1}).filter(a=>{let o=h(a);return o==="entry"||o==="worker"});if(r.length===0)return new Set;let s=b(t),i=new Set,n=new Set;for(;r.length>0;){let a=r.shift();if(!i.has(a)){i.add(a),h(a)==="barrel"&&n.add(a);for(let o of s.get(a)??[])i.has(o)||r.push(o)}}return n})}var K=p("live-barrels",{clearGroups:["whole-project"]});function J(t,e){return N(t).has(u(e))}function jt(t){let e=N(t);return P(t,{includeIgnored:!1}).filter(r=>H(r)&&!e.has(r)&&!Q(t,r))}function Q(t,e){let r=u(e),s=E(t).forFile(r,{facts:!0}).facts?.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 Tt(t,e){let r=h(e);return r==="entry"||r==="worker"||J(t,e)}function wt(t,e,r){let s=u(r);if(T(t,s)||et(e,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>u(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(u(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 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,h as b,H as c,J as d,jt as e,Tt as f,wt as g};
6
- //# sourceMappingURL=chunk-NAH5EAZS.js.map
6
+ //# sourceMappingURL=chunk-BZXE3HO4.js.map
@@ -1,4 +1,4 @@
1
- import{c as M}from"./chunk-72MFTCU5.js";import{a as I,c as N}from"./chunk-ECVXWZ4Q.js";import{f as g,m as S}from"./chunk-MBKJ7GHT.js";import{d as b,f as p}from"./chunk-HXXMPYEF.js";import{x as h}from"./chunk-ISLWJ4PY.js";function $(o,s,i={}){let{maxDepth:c=5,scope:a}=i,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let r=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&r.push(n.symbolMatch)}t=r}return u.sort((e,r)=>e.depth-r.depth||e.file.localeCompare(r.file)),u}function D(o,s,i){let c=M(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!i||t.file.includes(i)),a=new Set(c.map(t=>t.file)),l=[];for(let t of _(o,s,i)){if(a.has(t))continue;let e=g(o,t),r=e.length>0?S(e,e[0].startLine):null;l.push({symbol:r?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=N(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:b(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!w(e))continue;let r=`${e.symbolId}|${e.relativePath}`;m.has(r)||(m.add(r),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function _(o,s,i){let c=i?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return i&&a.push(`%${i}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
1
+ import{c as M}from"./chunk-5VY3RIEI.js";import{a as I,c as N}from"./chunk-27HMTUJE.js";import{f as g,m as S}from"./chunk-7TVFPOD7.js";import{d as b,f as p}from"./chunk-X5C43YVI.js";import{x as h}from"./chunk-ISLWJ4PY.js";function $(o,s,i={}){let{maxDepth:c=5,scope:a}=i,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let r=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&r.push(n.symbolMatch)}t=r}return u.sort((e,r)=>e.depth-r.depth||e.file.localeCompare(r.file)),u}function D(o,s,i){let c=M(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!i||t.file.includes(i)),a=new Set(c.map(t=>t.file)),l=[];for(let t of _(o,s,i)){if(a.has(t))continue;let e=g(o,t),r=e.length>0?S(e,e[0].startLine):null;l.push({symbol:r?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=N(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:b(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!w(e))continue;let r=`${e.symbolId}|${e.relativePath}`;m.has(r)||(m.add(r),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function _(o,s,i){let c=i?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return i&&a.push(`%${i}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents consumer_d ON consumer_d.id = c.document_id
@@ -7,4 +7,4 @@ import{c as M}from"./chunk-72MFTCU5.js";import{a as I,c as N}from"./chunk-ECVXWZ
7
7
  AND c.document_id != ?
8
8
  ${o.pathExclusionsFor("consumer_d")}
9
9
  ${c}`,...a).map(l=>l.relative_path).filter(l=>!o.isIgnored(l)))}function w(o){if(o.symbol.startsWith("scip-clojure ")||h(o.relativePath)==="clojure")return!0;let s=p(o.symbol);return s==="method"||s==="type"||o.symbol.endsWith("().")}export{$ as a};
10
- //# sourceMappingURL=chunk-AZLKLZ5S.js.map
10
+ //# sourceMappingURL=chunk-CXQQOXSI.js.map