scip-query 0.10.11 → 0.11.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 +45 -0
- package/{vendor/scip/LICENSE.scip → LICENSE} +1 -0
- package/README.md +168 -55
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-2VSDXOG5.js +2 -0
- package/dist/chunk-343O6EVV.js +2 -0
- package/dist/chunk-3KDUITBE.js +7 -0
- package/dist/chunk-3T2FNHIU.js +2 -0
- package/dist/chunk-3V6JQQM5.js +2 -0
- package/dist/chunk-5AAAEZ2Z.js +2 -0
- package/dist/chunk-6Q6OFLFQ.js +8 -0
- package/dist/chunk-6XA4LDHY.js +2 -0
- package/dist/chunk-75X52JTA.js +2 -0
- package/dist/{chunk-54KGX7EX.js → chunk-7HB3CZFD.js} +2 -2
- package/dist/chunk-7JZRFDCU.js +2 -0
- package/dist/chunk-7XL7J7PT.js +3 -0
- package/dist/chunk-ALHNAPS2.js +2 -0
- package/dist/{chunk-JATUZIEH.js → chunk-BDRBPG7Y.js} +2 -2
- package/dist/chunk-BN5SXXQS.js +40 -0
- package/dist/chunk-C4ICAIJ4.js +3 -0
- package/dist/{chunk-LSET2TXH.js → chunk-CMHYBXJB.js} +2 -2
- package/dist/{chunk-YWYFU2V3.js → chunk-DRPAQAFM.js} +6 -6
- package/dist/chunk-FERAXG6Y.js +72 -0
- package/dist/chunk-FLJJLSGB.js +2 -0
- package/dist/chunk-FXG3PHVW.js +9 -0
- package/dist/chunk-GCN2P4EJ.js +2 -0
- package/dist/chunk-GHXRVCIY.js +21 -0
- package/dist/chunk-GNG622H3.js +3 -0
- package/dist/chunk-H4LUPLEJ.js +2 -0
- package/dist/{chunk-BASVXNY3.js → chunk-H56MGERE.js} +4 -4
- package/dist/chunk-H7NSJ7L2.js +5 -0
- package/dist/chunk-HINMXZ6J.js +2 -0
- package/dist/chunk-HXXMPYEF.js +2 -0
- package/dist/{chunk-Z3YYR4OS.js → chunk-HZKMEXA3.js} +2 -2
- package/dist/chunk-IFSX6YVU.js +4 -0
- package/dist/chunk-ISLWJ4PY.js +10 -0
- package/dist/chunk-J5WVNZ6O.js +2 -0
- package/dist/chunk-K2HYR5A7.js +3 -0
- package/dist/chunk-K6UI6EBZ.js +2 -0
- package/dist/chunk-KJCDEDQW.js +2 -0
- package/dist/{chunk-Z4HICZGY.js → chunk-KKMOB3OJ.js} +2 -2
- package/dist/{chunk-YWOOQ4FF.js → chunk-KMVGRIO2.js} +2 -2
- package/dist/chunk-LWOOTRHC.js +2 -0
- package/dist/{chunk-EY43NV4M.js → chunk-LZNLRE4X.js} +17 -8
- package/dist/chunk-M2YXL62V.js +23 -0
- package/dist/chunk-MNEJYEHW.js +3 -0
- package/dist/chunk-MTDBHTSF.js +2 -0
- package/dist/{chunk-ZQDIXAF5.js → chunk-N2Z3CU7X.js} +2 -2
- package/dist/chunk-N7PNFLGY.js +2 -0
- package/dist/chunk-NAH5EAZS.js +6 -0
- package/dist/chunk-NBXK32I6.js +2 -0
- package/dist/chunk-NJJ7AS4F.js +2 -0
- package/dist/{chunk-FDEQIPPK.js → chunk-NLMRJ7SI.js} +2 -2
- package/dist/chunk-ODVITBYU.js +26 -0
- package/dist/chunk-ORBRX2QJ.js +2 -0
- package/dist/chunk-P36UR5II.js +2 -0
- package/dist/chunk-PYZZBIEU.js +3 -0
- package/dist/chunk-PZS6J5YG.js +16 -0
- package/dist/{chunk-LM5SHAN4.js → chunk-QARYU7R3.js} +2 -2
- package/dist/chunk-QJ3FK4TB.js +38 -0
- package/dist/chunk-QXGTGE2C.js +35 -0
- package/dist/chunk-QZ4JVECJ.js +2 -0
- package/dist/chunk-R3JY4EZ4.js +102 -0
- package/dist/{chunk-VOYOYC5T.js → chunk-R5336VHZ.js} +2 -2
- package/dist/chunk-RJMXSHKM.js +2 -0
- package/dist/chunk-STBXCPKY.js +5 -0
- package/dist/chunk-T2FQ4GHD.js +9 -0
- package/dist/chunk-TFWDJDGO.js +2 -0
- package/dist/chunk-TG7QSYCJ.js +2 -0
- package/dist/{chunk-FKCGBZAC.js → chunk-TTS75UF2.js} +5 -5
- package/dist/{chunk-BVRS7RKQ.js → chunk-U7I373V4.js} +2 -2
- package/dist/chunk-UIKLA3F5.js +2 -0
- package/dist/{chunk-P753MDDE.js → chunk-UMPNL7T6.js} +2 -2
- package/dist/chunk-URSSPS5H.js +2 -0
- package/dist/chunk-VGMUFW3J.js +2 -0
- package/dist/chunk-VXTNADIW.js +18 -0
- package/dist/chunk-VYF5HA76.js +2 -0
- package/dist/chunk-WFGOH2UI.js +43 -0
- package/dist/chunk-WGA5BBTA.js +4 -0
- package/dist/chunk-WIBFXSYB.js +6 -0
- package/dist/chunk-WPSS37EW.js +2 -0
- package/dist/chunk-WQHWIVA7.js +3 -0
- package/dist/chunk-WS3Z6W3M.js +65 -0
- package/dist/chunk-WXVGNFAO.js +2 -0
- package/dist/{chunk-6LJHXREW.js → chunk-WZLPXFZU.js} +2 -2
- package/dist/chunk-X4O6K47U.js +2 -0
- package/dist/chunk-X6OGDTQH.js +2 -0
- package/dist/chunk-XEMQUN3Z.js +20 -0
- package/dist/{chunk-7B6LP46R.js → chunk-XHWLNQVZ.js} +2 -2
- package/dist/chunk-XMR747CP.js +2 -0
- package/dist/chunk-Y6L4LXPG.js +2 -0
- package/dist/chunk-YCPASUCX.js +2 -0
- package/dist/chunk-YZXV3CU3.js +60 -0
- package/dist/chunk-ZEKBR4OK.js +10 -0
- package/dist/chunk-ZMGBWSFZ.js +2 -0
- package/dist/cli.js +462 -274
- package/dist/{config-types-BDIWAYzr.d.ts → config-types-BrHl3Bge.d.ts} +61 -1
- package/dist/{db-Djj3Nqrb.d.ts → db-_Bdx0E1W.d.ts} +1 -1
- package/dist/diff-gate-types-CG2YQ_ei.d.ts +4 -0
- package/dist/{frontend-behavior-evidence-BxKpKWUu.d.ts → frontend-behavior-evidence-EfM4_9bc.d.ts} +1 -1
- package/dist/{health-D5J42g4D.d.ts → health-BEZ1Rt0S.d.ts} +54 -2
- package/dist/index.d.ts +10 -70
- package/dist/index.js +2 -2
- package/dist/postinstall.js +1 -4
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -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 +12 -2
- 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 +7 -3
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +42 -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 +12 -3
- 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 +3 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- 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 +65 -8
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +21 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +29 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +15 -3
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +55 -0
- package/dist/queries/duplicate-bodies.js +2 -0
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +4 -3
- package/dist/queries/files.js +1 -1
- 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 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +12 -7
- 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/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +11 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +3 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +7 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +3 -3
- 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 +2 -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 +9 -4
- 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 +17 -10
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +85 -17
- 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/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +55 -0
- package/dist/queries/twin-ab.js +2 -0
- package/dist/queries/twin-drift.d.ts +97 -0
- package/dist/queries/twin-drift.js +2 -0
- 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 +7 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +3 -3
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +6 -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 +9 -9
- package/dist/reindex.d.ts +30 -4
- package/dist/reindex.js +19 -19
- package/dist/runtime.d.ts +12 -6
- package/dist/runtime.js +2 -2
- package/dist/{scip-cli-CnK9Va4O.d.ts → scip-cli-C7cg4ZHR.d.ts} +1 -1
- package/dist/symbol-types-DaoeXKUt.d.ts +66 -0
- package/docs/AGENT_GUIDE.md +20 -18
- package/docs/AI_FAILURE_MODES.md +36 -13
- package/docs/API.md +1 -1
- package/docs/COMMAND_REFERENCE.md +57 -14
- package/docs/DETECTOR_GUIDE.md +20 -3
- package/docs/REGEX_POLICY.md +34 -0
- package/docs/analyzer-inventory.md +48 -3
- package/docs/analyzer-validation-ledger.md +41 -6
- package/package.json +23 -7
- package/scripts/build-scip-windows.mjs +10 -7
- package/scripts/evidence-product-contract.mjs +197 -0
- package/skills/_shared/SKILL.md +243 -0
- package/skills/_shared/agents/openai.yaml +4 -0
- package/skills/scip-api-impact/SKILL.md +55 -71
- package/skills/scip-claim-audit/SKILL.md +105 -0
- package/skills/scip-claim-audit/agents/openai.yaml +4 -0
- package/skills/scip-cleanup-audit/SKILL.md +122 -0
- package/skills/scip-cleanup-audit/agents/openai.yaml +4 -0
- package/skills/scip-cleanup-improve/SKILL.md +84 -0
- package/skills/scip-cleanup-improve/agents/openai.yaml +4 -0
- package/skills/scip-concrete-plan/SKILL.md +181 -0
- package/skills/scip-concrete-plan/agents/openai.yaml +4 -0
- package/skills/scip-conductor/SKILL.md +133 -0
- package/skills/scip-conductor/agents/openai.yaml +4 -0
- package/skills/scip-debug/SKILL.md +60 -58
- package/skills/scip-diagram/SKILL.md +64 -94
- package/skills/scip-directory-architecture/SKILL.md +65 -107
- package/skills/scip-doc-reconcile/SKILL.md +56 -67
- package/skills/scip-explore/SKILL.md +78 -210
- package/skills/scip-hyper-optimization/SKILL.md +124 -198
- package/skills/scip-integrity-audit/SKILL.md +103 -0
- package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
- package/skills/scip-language-playbook/SKILL.md +56 -326
- package/skills/scip-maintainability/SKILL.md +80 -219
- package/skills/scip-probe-reachability/SKILL.md +92 -0
- package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
- package/skills/scip-query/SKILL.md +108 -124
- package/skills/scip-react-maintainability/SKILL.md +64 -82
- package/skills/scip-setup/SKILL.md +121 -0
- package/skills/scip-setup/agents/openai.yaml +4 -0
- package/skills/scip-tla-model-system/SKILL.md +138 -0
- package/skills/scip-tla-model-system/agents/openai.yaml +4 -0
- package/skills/scip-triage-issue/SKILL.md +53 -41
- package/skills/scip-twin-drift/SKILL.md +107 -0
- package/skills/scip-twin-drift/agents/openai.yaml +4 -0
- package/skills/scip-verify/SKILL.md +70 -88
- package/skills/scip-vue-maintainability/SKILL.md +67 -94
- package/dist/chunk-2KHTSEIL.js +0 -102
- package/dist/chunk-3VD3JMK2.js +0 -2
- package/dist/chunk-4UZO3XCV.js +0 -35
- package/dist/chunk-5GOLFJEO.js +0 -8
- package/dist/chunk-5OST6GYB.js +0 -2
- package/dist/chunk-65AU3HFZ.js +0 -2
- package/dist/chunk-6GN7FXCH.js +0 -2
- package/dist/chunk-6IR2AOBM.js +0 -7
- package/dist/chunk-6JRV4MY2.js +0 -23
- package/dist/chunk-6QSOCTZT.js +0 -18
- package/dist/chunk-72KY2ZFO.js +0 -2
- package/dist/chunk-7GO4EQF5.js +0 -2
- package/dist/chunk-7IVSJJZU.js +0 -7
- package/dist/chunk-7TWLSZK5.js +0 -2
- package/dist/chunk-A536TEU4.js +0 -3
- package/dist/chunk-AVWPHM2Q.js +0 -4
- package/dist/chunk-B32FX5KB.js +0 -2
- package/dist/chunk-B6MJ5VQV.js +0 -2
- package/dist/chunk-BFXPG2VN.js +0 -2
- package/dist/chunk-BSN22NRK.js +0 -9
- package/dist/chunk-BZ53S4ZN.js +0 -2
- package/dist/chunk-C5CTSJ6X.js +0 -6
- package/dist/chunk-CO5GJRP7.js +0 -2
- package/dist/chunk-CW5YFOCP.js +0 -5
- package/dist/chunk-DS6QEB3G.js +0 -5
- package/dist/chunk-E35O7UCB.js +0 -2
- package/dist/chunk-EXDQ35NN.js +0 -2
- package/dist/chunk-FAYI6KZ5.js +0 -2
- package/dist/chunk-FFVIFETB.js +0 -2
- package/dist/chunk-FG4NT6VY.js +0 -2
- package/dist/chunk-FXNWFMKW.js +0 -25
- package/dist/chunk-G5UPYQGL.js +0 -4
- package/dist/chunk-GQBMH2TQ.js +0 -2
- package/dist/chunk-GRJY65YT.js +0 -2
- package/dist/chunk-HF25DFSC.js +0 -3
- package/dist/chunk-HHN2B5KA.js +0 -2
- package/dist/chunk-IHUETYFW.js +0 -2
- package/dist/chunk-JCLDUKT6.js +0 -38
- package/dist/chunk-JGN2ZFJR.js +0 -2
- package/dist/chunk-JM72FNGA.js +0 -2
- package/dist/chunk-JME7OWD3.js +0 -2
- package/dist/chunk-KDFONWTW.js +0 -40
- package/dist/chunk-LPL4MA6R.js +0 -2
- package/dist/chunk-LZHUWKGD.js +0 -2
- package/dist/chunk-M4COR2H6.js +0 -2
- package/dist/chunk-NOJAM5ZV.js +0 -21
- package/dist/chunk-O6ZH6C6Y.js +0 -2
- package/dist/chunk-OBGRLXWF.js +0 -3
- package/dist/chunk-OLTESY4K.js +0 -3
- package/dist/chunk-ONPCQ2PM.js +0 -6
- package/dist/chunk-P4KYUPBD.js +0 -4
- package/dist/chunk-P5RYBRIO.js +0 -4
- package/dist/chunk-P7AL7Y37.js +0 -2
- package/dist/chunk-PFOCOG57.js +0 -2
- package/dist/chunk-QLAUCRDJ.js +0 -2
- package/dist/chunk-QPU7EXAW.js +0 -2
- package/dist/chunk-QYB5P7GL.js +0 -2
- package/dist/chunk-RNM6LMCF.js +0 -2
- package/dist/chunk-RVWSAMTT.js +0 -2
- package/dist/chunk-TK7O5ER5.js +0 -3
- package/dist/chunk-TQ5W2H3S.js +0 -4
- package/dist/chunk-USPV3T5K.js +0 -2
- package/dist/chunk-UUBMFL3F.js +0 -59
- package/dist/chunk-VCQYSG2M.js +0 -10
- package/dist/chunk-VUKC6F77.js +0 -20
- package/dist/chunk-W2CBNBEL.js +0 -71
- package/dist/chunk-W6BVEKYC.js +0 -3
- package/dist/chunk-WUCEKFQC.js +0 -3
- package/dist/chunk-XUGQU7PM.js +0 -41
- package/dist/chunk-Y5NBHMQX.js +0 -2
- package/dist/chunk-YCOFCT4B.js +0 -2
- package/dist/chunk-YZA6PPZL.js +0 -3
- package/skills/concrete-plan/SKILL.md +0 -372
- package/skills/concrete-plan/agents/openai.yaml +0 -4
- package/skills/scip-adoption/SKILL.md +0 -122
- package/skills/scip-adoption/agents/openai.yaml +0 -4
- package/skills/scip-ai-cleanup/SKILL.md +0 -153
- package/skills/scip-ai-cleanup/agents/openai.yaml +0 -4
- package/skills/scip-debloat/SKILL.md +0 -439
- package/skills/scip-debloat/agents/openai.yaml +0 -4
- package/skills/scip-health-audit/SKILL.md +0 -162
- package/skills/scip-health-audit/agents/openai.yaml +0 -4
- package/skills/scip-health-improve/SKILL.md +0 -155
- package/skills/scip-health-improve/agents/openai.yaml +0 -4
- package/skills/scip-query-setup/SKILL.md +0 -170
- package/skills/scip-query-setup/agents/openai.yaml +0 -3
- package/vendor/scip/README.md +0 -6
- package/vendor/scip/win32-arm64/scip.exe +0 -0
- package/vendor/scip/win32-x64/scip.exe +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{A as R,B as We,C as he,D as He,E as Je,c as je,d as De,e as _,f as Oe,g as Me,h as ve,i as B,j as $e,k as H,l as Ue,m as qe,n as Be,o as L,p as J,q as A,r as me,s as de,t as S,u as fe,v as ze,w as ge,x as Q,y as G,z as Ve}from"./chunk-ISLWJ4PY.js";import{b as W,i as Se,m as K,o as X,p as k}from"./chunk-WS3Z6W3M.js";import{b as ne}from"./chunk-GNG622H3.js";import{a as we,c as q,f as re}from"./chunk-7S5E7KWT.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _t(e){return e.replace(/'''[\s\S]*?'''/g,w).replace(/"""[\s\S]*?"""/g,w).replace(/#.*$/gm,w).replace(/\/\/.*$/gm,w).replace(/\/\*[\s\S]*?\*\//g,w).replace(/`(?:\\[\s\S]|[^`])*`/g,w).replace(/'(?:\\.|[^'\\\r\n])*'/g,w).replace(/"(?:\\.|[^"\\\r\n])*"/g,w)}function w(e){return e.replace(/[^\r\n]/g," ")}var $n=re("stripped-lines",{clearGroups:["whole-project","source-file"]});we({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{se=null,Y=""},clearFile:()=>{se=null,Y=""}});var se=null,Y="";function Rt(e){return se===e||(se=e,Y=_t(e)),Y}function j(e,r,t){let n=Rt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function x(e,r){return new RegExp(`\\b${O(r)}\\b`,"m").test(e)}function z(e,r){let t=new Set,n=new RegExp(`\\b${O(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function xe(e){let r=0;for(let t of e)t==="("&&(r+=1),t===")"&&(r-=1);return r}var Et=new Set(["identifier","type_identifier","field_identifier"]),Tt=new Set(["identifier"]),Ft=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Lt=new Set(["rust","python"]),At=/\{([^{}]*)\}/g,kt=/\b([A-Za-z_][\w]*)\b/g;function Ke(e,r){return wt(r).has(e.type)}function Xe(e,r){return Lt.has(r)&&e.type==="string_content"}function ye(e){let r=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>r&&(r=s)}let t=new Array(r+1);for(let n=0;n<=r;n+=1)t[n]=new Set;for(let[n,s]of e)for(let o of s)t[o].add(n);return t}function wt(e){return e==="rust"?Et:e==="python"?Tt:Ft}function Qe(e,r){let t=e.startPosition.row;for(let n of e.text.matchAll(At)){let s=n[1]??"";for(let o of s.matchAll(kt))o[1]&&r(o[1],t)}}var jt=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Dt=/^#!?\[\s*serde\s*\(/,Ot=/^#!?\[\s*schemars\s*\(/,Mt=/^#!?\[\s*validate\s*\(/,vt=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Ge(e,r,t){if(r!=="typescript"&&r!=="tsx"&&r!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=he(n);if(!s||!vt.has(s))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let i=o.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&t.add(a.text)}function Ye(e,r){let t=Dt.test(e),n=Ot.test(e),s=Mt.test(e);if(!(!t&&!n&&!s))for(let o of jt){o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&r.add(c)}}}function Ze(e,r){let t=new Map,n=(i,a)=>{if(i===a)return;let c=t.get(i);c||(c=new Set,t.set(i,c)),c.add(a)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(i,a)=>{let c=l=>{s.has(l.type)&&l.text!==a&&n(l.text,a);for(let p of l.children)c(p)};for(let l of i.children)c(l)};if(r==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&o(c,a),i.type==="type_item"&&o(i,a)}else if(r==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(l=>l.type==="identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="block");if(c)for(let l of c.descendantsOfType("type"))for(let p of l.descendantsOfType("identifier"))p.text!==a&&n(p.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(i,a)}return t}var $t=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),be=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function et(e){let r=[],t=[],n=[],s=new Map,o=[],i=0,a=0,c=(l,p)=>{let u=s.get(l);if(!u){s.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)};for(;a<e.length;){let l=e[a];if(l===`
|
|
2
|
+
`){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=ie(e,a);continue}if(l==='"'){let h=ee(e,a,i);i=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){o.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=o.pop();h&&(h.endLine=i,Ut(h,{callables:r,callSites:t,clojureMembers:n,recordIdentifier:c}),o[o.length-1]?.children.push(h)),a+=1;continue}if(Ne(l)){a+=1;continue}let p=i,u=a;for(;a<e.length&&!Ie(e[a]);)a+=1;let m=e.slice(u,a);if(!m)continue;let d={text:m,line:p};qt(o[o.length-1],d),c(N(m),p)}return{language:"clojure",callables:r,callSites:t,clojureMembers:n,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:Ht(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Ut(e,r){if(e.kind!=="("||e.headTokens.length===0)return;let t=e.headTokens[0],n=N(t.text),s=$t.get(t.text);if(s){let i=e.headTokens[1];if(i){let a=N(i.text);r.recordIdentifier(a,i.line),r.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:s})}}if(Bt(e,r),!n||be.has(t.text)||be.has(n)||n.startsWith(":"))return;let o=Wt(t.text);r.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:t.line})}function qt(e,r){e&&(e.headTokens.length<2&&e.headTokens.push(r),e.tokens.length<200&&e.tokens.push(r))}function Bt(e,r){let t=N(e.tokens[0]?.text??"");if(t==="defprotocol"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"protocol",s,"protocol-method");return}if(t==="defrecord"||t==="deftype"){let n=N(e.tokens[1]?.text??"");if(!n)return;let s=t==="defrecord"?"record":"type",o=t==="defrecord"?"record-method":"type-method";for(let i of oe(e))Z(r,n,s,i,o);return}if(t==="extend-type"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"extension",s,"extension-method");return}if(t==="extend-protocol"){let n=N(e.tokens[1]?.text??"");for(let s of oe(e)){n&&Z(r,n,"extension",s,"extension-method");let o=Vt(e,s.startLine);o&&o!==n&&Z(r,o,"extension",s,"extension-method")}}}function oe(e){return e.children.filter(zt)}function zt(e){if(e.kind!=="(")return!1;let r=N(e.tokens[0]?.text??"");return!!(r&&!be.has(r)&&!r.startsWith(":"))}function Z(e,r,t,n,s){let o=n.tokens[0],i=N(o?.text??"");!o||!i||(e.recordIdentifier(i,o.line),e.clojureMembers.push({ownerName:r,ownerKind:t,memberName:i,memberKind:s,startLine:n.startLine,endLine:n.endLine}))}function Vt(e,r){let t=null;for(let n=2;n<e.tokens.length;n+=1){let s=e.tokens[n];if(s.line>r)break;let o=N(s.text);o&&!o.startsWith(":")&&(t=o)}return t}function N(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Wt(e){let r=e.replace(/^#?['`~@]+/,""),t=r.lastIndexOf("/"),n=N(r);if(t<=0)return{leaf:n,text:r};let s=r.slice(0,t);return{leaf:n,qualifier:s,text:r}}function ie(e,r){let t=r;for(;t<e.length&&e[t]!==`
|
|
3
|
+
`;)t+=1;return t}function ee(e,r,t){let n=r+1,s=t;for(;n<e.length;){let o=e[n];if(o==="\\"){n+=2;continue}if(o===`
|
|
4
|
+
`&&(s+=1),n+=1,o==='"')break}return{index:n,line:s}}function Ne(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Ie(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Ht(e){let r=[];for(let[t,n]of e)for(let s of n)r[s]??=new Set,r[s].add(t);return r}var Jt=re("source-facts",{clearGroups:["whole-project","source-file"]}),Ce=K({kind:"source-facts",invalidation:X("source-facts"),serialize:Gt,deserialize:Yt});function T(e,r){return Kt(e,r).facts}function Kt(e,r){let t=k(e,r);if(!t)return{facts:null};let n=Xt(e,r,t);return n?Jt.get(e,r,t,()=>Qt(e,r,n,t)):{facts:null}}function Xt(e,r,t){return G(r)?Ve(e,r,t)?.language??null:Q(r)}function Qt(e,r,t,n){let s=W(e,r,n),o=Ce.read(e,r,s);if(o&&o.language===t)return{facts:o};if(t==="clojure"){let c=et(n);return Ce.write(e,r,s,c),{facts:c}}let i=R(e,r);if(!i)return{facts:null,unavailable:{language:t,reason:"parser-unavailable"}};let a=rr(i,t);return Ce.write(e,r,s,a),{facts:a}}function Gt(e){let r={language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([t,n])=>[t,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(r)}function Yt(e){try{let r=JSON.parse(e);if(r.language==="clojure"&&(r.clojureMembers===void 0||r.callSites.some(n=>n.calleeText===void 0)))return null;let t=new Map(r.identifierLineMap);return{language:r.language,callables:r.callables,callSites:r.callSites,clojureMembers:r.clojureMembers??[],typeContainerMap:new Map(r.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:t,identifiersByLine:ye(t),fileIdentifiers:new Set(t.keys()),rustAttrReferencedNames:new Set(r.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(r.crossLanguageDispatchNames)}}catch{return null}}function Zt(e,r,t,n){let s=T(e,r);return s?tr(s,t,n)?.isLiteralPassthrough??!0:!0}function er(e,r){return r.relativePath.includes(".clj-kondo/hooks/")?!0:T(e,r.relativePath)?.callables.find(n=>n.startLine===r.startLine&&n.endLine===r.endLine)?.clojureKind==="macro"}function tr(e,r,t){return e.callables.find(n=>n.startLine===r&&n.endLine===t)??null}function rr(e,r){let t=[],n=[],s=new Set,o=new Set,i=new Map,a=(l,p)=>{let u=i.get(l);if(!u){i.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)},c=l=>{let p=He(l,r);p&&t.push(p);let u=We(l,r);u&&n.push(u),Ge(l,r,o),r==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&Ye(l.text,s),Ke(l,r)&&a(l.text,l.startPosition.row),Xe(l,r)&&Qe(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:r,callables:t,callSites:n,clojureMembers:[],typeContainerMap:Ze(e,r),identifierLineMap:i,identifiersByLine:ye(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:o}}var tt=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function nr(e,r){let t=T(e,r);return!t||!tt.has(t.language)?null:t.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function sr(e,r){let t=T(e,r);return!t||!tt.has(t.language)?null:t.callSites}function or(e,r){return T(e,r)?.typeContainerMap??new Map}function ir(e,r,t={}){let n=T(e,r);if(!n)return[];let s=[];if(t.includeCrossLanguageDispatchNames)for(let o of n.crossLanguageDispatchNames)s.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(t.includeRustAttributeNames&&n.language==="rust")for(let o of n.rustAttrReferencedNames)s.push({name:o,kind:"rust-attribute",occurrences:1});return s}import{basename as rt}from"path";var ar=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function b(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function g(e,r){let t=new Set,n=(s,o)=>{let i=o||r.has(s.type);!i&&ar.has(s.type)&&t.add(s.text);for(let a of s.children)n(a,i)};return n(e.rootNode,!1),t}function E(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??S(e,n,Be(r)),kind:"named",used:x(t,o),usedMembers:[]}}function f(e,r,t,n,s="named",o={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function F(e,r,t,n,s="named",o=[],i={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n,usedMembers:o,isTypeOnly:i.isTypeOnly}}function M(e,r){return{importedName:e,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function v(e,r,t={}){return{importedName:e,localName:t.localName??null,sourcePath:r,kind:"namespace",used:t.used??!0,usedMembers:t.usedMembers??[],isTypeOnly:t.isTypeOnly}}function I(e,r,t){let n=[];for(let s of e.matchAll(r)){let o=s[0];if(!o||typeof s.index!="number")continue;let i=j(e,s.index,s.index+o.length);for(let a of t(s,i))n.push(a)}return n}function C(e,r,t,n){let s=R(e,r);if(s){let o=t(s);if(o)return o}return n()}function ae(e,r,t,n){let s=R(e,r),o=Q(r),i=o?t[o]:void 0;return s&&i?i(s):n()}function nt(e,r,t){return C(e,r,n=>lr(e,r,n),()=>cr(e,r,t))}function cr(e,r,t){return I(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,s)=>{let o=n[1]?.trim();if(!o)return[];let i=rt(o).replace(/\.[^.]+$/,"");return[F(o,i,de(e,r,o),x(s,i))]})}function lr(e,r,t){let n=g(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(p=>p.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=rt(i).replace(/\.[^.]+$/,"");s.push(f(i,a,de(e,r,i),n))}return s}var pr=new Set([":require",":require-macros",":use"]),Re=String.raw`A-Za-z0-9_$*+!?.<>=-`;function ot(e,r,t){let n=Nr(t);if(!n)return[];let s=br(t,n.start,n.end),o=[];for(let i of n.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=P(i.children[0]);if(a){if(pr.has(a)){for(let c of dr(i.children.slice(1)))o.push(...mr(e,c,s));continue}if(a===":import")for(let c of gr(i.children.slice(1)))o.push(c)}}return o}function ur(e){return e.type==="list"&&P(e.children[0])==="ns"}function mr(e,r,t){let n=ze(e,r.namespace),s=r.alias??r.namespace,o=hr(t,s),i=[{importedName:r.namespace,localName:s,sourcePath:n,kind:"namespace",used:r.refers.length>0||r.referAll||o.length>0||xr(t,r.namespace),usedMembers:o}];r.referAll&&i.push({importedName:"*",localName:null,sourcePath:n,kind:"side-effect",used:!0,usedMembers:[]});for(let a of r.refers)i.push({importedName:a,localName:a,sourcePath:n,kind:"named",used:yr(t,a),usedMembers:[]});return i}function dr(e){return e.flatMap(r=>ce(r,null))}function ce(e,r){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:_e(r,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&P(e.children[0])===null?e.children.flatMap(t=>ce(t,r)):fr(e,r);if(e.type==="list"&&e.children.length>0){let t=P(e.children[0]);return t?!t||t.startsWith(":")?[]:e.children.slice(1).flatMap(n=>ce(n,_e(r,t))):e.children.flatMap(n=>ce(n,r))}return[]}function fr(e,r){let t=P(e.children[0]);if(!t||t.startsWith(":"))return[];let n={namespace:_e(r,t),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let o=P(e.children[s]);if(!o?.startsWith(":"))continue;let i=e.children[s+1];if((o===":as"||o===":as-alias")&&i){n.alias=P(i),s+=1;continue}o===":refer"&&i&&(P(i)===":all"?n.referAll=!0:(i.type==="vector"||i.type==="list")&&n.refers.push(...i.children.map(P).filter(Sr)),s+=1)}return[n]}function gr(e){let r=[];for(let t of e){if(t.type==="atom"){let s=t.text.split(".").pop()??t.text;r.push(F(s,s,null,!0));continue}if(t.type!=="vector")continue;let n=P(t.children[0]);if(n)for(let s of t.children.slice(1)){let o=P(s);o&&r.push(F(`${n}.${o}`,o,null,!0))}}return r}function _e(e,r){return e?`${e}.${r}`:r}function P(e){return e?.type==="atom"?e.text:null}function Sr(e){return!!(e&&!e.startsWith(":"))}function hr(e,r){let t=new Set,n=new RegExp(`${Ee()}${O(r)}\\s*/\\s*([${Re}]+)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function xr(e,r){return new RegExp(`${Ee()}${O(r)}\\s*/`,"m").test(e)}function yr(e,r){return new RegExp(`${Ee()}${O(r)}(?![${Re}])`,"m").test(e)}function Ee(){return`(?<![${Re}])`}function br(e,r,t){let n="",s=0;for(;s<e.length;){if(s>=r&&s<t){n+=e[s]===`
|
|
5
|
+
`?`
|
|
6
|
+
`:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ie(e,s);n+=st(e.slice(s,i)),s=i;continue}if(o==='"'){let i=ee(e,s,0).index;n+=st(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Nr(e){let r=0;for(;r<e.length&&(r=Te(e,r),!(r>=e.length));){let t=le(e,r);if(!t){r+=1;continue}if(ur(t.form))return t.form;r=t.index}return null}function le(e,r){let t=Te(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Ir(e,t);if(e.startsWith("#_",t)){let s=le(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Ne(e[t]);)t+=1;let n=e[t];return n?n==="("?Pe(e,t,"list",")"):n==="["?Pe(e,t,"vector","]"):n==="{"?Pe(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:ee(e,t,0).index},index:ee(e,t,0).index}:Pr(e,t):null}function Ir(e,r){let t=e.startsWith("#?@",r)?3:2,n=le(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Cr(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Cr(e){let r=[];for(let t=0;t<e.length;t+=2){let n=P(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Pe(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=Te(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=le(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Pr(e,r){let t=r;for(;t<e.length&&!Ie(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function Te(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=ie(e,t);continue}break}return t}function st(e){return e.replace(/[^\r\n]/g," ")}function it(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=j(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:fe(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?z(c,i):[]})}return n}function at(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:fe(e,r,o)})}return n}function ct(e,r,t){return ae(e,r,{csharp:n=>Rr(e,r,n),vb:n=>_r(e,r,n)},()=>{let n=qe(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[E(e,r,o,p,u,m,S(e,p,B))]})})}function _r(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(f(p,u,S(e,l,B),n,c?"namespace":"named"))}return s}function Rr(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(f(p,u,S(e,l,B),n,a?"namespace":"named"))}return s}var Er=q("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function lt(e,r){return Er.get(e,r,()=>{let t=new Set,n=k(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}function Fe(e,r,t){return C(e,r,n=>Fr(e,r,n),()=>Tr(e,r,t))}function Tr(e,r,t){return Ur(t).flatMap(n=>qr(e,r,n.clause,n.specifier,n.start,n.end,t))}function Fr(e,r,t){let n=Lr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Ar(e,r,t,o,n));return s}function Lr(e,r,t){let n=g(t,new Set(["import_statement"]));if(G(r))for(let s of lt(e,r))n.add(s);return n}function Ar(e,r,t,n,s){let o=Or(n);if(!o)return[];let i=L(e,r,o),a=b(n,"import_clause");return a?kr(t,a,i,s,Mr(n.text)):[M("*",i)]}function kr(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(wr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=jr(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Dr(i,t,n,s));return o}function wr(e,r,t,n){return f("default",e,r,t,"default",{isTypeOnly:n})}function jr(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=$r(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function Dr(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(f(c,l,r,t,"named",{isTypeOnly:n||vr(o.text)}))}return s}function Or(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function Mr(e){return/^\s*import\s+type\b/.test(e)}function vr(e){return/^\s*type\b/.test(e.trim())}function $r(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function Ur(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function qr(e,r,t,n,s,o,i){let a=L(e,r,n),c=j(i,s,o);return t?Br(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=z(c,p.localName);return v(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?M(p.importedName,p.sourcePath):F(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[M("*",a)]}function Br(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=zr(n),i=[];return s&&i.push(...pt(s,t)),o&&i.push(...pt(o,t)),i}function pt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function zr(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function Le(e,r,t){let n=R(e,r);return n?Xr(e,r,n):Vr(e,r,t)}function Vr(e,r,t){return[...Wr(e,r,t),...Hr(e,r,t),...Jr(e,r,t)]}function Wr(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>Kr(u.trim())).filter(u=>!!u),l=V(t,o.index),p=V(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:L(e,r,a),names:c,startLine:l,endLine:p})}return n}function Hr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Jr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Kr(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function V(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function Xr(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=Qr(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=Gr(s,o,i,a);n.push(c)}return n}function Qr(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return L(e,r,s.text)}function Gr(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}return b(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:n}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function ut(e,r,t){return ae(e,r,{java:n=>Yr(e,r,n),kotlin:n=>Zr(e,r,n),scala:n=>en(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?tn(e,r,o,s):[]}))}function Yr(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(v("*",S(e,l,_)));continue}let p=l.split(".").pop()??l;s.push(f(p,p,S(e,l,_),n))}return s}function Zr(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),c=o.namedChildren.find(d=>d.type==="import_alias");if(a){s.push(v("*",S(e,i.text,_)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(f(p,m,S(e,l,_),n))}return s}function en(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(v("*",S(e,c,_)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,d]=u.namedChildren;if(!m)continue;let h=m.text,$=d?.text??h;if(h==="_")continue;s.push(f(h,$,S(e,`${c}.${h}`,_),n))}else if(u.type==="identifier"){let m=u.text;s.push(f(m,m,S(e,`${c}.${m}`,_),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(f(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,_),n))}return s}function tn(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[E(e,r,n,m,p,u)]})}return[E(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function dt(e,r,t){return C(e,r,n=>rn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[E(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}))}function rn(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(f(a,c,S(e,i.replace(/\\/g,"."),H),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=mt(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=mt(c,"");l&&o(u,l,p)}}return s}function mt(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function gt(e,r,t){return C(e,r,n=>nn(e,r,n),()=>on(t).flatMap(n=>cn(e,r,n,t)))}function nn(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=ft(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=sn(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=ft(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function ft(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function sn(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function on(e){let r=e.split(`
|
|
7
|
+
`),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=xe(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
|
|
8
|
+
${m}`,l+=1+m.length,p+=xe(m),n+=m.length+1}let u=an(c);u&&t.push({...u,start:a,end:l})}return t}function an(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function cn(e,r,t,n){let s=j(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),d=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=z(s,d);return[{importedName:m,localName:d,sourcePath:h,kind:"namespace",used:x(s,d)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as ln}from"path";function St(e,r,t){return C(e,r,n=>un(e,r,n),()=>pn(e,r,t))}function pn(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?me(e,r,i):null;if(a){let c=ht(i);return[F(c,c,a,x(s,c))]}return[M(i,a)]})}function un(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(d=>d.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?me(e,r,u):null;if(m){let d=ht(u);s.push(f(d,d,m,n))}else s.push(M(u,m))}return s}function ht(e){return Je(ln(e).replace(/\.[^.]+$/,""),/_/)}function xt(e,r,t){return C(e,r,n=>mn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?dn(e,r,o,s):[]}))}function mn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of te(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=A(e,r,a.qualifiedName)??A(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(f(a.importedName,a.localName,c,n))}}return s}function te(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:pe(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:pe(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=pe(r,t.text),o=[];for(let i of n.namedChildren)o.push(...te(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...te(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=te(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:pe(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function pe(e,r){return e?r?`${e}::${r}`:e:r}function dn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let d=m.trim();if(!d||d==="self")return[];let[h,$]=d.split(/\s+as\s+/),U=h?.trim();if(!U)return[];let Ct=($??U.split("::").pop()??U).trim(),Pt=`${p}::${U}`.replace(/::::/g,"::");return[E(e,r,n,Pt,U.split("::").pop()??U,Ct,A(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=A(e,r,a)??A(e,r,a.split("::").slice(0,-1).join("::"));return[E(e,r,n,a,a.split("::").pop()??a,c,l)]}function yt(e,r,t){let n=R(e,r);if(n)return fn(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Sn(e,r,i))}return s}function fn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!gn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of te(o,""))i.importedName&&n.push(Ae(e,r,i.qualifiedName))}return n}function gn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Sn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[Ae(e,r,l)]})}return[Ae(e,r,n)]}function Ae(e,r,t){return{specifier:t,sourcePath:A(e,r,t)??A(e,r,t.split("::").slice(0,-1).join("::"))}}function D({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function bt(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var hn={language:"javascript",extensions:je,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Fe,parseReExports:Le},xn=D({language:"python",extensions:De,imports:"ast-with-regex-fallback",parseImports:gt}),yn=D({language:"jvm",extensions:_,imports:"ast-dispatch-with-regex-fallback",parseImports:ut}),bn={language:"rust",extensions:Oe,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:xt,parseExports:yt},Nn=D({language:"ruby",extensions:Me,imports:"ast-with-regex-fallback",parseImports:St}),In=D({language:"c/cpp",extensions:ve,imports:"ast-with-regex-fallback",parseImports:nt}),Cn=D({language:"dotnet",extensions:B,imports:"ast-dispatch-with-regex-fallback",parseImports:ct}),Pn={language:"dart",extensions:$e,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:it,parseExports:at},_n=D({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:dt}),Rn=D({language:"clojure",extensions:Ue,imports:"regex-only",parseImports:ot}),En=[hn,xn,yn,bn,Nn,In,Cn,Pn,_n,Rn];function ue(e){return bt(En,e)}var ke={clearGroups:["whole-project","source-file"]},Tn=q("source-imports",ke),Fn=q("source-exports",ke),Ln=q("source-reexports",ke),Nt=K({kind:"source-imports",invalidation:X("source-imports"),serialize:An,deserialize:kn}),It=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:wn,deserialize:jn});function zo(e,r){let t=ne(r);return Ln.get(e,t,()=>{let n=ue(t);if(!n?.parseReExports)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=It.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return It.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Vo(e,r){let t=ne(r);return Tn.get(e,t,()=>{let n=ue(t);if(!n)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=Nt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return Nt.write(e,t,o,{resolutionFingerprint:i,imports:c}),c})}function Wo(e,r){let t=ne(r);return Fn.get(e,t,()=>{let n=ue(t);if(!n?.parseExports)return[];let s=k(e,t);return s?n.parseExports(e,t,s):[]})}function An(e){return JSON.stringify(e)}function kn(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function wn(e){return JSON.stringify(e)}function jn(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,_t as b,xe as c,T as d,Kt as e,Zt as f,er as g,nr as h,sr as i,or as j,ir as k,zo as l,Vo as m,Wo as n};
|
|
9
|
+
//# sourceMappingURL=chunk-T2FQ4GHD.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{execFileSync as t}from"child_process";import{platform as l}from"os";var c=l()==="win32";function n(e){let r=c?"where":"which";try{return t(r,[e],{stdio:"pipe"}),!0}catch{return!1}}import{execFileSync as o}from"child_process";import{createRequire as a}from"module";import{existsSync as p}from"fs";import{platform as s,arch as u}from"os";var g="https://github.com/sourcegraph/scip",f="SCIP_QUERY_SCIP_BIN";function m(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let r=e.env[f];if(r&&e.fileExists(r))return{source:"env",path:r};if(e.platform==="win32"){let i=e.resolveSidecar(e.arch);if(i&&e.fileExists(i))return{source:"sidecar",path:i}}return null}function d(e){let r=a(import.meta.url);for(let i of e==="arm64"?["arm64","x64"]:[e])try{return r.resolve(`scip-query-scip-windows/scip-win32-${i}.exe`)}catch{}return null}function P(e=process.env){return m({platform:s(),arch:u(),env:e,isOnPath:n,fileExists:p,resolveSidecar:d})?.path??null}function B(e){if(s()==="darwin"&&n("brew")){e("Installing scip CLI via Homebrew...");try{if(o("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(n("go")){e("Installing scip CLI via go install...");try{if(o("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${g}/releases`),!1}export{n as a,P as b,B as c};
|
|
2
|
+
//# sourceMappingURL=chunk-TFWDJDGO.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as P,b as y}from"./chunk-KJCDEDQW.js";import{a as C,c as b,e as o,f}from"./chunk-6XA4LDHY.js";import{a as g,b as h,c as k}from"./chunk-KMVGRIO2.js";import{F as v}from"./chunk-ISLWJ4PY.js";function L(e,i={}){let{minSimilarity:r=.62,minTokens:n=8,limit:c=20,scope:l,scanLimit:u,filePattern:m,focusFiles:d}=i,s=T(e,{scope:l,minTokens:n,scanLimit:u}),p=P(s,t=>t.tokens);return y({profiles:s,limit:c,filePattern:m,focusFiles:d,candidateIndex:p,profile:{name:"vue-component-duplicates"},compare:(t,a)=>V(t,a,r),sort:(t,a)=>a.similarity-t.similarity||t.fileA.localeCompare(a.fileA)||t.fileB.localeCompare(a.fileB)})}function T(e,i){return v(e).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(r=>({file:r.file,tokens:r.templateTokens,loc:B(r)}))}function B(e){return e.totalLines}function V(e,i,r){let n=g(e.tokens,i.tokens);if(n.size<6||!R(n))return null;let c=k(e.tokens,i.tokens);if(c<r)return null;let l=o(n,"component:"),u=o(n,"prop:"),m=o(n,"event:"),d=o(n,"directive:"),s=o(n,"slot:"),p=o(n,"id:"),t=S({sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p});return{fileA:e.file,fileB:i.file,similarity:c,sharedTokens:f(n),sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p,evidenceClass:t.evidenceClass,actionTier:t.actionTier,evidenceClassReasons:t.reasons,recommendation:t.recommendation,uniqueToA:f(h(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(h(i.tokens,e.tokens)).slice(0,25),locA:e.loc,locB:i.loc}}function R(e){let i=0,r=0;for(let n of e)n.startsWith("component:")&&(i+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("directive:")||n.startsWith("slot:"))&&(r+=1);return b([{name:"component",count:i},{name:"behavior",count:r}],[{min:{component:1},reason:"shared custom component"},{min:{behavior:3},reason:"shared Vue template structure"}]).pass}function S(e){return C({genericWords:x,primitiveGroups:[{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"},{values:e.sharedDirectives,reasonPrefix:"shared directives",bucket:"generic"},{values:e.sharedSlots,reasonPrefix:"shared slots",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedIdentifiers,label:"shared identifier",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific Vue primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var x=new Set(["actions","app","button","card","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-TG7QSYCJ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
1
|
+
import{a as R}from"./chunk-X4O6K47U.js";import{a as _,d as f}from"./chunk-NAH5EAZS.js";import{d,f as p}from"./chunk-HXXMPYEF.js";import{l as c,m,n as s}from"./chunk-T2FQ4GHD.js";import{p as l}from"./chunk-WS3Z6W3M.js";import{a}from"./chunk-64MNV6AB.js";function P(e,o={}){let{scope:n,limit:r}=o,t=new R(e),i=C([...h(e,n),...N(e,t,n)]);return D(i),r?i.slice(0,r):i}function h(e,o){let n=[];for(let r of E(e,o)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||f(e,r.barrel_path)||l(e,r.barrel_path)&&s(e,r.barrel_path).length===0)continue;let t=S(e,r),i=t?.barrel_consumers??0,u=t?.direct_consumers??0;i!==0||u!==0||n.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:d(r.symbol),originalFile:r.original_path,barrelConsumers:i,directConsumers:u,...g(e,r.barrel_path)})}return n}function E(e,o){let n=o?"AND barrel_d.relative_path LIKE ?":"",r=o?[`%${o}%`]:[];return e.all(`SELECT DISTINCT
|
|
2
2
|
barrel_d.id AS barrel_doc_id,
|
|
3
3
|
barrel_d.relative_path AS barrel_path,
|
|
4
4
|
gs.id AS symbol_id,
|
|
@@ -27,8 +27,8 @@ import{a as R}from"./chunk-5OST6GYB.js";import{a as _,d as f}from"./chunk-C5CTSJ
|
|
|
27
27
|
${e.symbolNoiseFor("gs")}
|
|
28
28
|
-- Only function-level symbols (ending with ().), not module-level
|
|
29
29
|
AND gs.symbol LIKE '%().'
|
|
30
|
-
${
|
|
31
|
-
ORDER BY barrel_d.relative_path, gs.symbol
|
|
30
|
+
${n}
|
|
31
|
+
ORDER BY barrel_d.relative_path, gs.symbol`,...r)}function S(e,o){return e.get(`SELECT
|
|
32
32
|
SUM(CASE WHEN uses_barrel = 1 THEN 1 ELSE 0 END) AS barrel_consumers,
|
|
33
33
|
SUM(CASE WHEN uses_barrel = 0 THEN 1 ELSE 0 END) AS direct_consumers
|
|
34
34
|
FROM (
|
|
@@ -57,5 +57,5 @@ import{a as R}from"./chunk-5OST6GYB.js";import{a as _,d as f}from"./chunk-C5CTSJ
|
|
|
57
57
|
AND consumer_d.id != ?
|
|
58
58
|
${e.pathExclusionsFor("consumer_d")}
|
|
59
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,
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
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-TTS75UF2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-XEMQUN3Z.js";function K(i,l={}){let{limit:d=10,scope:h,minDepth:x=3}=l,f=k(i,h),w=new Map,o=[],p=new Map,a=new Map,m=new Set,b=[],g=0;for(let e of f.keys()){if(p.has(e))continue;let t=[],s=(f.get(e)??new Set).values();for(p.set(e,g),a.set(e,g),g+=1,b.push(e),m.add(e),t.push({node:e,iter:s,pendingChild:null});t.length>0;){let n=t[t.length-1];if(n.pendingChild!==null){let u=n.pendingChild;n.pendingChild=null,a.set(n.node,Math.min(a.get(n.node),a.get(u)))}let c=n.iter.next();if(c.done){if(a.get(n.node)===p.get(n.node)){let u=[];for(;;){let S=b.pop();if(m.delete(S),u.push(S),w.set(S,o.length),S===n.node)break}o.push(u)}t.pop();continue}let r=c.value;if(p.has(r))m.has(r)&&a.set(n.node,Math.min(a.get(n.node),p.get(r)));else{p.set(r,g),a.set(r,g),g+=1,b.push(r),m.add(r);let u=(f.get(r)??new Set).values();n.pendingChild=r,t.push({node:r,iter:u,pendingChild:null})}}}let C=new Map,D=new Array(o.length);for(let e=0;e<o.length;e++)D[e]=o[e].length,C.set(e,new Set);for(let[e,t]of f){let s=w.get(e);for(let n of t){let c=w.get(n);c!==s&&C.get(s).add(c)}}let y=new Array(o.length),R=new Array(o.length);for(let e=0;e<o.length;e++){let t=[],s=0;for(let n of C.get(e)){let c=R[n];c>s&&(s=c,t=y[n])}y[e]=[e,...t],R[e]=D[e]+s}function M(e){return y[e]}let T=o.map(e=>[...e].sort()),v=new Set,I=[];for(let e=0;e<o.length;e++){let t=M(e),s=[];for(let c of t)s.push(...T[c]);if(s.length<x)continue;let n=s.join(" ");v.has(n)||(v.add(n),I.push(A(s)))}return I.sort((e,t)=>t.depth-e.depth),F(I).slice(0,d)}function A(i){return{chain:i,depth:i.length,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${i.length} file(s) form the representative transitive dependency path`,"cycles are condensed before longest-path calculation"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function F(i){let l=[];for(let d of i)l.some(h=>L(d.chain,h.chain))||l.push(d);return l}function L(i,l){if(i.length>=l.length)return!1;let d=l.length-i.length;for(let h=0;h<i.length;h++)if(i[h]!==l[d+h])return!1;return!0}export{K as a};
|
|
2
|
+
//# sourceMappingURL=chunk-U7I373V4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e as $}from"./chunk-K2HYR5A7.js";import{b as D}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-C4ICAIJ4.js";import{c as h,d as x,g as y}from"./chunk-R3JY4EZ4.js";import{d as b}from"./chunk-HXXMPYEF.js";import{a as g,c as S}from"./chunk-T2FQ4GHD.js";import{p as d}from"./chunk-WS3Z6W3M.js";function K(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=M(e,B(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=I(t);return r?m.slice(0,r):m}function B(e,n){let s=y(e,{scope:n.scope}).filter(i=>i.isFunctionLike&&!e.isIgnored(i.relativePath)).filter(i=>p(i)>=n.minLoc);return typeof n.scanLimit=="number"&&n.scanLimit>0&&s.sort((i,r)=>p(r)-p(i)||i.relativePath.localeCompare(r.relativePath)),D(s,n.scanLimit)}function M(e,n,s){let i=[];for(let a of n){let o=w(e,a,s);o&&i.push({signature:o,definition:a,fn:v(a)})}let r=new Map;for(let a of i)r.set(a.signature,(r.get(a.signature)??0)+1);let c=new Map;for(let a of i){let o=F(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?$(e,a.definition):null;if(t&&!m)continue;let u=t?`${a.signature}\0body\0${m}`:`${a.signature}\0band\0${o}`,l=c.get(u)??{signature:a.signature,locBand:o,exactBody:t,functions:[]};l.functions.push(a.fn),c.set(u,l)}return[...c.values()]}function v(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function I(e){let n=[];for(let s of e)s.functions.length>=2&&n.push(s);return n.sort((s,i)=>{let r=i.functions.length-s.functions.length;if(r!==0)return r;let c=s.functions.reduce((o,t)=>o+t.loc,0);return i.functions.reduce((o,t)=>o+t.loc,0)-c}),n}function F(e){return e<=5?"<=5":e<=20?"6-20":">20"}function w(e,n,s){if(s.semantic){let c=L(e,n);if(c)return c}let i=z(n.documentation),r=i?q(i):null;return r||A(G(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function z(e){return h(x(e))}function G(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=k(a,s,i,r);for(let t of o){let m=Math.min(a.length-1,Math.max(t,t+4)),u="";for(let l=t;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,P(u)))return u}if(u&&u.includes("("))return u}return null}function P(e){let n=e.replace(/\s+/g," ").trim();return!n.includes("(")||S(n)>0?!1:/[;{]$/.test(n)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(n)||/\)\s*As\s+.+$/i.test(n)}function q(e){if(!e||!e.trim())return null;let n=e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=n.indexOf("(");return s===-1||(n=n.slice(s),n=n.replace(/\s+/g,"").toLowerCase(),n.length<3)?null:n}function A(e,n){if(!e||!e.trim())return null;let s=e.replace(/\s+/g," ").trim(),i=s.indexOf("(");if(i===-1)return null;let r=s.slice(0,i),a=new RegExp(`\\b${g(n)}\\b`,"i").exec(r);a&&typeof a.index=="number"&&(r=r.slice(0,a.index)),r=r.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let o=C(s.slice(i)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!o.startsWith("("))return null;let t=`${r?`${r} `:""}${o}`.replace(/\s+/g,"").toLowerCase();return t.length>=3?t:null}function C(e){let n=0,s=0,i=0,r=0,c=null,a=!1;for(let o=0;o<e.length;o+=1){let t=e[o];if(c){if(a){a=!1;continue}if(t==="\\"){a=!0;continue}t===c&&(c=null);continue}if(t==='"'||t==="'"||t==="`"){c=t;continue}if(t==="(")n+=1;else if(t===")")n=Math.max(0,n-1);else if(t==="[")i+=1;else if(t==="]")i=Math.max(0,i-1);else if(t==="<")r+=1;else if(t===">")r=Math.max(0,r-1);else if(t==="{"){if(n===0&&i===0&&r===0)return e.slice(0,o);s+=1}else if(t==="}")s=Math.max(0,s-1);else if(t==="="&&e[o+1]===">"&&n===0&&s===0&&i===0&&r===0)return e.slice(0,o)}return e}function k(e,n,s,i){let r=g(i),c=new RegExp(`\\b${r}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${r}\\b`,"i"),o=[],t=new Set,m=Math.max(0,Math.min(n,e.length-1)),u=Math.max(m,Math.min(e.length-1,Math.max(s,n+4)));for(let l=m;l<=u;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}for(let l=0;l<e.length;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}return o}export{K as a};
|
|
2
|
+
//# sourceMappingURL=chunk-UIKLA3F5.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-WQHWIVA7.js";import{b as g,d as m}from"./chunk-HXXMPYEF.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
|
|
2
2
|
WHERE id = ? LIMIT 1`,a.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],e=t.enclosing_symbol,r=1,c=new Set([t.symbol]);for(;e&&!c.has(e)&&r<20;){c.add(e);let s=n.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",e);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:r}),e=s.enclosing_symbol,r++}if(o.length>1)return o;let y=g(t.symbol);if("kind"in y)return o;let l=y.descriptors;if(l.length<=1)return o;let b=[o[0]];for(let s=l.length-2,h=1;s>=0;s--,h++){let p=l.slice(0,s+1).map(i=>i.suffix==="method"?`${i.name}()`:i.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");b.push({symbol:p,shortName:p,depth:h})}return b}export{_ as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-UMPNL7T6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as R,b as F}from"./chunk-KJCDEDQW.js";import{a as k,b as C,c as V,e as a,f as v}from"./chunk-6XA4LDHY.js";import{a as B,b as g}from"./chunk-KMVGRIO2.js";import{F as y}from"./chunk-ISLWJ4PY.js";function j(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:t=6,limit:i=20,scope:l,scanLimit:c,filePattern:d,focusFiles:h}=s,u=y(e).vueProfiles({scope:l,minBehaviorTokens:Math.max(3,t),scanLimit:c}).map(n=>({file:n.file,tokens:n.behaviorTokens,profile:n})),r=R(u,n=>n.tokens);return F({profiles:u,limit:i,filePattern:d,focusFiles:h,candidateIndex:r,profile:{name:"vue-composable-candidates"},compare:(n,o)=>T(n,o,m,t),sort:(n,o)=>o.similarity-n.similarity||n.fileA.localeCompare(o.fileA)||n.fileB.localeCompare(o.fileB)})}function T(e,s,m,t){let i=B(e.tokens,s.tokens);if(i.size<t||!P(i))return null;let l=C(e.tokens,s.tokens);if(l<m)return null;let c=a(i,"composable:"),d=a(i,"store:"),h=a(i,"reactivity:"),u=a(i,"lifecycle:"),r=a(i,"request:"),n=a(i,"function:"),o=a(i,"function-verb:"),b=a(i,"template-binding:"),p=a(i,"template-event:"),f=q({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:r,sharedFunctions:n,sharedFunctionVerbs:o,sharedBindings:b,sharedTemplateEvents:p});return{fileA:e.file,fileB:s.file,similarity:l,sharedTokens:v(i),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:r,sharedFunctions:n,sharedFunctionVerbs:o,sharedBindings:b,sharedTemplateEvents:p,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:v(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:v(g(s.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:r,sharedLifecycle:u,sharedFunctions:n,sharedFunctionVerbs:o,sharedBindings:b}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function q(e){return k({genericWords:E,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e){let s=0,m=0,t=0,i=0,l=0,c=0,d=0;for(let r of e)r.startsWith("composable:")?s+=1:r.startsWith("store:")?m+=1:r.startsWith("request:")?t+=1:r.startsWith("lifecycle:")?i+=1:r.startsWith("function:")?l+=1:r.startsWith("reactivity:")?c+=1:(r.startsWith("function-verb:")||r.startsWith("template-binding:")||r.startsWith("template-event:"))&&(d+=1);let h=s+m,u=h+t+i+l+d;return V([{name:"requests",count:t},{name:"lifecycle",count:i},{name:"functions",count:l},{name:"reusableHooks",count:h},{name:"reactivity",count:c},{name:"namedBehavior",count:u}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{lifecycle:1,functions:2,namedBehavior:4},reason:"shared lifecycle workflow"},{min:{reusableHooks:2,requests:1,namedBehavior:5},reason:"shared reusable Vue hooks and requests"},{min:{reusableHooks:2,functions:2,namedBehavior:5},reason:"shared reusable Vue hooks and functions"},{min:{functions:2,reactivity:1,namedBehavior:4},reason:"shared reactive functions"}]).pass}function S(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}var E=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-URSSPS5H.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e as S}from"./chunk-C4ICAIJ4.js";import{a as f,e as D}from"./chunk-HXXMPYEF.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-VGMUFW3J.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{a as S}from"./chunk-X4O6K47U.js";import{b as D}from"./chunk-NAH5EAZS.js";import{c as v}from"./chunk-C4ICAIJ4.js";import{m as y}from"./chunk-T2FQ4GHD.js";import{a as b}from"./chunk-64MNV6AB.js";import p from"path";var w={analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),domain:new Set([]),instrumentation:new Set([]),"language-parsers":new Set(["core","domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","semantic","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["core","domain","queries","reindex","resolution","semantic","source","storage","symbols","tla"]),semantic:new Set(["core","domain","resolution","storage","symbols"]),source:new Set(["core","domain","storage"]),storage:new Set(["domain","source"]),symbols:new Set(["analysis","domain","language-parsers","resolution","semantic","source","storage"]),tla:new Set(["core","domain","queries","source","storage","symbols"])};function f(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length<=1?"(root)":t.length>=3&&["src","lib","app","server","client"].includes(t[0])?`${t[0]}/${t[1]}`:t[0]}function h(e,n){if(e===n)return"ok";let t=g(e),i=g(n);return t&&i?!m(t)||!m(i)?null:P(t,i)?"ok":"violation":E(e,n)}function k(e,n){let t=g(f(e)),i=g(f(n));return!!t&&!!i&&m(t)&&m(i)}function R(e,n){let t=g(e),i=g(n);return!!t&&!!i&&(!m(t)||!m(i))}function g(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function P(e,n){return n==="instrumentation"||n==="domain"?!0:e==="domain"?!1:w[e]?.has(n)??!1}function m(e){return Object.hasOwn(w,e)}function E(e,n){if(n==="shared")return"ok";let t={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return t[e]?t[e].has(n)?"ok":"violation":null}function re(e,n){let{scope:t,minDeviation:i=5,limit:r=50}=n??{},a=n?.semantic!==!1,c=n?.includePatternDeviations===!0,s=new S(e).fileDependencyGraph(t),l=F([...I(e,s,{scope:t,semantic:a}),...M(s),...c?N(s,i):[]]);return r<=0||l.results.length<=r?l:{...l,results:l.results.slice(0,r),totalResults:l.results.length}}function I(e,n,t){let i=T(e,t.scope),r=[],a=new Set;for(let[o,s]of n){if(d(o))continue;let l=i.get(o)??new Set;for(let u of s)d(u)||l.has(u)||_(e,o,u,t)||(r.push({file:o,dep:u}),a.add(o))}a.size>0&&U(e,i,{paths:[...a]});let c=[];for(let{file:o,dep:s}of r)(i.get(o)??new Set).has(s)||c.push({file:o,kind:"unused-import",description:`Depends on ${s} but references none of its symbols`,dep:s,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${o} to ${s}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return c}function _(e,n,t,i){return J(e,n,t)||z(e,n,t)||q(t)||W(e,n,t)||K(t)?!0:i.semantic&&C(e,n,t)}function M(e){let n=[],t=V(e);for(let[i,r]of e){if(d(i))continue;let a=f(i);for(let c of r){if(d(c))continue;let o=f(c);if(a===o)continue;let s=h(a,o),l=s===null&&R(a,o),u=s?"explicit":l?"unknown-layer":"inferred";if((l?"violation":s??t.get(`${a}->${o}`))==="violation"){let $=u==="explicit"?"direct":"signal";n.push({file:i,kind:"layer-violation",description:`Imports from ${o}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${a}/ should not depend on ${o}/`,actionTier:$,policyBasis:u,evidenceReasons:[`dependency edge exists from ${i} to ${c}`,O(u,a,o)],recommendation:u==="explicit"?"Move the dependency behind an allowed layer boundary or document a policy change.":u==="unknown-layer"?"Add a layer policy entry before treating this as a boundary violation.":"Review whether this is a real boundary break or an intentional exception before moving code."})}}}return n}function O(e,n,t){return e==="explicit"?`explicit layer policy rejects ${n}/ -> ${t}/`:e==="unknown-layer"?`source layer policy has no entry for ${n}/ -> ${t}/`:`rare cross-layer edge ${n}/ -> ${t}/ is inferred as a violation`}function N(e,n){let t=[];for(let[i,r]of A(e)){let a=r.filter(o=>!d(o));if(a.length<n)continue;let c=L(e,a);for(let o of a)for(let s of e.get(o)??[])d(s)||(c.get(s)??0)===1&&p.dirname(s)!==i&&p.dirname(s)!==p.dirname(i)&&(k(o,s)||t.push({file:o,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${s}`,dep:s,actionTier:"signal",evidenceReasons:[`${a.length} sibling file(s) in ${i}/ were compared`,`${o} is the only non-skipped sibling depending on ${s}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."}))}return t}function F(e){return{results:e,unusedImports:e.filter(n=>n.kind==="unused-import").length,layerViolations:e.filter(n=>n.kind==="layer-violation").length,patternDeviations:e.filter(n=>n.kind==="pattern-deviation").length}}function A(e){let n=new Map;for(let t of e.keys()){let i=p.dirname(t),r=n.get(i);r||(r=[],n.set(i,r)),r.push(t)}return n}function L(e,n){let t=new Map;for(let i of n)for(let r of e.get(i)??[])d(r)||t.set(r,(t.get(r)??0)+1);return t}function T(e,n){let t=new Map;return j(e,t,n),t}function j(e,n,t){for(let i of B(e,t))x(e,n,i.from_file,i.to_file)}function B(e,n){let t=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[];return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents d1 ON c.document_id = d1.id
|
|
5
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
+
JOIN (
|
|
7
|
+
SELECT m2.symbol_id, c2.document_id
|
|
8
|
+
FROM mentions m2
|
|
9
|
+
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
+
WHERE m2.role = 1
|
|
11
|
+
GROUP BY m2.symbol_id
|
|
12
|
+
) sym_def ON sym_def.symbol_id = gs.id
|
|
13
|
+
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
14
|
+
WHERE d1.id != d2.id
|
|
15
|
+
AND m.role != 1
|
|
16
|
+
${e.pathExclusionsFor("d1","d2")}
|
|
17
|
+
${t}`,...i)}function U(e,n,t={}){new S(e).scanSourceReferences({paths:t.paths??b(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},r=>{r.target.relativePath!==r.sourceFile&&(e.isIgnored(r.target.relativePath)||x(e,n,r.sourceFile,r.target.relativePath))})}function x(e,n,t,i){if(e.isIgnored(t)||e.isIgnored(i))return;let r=n.get(t);r||(r=new Set,n.set(t,r)),r.add(i)}function V(e){let n=new Map;for(let[i,r]of e){if(d(i))continue;let a=f(i);for(let c of r){if(d(c))continue;let o=f(c);if(a===o||h(a,o))continue;let s=`${a}->${o}`;n.set(s,(n.get(s)??0)+1)}}let t=new Map;for(let[i,r]of n)t.set(i,r<=2?"violation":"ok");return t}function q(e){return e.includes("types")||e.endsWith(".d.ts")}function C(e,n,t){let i=v(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.isUsed)}function J(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.used)}function z(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.every(r=>r.isTypeOnly===!0)}function K(e){return e.endsWith(".vue")}function W(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length===0?!1:i.every(r=>r.kind==="side-effect"||r.kind==="namespace"&&r.usedMembers.length===0&&!r.used)}function d(e){let n=D(e);return!!(n==="entry"||n==="barrel"||n==="test"||n==="worker"||H(p.basename(e)))}function H(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{re as a};
|
|
18
|
+
//# sourceMappingURL=chunk-VXTNADIW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d,b as m}from"./chunk-KJCDEDQW.js";import{c as u}from"./chunk-KMVGRIO2.js";import{a as c}from"./chunk-XEMQUN3Z.js";function y(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:p}=e,r=e.minDeps??(p?1:3),{profiles:i,distinctiveDeps:f}=D(t,{scope:n,minDeps:r}),s=d(i,a=>a.deps);return m({profiles:i,limit:l,filePattern:p,overrunFactor:5,candidateIndex:s,profile:{name:"similar-files"},compare:(a,g)=>F(a,g,o,f)})}function D(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:p,distinctiveDeps:r}=S(n),i=[];for(let[f,s]of n)s.size>=l&&i.push({file:f,deps:new Set([...s].filter(a=>!p.has(a)))});return{profiles:i,distinctiveDeps:r}}function S(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let i of r)n.set(i,(n.get(i)??0)+1);let p=Math.max(3,Math.ceil(l*.03));for(let[r,i]of n)i>=5&&i/l>.3?e.add(r):i<=p&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function F(t,e,o,l){let n=new Set;for(let s of t.deps)e.deps.has(s)&&n.add(s);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let p=0;for(let s of n)l.has(s)&&p++;if(p<2)return null;let r=u(t.deps,e.deps);if(r<o)return null;let i=[];for(let s of t.deps)e.deps.has(s)||i.push(s);let f=[];for(let s of e.deps)t.deps.has(s)||f.push(s);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:i,uniqueToB:f}}export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-VYF5HA76.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import{d as O}from"./chunk-C4ICAIJ4.js";import{d as R}from"./chunk-WQHWIVA7.js";import{f as F,m as T}from"./chunk-R3JY4EZ4.js";import{e as d}from"./chunk-HXXMPYEF.js";import{a as v,b as k,d as h,m as y}from"./chunk-T2FQ4GHD.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-WFGOH2UI.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as g}from"./chunk-K6UI6EBZ.js";import{b as h}from"./chunk-PZS6J5YG.js";import{a as y}from"./chunk-X4O6K47U.js";import{d as b}from"./chunk-HXXMPYEF.js";import{d as p}from"./chunk-T2FQ4GHD.js";function v(e,n){let{scope:s,minLoc:r=10,limit:o=30,scanLimit:a}=n??{},l=new y(e);return g({candidates:()=>l.productionCallableDefinitions({scope:s,minLoc:r,requireFunctionLikeSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,profile:{name:"complexity-hotspots"},prepare:t=>{let i=B(e,t);return{callerMap:l.crossFileCallerMap(t,{semantic:n?.semantic!==!1}),calleeMap:l.calleeMap(t,{semantic:n?.semantic!==!1}),languageByFile:i,clojureCallableIds:I(e,t,i),branchEstimates:x(e,t)}},evaluate:(t,i)=>M(t,i,r),orderResults:(t,i)=>i.score-t.score||i.loc-t.loc,limit:o})}function M(e,n,s){if(n.languageByFile.get(e.relativePath)==="clojure"&&!n.clojureCallableIds.has(e.symbolId))return null;let r=e.endLine-e.startLine+1;if(r<s)return null;let o=n.callerMap.get(e.symbolId)?.size??0,a=n.calleeMap.get(e.symbolId)??[],l=new Set,t=new Set;for(let m of a){let u=`${m.symbol}|${m.file}`;l.add(u),m.file!==e.relativePath&&t.add(u)}let i=t.size,d=l.size,c=n.branchEstimates.get(e.symbolId)??{branches:0,estimateBasis:"regex-fallback"},f=c.branches+1;return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:r,fanIn:o,fanOut:i,calleeCount:d,branches:c.branches,estimateBasis:c.estimateBasis,score:Math.round(r/50*(o/5)*Math.max(i/5,1)*Math.max(f/5,1)*100)/100}}function x(e,n){return new Map(n.map(s=>[s.symbolId,h(e,s)]))}function B(e,n){let s=[...new Set(n.map(a=>a.relativePath))];if(s.length===0)return new Map;let r=s.map(()=>"?").join(", "),o=e.all(`SELECT relative_path, language
|
|
2
|
+
FROM documents
|
|
3
|
+
WHERE relative_path IN (${r})`,...s);return new Map(o.map(a=>[a.relative_path,a.language?.toLowerCase()??null]))}function I(e,n,s){let r=new Set,o=new Map;for(let a of n){if(s.get(a.relativePath)!=="clojure")continue;let l=o.get(a.relativePath);l||(l=new Set((p(e,a.relativePath)?.callables??[]).map(t=>`${t.name}:${t.startLine}`)),o.set(a.relativePath,l)),l.has(`${a.leaf}:${a.startLine}`)&&r.add(a.symbolId)}return r}export{v as a};
|
|
4
|
+
//# sourceMappingURL=chunk-WGA5BBTA.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{execFileSync as m}from"child_process";import{platform as d}from"os";var h=d()==="win32";function n(e){let r=h?"where":"which";try{return m(r,[e],{stdio:"pipe"}),!0}catch{return!1}}import{execFileSync as l}from"child_process";import{createRequire as y}from"module";import{existsSync as S}from"fs";import{platform as o,arch as p}from"os";var u="v0.8.1",c="https://github.com/sourcegraph/scip",g="SCIP_QUERY_SCIP_BIN";function w(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let r=e.env[g];if(r&&e.fileExists(r))return{source:"env",path:r};if(e.platform==="win32"){let i=e.resolveSidecar(e.arch);if(i&&e.fileExists(i))return{source:"sidecar",path:i}}return null}function v(e){let r=y(import.meta.url);for(let i of e==="arm64"?["arm64","x64"]:[e])try{return r.resolve(`scip-query-scip-windows/scip-win32-${i}.exe`)}catch{}return null}function f(e=process.env){return w({platform:o(),arch:p(),env:e,isOnPath:n,fileExists:S,resolveSidecar:v})?.path??null}function N(){return f()!==null}function q(){let e=f();if(!e)return null;try{return l(e,["--version"],{stdio:"pipe"}).toString().trim()}catch{return null}}function x(){let e=o(),r=p(),i,s,t;switch(e){case"darwin":i="darwin",t="tar.gz";break;case"linux":i="linux",t="tar.gz";break;default:return null}switch(r){case"arm64":s="arm64";break;case"x64":s="amd64";break;default:return null}let a=`scip-${i}-${s}.${t}`;return{url:`${c}/releases/download/${u}/${a}`,filename:a}}function L(){let e=x();console.log("\nThe `scip` CLI is required but not found on PATH.\n"),o()==="darwin"?(console.log("Install via Homebrew:"),console.log(` brew install sourcegraph/scip/scip
|
|
2
|
+
`),console.log("Or download manually:")):o()==="win32"?(console.log("On Windows the scip binary ships via the npm sidecar package scip-query-scip-windows,"),console.log("installed automatically with scip-query. If it is missing:"),console.log(" npm install -g scip-query-scip-windows"),console.log(`Or set ${g} to a local scip.exe path.
|
|
3
|
+
`),console.log("Upstream release page:")):console.log("Download from:"),console.log(e?` ${e.url}
|
|
4
|
+
`:` ${c}/releases/tag/${u}
|
|
5
|
+
`),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function O(e){if(o()==="darwin"&&n("brew")){e("Installing scip CLI via Homebrew...");try{if(l("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(n("go")){e("Installing scip CLI via go install...");try{if(l("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${c}/releases`),!1}export{n as a,f as b,N as c,q as d,L as e,O as f};
|
|
6
|
+
//# sourceMappingURL=chunk-WIBFXSYB.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as C}from"./chunk-X4O6K47U.js";import{q as v}from"./chunk-WFGOH2UI.js";import{b as O,d as x,f as T}from"./chunk-C4ICAIJ4.js";import{d as A}from"./chunk-HXXMPYEF.js";import{d as b}from"./chunk-T2FQ4GHD.js";import{x as g}from"./chunk-ISLWJ4PY.js";function H(e,n={}){let{samples:o=50,scope:r,maxDisagreements:u=5}=n,l=new C(e),a=B(l.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o),c=K(e,a);if(a.length===0||!c)return{available:!1,sampleSize:a.length,oracleCoverage:0,scores:[],topDisagreements:[]};let t={references:P(),callees:P()},i=[],f=0,m=c==="semantic"?T(e,a):new Map,I=c==="source"?E(e,l,a):null;for(let s of a){let p=S(s,c==="semantic"?x(e,s).map(d=>d.file):[...I?.referencesBySymbolId.get(s.symbolId)??[]]),j=S(s,c==="semantic"?(m.get(s.symbolId)??[]).map(d=>d.file):[...I?.calleesBySymbolId.get(s.symbolId)??[]]);f+=1;let L=S(s,v(e,s).map(d=>d.file)),k=S(s,(l.calleeMap([s],{semantic:!1}).get(s.symbolId)??[]).map(d=>d.file)),w=y(c,"references"),R=y(c,"callees");Q(t.references,s,"references",L,p,w,i),Q(t.callees,s,"callees",k,j,R,i)}return i.sort((s,p)=>p.cheapOnly.length+p.oracleOnly.length-(s.cheapOnly.length+s.oracleOnly.length)),{available:!0,sampleSize:a.length,oracleCoverage:a.length>0?D(f/a.length):0,oracleKind:c,scores:["references","callees"].map(s=>F(s,t[s],c)),topDisagreements:i.slice(0,u)}}function P(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0,skippedOraclePartial:0}}function B(e,n){let o=[...e].sort((l,a)=>l.symbolId-a.symbolId);if(o.length<=n)return o;let r=o.length/n,u=[];for(let l=0;l<n;l++)u.push(o[Math.floor(l*r)]);return u}function K(e,n){let o=n[0];if(!o)return null;if(h(e,o))return"source";try{if(O(e).capability("semantic-references",o.relativePath).available)return"semantic"}catch{}return n.some(r=>h(e,r))?"source":null}function S(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function Q(e,n,o,r,u,l,a){if(!l&&u.size===0){e.skippedOraclePartial+=1;return}e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=u.size;let c=[],t=[];for(let i of r)u.has(i)?e.agreed+=1:c.push(i);for(let i of u)r.has(i)||t.push(i);(c.length>0||t.length>0)&&a.push({symbol:A(n.symbol),question:o,cheapOnly:c,oracleOnly:t})}var z={references:!0,callees:!1};function F(e,n,o){let r=n.oracleTotal>0?n.agreed/n.oracleTotal:1,u=n.cheapTotal-n.agreed,l=y(o,e);return{question:e,comparedSymbols:n.comparedSymbols,precision:l&&n.cheapTotal>0?D(n.agreed/n.cheapTotal):null,recall:D(r),unverified:u,skippedOraclePartial:n.skippedOraclePartial}}function y(e,n){return e==="semantic"?z[n]:!1}function h(e,n){return g(n.relativePath)==="clojure"&&b(e,n.relativePath)!==null}function E(e,n,o){let r=new Map,u=new Map,l=o.filter(t=>h(e,t)),a=new Map;for(let t of l){let i=a.get(t.leaf)??[];i.push(t),a.set(t.leaf,i)}for(let t of n.sourceFiles()){if(g(t)!=="clojure")continue;let i=b(e,t);if(i)for(let f of i.fileIdentifiers)for(let m of a.get(f)??[])M(r,m.symbolId,t)}let c=new Map;for(let t of n.scopedDefinitions()){if(g(t.relativePath)!=="clojure")continue;let i=c.get(t.leaf)??[];i.push(t),c.set(t.leaf,i)}for(let t of l){let i=b(e,t.relativePath);if(i){for(let f of i.callSites)if(!(f.line<t.startLine||f.line>t.endLine))for(let m of c.get(f.calleeLeaf)??[])M(u,t.symbolId,m.relativePath)}}return{referencesBySymbolId:r,calleesBySymbolId:u}}function M(e,n,o){let r=e.get(n);if(r){r.add(o);return}e.set(n,new Set([o]))}function D(e){return Math.round(e*1e3)/1e3}export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-WPSS37EW.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as y,b as d,e as b,n as C}from"./chunk-R3JY4EZ4.js";import{c as M,d as L,e as Q,g as I,h as E,i as K}from"./chunk-HXXMPYEF.js";function se(e,n){return O(e,n).match}function O(e,n){let t=z(e,n.trim()).filter(r=>!e.isIgnored(r.relative_path));if(t.length>0)return S(e,t);let o=G(e,n);if(o&&!e.isIgnored(o.relative_path))return S(e,[o]);let i=W(e,n);return i.length>0?S(e,i):X(e,n)}function W(e,n){let t=N(n),o=x(t);if(!o)return[];let i=`%${o.path}%`,r=o.leaf;return j(e,i,r,t)}function j(e,n,t,o){let i=b([],[...q(e,n,t),...T(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>f(r,o)>1);return i.sort((r,a)=>f(a,o)-f(r,o)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),i}function q(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function T(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function X(e,n){let t=N(n),o=P(n),i=V(e,o),r=ee(i,n,t).filter(s=>!e.isIgnored(s.relative_path));if(r.length>0)return S(e,r);let a=[];for(let s of i){if(e.isIgnored(s.relative_path))continue;let c=Y(s,n,t,o);c<=0||a.push({row:s,score:c})}return a.sort((s,c)=>c.score-s.score||s.row.end_line-s.row.start_line-(c.row.end_line-c.row.start_line)||s.row.relative_path.localeCompare(c.row.relative_path)||s.row.symbol.localeCompare(c.row.symbol)),S(e,a.map(s=>s.row))}function S(e,n){let t=n.map(i=>C(e,i)),o=t[0]??null;return{match:o,candidates:o?Z(t,o):[],total:t.length}}function Z(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let i of e){let r=`${i.symbolId}:${i.relativePath}:${i.startLine}`;if(!t.has(r)&&(t.add(r),o.push({symbol:i.symbol,shortName:L(i.symbol),relativePath:i.relativePath,startLine:i.startLine}),o.length>=5))break}return o}function G(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return;let[,o,i,r]=t,a=Math.max(0,parseInt(i,10)-1),s=Math.max(a,parseInt(r,10)-1);return H(e,o,a,s)??J(e,o,a,s)}function H(e,n,t,o){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function J(e,n,t,o){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function le(e,n){let t=z(e,n).find(o=>!e.isIgnored(o.relative_path));return t?C(e,t):null}function z(e,n){let t=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return b(t,o)}function ce(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=U(e,n.symbolId)[0];return t?C(e,t):null}function U(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return b(t,o)}function V(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(s=>{let c=`%${s}%`;return[c,c,c]}),i=t.join(`
|
|
2
|
+
AND `),r=y(e,{where:i,params:o,limit:200}),a=d(e,{where:i,params:o,limit:200});return b(r,a)}function Y(e,n,t,o){let i=n.trim(),r=t,a=r.replace(/\(\)$/,""),s=n.toLowerCase(),c=t.toLowerCase(),h=c.replace(/\(\)$/,""),k=e.symbol,v=L(e.symbol),g=Q(e.symbol),A=e.display_name??"",w=e.symbol.toLowerCase(),m=v.toLowerCase(),u=g.toLowerCase(),D=A.toLowerCase(),p=e.relative_path.toLowerCase(),F=/[/:.]/.test(t),$=x(t),_=$?.leaf.toLowerCase(),l=0;return(k===i||k===r)&&(l+=1150),(v===i||v===r)&&(l+=1100),A===a&&(l+=1180),g===a&&(l+=1160),(`${g}()`===i||`${g}()`===r)&&(l+=955),(w===s||w===c)&&(l+=1e3),(m===s||m===c)&&(l+=950),(p===s||p===c)&&(l+=925),(p.endsWith(`/${c}`)||p.endsWith(`/${s}`))&&(l+=875),D===h&&(l+=850),u===h&&(l+=825),(`${u}()`===s||`${u}()`===c)&&(l+=820),(m.endsWith(`:${c}`)||m.endsWith(`:${h}`)||m.endsWith(`:${h}()`))&&(l+=800),w.includes(c)&&(l+=120),m.includes(c)&&(l+=140),p.includes(c)&&(l+=140),D.includes(c)&&(l+=110),o.every(B=>{let R=B.toLowerCase();return w.includes(R)||m.includes(R)||p.includes(R)||D.includes(R)})&&(l+=100+o.length*15),$&&p.includes($.path.toLowerCase())&&(l+=360,_&&(u===_||`${u}()`===_||`${u}()`==`${_}()`)&&(l+=700),I(e.symbol)&&(l+=180)),E(e.symbol)&&u===h&&(l+=60),!F&&K(e.symbol)&&(l-=160),l-=Math.min(50,Math.max(0,e.end_line-e.start_line)),l}function x(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let o=n.slice(t+1).replace(/\(\)$/,"");return!o||o.includes(".")?null:{path:n.slice(0,t),leaf:o}}function N(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function P(e){let n=N(e),t=n.split(/[^A-Za-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>0);return t.length>0?[...new Set(t)]:[n]}function ee(e,n,t){let o=n.trim(),i=e.filter(r=>{let a=L(r.symbol),s=(r.display_name??"").trim();return r.symbol===o||a===o||a===t||s===o||s===t||`${s}()`===o||f(r,t)>1||r.relative_path===o});return i.length===0?[]:(i.sort((r,a)=>f(a,t)-f(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),i)}function f(e,n){let t=x(n);if(!t)return 0;let o=e.relative_path.toLowerCase(),i=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return o.includes(r)?i!==a?1:I(e.symbol)?M(e.symbol)===null?5:4:M(e.symbol)===null?3:2:0}export{se as a,O as b,le as c,ce as d};
|
|
3
|
+
//# sourceMappingURL=chunk-WQHWIVA7.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import{c as p}from"./chunk-7S5E7KWT.js";import{createHash as w}from"crypto";import{readFileSync as k}from"fs";import{dirname as m,join as y}from"path";import F from"better-sqlite3";var I="evidence.db";var g=new WeakMap,b=p("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),j=p("evidence-project-fingerprint",{clearGroups:["whole-project"]}),l="evidence-v1",E="version NOT LIKE 'evidence-%'";function T(e){return w("sha256").update(e).digest("hex")}function ce(e,n,t){return b.get(e,n,()=>T(t))}function de(e){return j.get(e,"current",()=>{try{let n=JSON.parse(k(y(m(e.config.dbPath),"meta.json"),"utf-8"));if(n.version!==2&&n.version!==3||n.status!=="complete"||n.fingerprint===void 0)return null;let t=Array.isArray(n.indexedLanguages)?[...n.indexedLanguages].sort():[];return T(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:t}))}catch(n){return f("project fingerprint unavailable",n),null}})}function f(e,n){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${e}: ${n instanceof Error?n.message:String(n)}`)}function c(e){if(g.has(e))return g.get(e)??null;let n=null;try{let t=new F(y(m(e.config.dbPath),I));t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 5000"),t.pragma("synchronous = NORMAL"),t.exec(`
|
|
2
|
+
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
3
|
+
kind TEXT NOT NULL,
|
|
4
|
+
relative_path TEXT NOT NULL,
|
|
5
|
+
content_hash TEXT NOT NULL,
|
|
6
|
+
version TEXT NOT NULL,
|
|
7
|
+
payload TEXT NOT NULL,
|
|
8
|
+
PRIMARY KEY (kind, relative_path)
|
|
9
|
+
);
|
|
10
|
+
CREATE TABLE IF NOT EXISTS project_evidence (
|
|
11
|
+
kind TEXT NOT NULL,
|
|
12
|
+
cache_key TEXT NOT NULL,
|
|
13
|
+
project_fingerprint TEXT NOT NULL,
|
|
14
|
+
version TEXT NOT NULL,
|
|
15
|
+
payload TEXT NOT NULL,
|
|
16
|
+
PRIMARY KEY (kind, cache_key)
|
|
17
|
+
);
|
|
18
|
+
CREATE TABLE IF NOT EXISTS semantic_callees (
|
|
19
|
+
relative_path TEXT NOT NULL,
|
|
20
|
+
symbol TEXT NOT NULL,
|
|
21
|
+
content_hash TEXT NOT NULL,
|
|
22
|
+
deps_digest TEXT NOT NULL,
|
|
23
|
+
version TEXT NOT NULL,
|
|
24
|
+
payload TEXT NOT NULL,
|
|
25
|
+
PRIMARY KEY (relative_path, symbol)
|
|
26
|
+
);
|
|
27
|
+
CREATE TABLE IF NOT EXISTS semantic_references (
|
|
28
|
+
relative_path TEXT NOT NULL,
|
|
29
|
+
symbol TEXT NOT NULL,
|
|
30
|
+
project_fingerprint TEXT NOT NULL,
|
|
31
|
+
version TEXT NOT NULL,
|
|
32
|
+
payload TEXT NOT NULL,
|
|
33
|
+
PRIMARY KEY (relative_path, symbol)
|
|
34
|
+
);
|
|
35
|
+
CREATE TABLE IF NOT EXISTS finding_outcome_ledger (
|
|
36
|
+
check_name TEXT NOT NULL,
|
|
37
|
+
finding_id TEXT NOT NULL,
|
|
38
|
+
first_seen INTEGER NOT NULL,
|
|
39
|
+
last_seen INTEGER NOT NULL,
|
|
40
|
+
times_shown INTEGER NOT NULL,
|
|
41
|
+
outcome TEXT NOT NULL,
|
|
42
|
+
PRIMARY KEY (check_name, finding_id)
|
|
43
|
+
);
|
|
44
|
+
`),n={evidence:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:t.prepare(`SELECT payload FROM file_evidence
|
|
45
|
+
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${E}
|
|
46
|
+
ORDER BY version DESC
|
|
47
|
+
LIMIT 1`),writeFileEvidence:t.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:t.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:t.prepare(`SELECT payload FROM project_evidence
|
|
48
|
+
WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${E}
|
|
49
|
+
ORDER BY version DESC
|
|
50
|
+
LIMIT 1`),writeProjectEvidence:t.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:t.prepare(`SELECT payload FROM semantic_callees
|
|
51
|
+
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:t.prepare(`SELECT payload FROM semantic_callees
|
|
52
|
+
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${E}
|
|
53
|
+
ORDER BY version DESC
|
|
54
|
+
LIMIT 1`),writeCallees:t.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
55
|
+
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:t.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:t.prepare(`SELECT payload FROM semantic_references
|
|
56
|
+
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:t.prepare(`SELECT payload FROM semantic_references
|
|
57
|
+
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${E}
|
|
58
|
+
ORDER BY version DESC
|
|
59
|
+
LIMIT 1`),writeReferences:t.prepare(`INSERT OR REPLACE INTO semantic_references
|
|
60
|
+
(relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:t.prepare("DELETE FROM semantic_references WHERE project_fingerprint != ?"),readFindingOutcomeLedger:t.prepare("SELECT check_name, finding_id, first_seen, last_seen, times_shown, outcome FROM finding_outcome_ledger"),deleteFindingOutcomeLedgerForCheck:t.prepare("DELETE FROM finding_outcome_ledger WHERE check_name = ?"),writeFindingOutcomeLedgerRow:t.prepare(`INSERT INTO finding_outcome_ledger
|
|
61
|
+
(check_name, finding_id, first_seen, last_seen, times_shown, outcome) VALUES (?, ?, ?, ?, ?, ?)`)}}catch(t){f("disabled (open failed)",t)}return g.set(e,n),n}function d(e,n,t){f(`disabled (${n})`,t),g.set(e,null)}function _(e,n,t,i){let r=c(e);if(!r)return null;try{return(r.readFileEvidence.get(n,t,i,l)??r.readLegacyFileEvidence.get(n,t,i))?.payload??null}catch(a){return d(e,"file_evidence read",a),null}}function S(e,n,t,i,r){let a=c(e);if(a)try{a.writeFileEvidence.run(n,t,i,l,r)}catch(o){d(e,"file_evidence write",o)}}function N(e,n,t,i){let r=c(e);if(!r)return null;try{return(r.readProjectEvidence.get(n,t,i,l)??r.readLegacyProjectEvidence.get(n,t,i))?.payload??null}catch(a){return d(e,"project_evidence read",a),null}}function P(e,n,t,i,r){let a=c(e);if(a)try{a.writeProjectEvidence.run(n,t,i,l,r)}catch(o){d(e,"project_evidence write",o)}}function le(e,n,t,i,r){let a=c(e);if(!a)return null;try{return(a.readCallees.get(n,t,i,r,l)??a.readLegacyCallees.get(n,t,i,r))?.payload??null}catch(o){return d(e,"semantic_callees read",o),null}}function pe(e,n,t,i){let r=c(e);if(!r)return null;try{return(r.readReferences.get(n,t,i,l)??r.readLegacyReferences.get(n,t,i))?.payload??null}catch(a){return d(e,"semantic_references read",a),null}}function ue(e,n){if(n.length===0)return;let t=c(e);if(t)try{t.evidence.transaction(()=>{let i=new Set;for(let r of n){let a=`${r.relativePath}\0${r.contentHash}`;i.has(a)||(i.add(a),t.dropStaleCallees.run(r.relativePath,r.contentHash)),t.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,l,r.payload)}})()}catch(i){d(e,"semantic_callees write",i)}}function Ee(e,n){if(n.length===0)return;let t=c(e);if(t)try{t.evidence.transaction(()=>{let i=new Set;for(let r of n)i.has(r.projectFingerprint)||(i.add(r.projectFingerprint),t.dropStaleReferences.run(r.projectFingerprint)),t.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,l,r.payload)})()}catch(i){d(e,"semantic_references write",i)}}function ge(e){let n=c(e);if(!n)return[];try{return n.readFindingOutcomeLedger.all().map(i=>({check:i.check_name,findingId:i.finding_id,firstSeen:i.first_seen,lastSeen:i.last_seen,timesShown:i.times_shown,outcome:i.outcome}))}catch(t){return d(e,"finding_outcome_ledger read",t),[]}}function ve(e){return typeof e=="object"&&e!==null}function he(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")?e:null}import{appendFileSync as A,mkdirSync as x}from"fs";import{dirname as M}from"path";import{performance as v}from"perf_hooks";var U="SCIP_QUERY_PROFILE",H="SCIP_QUERY_PROFILE_OUT",K="SCIP_QUERY_PROFILE_COMMAND",V="SCIP_QUERY_PROFILE_CACHE_STATE",L=new Set,O=!1;function C(){let e=process.env[U];return e==="1"||e==="true"}function X(){return process.env[H]}function W(){return process.env[K]}function Y(){return process.env[V]}function h(e,n,t){if(!C())return n();let i=v.now();try{let r=n();return R({type:"span",name:e,durationMs:Math.round(v.now()-i),ok:!0,...D(t)??{}}),r}catch(r){throw R({type:"span",name:e,durationMs:Math.round(v.now()-i),ok:!1,error:r instanceof Error?r.message:String(r),...D(t)??{}}),r}}function R(e,n=X()){let t={timestamp:new Date().toISOString(),pid:process.pid,command:W(),cacheState:Y(),...e},i=`${JSON.stringify(t)}
|
|
62
|
+
`;if(n)try{let r=M(n);L.has(r)||(x(r,{recursive:!0}),L.add(r)),A(n,i);return}catch(r){O||(O=!0,process.stderr.write(`[profile] failed to write ${n}: ${r instanceof Error?r.message:String(r)}
|
|
63
|
+
`));return}C()&&process.stderr.write(i)}function D(e){return typeof e=="function"?e():e}var $=[s("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),s("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),s("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),s("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),s("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),s("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),s("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),s("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),s("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),s("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),s("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),B("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"})];function Re(e){return{kind:e.kind,read(n,t,i){let r=!1,a=0;return h("evidence-product.file.read",()=>{let o=_(n,e.kind,t,i);if(o===null)return null;a=o.length;try{let u=e.deserialize(o);return r=u!==null,u}catch{return null}},()=>({scope:"file",kind:e.kind,available:!0,hit:r,payloadBytes:a}))},write(n,t,i,r){S(n,e.kind,t,i,e.serialize(r))}}}function De(e){return{kind:e.kind,read(n,t,i){let r=!1,a=0;return h("evidence-product.project.read",()=>{let o=N(n,e.kind,t,i);if(o===null)return null;a=o.length;try{let u=e.deserialize(o);return r=u!==null,u}catch{return null}},()=>({scope:"project",kind:e.kind,available:!0,hit:r,payloadBytes:a}))},write(n,t,i,r){P(n,e.kind,t,i,e.serialize(r))}}}function Ce(e){let n=$.find(t=>t.kind===e);if(!n)throw new Error(`missing evidence product manifest entry for ${e}`);return n.invalidation}function s(e,n){return{scope:"file",kind:e,invalidation:{scope:"file",...n}}}function B(e,n){return{scope:"project",kind:e,invalidation:{scope:"project",...n}}}import{readFileSync as G}from"fs";import{join as z}from"path";var J=p("source-text",{clearGroups:["whole-project","source-file"]}),Q=p("source-lines",{clearGroups:["whole-project","source-file"]});function q(e,n){let t=n.replace(/\\/g,"/");return J.get(e,t,()=>{let i=z(e.config.projectRoot,t);try{return G(i,"utf-8")}catch(r){if(Z(r))return"";throw r}})}function Z(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function ee(e,n){let t=n.replace(/\\/g,"/");return Q.get(e,t,()=>{let i=q(e,t);return i?i.split(`
|
|
64
|
+
`):[]})}var te=/^\s*(?:\/\/|#|\/\*+|\*)\s*scip-query[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar))?\b/i;function ne(e){let n=te.exec(e);return n?n[1]??"":null}function be(e,n,t){if(t<=0)return!1;let i=ee(e,n);if(i.length===0)return!1;for(let r=t-1;r>=0&&r>=t-5;r-=1){let a=(i[r]??"").trim();if(a!==""){if(ne(a)!==null)return!0;if(!a.startsWith("//")&&!a.startsWith("*")&&!a.startsWith("/*")&&!a.startsWith("@")&&!a.startsWith("#"))return!1}}return!1}export{T as a,ce as b,de as c,le as d,pe as e,ue as f,Ee as g,ge as h,ve as i,he as j,C as k,h as l,Re as m,De as n,Ce as o,q as p,ee as q,ne as r,be as s};
|
|
65
|
+
//# sourceMappingURL=chunk-WS3Z6W3M.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-XHWLNQVZ.js";function m(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -30,4 +30,4 @@ import{a as s}from"./chunk-7B6LP46R.js";function m(e,d){let i=s(e,d);return i?e.
|
|
|
30
30
|
WHERE d2.relative_path = ?
|
|
31
31
|
AND d1.relative_path != ?
|
|
32
32
|
ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{m as a,o as b};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-WZLPXFZU.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as D,f as H,g as O}from"./chunk-NAH5EAZS.js";import{a as x}from"./chunk-BGBBVSH4.js";import{b as U,d as X,e as Z,f as $}from"./chunk-QJ3FK4TB.js";import{a as _,j as z,k as J,m as N,n as Q}from"./chunk-WFGOH2UI.js";import{a as B}from"./chunk-XEMQUN3Z.js";import{f as I,h as W,i as Y,j as P}from"./chunk-R3JY4EZ4.js";import{a as j,g as k,h as T,j as V,k as G}from"./chunk-HXXMPYEF.js";import{k as F}from"./chunk-T2FQ4GHD.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-X4O6K47U.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-X4O6K47U.js";import{a as c,c as f}from"./chunk-QJ3FK4TB.js";import{d as m}from"./chunk-HXXMPYEF.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-X6OGDTQH.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{m as P}from"./chunk-T2FQ4GHD.js";import{a as E,c as F,l,n as I,o as _}from"./chunk-WS3Z6W3M.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as h}from"./chunk-7S5E7KWT.js";var D=I({kind:"file-dependency-graph",invalidation:_("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:w}),C=h("file-dep-graph",{clearGroups:["whole-project"]});function T(e,r){return C.get(e,r??"",()=>{let i=new Set(S(e,{includeIgnored:!1})),n=F(e),s=A(r),o=0,a=0,u=null,m=!1,c=0,f=0;return l("file-dep-graph.product",()=>{if(n){let t=D.read(e,s,n);if(t){m=!0;let p=b(t);return o=t.sourceFileCount,a=t.sourceEdgeCount,c=t.scipEdgeCount,f=p.size,u=t.sourceImportFingerprint,p}}let d=l("file-dep-graph.source-imports",()=>{let t=N(e,i,r);return o=t.files.length,a=t.edges.length,u=t.fingerprint,t},()=>({scope:r??null,files:o,edges:a})),g=new Map,y=(t,p)=>J(e,g,i,t,p);l("file-dep-graph.scip-edges",()=>{for(let t of k(e,r))c+=1,y(t.from_file,t.to_file)},()=>({scope:r??null,edges:c}));for(let t of d.edges)y(t.fromFile,t.toFile);return f=g.size,n&&D.write(e,s,n,{sourceImportFingerprint:d.fingerprint,sourceFileCount:d.files.length,sourceEdgeCount:d.edges.length,scipEdgeCount:c,graph:G(g)}),g},()=>({scope:r??null,available:n!==null,hit:m,files:o,sourceEdges:a,scipEdges:c,graphFiles:f,sourceImportFingerprint:u}))})}function N(e,r,i){let n=[],s=[];for(let o of r)if(!(i&&!o.includes(i))){n.push(o);for(let a of P(e,o))a.sourcePath&&s.push({fromFile:o,toFile:a.sourcePath})}return{files:n,edges:s,fingerprint:O(n,s)}}function O(e,r){let i=r.map(n=>`${n.fromFile}\0${n.toFile}`).sort();return E(JSON.stringify({files:e,edges:i}))}function A(e){return e??"<all>"}function G(e){return[...e].map(([r,i])=>[r,[...i]])}function b(e){return new Map(e.graph.map(([r,i])=>[r,new Set(i)]))}function w(e){let r=JSON.parse(e);return v(r)?r:null}function v(e){if(!e||typeof e!="object")return!1;let r=e;return typeof r.sourceImportFingerprint=="string"&&typeof r.sourceFileCount=="number"&&typeof r.sourceEdgeCount=="number"&&typeof r.scipEdgeCount=="number"&&Array.isArray(r.graph)&&r.graph.every(R)}function R(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(r=>typeof r=="string")}function k(e,r){let i=r?"AND d1.relative_path LIKE ?":"",n=r?[`%${r}%`]:[];return e.all(`SELECT DISTINCT
|
|
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-XEMQUN3Z.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-WQHWIVA7.js";import{a as c}from"./chunk-64MNV6AB.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as g,join as d}from"path";function S(t,r){let e=f(t,r,{allowMultiple:!1})[0]?.relativePath;return e||x(t,r)}function j(t,r){return f(t,r,{allowMultiple:!0}).map(e=>e.relativePath)}function x(t,r){if(!r)return null;let e=r.replace(/\\/g,"/").replace(/^\.\//,""),s=g(e)&&e.startsWith(t.config.projectRoot)?e.slice(t.config.projectRoot.length).replace(/^\/+/,""):e,i=d(t.config.projectRoot,s);return m(i)?s:null}function f(t,r,e){let s=h(r);if(!s)return[];let i=c(t,{includeIgnored:!1}).map(o=>({relativePath:o,score:v(o,s)})).filter(o=>o.score>0).sort((o,l)=>l.score-o.score||o.relativePath.localeCompare(l.relativePath));if(i.length===0){let o=u(t,r);return!o||t.isIgnored(o.relativePath)?[]:[{relativePath:o.relativePath,score:700}]}let n=i.filter(o=>o.score>=1100);if(n.length>0)return e.allowMultiple?n:[n[0]];let a=i.filter(o=>o.score>=800);return a.length>0?e.allowMultiple?a:[a[0]]:e.allowMultiple?i:[i[0]]}function v(t,r){let e=h(t),s=p(e),i=p(r),n=0;return e===r&&(n+=1200),e.endsWith(`/${r}`)&&(n+=1100),s===i&&(n+=900),e.startsWith(`${r}/`)&&(n+=850),e.includes(r)&&(n+=250),n}function h(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{S as a,j as b};
|
|
2
|
+
//# sourceMappingURL=chunk-XHWLNQVZ.js.map
|