scip-query 0.14.0 → 0.16.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.
- package/CHANGELOG.md +14 -2
- package/README.md +158 -62
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-2EU6WVR3.js +3 -0
- package/dist/chunk-2HFXPIBT.js +2 -0
- package/dist/chunk-2LGPMYS2.js +35 -0
- package/dist/chunk-2Y7YX54K.js +16 -0
- package/dist/chunk-363TZ64I.js +2 -0
- package/dist/chunk-3I34FZ6R.js +2 -0
- package/dist/chunk-3LAKH6BV.js +2 -0
- package/dist/chunk-3M2UCPFS.js +3 -0
- package/dist/chunk-3OPIMH42.js +2 -0
- package/dist/{chunk-QZOAOLLZ.js → chunk-3YAZH3JU.js} +2 -2
- package/dist/chunk-5P26M63Y.js +2 -0
- package/dist/{chunk-72FR7KEZ.js → chunk-5TVNLPUM.js} +14 -12
- package/dist/chunk-5UKDCXVC.js +5 -0
- package/dist/{chunk-R7U2I55B.js → chunk-5XDNFOAH.js} +2 -2
- package/dist/chunk-62Y3PC27.js +4 -0
- package/dist/chunk-6DNE65QS.js +40 -0
- package/dist/{chunk-N2OTJWC2.js → chunk-6EVORGCB.js} +2 -2
- package/dist/chunk-6GZ7LM7S.js +2 -0
- package/dist/chunk-753JWTUH.js +3 -0
- package/dist/chunk-7II7NFRV.js +4 -0
- package/dist/{chunk-M7EEHYSU.js → chunk-7RAS466A.js} +2 -2
- package/dist/chunk-A46JTKTM.js +5 -0
- package/dist/{chunk-2XRXEIRK.js → chunk-AAMZRDJT.js} +2 -2
- package/dist/chunk-AMPN2VMF.js +3 -0
- package/dist/{chunk-6XA4LDHY.js → chunk-B3X6KU75.js} +2 -2
- package/dist/chunk-BFWVHD2P.js +16 -0
- package/dist/chunk-BVHP2B4D.js +61 -0
- package/dist/{chunk-BUNDZ6K2.js → chunk-BVUA3GZC.js} +2 -2
- package/dist/{chunk-EDSD3VJK.js → chunk-CKIAEVGM.js} +2 -2
- package/dist/chunk-CM4EZLW4.js +2 -0
- package/dist/chunk-CS3FXTUC.js +2 -0
- package/dist/chunk-CVBS2FD4.js +2 -0
- package/dist/chunk-D5OXYOJP.js +7 -0
- package/dist/chunk-DA34GNNO.js +29 -0
- package/dist/chunk-DKK2H4D7.js +7 -0
- package/dist/chunk-EBSSCVR4.js +5 -0
- package/dist/{chunk-OXTM2RX3.js → chunk-EVCSXWER.js} +2 -2
- package/dist/chunk-FFIYGYQR.js +67 -0
- package/dist/chunk-G4KQ7S74.js +20 -0
- package/dist/{chunk-44P4SJFN.js → chunk-GWWYLYD3.js} +2 -2
- package/dist/chunk-HGUNWXJX.js +2 -0
- package/dist/chunk-HLRWOFXC.js +9 -0
- package/dist/{chunk-YQKECTPV.js → chunk-IRIM3SUR.js} +2 -2
- package/dist/chunk-JHK2DMUQ.js +4 -0
- package/dist/chunk-JQ2PCFZW.js +3 -0
- package/dist/chunk-JRFCWCOD.js +16 -0
- package/dist/chunk-JXAJDINF.js +2 -0
- package/dist/chunk-K32ZOW3P.js +2 -0
- package/dist/{chunk-3H5OSDF7.js → chunk-KI4WPR7Q.js} +2 -2
- package/dist/{chunk-43GKP6LI.js → chunk-KP2DJY7D.js} +2 -2
- package/dist/{chunk-YTVKPJXW.js → chunk-L27UIF3E.js} +2 -2
- package/dist/chunk-LT6AHYVY.js +18 -0
- package/dist/chunk-MCNWCJYL.js +11 -0
- package/dist/{chunk-K6UI6EBZ.js → chunk-MZB3DTHW.js} +2 -2
- package/dist/chunk-NLRWGGPY.js +8 -0
- package/dist/chunk-NLVKD45E.js +13 -0
- package/dist/chunk-OO6S4ECV.js +112 -0
- package/dist/{chunk-QYOPMTZ6.js → chunk-OYGKBDAD.js} +2 -2
- package/dist/chunk-P5QZILZ4.js +2 -0
- package/dist/chunk-P5XHIJHI.js +2 -0
- package/dist/chunk-PCCMMI2M.js +3 -0
- package/dist/{chunk-2TPCIPYA.js → chunk-Q65QYKU7.js} +2 -2
- package/dist/{chunk-K7SPOJHZ.js → chunk-QB7NRST4.js} +2 -2
- package/dist/{chunk-7JZRFDCU.js → chunk-QSNG3NHQ.js} +2 -2
- package/dist/chunk-QVZSWLLZ.js +2 -0
- package/dist/chunk-RLB7FZKR.js +10 -0
- package/dist/{chunk-KYB7FPXT.js → chunk-RPMT6MTX.js} +2 -2
- package/dist/chunk-RQWNF2RM.js +2 -0
- package/dist/chunk-RYFIRFYJ.js +4 -0
- package/dist/{chunk-QARYU7R3.js → chunk-S2FZILCF.js} +2 -2
- package/dist/{chunk-HV27H2V2.js → chunk-S3IXCXW2.js} +2 -2
- package/dist/{chunk-TYCZ7S4I.js → chunk-S5MTSES5.js} +2 -2
- package/dist/chunk-S5RZQA6V.js +2 -0
- package/dist/{chunk-PEHDARNC.js → chunk-SEEJPIWG.js} +2 -2
- package/dist/chunk-SOCS3467.js +2 -0
- package/dist/chunk-U6BJVXWQ.js +2 -0
- package/dist/chunk-UO4IADXJ.js +38 -0
- package/dist/{chunk-ZEO4CXQR.js → chunk-VLSI5MYU.js} +2 -2
- package/dist/chunk-VSQRU3AP.js +2 -0
- package/dist/chunk-VYQY75NA.js +2 -0
- package/dist/{chunk-NOKUZU56.js → chunk-VZCR3VQY.js} +2 -2
- package/dist/chunk-W3ZVRLCH.js +2 -0
- package/dist/chunk-WA64GKWB.js +20 -0
- package/dist/chunk-WFRZGMWJ.js +71 -0
- package/dist/chunk-WN6XEYVX.js +2 -0
- package/dist/chunk-XAEU4ROB.js +101 -0
- package/dist/chunk-XBPAJASV.js +2 -0
- package/dist/{chunk-GY3HAWUA.js → chunk-XC6PUFNN.js} +2 -2
- package/dist/chunk-Y42DMR6F.js +6 -0
- package/dist/chunk-YCVYOV4A.js +7 -0
- package/dist/{chunk-WPZPB42I.js → chunk-YD37KSEK.js} +2 -2
- package/dist/{chunk-V5W7H7V4.js → chunk-YFEJIYWH.js} +2 -2
- package/dist/chunk-YSUD2S7T.js +3 -0
- package/dist/{chunk-KJCDEDQW.js → chunk-ZEKBAMCN.js} +2 -2
- package/dist/chunk-ZHGUZKJL.js +2 -0
- package/dist/cli.js +587 -305
- package/dist/{config-types-BrHl3Bge.d.ts → config-types-SVkUIufk.d.ts} +10 -2
- package/dist/{db-_Bdx0E1W.d.ts → db-CS0TuVH6.d.ts} +1 -1
- package/dist/{git-history-Dao3_Pu9.d.ts → git-history-ChNHbfZQ.d.ts} +2 -1
- package/dist/{health-BEZ1Rt0S.d.ts → health-Btal3mQi.d.ts} +4 -4
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1 -19
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +8 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +4 -3
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +3 -3
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +5 -4
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +12 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +2 -2
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +8 -3
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +5 -4
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +4 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +3 -3
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +11 -5
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +5 -5
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -2
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +3 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +4 -4
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +4 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +4 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +4 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +2 -2
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +4 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +4 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +256 -12
- package/dist/reindex.d.ts +29 -3
- package/dist/reindex.js +251 -22
- package/dist/runtime.d.ts +8 -4
- package/dist/runtime.js +2 -2
- package/dist/rust-semantic-session-server.js +2 -0
- package/dist/rust-semantic-session-worker.js +2 -0
- package/dist/rust-semantic-worker.js +2 -0
- package/dist/{scip-cli-C7cg4ZHR.d.ts → scip-cli-BKL-26TZ.d.ts} +2 -2
- package/dist/{symbol-types-DaoeXKUt.d.ts → symbol-types-BgWU6lhL.d.ts} +2 -0
- package/dist/watch-server.js +42 -0
- package/docs/AGENT_GUIDE.md +110 -34
- package/docs/AI_FAILURE_MODES.md +8 -3
- package/docs/COMMAND_REFERENCE.md +11 -6
- package/docs/REGEX_POLICY.md +3 -1
- package/docs/accuracy-audit-checklist.md +300 -0
- package/docs/accuracy-hardening-goal.md +493 -54
- package/docs/analyzer-inventory.md +31 -23
- package/docs/analyzer-validation-ledger.md +51 -21
- package/package.json +2 -1
- package/scripts/build-scip-windows.mjs +7 -7
- package/skills/_shared/SKILL.md +21 -18
- package/skills/scip-calibrate/SKILL.md +9 -3
- package/skills/scip-hyper-optimization/SKILL.md +5 -1
- package/skills/scip-query/SKILL.md +1 -1
- package/skills/scip-setup/SKILL.md +104 -4
- package/skills/scip-verify/SKILL.md +24 -13
- package/dist/chunk-27HMTUJE.js +0 -3
- package/dist/chunk-27XEGMCT.js +0 -7
- package/dist/chunk-3AMWF6V5.js +0 -3
- package/dist/chunk-5AAAEZ2Z.js +0 -2
- package/dist/chunk-5JRMZMLM.js +0 -2
- package/dist/chunk-5VY3RIEI.js +0 -38
- package/dist/chunk-6JUAGXR4.js +0 -4
- package/dist/chunk-6KDOYKCB.js +0 -40
- package/dist/chunk-6KMTPNZL.js +0 -3
- package/dist/chunk-7COVQPQQ.js +0 -9
- package/dist/chunk-7S5E7KWT.js +0 -2
- package/dist/chunk-7TVFPOD7.js +0 -102
- package/dist/chunk-A6KSEIRN.js +0 -61
- package/dist/chunk-AAMURYOK.js +0 -4
- package/dist/chunk-BP7S6V3M.js +0 -20
- package/dist/chunk-BRBF3E5X.js +0 -35
- package/dist/chunk-BZXE3HO4.js +0 -6
- package/dist/chunk-CXQQOXSI.js +0 -10
- package/dist/chunk-EVZSAR3S.js +0 -2
- package/dist/chunk-GMOEX7EV.js +0 -2
- package/dist/chunk-GNG622H3.js +0 -3
- package/dist/chunk-GUDKRIGW.js +0 -7
- package/dist/chunk-GULVO6NF.js +0 -43
- package/dist/chunk-HZZQKNVE.js +0 -2
- package/dist/chunk-I4R3SNMR.js +0 -2
- package/dist/chunk-IMQFJ53K.js +0 -2
- package/dist/chunk-ISLWJ4PY.js +0 -10
- package/dist/chunk-IUSSGHJO.js +0 -2
- package/dist/chunk-J5WVNZ6O.js +0 -2
- package/dist/chunk-JJUX2OAP.js +0 -2
- package/dist/chunk-JZBGTSAB.js +0 -13
- package/dist/chunk-K5N5RNGM.js +0 -2
- package/dist/chunk-KSJ544IV.js +0 -5
- package/dist/chunk-LY7NMOBW.js +0 -2
- package/dist/chunk-N23FT4EZ.js +0 -2
- package/dist/chunk-NCVFKOLB.js +0 -2
- package/dist/chunk-PESEPWZO.js +0 -2
- package/dist/chunk-PMY4UFGV.js +0 -2
- package/dist/chunk-Q7PWDXL5.js +0 -5
- package/dist/chunk-QVGFVRKD.js +0 -2
- package/dist/chunk-R5336VHZ.js +0 -2
- package/dist/chunk-RLB6SG25.js +0 -2
- package/dist/chunk-SFDVBARK.js +0 -2
- package/dist/chunk-TG7QSYCJ.js +0 -2
- package/dist/chunk-U3VMUDXJ.js +0 -2
- package/dist/chunk-UHPWZCYQ.js +0 -3
- package/dist/chunk-URSSPS5H.js +0 -2
- package/dist/chunk-WIBFXSYB.js +0 -6
- package/dist/chunk-WMO2VZZK.js +0 -3
- package/dist/chunk-WS3Z6W3M.js +0 -65
- package/dist/chunk-X3DTIEMU.js +0 -18
- package/dist/chunk-X5C43YVI.js +0 -2
- package/dist/chunk-X7CHWTZ2.js +0 -72
- package/dist/chunk-XC2PJOVM.js +0 -3
- package/dist/chunk-XDESMVOL.js +0 -4
- package/dist/chunk-XZBLZHXL.js +0 -16
- package/dist/chunk-ZMGBWSFZ.js +0 -2
package/dist/chunk-A6KSEIRN.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
barrel_d.id AS barrel_doc_id,
|
|
3
|
-
barrel_d.relative_path AS barrel_path,
|
|
4
|
-
gs.id AS symbol_id,
|
|
5
|
-
gs.symbol AS symbol,
|
|
6
|
-
orig_d.id AS original_doc_id,
|
|
7
|
-
orig_d.relative_path AS original_path
|
|
8
|
-
FROM mentions m
|
|
9
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
-
JOIN documents barrel_d ON c.document_id = barrel_d.id
|
|
11
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
12
|
-
JOIN (
|
|
13
|
-
SELECT m2.symbol_id, c2.document_id
|
|
14
|
-
FROM mentions m2
|
|
15
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
16
|
-
WHERE m2.role = 1
|
|
17
|
-
GROUP BY m2.symbol_id
|
|
18
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
19
|
-
JOIN documents orig_d ON sym_def.document_id = orig_d.id
|
|
20
|
-
WHERE m.role != 1
|
|
21
|
-
AND (barrel_d.relative_path LIKE '%/index.ts'
|
|
22
|
-
OR barrel_d.relative_path LIKE '%/index.js'
|
|
23
|
-
OR barrel_d.relative_path = 'index.ts'
|
|
24
|
-
OR barrel_d.relative_path = 'index.js')
|
|
25
|
-
AND orig_d.id != barrel_d.id
|
|
26
|
-
${e.pathExclusionsFor("barrel_d","orig_d")}
|
|
27
|
-
${e.symbolNoiseFor("gs")}
|
|
28
|
-
-- Only function-level symbols (ending with ().), not module-level
|
|
29
|
-
AND gs.symbol LIKE '%().'
|
|
30
|
-
${n}
|
|
31
|
-
ORDER BY barrel_d.relative_path, gs.symbol`,...r)}function S(e,o){return e.get(`SELECT
|
|
32
|
-
SUM(CASE WHEN uses_barrel = 1 THEN 1 ELSE 0 END) AS barrel_consumers,
|
|
33
|
-
SUM(CASE WHEN uses_barrel = 0 THEN 1 ELSE 0 END) AS direct_consumers
|
|
34
|
-
FROM (
|
|
35
|
-
SELECT
|
|
36
|
-
consumer_d.id AS consumer_doc_id,
|
|
37
|
-
MAX(CASE WHEN EXISTS (
|
|
38
|
-
SELECT 1
|
|
39
|
-
FROM mentions barrel_m
|
|
40
|
-
JOIN chunks barrel_c ON barrel_m.chunk_id = barrel_c.id
|
|
41
|
-
WHERE barrel_c.document_id = consumer_d.id
|
|
42
|
-
AND barrel_m.role != 1
|
|
43
|
-
AND barrel_m.symbol_id IN (
|
|
44
|
-
SELECT m2.symbol_id
|
|
45
|
-
FROM mentions m2
|
|
46
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
47
|
-
WHERE c2.document_id = ?
|
|
48
|
-
AND m2.role != 1
|
|
49
|
-
)
|
|
50
|
-
) THEN 1 ELSE 0 END) AS uses_barrel
|
|
51
|
-
FROM mentions ref_m
|
|
52
|
-
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
53
|
-
JOIN documents consumer_d ON ref_c.document_id = consumer_d.id
|
|
54
|
-
WHERE ref_m.symbol_id = ?
|
|
55
|
-
AND ref_m.role != 1
|
|
56
|
-
AND consumer_d.id != ?
|
|
57
|
-
AND consumer_d.id != ?
|
|
58
|
-
${e.pathExclusionsFor("consumer_d")}
|
|
59
|
-
GROUP BY consumer_d.id
|
|
60
|
-
)`,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-A6KSEIRN.js.map
|
package/dist/chunk-AAMURYOK.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
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
|
-
`).slice(i,n+1).join(`
|
|
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-AAMURYOK.js.map
|
package/dist/chunk-BP7S6V3M.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
d1.relative_path AS from_file,
|
|
3
|
-
d2.relative_path AS to_file
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
-
JOIN (
|
|
9
|
-
SELECT m2.symbol_id, c2.document_id
|
|
10
|
-
FROM mentions m2
|
|
11
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
-
WHERE m2.role = 1
|
|
13
|
-
GROUP BY m2.symbol_id
|
|
14
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
-
WHERE d1.id != d2.id
|
|
17
|
-
AND m.role != 1
|
|
18
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
-
${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-BP7S6V3M.js.map
|
package/dist/chunk-BRBF3E5X.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d ON c.document_id = d.id
|
|
5
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
-
WHERE gs.symbol LIKE ?
|
|
7
|
-
AND m.role = 2
|
|
8
|
-
ORDER BY d.relative_path`,`%${r}%`).filter(o=>!e.isIgnored(o.importer)).map(o=>({symbol:o.symbol,shortName:a(o.symbol),fromFile:o.importer}))}function y(e,r,t=d(e,r)){let o=t?.relativePath??null,s=t?I(t.symbol):r.replace(/\(\)$/,""),n=t?b(t.symbol):!1,i=new Set;for(let l of g(e,{includeIgnored:!1}))for(let F of c(e,l))k(F,l,{targetFile:o,targetLeaf:s,targetIsModule:n,targetPattern:r})&&i.add(l);let m=p(r)?r.trim():null;return[...i].sort().map(l=>({symbol:m??t?.symbol??s,shortName:m??(t?a(t.symbol):s),fromFile:l}))}function R(e){return!!(e&&(e.symbol.startsWith("scip-clojure ")||h(e.relativePath)==="clojure"))}function O(e){let r=new Set,t=[];for(let o of e){let s=`${o.symbol}|${o.fromFile}`;r.has(s)||(r.add(s),t.push(o))}return t.sort((o,s)=>o.fromFile.localeCompare(s.fromFile)||o.shortName.localeCompare(s.shortName))}function k(e,r,t){return!e.sourcePath||t.targetFile&&u(e.sourcePath)!==u(t.targetFile)?!1:e.kind==="side-effect"||t.targetFile&&M(r)||e.kind==="namespace"&&D(e,t.targetPattern)||t.targetIsModule||e.kind==="named"&&e.importedName===t.targetLeaf?!0:e.kind==="namespace"&&e.usedMembers.includes(t.targetLeaf)}function D(e,r){let t=r.trim().replace(/\(\)$/,"");return p(t)?e.importedName===t||e.localName===t:!1}function p(e){let r=e.trim().replace(/\(\)$/,"");return r.includes(".")&&!r.includes("/")&&!r.includes(":")}function N(e,r,t={}){let o=_(e,r);return o?x(e,o,t)??(t.semantic===!1?null:L(e,o))??T(e,o):null}function x(e,r,t){let s=e.all(`SELECT DISTINCT
|
|
9
|
-
gs.symbol,
|
|
10
|
-
def_d.relative_path AS from_file,
|
|
11
|
-
imp_d.relative_path AS importer,
|
|
12
|
-
EXISTS (
|
|
13
|
-
SELECT 1
|
|
14
|
-
FROM mentions ref_m
|
|
15
|
-
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
16
|
-
WHERE ref_m.symbol_id = gs.id
|
|
17
|
-
AND ref_m.role != 1
|
|
18
|
-
AND ref_c.document_id = imp_d.id
|
|
19
|
-
) AS used
|
|
20
|
-
FROM mentions m
|
|
21
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
22
|
-
JOIN documents imp_d ON c.document_id = imp_d.id
|
|
23
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
24
|
-
LEFT JOIN (
|
|
25
|
-
SELECT m2.symbol_id, c2.document_id
|
|
26
|
-
FROM mentions m2
|
|
27
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
28
|
-
WHERE m2.role = 1
|
|
29
|
-
GROUP BY m2.symbol_id
|
|
30
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
31
|
-
LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
32
|
-
WHERE imp_d.relative_path = ?
|
|
33
|
-
AND m.role = 2
|
|
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-BRBF3E5X.js.map
|
package/dist/chunk-BZXE3HO4.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
FROM defn_enclosing_ranges der
|
|
3
|
-
JOIN documents d ON d.id = der.document_id
|
|
4
|
-
WHERE d.relative_path = ?
|
|
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-BZXE3HO4.js.map
|
package/dist/chunk-CXQQOXSI.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
AND c.document_id != ?
|
|
8
|
-
${o.pathExclusionsFor("consumer_d")}
|
|
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-CXQQOXSI.js.map
|
package/dist/chunk-EVZSAR3S.js
DELETED
package/dist/chunk-GMOEX7EV.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b}from"./chunk-K7SPOJHZ.js";import{k as f}from"./chunk-7TVFPOD7.js";import{m as d}from"./chunk-X5C43YVI.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-GMOEX7EV.js.map
|
package/dist/chunk-GNG622H3.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-64MNV6AB.js";import{c as S}from"./chunk-7S5E7KWT.js";import{isAbsolute as x,relative as h}from"path";function g(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function F(e){return e.replace(/\\/g,"/")}function X(e,t){return g(e)===g(t)}function P(e,t){let n=h(e,t);return n===""||!n.startsWith("..")&&!x(n)}import{readdirSync as y}from"fs";import{execFileSync as _}from"child_process";import{extname as l,join as R}from"path";var C=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],H=[".vue"],p=[".tsx",".jsx"],f=[".vue"],I=[...p,...f],O=new Set(p),v=new Set(f),E=new Set(C.map(e=>e.toLowerCase())),w=[...E].sort().join(","),m=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function N(e,t={}){let n=t.includeIndexed??!0,i=t.includeAuxiliary??!0,o=t.extensions?.map(c=>c.toLowerCase()),s=o?new Set(o):E,u=o?[...s].sort().join(","):w,r=`${n?"1":"0"}|${i?"1":"0"}|${u}`;return j.get(e,r,()=>{let c=new Set;if(n)for(let a of d(e,{includeIgnored:!1}))s.has(l(a).toLowerCase())&&c.add(a);if(i)for(let a of T(e.config.projectRoot,s))e.isIgnored(a)||n&&c.has(a)||c.add(a);return[...c].sort()})}function V(e,t={}){let n=!1,i=!1;for(let o of N(e,{extensions:I})){if(t.scope&&!o.includes(t.scope))continue;let s=l(o).toLowerCase();if(n||=O.has(s),i||=v.has(s),n&&i)break}return{react:n,vue:i}}var j=S("source-files",{clearGroups:[]});function T(e,t){return b(e,t)??L(e,t)}function b(e,t){try{let n=_("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}),i=new Set;for(let o of n.split(`
|
|
2
|
-
`)){let s=o.trim();s&&(A(s)||t.has(l(s).toLowerCase())&&i.add(s))}return i}catch{return null}}function A(e){return e.split("/").some(t=>m.has(t))}function L(e,t){let n=new Set,i=o=>{let s=o?R(e,o):e,u;try{u=y(s,{withFileTypes:!0})}catch{return}for(let r of u)if(!m.has(r.name)){if(r.isDirectory()){i(o?`${o}/${r.name}`:r.name);continue}t.has(l(r.name).toLowerCase())&&n.add(o?`${o}/${r.name}`:r.name)}};return i(""),n}export{g as a,F as b,X as c,P as d,H as e,m as f,N as g,V as h};
|
|
3
|
-
//# sourceMappingURL=chunk-GNG622H3.js.map
|
package/dist/chunk-GUDKRIGW.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{b as k}from"./chunk-QVGFVRKD.js";import{a as D}from"./chunk-IMQFJ53K.js";import{f as y,g as v}from"./chunk-BZXE3HO4.js";import{p as S}from"./chunk-GULVO6NF.js";import{f as L}from"./chunk-7TVFPOD7.js";import{d as h}from"./chunk-X5C43YVI.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||y(e,l.relativePath)||v(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(y(e,t.relativePath)||v(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
|
|
2
|
-
FROM global_symbols gs
|
|
3
|
-
JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
4
|
-
JOIN documents d ON d.id = der.document_id
|
|
5
|
-
WHERE gs.symbol = ?
|
|
6
|
-
LIMIT 1`,n);return s?L(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=L(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
|
|
7
|
-
//# sourceMappingURL=chunk-GUDKRIGW.js.map
|
package/dist/chunk-GULVO6NF.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import{d as O}from"./chunk-WMO2VZZK.js";import{d as R}from"./chunk-27HMTUJE.js";import{f as F,m as T}from"./chunk-7TVFPOD7.js";import{e as d}from"./chunk-X5C43YVI.js";import{a as v,b as k,f as h,o as y}from"./chunk-JZBGTSAB.js";import{x as A}from"./chunk-ISLWJ4PY.js";import{p as m}from"./chunk-WS3Z6W3M.js";import{a as w,c as p,g as L}from"./chunk-GNG622H3.js";import{c as u,d as D}from"./chunk-7S5E7KWT.js";function _(e,r,n,t={}){if(!n)return[];let i=m(e,r);return i?i.indexOf(n)===-1?[]:(N(e,r).get(n)??[]).filter(o=>!W(o,t)):[]}function W(e,r){return typeof r.excludeStartLine=="number"&&typeof r.excludeEndLine=="number"&&e>=r.excludeStartLine&&e<=r.excludeEndLine}var Y=u("file-identifiers",{clearGroups:["whole-project","source-file"]});function P(e,r){let n=h(e,r);return n?n.fileIdentifiers:Y.get(e,r,()=>new Set(N(e,r).keys()))}var Q=u("file-ident-lines",{clearGroups:["whole-project","source-file"]});function N(e,r){let n=h(e,r);return n?n.identifierLineMap:Q.get(e,r,()=>X(e,r))}var V=u("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function ge(e,r){let n=h(e,r);return n?n.identifiersByLine:V.get(e,r,()=>{let t=N(e,r),i=0;for(let o of t.values()){let c=o[o.length-1];c!==void 0&&c>i&&(i=c)}let a=new Array(i+1);for(let o=0;o<=i;o+=1)a[o]=new Set;for(let[o,c]of t)for(let s of c)a[s].add(o);return a})}function X(e,r){let n=new Map,t=(c,s)=>{let l=n.get(c);if(!l){n.set(c,[s]);return}l[l.length-1]!==s&&l.push(s)},i=m(e,r);if(!i)return n;let a=k(i).split(/\r?\n/),o=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<a.length;c+=1){let s=a[c]??"";for(let l of s.matchAll(o))l[1]&&t(l[1],c)}return n}function Se(e,r){return I(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
|
|
2
|
-
m.symbol_id,
|
|
3
|
-
d.relative_path,
|
|
4
|
-
COUNT(*) AS ref_count
|
|
5
|
-
FROM mentions m
|
|
6
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
-
JOIN documents d ON c.document_id = d.id
|
|
8
|
-
WHERE m.role != 1
|
|
9
|
-
${t}
|
|
10
|
-
${e.pathExclusionsFor("d")}
|
|
11
|
-
GROUP BY m.symbol_id, d.relative_path`,...n??[])})}function he(e,r){return I(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
|
|
12
|
-
FROM mentions m
|
|
13
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
14
|
-
JOIN documents d ON c.document_id = d.id
|
|
15
|
-
WHERE m.role != 1
|
|
16
|
-
${t}
|
|
17
|
-
${e.pathExclusionsFor("d")}`,...n??[])}).filter(n=>n.symbol_id!==null)}function ye(e,r){return I(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id
|
|
18
|
-
FROM mentions m
|
|
19
|
-
WHERE m.role != 1
|
|
20
|
-
${t}`,...n??[])}).filter(n=>n.symbol_id!==null)}function $(e,r){return I(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
|
|
21
|
-
c.start_line AS chunk_start, c.end_line AS chunk_end
|
|
22
|
-
FROM mentions m
|
|
23
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
24
|
-
JOIN documents d ON c.document_id = d.id
|
|
25
|
-
WHERE m.role != 1
|
|
26
|
-
${t}
|
|
27
|
-
${e.pathExclusionsFor("d")}
|
|
28
|
-
ORDER BY d.relative_path, c.start_line`,...n??[])})}function I(e,r,n){if(!r)return n();if(r.length===0)return[];let t=[];for(let i=0;i<r.length;i+=750)t.push(...n(r.slice(i,i+750)));return t}function xe(e,r){let n=j(e);return n?r.filter(t=>j(t.file)===n):r}function Ce(e,r,n,t){let i=n.find(a=>a.file===r);if(i)return i;if(t){let a=new Set(y(e,r).map(o=>o.sourcePath).filter(o=>!!o));for(let o of n)for(let c of a)if(p(c,o.file))return o;return null}return n.length===1?n[0]:null}function j(e){let r=A(e);return r?r==="typescript"||r==="tsx"||r==="javascript"?"javascript-family":r:null}var q=D("global-leaf-index",{clearGroups:["whole-project"]});function x(e){return q.get(e,()=>{let r=e.all(`SELECT gs.id, gs.symbol,
|
|
29
|
-
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
30
|
-
FROM global_symbols gs
|
|
31
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
32
|
-
LEFT JOIN documents der_doc ON der_doc.id = der.document_id
|
|
33
|
-
LEFT JOIN (
|
|
34
|
-
SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
|
|
35
|
-
FROM mentions m
|
|
36
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
37
|
-
JOIN documents d ON c.document_id = d.id
|
|
38
|
-
WHERE m.role = 1
|
|
39
|
-
GROUP BY m.symbol_id
|
|
40
|
-
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
41
|
-
WHERE 1 = 1
|
|
42
|
-
${e.symbolNoiseFor("gs")}`),n=new Map;for(let t of r){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let i=d(t.symbol);if(!i)continue;let a=n.get(i);a||(a=[],n.set(i,a)),a.some(o=>o.symbolId===t.id)||a.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}var K=u("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function H(e,r){let n=w(r);return K.get(e,n,()=>ee(e,n))}function ee(e,r){let n=new Map;for(let t of y(e,r)){if(!t.sourcePath)continue;let i=t.localName??t.importedName;if(i&&B(n,i,t.sourcePath),t.kind==="namespace")for(let a of t.usedMembers)B(n,a,t.sourcePath)}return n}function B(e,r,n){let t=e.get(r);t||(t=new Set,e.set(r,t)),t.add(n)}var z=/[A-Za-z_$][A-Za-z0-9_$]*/g,G=/^[A-Za-z_$][A-Za-z0-9_$]*$/,ne=512;function C(e){let r=[],n=!1;for(let t of e)t&&(n=!0,G.test(t)||r.push(t));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:r}}function J(e,r){let n=te(r)?r:C(r);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;if(n.candidateNames.size<=ne){for(let i of n.candidateNames)if(i){if(G.test(i)){if(re(i).test(e))return!0;continue}if(e.includes(i))return!0}return!1}z.lastIndex=0;let t;for(;(t=z.exec(e))!==null;)if(n.candidateNames.has(t[0]))return!0;for(let i of n.nonIdentifierNames)if(e.includes(i))return!0;return!1}function te(e){return"candidateNames"in e}function re(e){return new RegExp(`(?<![A-Za-z_$0-9])${v(e)}(?![A-Za-z_$0-9])`)}function M(e,r,n){let t=x(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[g(t[0])];let i=t.filter(s=>s.file===r);if(i.length>0)return i.map(g);let a=H(e,r),o=a.get(n);if(o)for(let s of o){let l=t.filter(f=>p(s,f.file));if(l.length>0)return l.map(g)}let c=new Set;for(let s of a.values())for(let l of s)c.add(l);for(let s of c){let l=t.filter(f=>p(s,f.file));if(l.length>0&&l.length===t.length)return l.map(g)}return[]}function Ue(e,r,n){let t=M(e,r,n);if(t.length>0)return t;let i=x(e).get(n);return!i||i.length===0?[]:i.map(g)}function Z(e,r,n={}){let t=R(e,r);if(!t)return[];let i=d(t.symbol);if(!i)return[];if(n.semantic!==!1){let o=O(e,{...t,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(o.length>0){let c=new Map;for(let s of o){let l=c.get(s.file)??[];l.push(s.line),c.set(s.file,l)}return E(e,c)}}let a=new Map;for(let o of L(e)){let c=m(e,o);if(!c||c.indexOf(i)===-1||o!==t.relativePath&&!M(e,o,i).some(f=>f.symbolId===t.symbolId))continue;let s=_(e,o,i,o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});s.length>0&&a.set(o,s)}return E(e,a)}function We(e,r,n={}){let t=new Map;for(let s of r){if(!s.leaf)continue;let l=t.get(s.leaf)??[];l.push(s),t.set(s.leaf,l)}if(t.size===0)return new Map;let i=new Set(r.map(s=>s.symbolId)),a=new Set(t.keys()),o=C(a),c=new Map;for(let s of L(e)){if(n.skipPath?.(s)||!J(m(e,s),o))continue;let l=P(e,s);if(l.size!==0){for(let f of l)if(t.has(f))for(let b of M(e,s,f)){if(!i.has(b.symbolId)||s===b.relativePath)continue;let S=c.get(b.symbolId);S||(S=new Set,c.set(b.symbolId,S)),S.add(s)}}}return c}function g(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function E(e,r){let n=[],t=new Set;for(let[i,a]of r){let o=F(e,i);for(let c of a){let s=T(o,c),l=`${i}|${c}|${s?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:s?.symbol??null}))}}return n}function ie(e,r){let n=fe(e,r);return n?E(e,se(e,n.match,n.identifier)):[]}function en(e,r,n={}){return oe(e,r,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function oe(e,r,n={}){let t=Z(e,r,{semantic:n.semantic}),i=t.length>0?U(t,"source-attribution"):U(ie(e,r),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(a=>!e.isIgnored(a.file))}function U(e,r){return e.map(n=>({...n,provenance:r}))}function se(e,r,n){let t=new Map;for(let[i,a]of ae(e,r.symbolId))t.set(i,ce(e,i,a,r,n));return t}function ae(e,r){let n=new Map;for(let t of $(e,[r])){if(e.isIgnored(t.relative_path))continue;let i=n.get(t.relative_path);i||(i=[],n.set(t.relative_path,i)),i.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function ce(e,r,n,t,i){let a=r===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},o=i?_(e,r,i,a):[];return n.flatMap(c=>le(o,c))}function le(e,r){let n=e.filter(t=>t>=r.start_line&&t<=r.end_line);return n.length>0?n:[r.start_line]}function fe(e,r){let n=R(e,r);return n?{match:n,identifier:d(n.symbol)||null}:null}export{N as a,ge as b,Se as c,he as d,ye as e,$ as f,xe as g,Ce as h,x as i,C as j,J as k,H as l,M as m,Ue as n,We as o,ie as p,en as q};
|
|
43
|
-
//# sourceMappingURL=chunk-GULVO6NF.js.map
|
package/dist/chunk-HZZQKNVE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as k,f as C,g as w}from"./chunk-3AMWF6V5.js";import{b as N}from"./chunk-B75HZHUP.js";import{b as A,c as M}from"./chunk-BZXE3HO4.js";import{a as z}from"./chunk-BGBBVSH4.js";import{g as x}from"./chunk-7TVFPOD7.js";import{d as v}from"./chunk-X5C43YVI.js";import{b as h,k as S,o as R}from"./chunk-JZBGTSAB.js";import{c as d}from"./chunk-GNG622H3.js";function fe(t,e={}){let{includeHomonyms:r=!1,limit:o}=e,i=F(t,e).filter(s=>s.relationship==="divergent"||r&&s.relationship==="homonym");return o?i.slice(0,o):i}function F(t,e={}){let{scope:r,minSimilarity:o=.3,scanLimit:i}=e,s=B(t,{scope:r,scanLimit:i});return $(s,{minSimilarity:o,isDelegatePair:Y(t)})}function $(t,e={}){let r=e.minSimilarity??.3,o=e.isDelegatePair,i=t.filter(n=>!ee(n.leaf)),s=[...new Set(i.map(n=>n.leaf))],a=H(s),l=[];for(let n of a){let c=i.filter(f=>n.has(f.leaf));if(c.length<2||new Set(c.map(f=>f.file)).size<2||c.every(f=>A(f.file)==="test"))continue;let m=null,b=!1,y=!1;for(let f=0;f<c.length;f+=1)for(let u=f+1;u<c.length;u+=1){let g=c[f],p=c[u];if(g.file===p.file||o?.(g,p,c)||o?.(p,g,c))continue;if(b=!0,g.normalizedBody===p.normalizedBody){y=!0;continue}let L=E(g.tokens,p.tokens);(!m||L>m.similarity)&&(m={a:g,b:p,similarity:L})}if(!b)continue;let T=[...c].sort((f,u)=>f.file.localeCompare(u.file)||f.startLine-u.startLine).map(O);if(!m){l.push({leaf:P(n),relationship:y?"identical":"homonym",maxDivergence:0,members:T});continue}let D=m.similarity>=r?"divergent":"homonym";l.push({leaf:P(n),relationship:D,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:T,...D==="divergent"?{firstDivergentTokens:Z(m.a.tokens,m.b.tokens)}:{}})}return l.sort((n,c)=>c.members.length-n.members.length||c.maxDivergence-n.maxDivergence||n.leaf.localeCompare(c.leaf))}function B(t,e){let r=x(t,{scope:e.scope}).filter(s=>s.isFunctionLike&&!t.isIgnored(s.relativePath)).filter(s=>!M(s.relativePath));r.sort((s,a)=>s.relativePath.localeCompare(a.relativePath)||s.startLine-a.startLine);let o=N(r,e.scanLimit),i=[];for(let s of o){let a=I(t,s);a&&i.push(a)}return i}function I(t,e){if(!e.leaf)return null;let r=C(t,e);if(!r)return null;let o=k(r);if(!o||o.length<8)return null;let i=G(r);return i.length===0?null:{leaf:e.leaf,symbol:e.symbol,shortName:v(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:z(e),normalizedBody:o,tokens:i,isThinForwarder:X(r)}}var j=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function G(t){let e=w(t);return h(e).match(j)??[]}function O(t){return{symbol:t.symbol,shortName:t.shortName,file:t.file,startLine:t.startLine,endLine:t.endLine,loc:t.loc}}function E(t,e){let r=new Set(t),o=new Set(e);if(r.size===0&&o.size===0)return 1;if(r.size===0||o.size===0)return 0;let i=0;for(let a of r)o.has(a)&&(i+=1);let s=r.size+o.size-i;return s===0?0:i/s}function Z(t,e){let r=Math.min(t.length,e.length),o=0;for(;o<r&&t[o]===e[o];)o+=1;let i=t.slice(o,o+6).join(" "),s=e.slice(o,o+6).join(" ");return!i&&!s?"(bodies differ only in trailing length)":`A: ${i||"(end)"} | B: ${s||"(end)"}`}function H(t){let e=new Map;for(let a of t)e.set(a,a);let r=a=>{let l=a;for(;e.get(l)!==l;)l=e.get(l);let n=a;for(;e.get(n)!==l;){let c=e.get(n);e.set(n,l),n=c}return l},o=(a,l)=>{let n=r(a),c=r(l);n!==c&&e.set(n,c)},i=new Map;for(let a of t){let l=a.slice(0,1).toLowerCase(),n=i.get(l)??[];n.push(a),i.set(l,n)}for(let a of i.values())for(let l=0;l<a.length;l+=1)for(let n=l+1;n<a.length;n+=1)W(a[l],a[n])&&o(a[l],a[n]);let s=new Map;for(let a of t){let l=r(a),n=s.get(l)??new Set;n.add(a),s.set(l,n)}return[...s.values()]}function W(t,e){return t===e||t.toLowerCase()===e.toLowerCase()?!0:t.length<8||e.length<8||Math.abs(t.length-e.length)>2?!1:K(t.toLowerCase(),e.toLowerCase(),2)}function K(t,e,r){if(Math.abs(t.length-e.length)>r)return!1;let o=Array.from({length:e.length+1},(i,s)=>s);for(let i=1;i<=t.length;i+=1){let s=[i],a=s[0];for(let l=1;l<=e.length;l+=1){let n=t[i-1]===e[l-1]?0:1,c=Math.min(o[l]+1,s[l-1]+1,o[l-1]+n);s.push(c),a=Math.min(a,c)}if(a>r)return!1;o=s}return o[e.length]<=r}function X(t){let e=h(w(t)).trim();if(!e||q.test(e))return!1;let r=U(e);return r.length===0||r.length>2?!1:Q(r[r.length-1])}var q=/\b(?:if|else|for|while|switch|try|catch|do)\b/,J=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function Q(t){let e=t.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return J.test(e)}function U(t){let e=[],r=0,o="";for(let i of t){if(i==="("||i==="["||i==="{"?r+=1:(i===")"||i==="]"||i==="}")&&(r=Math.max(0,r-1)),i===";"&&r===0){e.push(o),o="";continue}o+=i}return o.trim()&&e.push(o),e.map(i=>i.trim()).filter(i=>i.length>0)}var V=3;function Y(t){let e=new Map;return(r,o,i)=>{if(!r.isThinForwarder)return!1;let s=`${r.symbol}\0${o.symbol}`,a=e.get(s);if(a!==void 0)return a;let l=_(t,r,o,i,V,new Set);return e.set(s,l),l}}function _(t,e,r,o,i,s){if(i<=0||s.has(e.symbol)||(s.add(e.symbol),(S(t,e.file)??[]).filter(n=>n.line>=e.startLine&&n.line<=e.endLine&&n.calleeLeaf===r.leaf).length===0))return!1;let l=new Set(R(t,e.file).filter(n=>n.sourcePath&&(n.kind!=="namespace"||n.usedMembers.includes(r.leaf))).map(n=>n.sourcePath));if([...l].some(n=>d(n,r.file)))return!0;for(let n of o)if(!(n.symbol===e.symbol||n.symbol===r.symbol||!n.isThinForwarder)&&[...l].some(c=>d(c,n.file))&&_(t,n,r,o,i-1,s))return!0;return!1}function ee(t){return t.startsWith("<")&&t.endsWith(">")}function P(t){return[...t].sort()[0]}export{fe as a,F as b,$ as c,X as d,U as e};
|
|
2
|
-
//# sourceMappingURL=chunk-HZZQKNVE.js.map
|
package/dist/chunk-I4R3SNMR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as S}from"./chunk-WMO2VZZK.js";import{a as f,e as D}from"./chunk-X5C43YVI.js";import{x as F}from"./chunk-ISLWJ4PY.js";import{b as C,l as g,m as v,o as y}from"./chunk-WS3Z6W3M.js";import{c as d}from"./chunk-7S5E7KWT.js";var E=d("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]}),b=v({kind:"consumer-file-usage",invalidation:y("consumer-file-usage"),serialize:O,deserialize:k});function B(n,e){return{forDefinitions(i,r){return M(n,e,i,r)}}}function J(n){let e=new Map;for(let[i,r]of n)e.set(i,new Set(r.files.map(t=>t.file)));return e}function q(n,e,i){return L(n,e,i).partition}function M(n,e,i,r){let t=x(i.length);return g("consumer-evidence.product",()=>{let o=w(n,e,i,r),s=new Map;t={...t,...o.counters};for(let a of i){let c=o.sources.get(a.symbolId)??new Map,l=L(n,a,[...c.keys()],c);t.realFiles+=l.partition.realConsumers.length,t.reexportOnlyFiles+=l.partition.barrelConsumers,t.importOnlyFiles+=l.partition.importOnlyConsumers,s.set(a.symbolId,{definition:a,files:l.files,...l.partition})}return s},()=>({...t}))}function x(n){return{definitions:n,indexedFiles:0,semanticFiles:0,fallbackFiles:0,totalFiles:0,realFiles:0,reexportOnlyFiles:0,importOnlyFiles:0}}function w(n,e,i,r){let t=x(i.length),o=new Map;return m(o,t,"indexed",e.crossFileCallerMap(i,{semantic:!1})),r.semantic&&m(o,t,"semantic",S(n,i)),r.sourceFallback!==!1&&m(o,t,"source-fallback",e.sourceFallbackCallerFiles(i)),t.totalFiles=[...o.values()].reduce((s,a)=>s+a.size,0),{sources:o,counters:t}}function m(n,e,i,r){let t=0;for(let[o,s]of r){let a=n.get(o);a||(a=new Map,n.set(o,a));for(let c of s){t++;let l=a.get(c)??new Set;l.add(i),a.set(c,l)}}i==="indexed"?e.indexedFiles+=t:i==="semantic"?e.semanticFiles+=t:e.fallbackFiles+=t}function L(n,e,i,r=new Map){let t=[],o=0,s=0,a=D(e.symbol),c=[];for(let l of i){let u;_(n,l,e.relativePath,a)?(o++,u="reexport-only"):h(n,l,a)?(s++,u="import-only"):(t.push(l),u="real"),c.push({file:l,sources:[...r.get(l)??[]],classification:u})}return{partition:{realConsumers:t,barrelConsumers:o,importOnlyConsumers:s},files:c}}function h(n,e,i){if(!i)return!1;let r=F(e);if(!r)return!1;let t=E.get(n,e,()=>P(n,e,r));return t.importedLeaves.has(i)&&!t.usedLeaves.has(i)}function P(n,e,i){let r=f(n).forFile(e,{text:!0,ast:!0}),t=r.text;if(!t)return U();let o=C(n,e,t),s=b.read(n,e,o);if(s)return s;let a=I(r.ast,i);return b.write(n,e,o,a),a}function I(n,e){let i=new Set,r=new Set;if(!n)return{importedLeaves:i,usedLeaves:r};let t=e==="rust"?new Set(["use_declaration"]):e==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),o=(s,a)=>{let c=a||t.has(s.type);(s.type==="identifier"||s.type==="type_identifier"||s.type==="property_identifier"||s.type==="field_identifier")&&(c?i.add(s.text):r.add(s.text));for(let l of s.children)o(l,c)};return o(n.rootNode,!1),{importedLeaves:i,usedLeaves:r}}function U(){return{importedLeaves:new Set,usedLeaves:new Set}}function O(n){return JSON.stringify({importedLeaves:[...n.importedLeaves],usedLeaves:[...n.usedLeaves]})}function k(n){try{let e=JSON.parse(n);return!Array.isArray(e.importedLeaves)||!Array.isArray(e.usedLeaves)?null:{importedLeaves:new Set(e.importedLeaves.filter(i=>typeof i=="string")),usedLeaves:new Set(e.usedLeaves.filter(i=>typeof i=="string"))}}catch{return null}}function _(n,e,i,r){if(!r)return!1;let t=f(n).forFile(e,{lines:!0,reexports:!0}),o=t.lines??[];if(o.length===0)return!1;let s=t.reexports??[];if(s.length===0)return!1;let a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=new RegExp(`\\b${a}\\b`),l=0;for(let u=0;u<o.length;u++){if(!c.test(o[u]??""))continue;if(l++,!s.find(p=>p.startLine<=u&&u<=p.endLine))return!1}return l>0}export{B as a,J as b,q as c,h as d};
|
|
2
|
-
//# sourceMappingURL=chunk-I4R3SNMR.js.map
|
package/dist/chunk-IMQFJ53K.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as D,f as H,g as O}from"./chunk-BZXE3HO4.js";import{a as x}from"./chunk-BGBBVSH4.js";import{b as U,d as X,e as Z,f as $}from"./chunk-5VY3RIEI.js";import{a as _,j as z,k as J,m as N,n as Q}from"./chunk-GULVO6NF.js";import{a as B}from"./chunk-BP7S6V3M.js";import{f as I,h as W,i as Y,j as P}from"./chunk-7TVFPOD7.js";import{a as j,g as k,h as T,j as V,k as G}from"./chunk-X5C43YVI.js";import{m as F}from"./chunk-JZBGTSAB.js";import{x as R,y as E}from"./chunk-ISLWJ4PY.js";import{l as w,p as A,s as h}from"./chunk-WS3Z6W3M.js";import{g as K}from"./chunk-GNG622H3.js";import{a as q}from"./chunk-64MNV6AB.js";function ee(n,e,t){let r=e.identifierResolution==="strict"?N:Q,l=e.candidateNames?z(e.candidateNames):null,o=0,f=0,m=0,p=0,y="";for(let a of e.paths)if(o+=1,y=a,!(!R(a)&&!(e.includeVueSfc&&E(a)))&&!n.isIgnored(a)&&!e.skipPath?.(a))try{if(l&&!J(A(n,a),l))continue;f+=1;let S=(s,u,v,b)=>{if(e.candidateNames&&!e.candidateNames.has(s))return;m+=1;let g=e.resolveTargets?e.resolveTargets({sourceFile:a,name:s,kind:u,defaultTargets:b}):b();for(let L of g)p+=1,t({sourceFile:a,name:s,target:L,occurrences:v,kind:u})},M=_(n,a);for(let[s,u]of M)S(s,"identifier",u.length,()=>r(n,a,s));for(let s of F(n,a,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let u=s.kind==="cross-language-dispatch"?()=>N(n,a,s.name):()=>r(n,a,s.name);S(s.name,s.kind,s.occurrences,u)}}finally{e.afterPath?.(a),o%10===0&&w("source-reference-scan.progress",()=>{},()=>({scannedPaths:o,currentPath:y,candidateMatchedPaths:f,visitedNames:m,visitedHits:p}))}}function ne(n,e={}){let{scope:t,files:r,minLoc:l=1,maxLoc:o=Number.POSITIVE_INFINITY,excludeSymbol:f,excludeEntrySurfaces:m=!1,excludeTypesFiles:p=!1,excludeRootedSymbols:y=!1,requireFunctionLikeSymbol:a=!1,requireCallableSymbol:C=!1,excludeRustTraitImplMembers:S=!1,includeSuppressed:M=!1,sortByLocDesc:s=!1}=e,u=[],v=re(n,{scope:t,files:r,requireFunctionLikeSymbol:a,requireCallableSymbol:C}),b=new Map,g=new Map,L=i=>{let c=b.get(i);if(c!==void 0)return c;let d=H(n,i);return b.set(i,d),d},ie=i=>{let c=g.get(i);if(c!==void 0)return c;let d=D(i);return g.set(i,d),d};for(let i of v){let c=i.relativePath;if(n.isIgnored(c)||m&&L(c)||!oe(i,{requireFunctionLikeSymbol:a,requireCallableSymbol:C})||f!==void 0&&i.symbol===f)continue;let d=x(i);d<l||d>o||p&&ae(c)||y&&O(n,i.symbol,c)||S&&V(i.symbol)||ie(c)!=="test"&&(G(i.symbol)||!M&&h(n,c,i.startLine)||u.push(i))}return s?u.sort((i,c)=>x(c)-x(i)):u}function re(n,e){return e.files!==void 0?[...new Set(e.files.map(r=>r.replace(/\\/g,"/")))].sort().filter(r=>!e.scope||r.includes(e.scope)).flatMap(r=>I(n,r)):e.requireCallableSymbol?P(n,{scope:e.scope,symbolMatches:k,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?P(n,{scope:e.scope,symbolMatches:T,sqlPrefilter:"function-like"}):Y(n,e.scope)}function oe(n,e){return e.requireCallableSymbol?k(n.symbol):e.requireFunctionLikeSymbol?T(n.symbol):n.isFunctionLike}function ae(n){return(n.split("/").pop()??"").includes("types")}var te=class{constructor(e){this.db=e}db;scopedDefinitions(e){return W(this.db,e)}definitionsForFile(e){return I(this.db,e)}productionCallableDefinitions(e={}){return ne(this.db,e)}calleeMap(e,t={}){return U(this.db,e,t)}crossFileCallerMap(e,t={}){return X(this.db,e,t)}sourceFallbackCallerFiles(e,t={}){return Z(this.db,e,t)}callerFileMap(e,t={}){return $(this.db,e,t)}frameworkReferencedSymbolIds(e){let t=new Map;for(let l of e){if(!l.leaf)continue;let o=t.get(l.leaf)??[];o.push(l.symbolId),t.set(l.leaf,o)}let r=new Set;for(let l of q(this.db,{includeIgnored:!1}))if(R(l)==="rust")for(let{name:o}of F(this.db,l,{includeRustAttributeNames:!0}))for(let f of t.get(o)??[])r.add(f);return r}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let r=new Map(e.map(o=>[o.symbolId,o.symbol])),l=this.calleeMap(e,t);return new Set([...l.entries()].filter(([o,f])=>{let m=r.get(o);return f.some(p=>p.symbol!==m)}).map(([o])=>o))}fileDependencyGraph(e){return B(this.db,e)}fileKind(e){return D(e)}hasSuppressionComment(e){return h(this.db,e.relativePath,e.startLine)}sourceFiles(){return K(this.db)}scanSourceReferences(e,t){ee(this.db,e,t)}callableSignature(e){let t=j(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(r=>r.startLine===e.startLine&&r.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};export{te as a};
|
|
2
|
-
//# sourceMappingURL=chunk-IMQFJ53K.js.map
|
package/dist/chunk-ISLWJ4PY.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as Ce,b as ke,i as Le,j as y,m as _e,o as Fe,p as g,q as Pe}from"./chunk-WS3Z6W3M.js";import{b as v,g as U}from"./chunk-GNG622H3.js";import{a as Te}from"./chunk-64MNV6AB.js";import{c as re,d as z,e as _,f as be}from"./chunk-7S5E7KWT.js";import{existsSync as se,readFileSync as ie,readdirSync as Ft,statSync as Pt}from"fs";import{join as A,relative as wt}from"path";function we(e){let t=At(e)??Bt(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of jt(e,o)){if(r.has(s))continue;r.add(s);let i=It(e,s);i&&n.push(i)}return n}function At(e){let t=A(e,"pnpm-workspace.yaml");if(!se(t))return null;try{return Et(ie(t,"utf8"))}catch{return null}}function Et(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Vt(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=Rt(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Vt(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Rt(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Bt(e){let t=A(e,"package.json");if(!se(t))return null;try{let n=JSON.parse(ie(t,"utf8"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function jt(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=A(e,t);return oe(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=A(e,r||".");return oe(s)?Ft(s).map(i=>A(s,i,o)).filter(oe):[]}function oe(e){try{return Pt(e).isDirectory()}catch{return!1}}function It(e,t){let n=A(t,"package.json");if(!se(n))return null;try{let r=JSON.parse(ie(n,"utf8"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:wt(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}import{extname as Ae}from"path";var $t={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function M(e){return $t[Ae(e).toLowerCase()]??null}function Ee(e){return Ae(e).toLowerCase()===".vue"}import{createRequire as Dt}from"module";var d=Dt(import.meta.url),q=null,Ve=!1;function Ot(){if(Ve)return null;if(q)return q;try{return q=d("tree-sitter"),q}catch{return Ve=!0,null}}var Re=new Map,H=new Set;function Wt(e){if(H.has(e))return null;let t=Re.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return H.add(e),null}}catch{return H.add(e),null}return Re.set(e,n),n}var Be=new Map;function zt(e){let t=Be.get(e);if(t)return t;let n=Wt(e);if(!n)return null;let r=Ot();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return H.add(e),null}return Be.set(e,o),o}function Ut(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function I(e,t){let n=zt(e);if(!n)return null;try{return Ut(n,t)}catch{return null}}import{posix as ae}from"path";import{parse as Mt}from"@vue/compiler-sfc";var qt=_("vue-sfc-units");function E(e,t){let n=$e(t),r=g(e,n);return qt.get(e,n,r,()=>ce(e,n,r))}function $e(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Ht(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function F(e){return!e||e.body.length===0?0:e.body.split(`
|
|
2
|
-
`).length}function ce(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Mt(n,{filename:t})}catch(i){return r.errors.push(Ie(i)),r}r.errors.push(...o.errors.map(Ie));let{descriptor:s}=o;return s.template&&(r.template=J(e,t,"template",s.template)),s.script&&r.scripts.push(je(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(je(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>J(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>J(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function je(e,t,n,r){let o=J(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:Ht(o.lang)}}function J(e,t,n,r){let o=Zt(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=Jt(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),f=l?Math.max(0,l.split(`
|
|
3
|
-
`).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:f,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function Jt(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=$e(ae.normalize(ae.join(ae.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function Zt(e){return{...e}}function Ie(e){return e instanceof Error?e.message:String(e)}function De(e,t,n){let o=ce(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
|
|
4
|
-
`.repeat(i.startLine)}${i.body}`).join(`
|
|
5
|
-
`),startLine:0,language:s}:null}var Oe=be("ast-trees",{clearGroups:["whole-project","source-file"]});function We(e,t){if(Ee(t))return Xt(e,t);let n=M(t);if(!n)return null;let r=g(e,t);return r?Oe.get(e,t,r,()=>I(n,r)):null}function Xt(e,t){let n=g(e,t);return n?Oe.get(e,t,n,()=>{let r=De(e,t,n);if(!r)return null;let o=`
|
|
6
|
-
`.repeat(r.startLine)+r.body;return I(r.language,o)}):null}import{extname as Yt}from"path";function Z(e,t){let n=Gt(e,t);if(!n)return null;let r=le(n);return r?{calleeLeaf:r,memberAccess:Qt(n),line:e.startPosition.row}:null}function Gt(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function Qt(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function le(e){switch(e.type){case"identifier":case"type_identifier":case"property_identifier":case"shorthand_property_identifier":return e.text;case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?le(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?le(t):null}case"super":case"self":case"this":return null;default:return null}}var Kt=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function X(e){return e.length<=2||Kt.has(e)}var en=[".tsx",".jsx"],ze=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),tn=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),nn=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),rn=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),on=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),sn=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),an=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),cn=_("react-component-behavior-profiles"),Ue=_e({kind:"react-component-behavior-profiles",invalidation:Fe("react-component-behavior-profiles"),serialize:fn,deserialize:mn});function Je(e,t={}){let n=U(e,{extensions:en}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>pe(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function pe(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return cn.get(e,n,r,()=>ln(e,n,r)).map(pn)}function ln(e,t,n){let r=ke(e,t,n),o=Ue.read(e,t,r);if(o)return o;let s=un(e,t);return Ue.write(e,t,r,s),s}function un(e,t){let n=gn(t);if(!n)return[];let r=We(e,t);if(!r)return[];let o=Pe(e,t).length;return hn(r.rootNode,n).filter(i=>i.kind==="hook"||fe(i.bodyNode)).map(i=>{let a=Cn(i.bodyNode),c=Fn(i.bodyNode,n);return{file:t,name:i.name,kind:i.kind,startLine:i.node.startPosition.row,endLine:i.node.endPosition.row,loc:Math.max(1,i.node.endPosition.row-i.node.startPosition.row+1),fileLines:o,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:C(a.componentNames),nativeTags:C(a.nativeTags),propNames:C(a.propNames),eventNames:C(a.eventNames),hookNames:C(c.hookNames),requestNames:C(c.requestNames),stateNames:C(c.stateNames),effectNames:C(c.effectNames),handlerNames:C(c.handlerNames)}})}function pn(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function fn(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function mn(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=dn(r);if(!o)return null;n.push(o)}return n}catch{return null}}function dn(e){if(!Le(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:f,nativeTags:u,propNames:N,eventNames:B,hookNames:te,requestNames:ne,stateNames:m,effectNames:b,handlerNames:j}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!G(o)||!G(s)||!G(i)||!G(a))return null;let S={jsxTokens:y(c),behaviorTokens:y(l),componentNames:y(f),nativeTags:y(u),propNames:y(N),eventNames:y(B),hookNames:y(te),requestNames:y(ne),stateNames:y(m),effectNames:y(b),handlerNames:y(j)};return Object.values(S).some(_t=>_t===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(S.jsxTokens),behaviorTokens:new Set(S.behaviorTokens),componentNames:S.componentNames,nativeTags:S.nativeTags,propNames:S.propNames,eventNames:S.eventNames,hookNames:S.hookNames,requestNames:S.requestNames,stateNames:S.stateNames,effectNames:S.effectNames,handlerNames:S.handlerNames}}function G(e){return typeof e=="number"&&Number.isFinite(e)}function gn(e){let t=Yt(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:M(e)}function hn(e,t){let n=[],r=new Set,o=s=>{let i=Sn(s);if(i&&(!Nn(s)||i.kind==="component")){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;r.has(a)||(r.add(a),n.push(i))}for(let a of s.namedChildren)o(a)};return(t==="tsx"||t==="javascript")&&o(e),n}function Sn(e){if(e.type==="class_declaration"){let s=ue(e);if(!s||!/^[A-Z]/.test(s))return null;let i=yn(e);return!i||!xn(e)&&!fe(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=ue(e);return!s||!Me(s)?null:{name:s,kind:qe(s),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=$(t);if(!r||!n||!Me(r))return null;let o=vn(n);return o?{name:r,kind:qe(r),node:e,bodyNode:o}:null}function yn(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function xn(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function Me(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function qe(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function vn(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=bn(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Nn(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function ue(e){return $(e.childForFieldName("name")??e.namedChild(0))}function bn(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function fe(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(fe)}function Cn(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?kn(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Tn(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function kn(e,t){let n=Ln(e),r=!1;if(n){let o=He(n),s=o==="Fragment"||o==="React.Fragment";r=Vn(o)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let s=_n(o);if(!s)continue;let i=He(s);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else an.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(Ze(o))}function Tn(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(Ze(e)),Xe(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of Rn(n))X(r)||t.tokens.add(`binding:${r}`)}function Ze(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",o=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return o?`prop:spread:${o}`:"prop:spread"}function Xe(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(Xe)}function Ln(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function _n(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function Fn(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=o=>{if(o.type==="call_expression"){let s=Z(o,t);s&&Pn(s.calleeLeaf,n)}else if(o.type==="variable_declarator")An(o,n);else if(o.type==="function_declaration"){let s=ue(o);s&&Ge(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function Pn(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!ze.has(e)&&!rn.has(e)&&t.tokens.add(`hook:${e}`)),ze.has(e)&&t.tokens.add(`react-hook:${e}`),tn.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),nn.has(e)&&t.tokens.add(`state-hook:${e}`),wn(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function wn(e){if(on.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function An(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let s=n.namedChildren.find(a=>$(a)),i=$(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=$(n);o&&Ge(o,t)}function Ge(e,t){let n=En(e);!n||!sn.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function En(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function Vn(e){return/^[A-Z]/.test(e)||e.includes(".")}function He(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function $(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function Rn(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function C(e){return[...e].sort()}function D(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var Bn=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function tt(e,t){let n=In(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:Ye(n.functionNode),params:Qe(n.functionNode),paramsEndLine:Ke(n.functionNode),isLiteralPassthrough:et(n.functionNode,t)};if(!jn(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(o=>o.type==="identifier"||o.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:Ye(e),params:Qe(e),paramsEndLine:Ke(e),isLiteralPassthrough:et(e,t)}:null}function nt(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function Qe(e){let t=nt(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(D(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let o=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!o&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let i=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:i?.text??"",simple:!1})}return n}function Ke(e){let t=nt(e);return t?t.endPosition.row:e.startPosition.row}function jn(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?Bn.has(e):!1}function In(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}return null}function Ye(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)D(r)||(n+=1);return n}function et(e,t){let n=e.namedChildren.find(u=>u.type==="block"||u.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(u=>!D(u));if(r.length!==1)return!1;let o=r[0],s=null;if(o.type==="return_statement"||o.type==="expression_statement"?s=o.namedChild(0)??null:t==="rust"&&(o.type==="call_expression"||o.type==="macro_invocation")&&(s=o),!s)return!1;let i=t==="python"?"call":"call_expression";if(s.type!==i)return!1;let a=s.namedChildren.find(u=>u.type==="arguments"||u.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(u=>!D(u)),l=e.namedChildren.find(u=>u.type==="parameters"||u.type==="formal_parameters");if(!l)return!1;let f=[];for(let u of l.namedChildren){if(u.type==="identifier"){f.push(u.text);continue}let N=u.namedChildren.find(B=>B.type==="identifier");N&&f.push(N.text)}if(c.length!==f.length)return!1;for(let u=0;u<f.length;u+=1){let N=c[u];if(N.type!=="identifier"||N.text!==f[u])return!1}return!0}var $n=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),Dn=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),On=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),Wn=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),zn=new Set(["catch","for","function","if","return","switch","while"]);function K(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=F(n),n.external&&(t.externalLineCount+=F(n),t.externalScriptPaths.push(n.sourcePath));for(let o of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:o});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...Hn(n));let r=I(n.astLanguage,n.body);r?Mn(n,r.rootNode,t):qn(n,t)}return Un(t),t.externalScriptPaths=ot(t.externalScriptPaths),t}function Un(e){e.composables=V(e,"composable"),e.stores=V(e,"store"),e.reactivity=V(e,"reactivity"),e.lifecycle=V(e,"lifecycle"),e.requests=V(e,"request"),e.macros=V(e,"macro")}function V(e,t){return ot(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function Mn(e,t,n){let r=new Set,o=new Set,s=i=>{let a=tt(i,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;o.has(l)||(o.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=Z(i,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:rt(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function qn(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||zn.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+Q(e.body,n.index??0),categories:rt(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let o=e.startLine+Q(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let o=e.startLine+Q(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function Hn(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),o=n[2];if(!r||!o)continue;let s=e.startLine+Q(e.body,n.index??0);for(let i of Jn(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function Jn(e){let t=[],r=e.split(",").map(i=>i.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let o=/\{([^}]*)\}/.exec(e)?.[1];if(o)for(let i of o.split(",")){let a=i.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let s=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return s&&t.push(s),t.filter(i=>/^[A-Za-z_$][\w$]*$/.test(i))}function rt(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),$n.has(e)&&t.push("reactivity"),Dn.has(e)&&t.push("lifecycle"),On.has(e)&&t.push("request"),Wn.has(e)&&t.push("macro"),t}function Q(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function ot(e){return[...new Set(e)].sort()}import{ElementTypes as Zn,NodeTypes as me,parse as Xn}from"@vue/compiler-dom";import{parse as ss}from"@vue/compiler-sfc";function st(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var Gn=_("vue-template-facts"),Qn=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),Kn=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Yn=new Set(["div","span","template"]),er=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function Y(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return Gn.get(e,n,r,()=>tr(n,E(e,n).template))}function tr(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=Xn(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return at(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function at(e,t,n,r){for(let o of e)if(o.type===me.ELEMENT)nr(o,t,n,r),at(o.children,t,n,r);else if(o.type===me.INTERPOLATION){r("interpolation");let s=de(o.content);s&&ct(s,t,o.loc.start.line,n,r)}}function nr(e,t,n,r){let o=lr(e.tag),s={tag:e.tag,normalized:o,kind:cr(e),startLine:R(t,e.loc.start.line),endLine:R(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),Yn.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)rr(i,t,n,r)}function rr(e,t,n,r){if(e.type===me.ATTRIBUTE){let a=e.value?.content??null,c=it("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=sr(e),s=de(e.exp),i=it(or(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&ct(s,t,e.loc.start.line,n,r)}function it(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:R(r,o),endLine:R(r,s)}}function or(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function sr(e){let t=de(e.arg);return t||e.name}function de(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function ct(e,t,n,r,o){for(let s of ir(e)){let i={name:s,startLine:R(t,n),endLine:R(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function ir(e){let t=new Set,n=ar(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];er.has(s)||X(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function ar(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function cr(e){let t=e.tag;return e.tagType===Zn.COMPONENT?"component":Qn.has(t)?"builtin":Kn.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function lr(e){return st(e,/[-_:]/)}function R(e,t){return e+Math.max(0,t-1)}import{createRequire as ur}from"module";import{existsSync as w}from"fs";import{basename as lt,dirname as h,extname as k,join as x,relative as P,resolve as p,sep as pr}from"path";var fr=z("indexed-paths",{clearGroups:[]}),mr=z("indexed-path-digest",{clearGroups:[]}),dr=re("tsconfig-alias-config",{clearGroups:["whole-project"]}),gr=re("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),hr=ur(import.meta.url),O;function Sr(){if(O!==void 0)return O;try{O=hr("typescript")}catch{O=null}return O}var yr=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],xr=z("workspace-packages",{clearGroups:["whole-project"]}),W=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],ut=[".py",".pyi"],pt=[".java",".scala",".kt",".kts"],ft=[".rs"],mt=[".rb"],dt=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],gt=[".cs",".vb"],ht=[".dart"],St=[".php"],ee=[".clj",".cljs",".cljc"],vr=new Set(W),ge=new Set(ut),yt=new Set(pt),he=new Set(ft),Se=new Set(mt),xt=new Set(dt),vt=new Set(gt),ye=new Set(ht),Nt=new Set(St),bt=new Set(ee),Nr=[{extensions:W,lookup:vr},{extensions:ut,lookup:ge},{extensions:pt,lookup:yt},{extensions:ft,lookup:he},{extensions:mt,lookup:Se},{extensions:dt,lookup:xt},{extensions:gt,lookup:vt},{extensions:ht,lookup:ye},{extensions:St,lookup:Nt},{extensions:ee,lookup:bt}];function T(e,t){return t.has(k(e).toLowerCase())}function br(e){return T(e,ge)}function Cr(e){return T(e,yt)}function kr(e){return T(e,he)}function Tr(e){return T(e,Se)}function Lr(e){return T(e,xt)}function _r(e){return T(e,vt)}function vs(e){return k(e).toLowerCase()===".vb"}function Fr(e){return T(e,ye)}function Pr(e){return T(e,Nt)}function wr(e){return T(e,bt)}function Ar(e){let t=k(e).toLowerCase();for(let n of Nr)if(n.lookup.has(t))return n.extensions;return W}function Er(e){return Cr(e)||_r(e)||Pr(e)}function Ct(e,t,n){return br(t)?qr(e,t,n):kr(t)?Hr(e,t,n):Tr(t)?Jr(e,t,n):Lr(t)?Zr(e,t,n):Er(t)?Xr(e,n.replace(/\\/g,"."),Ar(t)):Fr(t)?Gr(e,t,n):wr(t)?Qr(e,n):Vr(e,t,n)}function Vr(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return Rr(e,t,n)??jr(e,n);let r=h(x(e.config.projectRoot,t)),o=p(r,n),s=L(e);for(let i of ve(o)){let a=v(P(e.config.projectRoot,i));if(s.has(a)||w(i))return a}return v(P(e.config.projectRoot,o))}function Rr(e,t,n){let r=zr(e,t);if(!r)return null;let o=L(e);for(let s of Br(r,n)){let i=p(r.baseUrl,s);for(let a of ve(i)){let c=v(P(e.config.projectRoot,a));if(o.has(c)||w(a))return c}}return null}function Br(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function jr(e,t){let n=$r(Ir(e),t);if(!n)return null;let r=L(e);for(let o of Dr(n)){let s=p(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of ve(s)){let a=v(P(e.config.projectRoot,i));if(r.has(a)||w(i))return a}}return null}function Ir(e){return xr.get(e,()=>we(e.config.projectRoot))}function $r(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function Dr(e){let t=[],n=Or(e.pkg.exports,e.subpath);if(n){let r=Wr(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function Or(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return kt(e[n])}function kt(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=kt(t[n]);if(r)return r}return null}function Wr(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function zr(e,t){let n=v(h(t));return gr.get(e,n,()=>Ur(e,n))}function Ur(e,t){let n=Sr();if(!n)return null;let r=p(e.config.projectRoot),o=p(r,t);for(;o===r||o.startsWith(r+pr);){for(let i of yr){let a=x(o,i);if(!w(a))continue;let c=dr.get(e,a,()=>Mr(n,a));if(c)return c}let s=h(o);if(s===o)break;o=s}return null}function Mr(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,h(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?p(h(t),r.options.baseUrl):h(t),paths:o}}catch{return null}}function qr(e,t,n){let r=L(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=h(x(e.config.projectRoot,t));for(let l=1;l<i;l++)c=h(c);o=a?p(c,a.replace(/\./g,"/")):c}else o=p(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of Kr(o)){let i=v(P(e.config.projectRoot,s));if(r.has(i)||w(s))return i}return null}function Hr(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=h(x(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=p(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=p(o,r.slice(6).replace(/::/g,"/")):s=p(h(o),r.slice(7).replace(/::/g,"/")),xe(e,Yr(s))}function Jr(e,t,n){let r=h(x(e.config.projectRoot,t)),o=p(r,n);return xe(e,eo(o))}function Zr(e,t,n){let r=h(x(e.config.projectRoot,t)),o=[p(r,n),p(e.config.projectRoot,n),p(e.config.projectRoot,"include",n),p(e.config.projectRoot,"src",n)];return xe(e,o)}function Xr(e,t,n){let r=L(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,f=[...r].find(u=>u.endsWith(l));if(f)return f}for(let c of n){let l=[...r].find(f=>lt(f)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(k(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function Gr(e,t,n){let r=L(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=h(x(e.config.projectRoot,t)),s=p(o,n);for(let i of to(s)){let a=v(P(e.config.projectRoot,i));if(r.has(a)||w(i))return a}return null}function Qr(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=L(e);for(let o of ee){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of ee){let s=[...r].find(i=>lt(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function Kr(e){let t=k(e);return ge.has(t)?[e]:[`${e}.py`,`${e}.pyi`,x(e,"__init__.py"),x(e,"__init__.pyi")]}function xe(e,t){let n=L(e);for(let r of t){let o=v(P(e.config.projectRoot,r));if(n.has(o)||w(r))return o}return null}function Yr(e){let t=k(e);return he.has(t)?[e]:[`${e}.rs`,x(e,"mod.rs")]}function eo(e){let t=k(e);return Se.has(t)?[e]:[`${e}.rb`,x(e,"index.rb")]}function to(e){let t=k(e);return ye.has(t)?[e]:[`${e}.dart`,e]}function ve(e){let t=k(e),n=new Set;if(t){n.add(e);for(let r of W)n.add(e.slice(0,-t.length)+r)}else for(let r of W)n.add(`${e}${r}`),n.add(x(e,`index${r}`));return[...n]}function L(e){return fr.get(e,()=>new Set(Te(e,{includeIgnored:!1}).map(v)))}function Ns(e){return mr.get(e,()=>Ce([...L(e)].sort().join(`
|
|
7
|
-
`)))}var no=new Set(["in","key","of"]),ro=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),oo=_("vue-component-behavior-profiles");function Tt(e,t={}){let n=U(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>Ne(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Ne(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=oo.get(e,n,r,()=>so(e,n,r));return ao(o)}function so(e,t,n){let r=E(e,t),o=Y(e,t),s=K(r),i=uo(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,b,j)=>j.indexOf(m)===b).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,b,j)=>j.indexOf(m)===b).sort(),l=n?n.split(`
|
|
8
|
-
`).length:0,f=F(r.template),u=s.lineCount,N=r.styles.reduce((m,b)=>m+F(b),0),B=r.customBlocks.reduce((m,b)=>m+F(b),0),{lines:te,paths:ne}=io(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:lo(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:f,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:B,delegatedComposableLines:te,delegatedComposablePaths:ne}}function io(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=Ct(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
|
|
9
|
-
`).length:0)},0),paths:o}}function ao(e){let t=co(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function co(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function lo(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(ro.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function uo(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of po(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of Lt(n.value))t.add(r);return[...t].sort()}function po(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?Lt(t[1]??""):[]}function Lt(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];no.has(r)||t.push(r)}return t}function js(e){return{capability:(t,n)=>fo(t,n),reactProfiles:(t={})=>Je(e,t),reactProfilesForFile:t=>pe(e,t),vueProfiles:(t={})=>Tt(e,t),vueProfileForFile:t=>Ne(e,t),vueTemplateFacts:t=>Y(e,t),vueScriptFacts:t=>K(E(e,t))}}function fo(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{we as a,jt as b,W as c,ut as d,pt as e,ft as f,mt as g,dt as h,gt as i,ht as j,St as k,ee as l,vs as m,Ar as n,Ct as o,qr as p,Hr as q,Jr as r,Zr as s,Xr as t,Gr as u,Qr as v,Ns as w,M as x,Ee as y,De as z,We as A,Z as B,le as C,tt as D,st as E,js as F};
|
|
10
|
-
//# sourceMappingURL=chunk-ISLWJ4PY.js.map
|
package/dist/chunk-IUSSGHJO.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-7COVQPQQ.js";import{b as u}from"./chunk-BZXE3HO4.js";import{a as p}from"./chunk-BP7S6V3M.js";import{existsSync as $}from"fs";import{join as _}from"path";function ne(e){return b.test(e)}var b=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|CHANGELOG(?:\.[a-z]+)?|.*\.map)$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function se(e,t,n={}){let{minTogether:s=4,minConfidence:i=.6,limit:r=30,maxFilesPerCommit:l=20}=n,g=y(e),a=g.commitHistory(),c=t!==void 0,d=g.coChangePairs({minTogether:c?Math.min(s,2):s,minConfidence:c?0:i,maxFilesPerCommit:l});if(!a||!d)return{available:!1,commitsAnalyzed:0,findings:[]};let f=typeof n.scanLimit=="number"?d.slice(0,n.scanLimit):d,R=p(e),k=E(e),L=F(e,R,k),w=n.includeLinked===!0||c,m=[];for(let o of f){if(b.test(o.fileA)||b.test(o.fileB)||!P(e,o.fileA)||!P(e,o.fileB)||c&&!o.fileA.includes(t)&&!o.fileB.includes(t)||!c&&(u(o.fileA)==="test"||u(o.fileB)==="test"||D(o.fileA,o.fileB)||N(o.fileA,o.fileB)))continue;let h=L(o.fileA,o.fileB);if(!w&&h)continue;let C=j(o.fileA,o.fileB),S=v(o,C,h);if(m.push({...o,structurallyLinked:h,partnerClass:C.partnerClass,partnerClassReasons:C.reasons,...S?{declaredCouplingSuggestion:S}:{}}),m.length>=r)break}return{available:!0,commitsAnalyzed:a.commits.length,findings:m}}function P(e,t){return $(_(e.config.projectRoot,t))}function j(e,t){let n=A(e),s=A(t),i=[],r=a=>{i.includes(a)||i.push(a)},l=(a,c)=>n.tags.has(a)&&s.tags.has(c)||n.tags.has(c)&&s.tags.has(a);if(l("doc","code"))return r("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:i};if(n.tags.has("test")||s.tags.has("test"))return r("one side is classified as a test file"),{partnerClass:"test-code",reasons:i};if(l("schema","script"))return r("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:i};if(l("model","view"))return r("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:i};if(l("config","code"))return r("configuration file changes with executable source"),{partnerClass:"config-code",reasons:i};let g=U(n.tokens,s.tokens).filter(a=>!J.has(a));return x(e,t)||g.length>=2?(r(x(e,t)?"both files live in the same directory":`files share feature tokens: ${g.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:i}):(r("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:i})}function v(e,t,n){if(n||e.together<4||e.confidence<.75||e.commitScope==="broad-sweep"||e.recency==="stale"||!Z.has(t.partnerClass))return;let s=[e.fileA,e.fileB].sort();return{name:`co-change ${t.partnerClass}: ${V(s)}`,files:s,reason:`${t.partnerClass} pair changed together ${e.together}x with ${Math.round(e.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function F(e,t=p(e),n=E(e)){return(s,i)=>B(t,n,s,i)}var I=/(?:^|\/)(?:locales|i18n)\//i;function T(e){return I.test(e)}function N(e,t){return T(e)&&T(t)?!0:O(e,t)}function O(e,t){if(!e.endsWith(".json")||!t.endsWith(".json"))return!1;let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(n<0||s<0)return!1;let i=e.slice(0,n),r=t.slice(0,s);if(i===r)return!1;let l=e.slice(n+1),g=t.slice(s+1);if(l!==g)return!1;let a=i.lastIndexOf("/"),c=r.lastIndexOf("/"),d=a>=0?i.slice(0,a):"",f=c>=0?r.slice(0,c):"";return d===f}function D(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(e.slice(0,n)!==t.slice(0,s))return!1;let i=e.slice(n+1).split(".")[0],r=t.slice(s+1).split(".")[0];return i!==""&&i===r}function E(e){return(e.config.declaredCouplings??[]).filter(t=>Array.isArray(t.files)&&t.files.length>=2).map(t=>new Set(t.files))}function B(e,t,n,s){return e.get(n)?.has(s)===!0||e.get(s)?.has(n)===!0?!0:t.some(i=>i.has(n)&&i.has(s))}var z=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,G=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,M=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,H=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,q=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,W=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,Z=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),J=new Set(["src","lib","app","test","tests","spec","index","main","utils","util","types","type","config","docs","doc"]);function A(e){let t=e.replace(/\\/g,"/"),n=new Set;return z.test(t)&&n.add("doc"),G.test(t)&&n.add("config"),M.test(t)&&n.add("schema"),H.test(t)&&n.add("script"),q.test(t)&&n.add("model"),W.test(t)&&n.add("view"),u(t)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:K(t)}}function x(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/"),i=n>=0?e.slice(0,n):"",r=s>=0?t.slice(0,s):"";return i!==""&&i===r}function K(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(t=>t.toLowerCase()).filter(t=>t.length>=2)}function U(e,t){let n=new Set(t);return[...new Set(e.filter(s=>n.has(s)))].sort()}function V(e){return e.map(t=>t.split("/").pop()?.replace(/\.[^.]+$/,"")||t).join(" + ")}export{ne as a,se as b,j as c,v as d,F as e};
|
|
2
|
-
//# sourceMappingURL=chunk-IUSSGHJO.js.map
|
package/dist/chunk-J5WVNZ6O.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b,b as y}from"./chunk-KJCDEDQW.js";import{a as R,b as H,c as B,e as h,f as k}from"./chunk-6XA4LDHY.js";import{a as p,b as g}from"./chunk-KMVGRIO2.js";import{F as v}from"./chunk-ISLWJ4PY.js";function V(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:i=6,limit:a=20,scope:c,scanLimit:n,filePattern:d,focusFiles:f}=s,l=v(e).reactProfiles({scope:c,minBehaviorTokens:Math.max(3,i),scanLimit:n}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r})),o=b(l,r=>r.tokens);return y({profiles:l,limit:a,filePattern:d,focusFiles:f,candidateIndex:o,profile:{name:"react-hook-candidates"},compare:(r,t)=>C(r,t,m,i),sort:(r,t)=>t.similarity-r.similarity||r.fileA.localeCompare(t.fileA)||r.componentA.localeCompare(t.componentA)||r.fileB.localeCompare(t.fileB)||r.componentB.localeCompare(t.componentB)})}function C(e,s,m,i){let a=p(e.tokens,s.tokens);if(a.size<i||!E(a))return null;let c=H(e.tokens,s.tokens);if(c<m)return null;let n=h(a,"hook:"),d=h(a,"react-hook:"),f=h(a,"effect:"),l=h(a,"state:"),o=h(a,"request:"),r=h(a,"handler:"),t=h(a,"handler-verb:"),u=S({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:o,sharedHandlers:r,sharedHandlerVerbs:t});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,sharedTokens:k(a),sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:o,sharedHandlers:r,sharedHandlerVerbs:t,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:k(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:k(g(s.tokens,e.tokens)).slice(0,25),reason:P({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:o,sharedHandlers:r,sharedHandlerVerbs:t}),locA:e.profile.loc,locB:s.profile.loc}}function S(e){return R({genericWords:q,stripPrefixes:w,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:A})}function A(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function E(e){let s=0,m=0,i=0,a=0,c=0,n=0,d=0;for(let o of e)o.startsWith("hook:")?s+=1:o.startsWith("react-hook:")?m+=1:o.startsWith("effect:")?i+=1:o.startsWith("request:")?a+=1:o.startsWith("handler:")||o.startsWith("handler-verb:")?c+=1:o.startsWith("state:")?n+=1:o.startsWith("state-hook:")&&(d+=1);let f=n+d,l=s+m+i+a+c+f;return B([{name:"requests",count:a},{name:"customHooks",count:s},{name:"namedStates",count:n},{name:"handlers",count:c},{name:"effects",count:i},{name:"reactHooks",count:m},{name:"namedBehavior",count:l}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{customHooks:1,requests:1,namedBehavior:5},reason:"shared custom hook and request workflow"},{min:{customHooks:1,namedStates:1,namedBehavior:5},reason:"shared custom hook and state"},{min:{customHooks:1,handlers:2,namedBehavior:5},reason:"shared custom hook and handlers"},{min:{namedStates:1,handlers:2,effects:1,namedBehavior:5},reason:"shared stateful effects"},{min:{namedStates:1,handlers:2,reactHooks:2,namedBehavior:5},reason:"shared stateful React primitives"}]).pass}function P(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var q=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),w=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
|
|
2
|
-
//# sourceMappingURL=chunk-J5WVNZ6O.js.map
|
package/dist/chunk-JJUX2OAP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as k}from"./chunk-B75HZHUP.js";import{a as g}from"./chunk-IMQFJ53K.js";import{b as S}from"./chunk-BZXE3HO4.js";import{a as n}from"./chunk-BGBBVSH4.js";import{e as v}from"./chunk-WMO2VZZK.js";import{d as L}from"./chunk-X5C43YVI.js";import{l as a}from"./chunk-WS3Z6W3M.js";function q(u,b={}){let{scope:P,minLoc:x=3,scanLimit:c}=b,t=new g(u),f=b.semantic!==!1,y=0,d=a("isolated.candidates",()=>{let e=k(t.productionCallableDefinitions({scope:P,minLoc:x,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:typeof c=="number"&&c>0}),c);return y=e.length,e},()=>({definitions:y})),p=0,o=a("isolated.strict-callees",()=>{let e=t.symbolsWithNonSelfCallees(d,{additive:!1,semantic:!1});return p=e.size,e},()=>({definitions:d.length,symbols:p})),r=d.filter(e=>!o.has(e.symbolId)),h=0,N=a("isolated.scip-callers",()=>{let e=t.crossFileCallerMap(r,{semantic:!1});return h=e.size,e},()=>({definitions:r.length,symbols:h})),l=new Set(N.keys());for(let e of t.frameworkReferencedSymbolIds(r))l.add(e);let s=r.filter(e=>!l.has(e.symbolId));if(f&&s.length>0){for(let e of v(u,s).keys())l.add(e);for(let e of t.symbolsWithNonSelfCallees(s,{additive:!1,semantic:!0}))o.add(e);s=s.filter(e=>!l.has(e.symbolId)).filter(e=>!o.has(e.symbolId))}let C=0,W=a("isolated.source-fallback-callers",()=>{let e=t.sourceFallbackCallerFiles(s,{skipPath:i=>S(i)==="test"});return C=e.size,e},()=>({definitions:s.length,symbols:C}));for(let e of W.keys())l.add(e);let m=s.filter(e=>!l.has(e.symbolId)),I=0,F=a("isolated.additive-callees",()=>{let e=t.symbolsWithNonSelfCallees(m,{additive:!0,semantic:f});return I=e.size,e},()=>({definitions:m.length,symbols:I}));for(let e of F)o.add(e);return m.filter(e=>!o.has(e.symbolId)).sort((e,i)=>n(i)-n(e)||e.relativePath.localeCompare(i.relativePath)||e.startLine-i.startLine).map(e=>({symbol:e.symbol,shortName:L(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:n(e)}))}export{q as a};
|
|
2
|
-
//# sourceMappingURL=chunk-JJUX2OAP.js.map
|