scip-query 0.19.3 → 0.19.4
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/README.md +1 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-LSJDKJIB.js → chunk-25LPM4DG.js} +2 -2
- package/dist/chunk-2CTX5CMX.js +4 -0
- package/dist/chunk-2Y373BDD.js +2 -0
- package/dist/{chunk-24ET4VLC.js → chunk-2YU7I3QO.js} +2 -2
- package/dist/{chunk-QNO3QIMN.js → chunk-3MJ5YA4Y.js} +2 -2
- package/dist/{chunk-B26UX7ZD.js → chunk-3SVWW4PN.js} +2 -2
- package/dist/{chunk-WWCZCH7W.js → chunk-4333ETTV.js} +2 -2
- package/dist/{chunk-6EWBPAA3.js → chunk-4RSI5EMG.js} +2 -2
- package/dist/{chunk-CIYUFF24.js → chunk-4SALD7RU.js} +2 -2
- package/dist/{chunk-XWE7PZQH.js → chunk-4T3LTWUS.js} +2 -2
- package/dist/{chunk-34MLC6UI.js → chunk-4XTA5OMB.js} +2 -2
- package/dist/chunk-52ZYCAEO.js +2 -0
- package/dist/{chunk-SJ6XSCG7.js → chunk-54HA4ZXH.js} +2 -2
- package/dist/{chunk-J4MYRIYT.js → chunk-64RFXJT5.js} +2 -2
- package/dist/{chunk-FUFNRZFJ.js → chunk-6E7UTQY7.js} +2 -2
- package/dist/{chunk-PNESKY2Z.js → chunk-6NSFJYRC.js} +2 -2
- package/dist/{chunk-AOSFSYEA.js → chunk-7B3UPBVA.js} +2 -2
- package/dist/{chunk-4BUMNEYQ.js → chunk-7GXM52MI.js} +2 -2
- package/dist/{chunk-SOS256TP.js → chunk-A2EZV2UM.js} +2 -2
- package/dist/{chunk-6FIA5BEB.js → chunk-ABMYA4TN.js} +2 -2
- package/dist/{chunk-64QITTX7.js → chunk-B5NLK2B3.js} +2 -2
- package/dist/{chunk-OLG2YPLS.js → chunk-BTEE5NZQ.js} +2 -2
- package/dist/{chunk-MP43RX4O.js → chunk-C7NIYIQ4.js} +1 -1
- package/dist/{chunk-AEM24WSF.js → chunk-CFMXJPHH.js} +2 -2
- package/dist/{chunk-HHOJH3RJ.js → chunk-CNKAGUPL.js} +2 -2
- package/dist/{chunk-MQ2B33LQ.js → chunk-D4U5Q3FT.js} +2 -2
- package/dist/{chunk-YZXV3CU3.js → chunk-DGAGY7RJ.js} +1 -1
- package/dist/{chunk-FRXB74RQ.js → chunk-DLWR3NUU.js} +5 -5
- package/dist/{chunk-YGQBJUS6.js → chunk-DZ74OMG6.js} +2 -2
- package/dist/{chunk-APLNTJPJ.js → chunk-EOOJGLDU.js} +2 -2
- package/dist/{chunk-TYEGFDOP.js → chunk-F6O7AAC3.js} +2 -2
- package/dist/{chunk-HFBNIIZX.js → chunk-FECYOO5O.js} +2 -2
- package/dist/{chunk-AFVU2GB2.js → chunk-FWUUZTIO.js} +2 -2
- package/dist/{chunk-KMOMNTB4.js → chunk-GBQ5NYPR.js} +2 -2
- package/dist/{chunk-2ROSOG2I.js → chunk-GPBBJ5Y4.js} +2 -2
- package/dist/{chunk-IXAALOUP.js → chunk-H7UKLTWJ.js} +2 -2
- package/dist/{chunk-YILKXTIY.js → chunk-HEXVUYFQ.js} +2 -2
- package/dist/{chunk-J5XJWCB3.js → chunk-HKEHS2AS.js} +2 -2
- package/dist/{chunk-JRCJEHRG.js → chunk-I5AWSI2G.js} +2 -2
- package/dist/{chunk-XYBNOILR.js → chunk-I5RJM53C.js} +2 -2
- package/dist/{chunk-AD7WUFFT.js → chunk-IG7N5ZIK.js} +2 -2
- package/dist/{chunk-C3KCSAQ4.js → chunk-IUFDSKGG.js} +2 -2
- package/dist/{chunk-OQ6TCHBB.js → chunk-IZKFSVBV.js} +2 -2
- package/dist/{chunk-5OZCNAVM.js → chunk-J77UIT3I.js} +2 -2
- package/dist/{chunk-EGKWRX5I.js → chunk-K2ERX4UT.js} +2 -2
- package/dist/{chunk-FYE4PWWP.js → chunk-KP6XRY5Z.js} +2 -2
- package/dist/{chunk-FC5K7T35.js → chunk-L7SPDE73.js} +1 -1
- package/dist/{chunk-YGBHQOB2.js → chunk-LBMJEAEW.js} +2 -2
- package/dist/chunk-LHMNRHGV.js +3 -0
- package/dist/{chunk-5TZ2MQBG.js → chunk-M7AIS73L.js} +2 -2
- package/dist/{chunk-53SUJOJA.js → chunk-M7MTH5NR.js} +2 -2
- package/dist/{chunk-HNTLCR4F.js → chunk-MITTUCEH.js} +2 -2
- package/dist/{chunk-5GCAM4JE.js → chunk-MSWVMDAH.js} +6 -6
- package/dist/chunk-NH5ALKPW.js +2 -0
- package/dist/{chunk-EHU4TZJJ.js → chunk-NPKYOIFM.js} +3 -3
- package/dist/{chunk-XWJ3JYRG.js → chunk-NRCXJDHL.js} +2 -2
- package/dist/{chunk-5GOBZI34.js → chunk-NSS46APD.js} +2 -2
- package/dist/{chunk-5FUAFNMP.js → chunk-NZL2DBT7.js} +2 -2
- package/dist/{chunk-C3VQZFP2.js → chunk-OMPZHGHO.js} +2 -2
- package/dist/{chunk-XYNWAZ6J.js → chunk-P2PC2WGR.js} +2 -2
- package/dist/{chunk-CAKPEQZB.js → chunk-Q3AFUTGB.js} +2 -2
- package/dist/{chunk-ZJGZCBYT.js → chunk-Q4IIEGXJ.js} +2 -2
- package/dist/chunk-QDV6RDCP.js +4 -0
- package/dist/{chunk-FTRNGQGR.js → chunk-QGXBRIM5.js} +2 -2
- package/dist/{chunk-WXVGNFAO.js → chunk-QOKYJ33H.js} +1 -1
- package/dist/{chunk-FB6IKAKZ.js → chunk-QRGV2F7L.js} +2 -2
- package/dist/chunk-QVWS2VWZ.js +7 -0
- package/dist/{chunk-77IOFJVY.js → chunk-R4FQGQ4X.js} +2 -2
- package/dist/{chunk-4CZJ4YJB.js → chunk-RV2FQIX3.js} +2 -2
- package/dist/{chunk-4FMT4HPC.js → chunk-S44IULR6.js} +2 -2
- package/dist/{chunk-PCIFZHWS.js → chunk-SOAT6NLA.js} +2 -2
- package/dist/{chunk-TDUU63FC.js → chunk-STOL2BTL.js} +2 -2
- package/dist/chunk-SVLTAG5O.js +927 -0
- package/dist/{chunk-2WCXKANA.js → chunk-U6WNH5GC.js} +2 -2
- package/dist/chunk-U7DSEKOM.js +30 -0
- package/dist/{chunk-EII5ZHL2.js → chunk-UKZBVX4U.js} +2 -2
- package/dist/chunk-UOAV44HR.js +38 -0
- package/dist/{chunk-VIKEPD4D.js → chunk-VGRICIQI.js} +2 -2
- package/dist/{chunk-TOIS2VAI.js → chunk-VMNZB6WI.js} +2 -2
- package/dist/{chunk-JFO2UVQP.js → chunk-VTKGCT3V.js} +5 -5
- package/dist/{chunk-PJENL245.js → chunk-VXQNNXJE.js} +2 -2
- package/dist/{chunk-HAC5EI2T.js → chunk-WER3B7MI.js} +2 -2
- package/dist/{chunk-5OR4QRPR.js → chunk-WQTAC523.js} +2 -2
- package/dist/{chunk-GAE7WCBK.js → chunk-X6D5IC6I.js} +2 -2
- package/dist/{chunk-FBUNGRKI.js → chunk-XLTP42QA.js} +2 -2
- package/dist/chunk-XTX6QHOF.js +4 -0
- package/dist/{chunk-AYRHVJXW.js → chunk-XYADIZHU.js} +5 -5
- package/dist/{chunk-WAU7HVDI.js → chunk-YGAGTIDK.js} +2 -2
- package/dist/{chunk-IICQP2DY.js → chunk-YIJ7ZAA4.js} +3 -3
- package/dist/{chunk-EYF5HOUZ.js → chunk-YNRNA5LK.js} +2 -2
- package/dist/{chunk-QKW7ISEW.js → chunk-YVVCVR2L.js} +2 -2
- package/dist/{chunk-MRYPDVOS.js → chunk-ZAIILQNP.js} +3 -3
- package/dist/{chunk-Z7M7X3ZG.js → chunk-ZGZUZ7XE.js} +2 -2
- package/dist/{chunk-PTYQQHZM.js → chunk-ZXJYMGD3.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/{command-descriptors-QJEYYND2.js → command-descriptors-MFU4BCJ7.js} +55 -50
- package/dist/{config-types-BA3xLCfG.d.ts → config-types-D20KuvvZ.d.ts} +67 -0
- package/dist/{db-CzA-9_rL.d.ts → db-G_II8yXU.d.ts} +1 -1
- package/dist/diff-gate-types-C9BoYwYD.d.ts +10 -0
- package/dist/direct-navigation-MRMQFIRB.js +3 -0
- package/dist/{health-DYy13GAe.d.ts → health-oblXYgkF.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +86 -4
- package/dist/queries/architecture.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 +2 -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 +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +2 -2
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +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 +3 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +4 -8
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +3 -3
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +21 -5
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -2
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +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 +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +2 -2
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +7 -7
- package/dist/reindex.d.ts +3 -3
- package/dist/reindex.js +1 -1
- package/dist/runtime.d.ts +3 -3
- package/dist/runtime.js +2 -2
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-1bVKJgXi.d.ts → scip-cli-kRpaexVJ.d.ts} +1 -1
- package/dist/watch-server.js +4 -4
- package/docs/AI_FAILURE_MODES.md +1 -1
- package/docs/COMMAND_REFERENCE.md +1 -1
- package/docs/DETECTOR_GUIDE.md +1 -1
- package/docs/analyzer-inventory.md +1 -1
- package/docs/analyzer-validation-ledger.md +131 -1
- package/docs/architecture-coherence-vision.md +29 -0
- package/package.json +2 -2
- package/dist/chunk-26JI77AY.js +0 -927
- package/dist/chunk-2E7QY4B5.js +0 -7
- package/dist/chunk-33RLKB6L.js +0 -4
- package/dist/chunk-DO775SYA.js +0 -2
- package/dist/chunk-HCSTQGQE.js +0 -4
- package/dist/chunk-NLNZK7RL.js +0 -5
- package/dist/chunk-OAM22BCR.js +0 -2
- package/dist/chunk-PLDIXTKR.js +0 -38
- package/dist/chunk-UJKZQLDB.js +0 -2
- package/dist/chunk-WFWQWQK6.js +0 -3
- package/dist/chunk-XAMVIPE2.js +0 -29
- package/dist/diff-gate-types-CG2YQ_ei.d.ts +0 -4
- package/dist/direct-navigation-TT23TDBS.js +0 -3
package/README.md
CHANGED
|
@@ -213,7 +213,7 @@ When verification _fails_, the errors name the exact references the static evide
|
|
|
213
213
|
| `co-change-partner` | Historically coupled files that usually change together but are missing from this diff. | Default diff gate. |
|
|
214
214
|
| `twin-partner` | A changed symbol has a same-(near-)name twin (identical or already-divergent) elsewhere that this diff left untouched. | Default diff gate. Advisory: findings print but never cause a nonzero exit by themselves. |
|
|
215
215
|
| `coverage-contract` | A configured `coverageContracts` entry (.scipquery.json) drifted: its declared key set no longer matches its ground-truth source. | Default diff gate, only when either side of a configured contract changed. |
|
|
216
|
-
| `architecture` | A declared architecture boundary rule has a violation absent from the committed health baseline. | Default diff gate when closed dependency rows, requireCompletePolicy, or
|
|
216
|
+
| `architecture` | A declared architecture boundary rule has a violation absent from the committed health baseline. | Default diff gate when closed dependency rows, requireCompletePolicy, requireAcyclic, requireResolvedBoundaries, requireMinimalPolicy, maxBoundaryFanOut, global maxBoundaryFiles, per-boundary maxFiles, or testPaths are configured and a baseline exists. |
|
|
217
217
|
| `doc-reference` | Docs that cite changed files and may need a matching update. Dated snapshot docs (docs.snapshotPaths) are excluded by policy. | Default diff gate. Advisory (21.2) for bare file-mention citations; blocking when the citation has a line anchor or the cited file was deleted/renamed. |
|
|
218
218
|
| `unused-params` | Fresh trailing parameters or options that no changed body uses. | Default diff gate. |
|
|
219
219
|
| `new-dead` | Changed production symbols with zero indexed consumers. | Default diff gate. |
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as t}from"./chunk-
|
|
1
|
+
import{c as t}from"./chunk-64RFXJT5.js";import"./chunk-C7NIYIQ4.js";import{writeFileSync as o}from"fs";import{workerData as s}from"worker_threads";var e=s;try{let r=t({projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,vueFiles:e.vueFiles,tasks:e.tasks});o(e.resultPath,JSON.stringify({ok:!0,result:r}))}catch(r){o(e.resultPath,JSON.stringify({ok:!1,error:r instanceof Error?r.message:String(r)}))}finally{let r=new Int32Array(e.sharedBuffer);Atomics.add(r,0,1),Atomics.notify(r,0)}
|
|
2
2
|
//# sourceMappingURL=augment-vue-worker.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as l}from"./chunk-
|
|
1
|
+
import{b as l}from"./chunk-54HA4ZXH.js";import{c as a}from"./chunk-NH5ALKPW.js";import{d as i,g as n}from"./chunk-XYADIZHU.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -26,4 +26,4 @@ import{b as l}from"./chunk-SJ6XSCG7.js";import{a}from"./chunk-OAM22BCR.js";impor
|
|
|
26
26
|
AND ${e.localSymbolPredicate}
|
|
27
27
|
${e.pathExclusionsFor("d1")}
|
|
28
28
|
ORDER BY d1.relative_path`,...r,...r,...r)}function c(e,r){let t=new a(e);return r.flatMap(o=>t.definitionsForFile(o).filter(s=>n(s.symbol)).map(s=>({relative_path:o,symbol:s.symbol})))}function m(e){let r=new Set;return e.filter(t=>{let o=`${t.relative_path}|${t.symbol}`;return r.has(o)?!1:(r.add(o),!0)})}function u(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:i(e.symbol)}}export{_ as a};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-25LPM4DG.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as O,c as X}from"./chunk-LM72NQ7T.js";import{a as I}from"./chunk-7B3UPBVA.js";import{d as G,g as N,s as B,v as J,x as K}from"./chunk-L7SPDE73.js";import{a as V}from"./chunk-64MNV6AB.js";import{execFileSync as Z}from"child_process";import{existsSync as L,readFileSync as je}from"fs";import{createRequire as xe}from"module";import{platform as Q}from"os";import{dirname as Y,join as R}from"path";var Fe=xe(import.meta.url),At={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function W(t){return[t.indexerBinary,...t.binaryAliases??[]]}function Pe(t){let e=W(t);return e.length===1?e[0]:e.join(" or ")}function _(t){for(let e of W(t))if(Q()==="win32"){let n=X(e);if(n)return n}else if(O(e))return e;return Re(t)}function Et(t){return _(t)!==null||Ie(t)}function Ie(t){return ee(t)!==null}function Re(t){let e=ee(t);if(!e)return null;let r=JSON.parse(je(e,"utf8")).bin;if(!r)return null;if(typeof r=="string")return R(Y(e),r);for(let i of W(t)){let s=r[i];if(s)return R(Y(e),s)}return null}function ee(t){if(!t.bundledNpmPackage)return null;try{return Fe.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function Te(t,e){for(let n of t.projectLocalBinaries??[]){let r=R(e,n);if(L(r))return r}return null}function ve(t,e){return Te(t,e)??_(t)}function Dt(t,e=process.env,n=t.indexerBinary){if(t.indexerBinary!=="scip-dotnet"||$(n,e))return e;let r=te(n,e);return r?{...e,DOTNET_ROOT:r}:e}function Nt(t,e){let n=Pe(t),r=e?ve(t,e):_(t);if(!r)return{language:t.language,binaryLabel:n,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl};if(t.indexerBinary!=="scip-dotnet")return{language:t.language,binaryLabel:n,installed:!0,runnable:!0,resolvedBinary:r};let i=ke(r);return{language:t.language,binaryLabel:n,installed:!0,runnable:i.runnable,resolvedBinary:r,installUrl:t.installUrl,note:i.note}}function ke(t){if($(t,process.env))return{runnable:!0};let e=te(t,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let n=ne(process.env);return{runnable:!1,note:n.length>0?`.NET 9 runtime still unavailable after checking ${n.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function te(t,e){for(let n of ne(e))if($(t,{...e,DOTNET_ROOT:n}))return n;return null}function ne(t){let e=[],n=t.DOTNET_ROOT;if(n&&L(n)&&e.push(n),Q()==="darwin"&&O("brew"))try{let r=Z("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:t}).toString().trim(),i=R(r,"libexec");L(i)&&!e.includes(i)&&e.push(i)}catch{}return e}function $(t,e){try{return Z(t,["--version"],{stdio:"pipe",env:e}),!0}catch{return!1}}function Ot(t){try{return process.kill(t,0),!0}catch(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EPERM"}}import{mkdirSync as we,renameSync as Ce,writeFileSync as Me}from"fs";import{dirname as Ae}from"path";function $t(t,e,n={}){we(Ae(t),{recursive:!0});let r=`${t}.${process.pid}.${Date.now()}.tmp`,i=JSON.stringify(e,null,n.spacing);Me(r,n.trailingNewline?`${i}
|
|
2
|
+
`:i),Ce(r,t)}function z(t,e){let n=t.split("/").at(-1)??t;if(ce.has(n)||n===".scipquery.json"||/^tsconfig(?:\..+)?\.json$/.test(n))return"config";if(/\.d\.(?:ts|mts|cts)$/.test(t.toLowerCase()))return"ambient";let r=t.includes(".")?`.${t.split(".").at(-1).toLowerCase()}`:"";return e.some(i=>(pe[i]??[]).includes(r))?"source":"other"}function oe(t,e,n){let r=t.split("/").at(-1)??t;if(n?.includes(t)||n?.includes(r)||ce.has(r))return!0;let i=t.includes(".")?`.${t.split(".").at(-1).toLowerCase()}`:"";return(pe[e]??[]).includes(i)}function ae(t){if(typeof t!="object"||t===null)return null;let e=t;return typeof e.version!="number"||!re(e.languages)||typeof e.pnpmWorkspaces!="boolean"||typeof e.typescriptProjectMode!="string"||!re(e.typescriptProjects)||e.clojureConfigPath!==void 0&&typeof e.clojureConfigPath!="string"||!Array.isArray(e.files)||!e.files.every(Ee)?null:e}function Ut(t,e){let n=new Map((t?.files??[]).map(a=>[a.path,a])),r=new Map(e.files.map(a=>[a.path,a])),i=new Set([...n.keys(),...r.keys()]),s=[];for(let a of[...i].sort()){let p=n.get(a),u=r.get(a),d=z(a,e.languages);!p&&u?s.push({kind:"added",path:a,inputKind:d,after:u}):p&&!u?s.push({kind:"deleted",path:a,inputKind:d,before:p}):p&&u&&(p.hash!==u.hash||p.size!==u.size)&&s.push({kind:"modified",path:a,inputKind:d,before:p,after:u})}let o=new Set;return t||o.add("prior-snapshot-unavailable"),t&&t.version!==e.version&&o.add("snapshot-version-changed"),(ie(t?.files??[])||ie(e.files))&&o.add("duplicate-input-path"),[...t?.files??[],...e.files].some(De)&&o.add("unreadable-input"),{version:1,changes:s,projectIdentityChanged:t?!Ne(t,e):!0,uncertainty:[...o].sort()}}function re(t){return Array.isArray(t)&&t.every(e=>typeof e=="string")}function ie(t){return new Set(t.map(e=>e.path)).size!==t.length}function Ee(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.path=="string"&&typeof e.size=="number"&&typeof e.hash=="string"}function De(t){return t.hash==="unreadable"||t.size<0}function Ne(t,e){return se(t.languages,e.languages)&&t.pnpmWorkspaces===e.pnpmWorkspaces&&t.typescriptProjectMode===e.typescriptProjectMode&&se(t.typescriptProjects,e.typescriptProjects)&&t.clojureConfigPath===e.clojureConfigPath}function se(t,e){if(t.length!==e.length)return!1;let n=[...t].sort(),r=[...e].sort();return n.every((i,s)=>i===r[s])}var ce=new Set(["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lockb","tsconfig.json","tsconfig.base.json","pyproject.toml","setup.py","setup.cfg","Cargo.toml","Cargo.lock","go.mod","go.sum","pom.xml","build.gradle","build.gradle.kts","build.sbt","compile_commands.json","CMakeLists.txt","Makefile","Gemfile","Gemfile.lock","composer.json","composer.lock","pubspec.yaml","pubspec.lock","deps.edn","project.clj","bb.edn","shadow-cljs.edn"]),pe={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{execFileSync as Be}from"child_process";import{createHash as le}from"crypto";import{lstatSync as Oe,readdirSync as Le,readFileSync as We,readlinkSync as _e,realpathSync as ue}from"fs";import{isAbsolute as $e,join as de,relative as ze,sep as Ue}from"path";function He(t){return[...new Set((t??[]).map(e=>e.trim()).filter(Boolean))].sort((e,n)=>e.localeCompare(n))}function qe(t){return(Je(t)??Ke(t)).filter(e=>e&&!fe(e)).sort()}function Ge(t,e={}){let n=qe(t).filter(i=>!e.language||oe(i,e.language,e.markerFiles)).filter(i=>!e.includePath||e.includePath(i)),r=ue(t);return n.map(i=>{let s=de(t,i);try{if(Oe(s).isSymbolicLink()){let a=ue(s),p=ze(r,a);if(p===".."||p.startsWith(`..${Ue}`)||$e(p))throw new Error("external symlink");let u=_e(s);return{path:i,size:Buffer.byteLength(u),hash:le("sha256").update("symlink\0").update(u).digest("hex")}}let o=We(s);return{path:i,size:o.byteLength,hash:le("sha256").update(o).digest("hex")}}catch{return{path:i,size:-1,hash:"unreadable"}}})}function Xt(t,e,n){return{version:2,languages:[...e].sort(),pnpmWorkspaces:n.typescriptProjectMode!=="workspace"&&n.pnpmWorkspaces===!0,typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:He(n.typescriptProjects),clojureConfigPath:Ve(n.clojureConfigPath),files:Ge(t)}}function Ve(t){return t?.trim()||void 0}function Je(t){try{return Be("git",["-C",t,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
|
+
`).filter(Boolean)}catch{return null}}function Ke(t){let e=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?de(t,r):t,s;try{s=Le(i,{withFileTypes:!0})}catch{continue}for(let o of s){let a=r?`${r}/${o.name}`:o.name;if(o.isDirectory()){fe(a)||n.push(a);continue}e.push(a)}}return e}function fe(t){let e=t.split("/");return t==="meta.json"||e.some(n=>Xe.has(n))||t.endsWith(".db")||t.endsWith(".db-wal")||t.endsWith(".db-shm")||t.endsWith(".scip")}var Xe=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);import{readFileSync as rt}from"fs";import{dirname as it,join as st}from"path";var Ye=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function T(t){let e=t.toLowerCase();return Ye.some(n=>e.endsWith(n))}function k(t){let e=v(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(c=>[c.path,c])),i=t.snapshot.files.filter(c=>{let f=z(c.path,["typescript"]);return f==="config"||f==="ambient"}).map(c=>c.path),s=v([...e,...i]),o=s.find(c=>!r.has(c)),a=new Set(t.snapshot.files.map(c=>c.path)).size!==t.snapshot.files.length,p=!o&&s.some(c=>me(r.get(c))),u=N(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:v(t.snapshot.typescriptProjects),membership:e})),d=new Map;return{identityFor(c,f){if(!n.has(c))return b("target-outside-project");if(a)return b("duplicate-input-path");if(o)return b("missing-input-fingerprint");if(p)return b("unreadable-input");let h=[],l,S;if(t.graph===null)h.push("dependency-graph-unavailable"),S="whole-project",l=s;else{let P=Qe(c,t.graph,d);if(P.find(D=>!r.has(D)))return b("missing-input-fingerprint");if(l=v([...P,...i]),l.some(D=>me(r.get(D))))return b("unreadable-input");S="dependency-closure"}let F=l.map(P=>et(r.get(P)));return{version:1,key:N(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:f,projectIdentity:u,inputs:F})),mode:S,inputFiles:l,reasons:h}}}}function Ze(t,e){let n=new Set,r=[t];for(let i=0;i<r.length;i+=1){let s=r[i];if(!(s===void 0||n.has(s))){n.add(s);for(let o of[...e.get(s)??[]].sort())n.has(o)||r.push(o)}}return[...n].sort()}function Qe(t,e,n){let r=n.get(t);if(r)return r;let i=Ze(t,e);return n.set(t,i),i}function et(t){return{path:t.path,size:t.size,hash:t.hash}}function me(t){return t.size<0||t.hash==="unreadable"}function b(t){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[t]}}function v(t){return[...new Set(t)].sort()}import{createRequire as tt}from"module";var ge=tt(import.meta.url),j,w;function nt(){if(j!==void 0)return j;try{j=ge("ts-morph")}catch{j=null}return j}function C(){if(w)return w;let t=nt();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=ge("ts-morph/package.json").version??"unknown"}catch{}return w=`ts-morph:${e}:typescript:${t.ts.version}`,w}function rn(t,e){return e.map(n=>({tsconfigPath:n,project:new t.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function sn(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var ot=G("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function U(t,e,n){let r=ot.get(t,()=>at(t));if(!r)return null;let i=`${n}\0${e}`,s=r.identities.get(i);if(s)return s;let o=r.builder.identityFor(e,n);return r.identities.set(i,o),o}function x(t){return V(t,{includeIgnored:!1}).filter(T).sort()}function at(t){try{let e=JSON.parse(rt(st(it(t.config.dbPath),"meta.json"),"utf8")),n=ae(e.fingerprint);return n?{builder:k({projectFiles:x(t),snapshot:n,graph:I(t),engineIdentity:C()}),identities:new Map}:null}catch{return null}}function M(t,e){let n=new Map(t.map(i=>[i.symbol,i])),r=new Map(t.map(i=>[i.symbolId,[]]));for(let i of e.values())for(let s of i){let o=n.get(s.targetSymbol);o&&r.get(o.symbolId).push(s.location)}for(let[i,s]of r)r.set(i,ct(s));return r}function Se(t,e,n){let r=he(t,e),i=he(t,n),s=[...r].filter(c=>!i.has(c)).sort(),o=[...i].filter(c=>!r.has(c)).sort(),a=ye(t,e),p=ye(t,n),u=[...a].filter(c=>!p.has(c)).sort(),d=[...p].filter(c=>!a.has(c)).sort();return{passed:s.length===0&&o.length===0,expectedCount:r.size,actualCount:i.size,missing:s,extra:o,callerFiles:{passed:u.length===0&&d.length===0,expectedCount:a.size,actualCount:p.size,missing:u,extra:d}}}function ye(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function hn(t,e,n){let r=new Set(n),i=new Map(n.map(s=>[s,[]]));for(let s of t)for(let o of e.get(s.symbolId)??[])r.has(o.file)&&i.get(o.file).push({targetSymbol:s.symbol,location:o});for(let[s,o]of i)i.set(s,pt(o));return i}function he(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function ct(t){let e=new Map;for(let n of t)e.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...e.values()].sort(be)}function pt(t){let e=new Map;for(let n of t){let{location:r}=n;e.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...e.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||be(n.location,r.location))}function be(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}var H="typescript-reference-fragment-v2",E=J({kind:"typescript-reference-fragments",invalidation:K("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:ut});function vn(t,e,n,r=t){let i=x(t),s=k({projectFiles:i,snapshot:e,graph:I(t),engineIdentity:C()}),o=[...n].map(([a,p])=>({relativePath:a,contentHash:s.identityFor(a,H).key,value:[...p]}));if(o.some(a=>a.contentHash===null))throw new Error("TypeScript reference fragment identity is unavailable for an affected document.");return E.writeBatch(r,o.map(a=>({...a,contentHash:a.contentHash}))),o.length}function kn(t,e,n,r){let i=e.filter(o=>T(o.relativePath));if(i.length===0)return A("no TypeScript definitions");let s=A("shadow did not run");return B("typescript.reference-fragments.shadow",()=>{try{let o=r(i[0].relativePath);if(!o.availability().available||!o.referenceFragmentsForFiles)return s=A("TypeScript reference fragment provider is unavailable"),s;let a=x(t),p=new Set(a),u=o.referenceFragmentsForFiles(a),d=M(i,u),c=Se(i,lt(n,p),d);if(!c.passed)return s={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...c},s;let f=[];for(let h of a){let l=U(t,h,H);l?.key&&f.push({relativePath:h,contentHash:l.key,value:u.get(h)??[]})}return E.writeBatch(t,f),s={state:"passing",files:a.length,keyedFiles:f.length,writtenFiles:f.length,...c},s}catch(o){return s=A(o instanceof Error?o.message:String(o)),s}},()=>({...s}))}function lt(t,e){return new Map([...t].map(([n,r])=>[n,r.filter(i=>e.has(i.file))]))}function wn(t,e,n){if(e.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let r="fallback",i=0,s=0,o=0,a=0;return B("typescript.reference-fragments.materialize",()=>{try{let p=x(t);i=p.length;let u=new Map,d=new Map,c=[];for(let l of p){let S=U(t,l,H);if(!S?.key)return null;u.set(l,S.key);let F=E.read(t,l,S.key);F===null?(o+=1,c.push(l)):(s+=1,d.set(l,F))}if(o===0)return r="hit",{references:M(e,d),files:i,cacheHits:s,cacheMisses:o,computedFiles:a};let f=n(e[0].relativePath);if(!f.availability().available||!f.referenceFragmentsForFiles)return null;let h=f.referenceFragmentsForFiles(c);if(c.some(l=>!h.has(l)))return null;a=h.size,E.writeBatch(t,c.map(l=>({relativePath:l,contentHash:u.get(l),value:h.get(l)??[]})));for(let[l,S]of h)d.set(l,S);return r="computed",{references:M(e,d),files:i,cacheHits:s,cacheMisses:o,computedFiles:a}}catch{return null}},()=>({state:r,files:i,cacheHits:s,cacheMisses:o,computedFiles:a}))}function A(t){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:t}}function ut(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every(dt)?null:e}catch{return null}}function dt(t){if(!t||typeof t!="object")return!1;let e=t,n=e.location;return typeof e.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}import{readFileSync as ft}from"fs";import{join as q}from"path";var En=5e3,mt="watch.lock",gt="watch-state.json",yt="watch-activity.json";function Dn(t){return{lockPath:q(t,mt),statePath:q(t,gt),activityPath:q(t,yt)}}function Nn(t){try{return ht(JSON.parse(ft(t,"utf8")))}catch{return null}}function ht(t){if(!t||typeof t!="object")return null;let e=t;return e.version!==1||typeof e.protocolVersion!="number"||typeof e.pid!="number"||!Number.isInteger(e.pid)||e.pid<=0||typeof e.projectRoot!="string"||e.worktreeId!==void 0&&(typeof e.worktreeId!="string"||e.worktreeId.length===0)||typeof e.cliVersion!="string"||!y(e.startedAt)||!y(e.heartbeatAt)||!y(e.lastActivityAt)||!St(e.watcher)||e.idleDeadlineAt!==void 0&&!y(e.idleDeadlineAt)||e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration)||e.lastError!==void 0&&!bt(e.lastError)||e.lastRefresh!==void 0&&!jt(e.lastRefresh)||e.reindexActivity!==void 0&&!xt(e.reindexActivity)||e.typescriptSemantic!==void 0&&!Ft(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!Pt(e.typescriptIndex)?null:e}function y(t){return typeof t=="string"&&Number.isFinite(Date.parse(t))}function St(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return g(e.changedFiles)&&g(e.reindexAt);case"indexing":return g(e.startedAt);case"cooldown":return g(e.until)&&typeof e.dirty=="boolean";default:return!1}}function bt(t){if(!t||typeof t!="object")return!1;let e=t;return y(e.at)&&typeof e.message=="string"}function jt(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&y(e.startedAt)&&y(e.completedAt)&&g(e.durationMs)}function xt(t){if(!t||typeof t!="object")return!1;let e=t;return!y(e.windowStartedAt)||!y(e.windowEndedAt)||!m(e.runs)||!m(e.rebuilt)||!m(e.reused)||!m(e.failed)||!m(e.suppressed)||!g(e.estimatedLogicalOutputBytes)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"?!1:Object.values(e.byTrigger).every(n=>n===void 0||m(n))}function Ft(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&g(e.requests)&&g(e.sessionsCreated)&&g(e.sessionsReused)&&g(e.sessionsRefreshed)&&g(e.sessionsReplaced)&&g(e.projectsCreated)&&(e.lastRequestAt===void 0||y(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||y(e.busyUntil))}function Pt(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&m(e.requests)&&m(e.sessionsCreated)&&m(e.sessionsReplaced)&&m(e.initializations)&&m(e.programUpdates)&&m(e.documentsEmitted)&&m(e.documentsRemoved)&&(e.lastRequestAt===void 0||y(e.lastRequestAt))&&(e.lastDurationMs===void 0||g(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||y(e.busyUntil))}function g(t){return typeof t=="number"&&Number.isFinite(t)}function m(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0}export{At as a,Pe as b,_ as c,Et as d,Te as e,Dt as f,Nt as g,Ot as h,$t as i,z as j,ae as k,Ut as l,He as m,Ge as n,Xt as o,En as p,Dn as q,Nn as r,Ye as s,T as t,nt as u,rn as v,sn as w,hn as x,k as y,U as z,vn as A,kn as B,wn as C};
|
|
4
|
+
//# sourceMappingURL=chunk-2CTX5CMX.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f,b as m}from"./chunk-QZ4JVECJ.js";import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f,b as m}from"./chunk-QZ4JVECJ.js";import{a as u}from"./chunk-X6D5IC6I.js";import{B as g,E as d}from"./chunk-YGAGTIDK.js";import{y as l}from"./chunk-L7SPDE73.js";import{readFileSync as E,readdirSync as h}from"fs";import{basename as k,join as c}from"path";function S(t,e,r={}){let a=new Set(t),n=new Set(e),o=[...n].filter(i=>!a.has(i)).sort(),s=r.allowExtra?[]:[...a].filter(i=>!n.has(i)).sort();return{missing:o,extra:s}}function b(t,e){let r=N(t,e.file,e.keys);if(!r.ok)return{name:e.name,file:e.file,status:"unavailable",missing:[],extra:[],unavailableReason:r.reason};let a=L(t.config.projectRoot,e.mustEqual),n=S(r.keys,a,{allowExtra:e.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:e.name,file:e.file,status:o,missing:n.missing,extra:n.extra}}function O(t,e){return e.map(r=>b(t,r))}function G(t,e){if(e.has(t.file))return!0;let r=t.mustEqual;switch(r.type){case"top-level-dirs":return[...e].some(a=>a===r.path||a.startsWith(`${r.path}/`));case"file-glob":return[...e].some(a=>f(r.pattern,a));case"registered-commands":return e.has("docs/COMMAND_REFERENCE.md");case"builtin-skills":return[...e].some(a=>a.startsWith("skills/"))}}function I(t){if(t.status==="unavailable")return`[coverage-contract] ${t.name}: DISCLOSED \u2014 could not evaluate (${t.unavailableReason})`;let e=[];return t.missing.length>0&&e.push(`missing ${t.missing.join(", ")}`),t.extra.length>0&&e.push(`extra ${t.extra.join(", ")}`),`[coverage-contract] ${t.name}: ${e.join("; ")}`}function N(t,e,r){return r.type==="markdown-list"?T(t,e,r.marker):R(t,e,r)}function R(t,e,r){if(!l(t,e))return{ok:!1,reason:`file not found: ${e}`};let n=g(e);if(!n)return{ok:!1,reason:`unsupported file type for ${r.type} extraction: ${e}`};let o=d(t,e);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${e}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let s=r.type==="object-literal-keys"?D(o,r.identifier):w(o,r.identifier);return s===null?{ok:!1,reason:`no ${r.type==="object-literal-keys"?"object literal":"string array"} named "${r.identifier}" found in ${e}`}:{ok:!0,keys:s}}function y(t){let e=t.childForFieldName("value");return e?e.type==="as_expression"||e.type==="satisfies_expression"?e.namedChild(0):e:null}function D(t,e){for(let r of t.rootNode.descendantsOfType("variable_declarator")){if(r.childForFieldName("name")?.text!==e)continue;let n=y(r);if(n?.type==="object")return $(n)}return null}function $(t){let e=new Set;for(let r of t.namedChildren)if(r.type==="pair"){let a=r.childForFieldName("key");a&&e.add(C(a.text))}else r.type==="shorthand_property_identifier"&&e.add(r.text);return[...e].sort()}function w(t,e){for(let r of t.rootNode.descendantsOfType("variable_declarator")){if(r.childForFieldName("name")?.text!==e)continue;let n=y(r);if(n?.type!=="array")continue;let o=new Set;for(let s of n.namedChildren)s.type==="string"&&o.add(C(s.text));return[...o].sort()}return null}function C(t){return t.length>=2&&(t[0]==="'"&&t.endsWith("'")||t[0]==='"'&&t.endsWith('"'))?t.slice(1,-1):t}function T(t,e,r){let a=l(t,e);if(!a)return{ok:!1,reason:`file not found: ${e}`};let n=v(a,r);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${r} --> ... <!-- END GENERATED ${r} --> block in ${e}`}:{ok:!0,keys:x(n)}}function v(t,e){let r=u(e),n=new RegExp(`<!--\\s*BEGIN GENERATED ${r}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${r}\\s*-->`).exec(t);return n?n[1]:null}function x(t){let e=new Set;for(let r of t.matchAll(/`([a-z][a-z0-9-]*)`/g))e.add(r[1]);for(let r of t.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))e.add(r[1]);return[...e].sort()}function L(t,e){switch(e.type){case"top-level-dirs":return p(c(t,e.path));case"file-glob":return[...new Set(m(t,e.pattern).map(r=>k(r)))].sort();case"registered-commands":return A(t);case"builtin-skills":return p(c(t,"skills"))}}function p(t){let e;try{e=h(t,{withFileTypes:!0})}catch{return[]}return e.filter(r=>r.isDirectory()&&!r.name.startsWith(".")).map(r=>r.name).sort()}function A(t){let e;try{e=E(c(t,"docs/COMMAND_REFERENCE.md"),"utf-8")}catch{return[]}let r=v(e,"COMMAND REFERENCE");return r?x(r):[]}var z={dead:{minLoc:3,skipBarrels:!0,deadCodeOnly:!0},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};export{b as a,O as b,G as c,I as d,z as e};
|
|
2
|
+
//# sourceMappingURL=chunk-2YU7I3QO.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as d}from"./chunk-NH5ALKPW.js";import{a as h}from"./chunk-FECYOO5O.js";import{d as f}from"./chunk-XYADIZHU.js";import{b as u}from"./chunk-X6D5IC6I.js";import{E as l}from"./chunk-YGAGTIDK.js";import{readFileSync as E}from"fs";import{join as B}from"path";function j(t,e,s={}){let n=h(t,e);if(!n)return null;let a=new d(t),o=N(t,n),r=n.endLine-n.startLine+1,m=a.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(x=>x.symbol));return{symbol:n.symbol,shortName:f(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:o.branches,estimateBasis:o.estimateBasis,cyclomaticEstimate:o.branches+1,calleeCount:c.size,fanIn:P(t,n.symbolId),fanOut:w(m,n.relativePath)}}function N(t,e){let s=l(t,e.relativePath);if(s){let n=g(s.rootNode,e.startLine,e.endLine);if(n)return{branches:v(n),estimateBasis:"ast"}}return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function H(t,e){let s=new Map,n=new Map;for(let a of e){let o=n.get(a.relativePath)??[];o.push(a),n.set(a.relativePath,o)}for(let[a,o]of n){let r=l(t,a),i=r===null?[]:o.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});C(r.rootNode,i,s)}for(let c of o)m.has(c.symbolId)||s.set(c.symbolId,L(t,c))}return s}function L(t,e){return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function y(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function p(t,e,s,n){try{return E(B(t.config.projectRoot,e),"utf-8").split(`
|
|
2
2
|
`).slice(s,n+1).join(`
|
|
3
3
|
`)}catch{return""}}function P(t,e){return t.get(`SELECT COUNT(DISTINCT c.document_id) AS c
|
|
4
4
|
FROM mentions m
|
|
@@ -13,4 +13,4 @@ import{a as d}from"./chunk-OAM22BCR.js";import{a as h}from"./chunk-HFBNIIZX.js";
|
|
|
13
13
|
WHERE m.symbol_id = ?
|
|
14
14
|
AND m.role != 1
|
|
15
15
|
AND sym_def.document_id != c.document_id`,e)?.c??0}function w(t,e){return new Set(t.filter(s=>s.file!==e).map(s=>s.symbol)).size}function v(t){let e=0;return b(t,s=>{e+=S(s)}),e}function C(t,e,s){let n=[...e].sort((a,o)=>a.startLine-o.startLine||o.endLine-a.endLine);b(t,a=>{let o=S(a);if(o===0)return;let r=a.startPosition.row,i=a.endPosition.row;for(let m of n){if(m.startLine>r)break;if(m.endLine<i)continue;let c=s.get(m.symbolId);c&&(c.branches+=o)}})}function b(t,e){e(t);for(let s of t.namedChildren)b(s,e)}function g(t,e,s){if(t.startPosition.row>e||t.endPosition.row<s)return null;for(let n of t.namedChildren){let a=g(n,e,s);if(a)return a}return t}var D=new Set(["if_statement","conditional_expression","ternary_expression","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_case","case_statement","catch_clause","except_clause","elif_clause","match_arm"]);function S(t){return D.has(t.type)?1:t.type==="binary_expression"&&t.parent?.type!=="binary_expression"&&(t.text.includes("&&")||t.text.includes("||"))?I(t.text):0}function I(t){return(t.match(/&&|\|\|/g)??[]).length}function _(t,e){let s=u(t),n=0,a=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let o of a){let r=s.match(o);r&&(n+=r.length)}if(e==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}return n}export{j as a,N as b,H as c,v as d};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-3MJ5YA4Y.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as R}from"./chunk-NH5ALKPW.js";import{a as _,d as f}from"./chunk-Q3AFUTGB.js";import{d as l}from"./chunk-XYADIZHU.js";import{o as u,p,q as a}from"./chunk-X6D5IC6I.js";import{y as m}from"./chunk-L7SPDE73.js";import{a as d}from"./chunk-64MNV6AB.js";function $(e,o={}){let{scope:n,limit:r}=o,i=new R(e),t=D([...x(e,n),...O(e,i,n)]);return y(t),r?t.slice(0,r):t}function x(e,o){let n=[];for(let r of S(e,o)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||f(e,r.barrel_path)||m(e,r.barrel_path)&&a(e,r.barrel_path).length===0)continue;let i=N(e,r),t=i?.barrel_consumers??0,s=i?.direct_consumers??0;t!==0||s!==0||n.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:l(r.symbol),originalFile:r.original_path,barrelConsumers:t,directConsumers:s,...b(e,r.barrel_path)})}return n}function S(e,o){let n=o?"AND barrel_d.relative_path LIKE ?":"",r=o?[`%${o}%`]:[];return e.all(`SELECT DISTINCT
|
|
2
2
|
barrel_d.id AS barrel_doc_id,
|
|
3
3
|
barrel_d.relative_path AS barrel_path,
|
|
4
4
|
gs.id AS symbol_id,
|
|
@@ -58,4 +58,4 @@ import{a as R}from"./chunk-OAM22BCR.js";import{a as _,d as f}from"./chunk-CAKPEQ
|
|
|
58
58
|
${e.pathExclusionsFor("consumer_d")}
|
|
59
59
|
GROUP BY consumer_d.id
|
|
60
60
|
)`,o.barrel_doc_id,o.symbol_id,o.barrel_doc_id,o.original_doc_id)}function O(e,o,n){let r=[];for(let i of C(e,n))h(e,i,i)>0||r.push(...I(e,o,i));return r}function C(e,o){return d(e,{scope:o,includeIgnored:!1}).filter(n=>a(e,n).length>0||u(e,n).length>0)}function I(e,o,n){let r=a(e,n).filter(t=>t.sourcePath&&!e.isIgnored(t.sourcePath)).flatMap(t=>g(e,o,n,t.sourcePath,[A(t.specifier)])),i=u(e,n).filter(t=>t.sourcePath&&!e.isIgnored(t.sourcePath)).flatMap(t=>g(e,o,n,t.sourcePath,t.kind==="named"&&t.names.length>0?t.names:[t.kind==="star"?`* from ${t.sourcePath}`:`* namespace from ${t.sourcePath}`]));return[...r,...i]}function g(e,o,n,r,i){let t=o.definitionsForFile(r);return i.map(s=>{let c=t.find(E=>E.leaf===s);return{barrelFile:n,symbol:c?.symbol??`source-reexport:${n}:${s}`,shortName:c?l(c.symbol):s,originalFile:r,barrelConsumers:0,directConsumers:h(e,r,n),...b(e,n)}})}function A(e){return e.split("::").at(-1)?.split("/").at(-1)?.replace(/\.[^.]+$/,"")??e}function b(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 h(e,o,n){let r=new Set;for(let i of d(e,{includeIgnored:!1}))if(i!==n)for(let t of p(e,i))t.sourcePath===o&&r.add(i);return r.size}function D(e){let o=new Set,n=[];for(let r of e){let i=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;o.has(i)||(o.add(i),n.push(r))}return n}function y(e){e.sort((o,n)=>n.directConsumers-o.directConsumers||o.barrelFile.localeCompare(n.barrelFile)||o.shortName.localeCompare(n.shortName))}export{$ as a};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-3SVWW4PN.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as p}from"./chunk-
|
|
1
|
+
import{c as p}from"./chunk-GBQ5NYPR.js";import{b as D}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-BGBBVSH4.js";import{d as g,t as B}from"./chunk-XYADIZHU.js";import{b as f}from"./chunk-X6D5IC6I.js";import{C as d,z as y}from"./chunk-L7SPDE73.js";import{createHash as A}from"crypto";var h=3;function H(e,t={}){let{scope:o,maxLoc:n=15,minLoc:i=h,limit:r,scanLimit:s}=t,l=p(e),u=L(e,{scope:o,maxLoc:n,scanLimit:s}).map(a=>x(e,a,l,i)).filter(a=>a!==null),c=v(u);return r?c.slice(0,r):c}function M(e,t,o={}){let{scope:n,maxLoc:i=15,minLoc:r=h,scanLimit:s}=o,l=p(e),u=L(e,{scope:n,maxLoc:i,scanLimit:s}).map(a=>x(e,a,l,r)).filter(a=>a!==null),c=u.find(a=>a.symbol===t);return c?u.filter(a=>a.symbol!==c.symbol&&a.normalizedBody===c.normalizedBody&&a.file!==c.file).sort(z).map(({normalizedBody:a,...C})=>C):[]}function I(e){let t=S(e);return f(t).replace(/\s+/g,"")}function v(e){let t=new Map;for(let n of e){if(n.normalizedBody.length<8)continue;let i=F(n.normalizedBody),r=t.get(i)??[];r.push(n),t.set(i,r)}let o=[];for(let[n,i]of t){let r=new Set(i.map(l=>l.file));if(i.length<2||r.size<2)continue;let s=[...i].sort(z).map(({normalizedBody:l,...u})=>u);o.push({hash:n,canonical:s[0],functions:s})}return o.sort((n,i)=>{let r=i.functions.length-n.functions.length;if(r!==0)return r;let s=b(i)-b(n);return s!==0?s:n.canonical.file.localeCompare(i.canonical.file)}),o}function L(e,t){let o=B(e,{scope:t.scope}).filter(n=>n.isFunctionLike&&!e.isIgnored(n.relativePath)).filter(n=>!d(e,n.relativePath,n.startLine,"similar")).filter(n=>m(n)<=t.maxLoc);return o.sort((n,i)=>m(i)-m(n)||n.relativePath.localeCompare(i.relativePath)),D(o,t.scanLimit)}function x(e,t,o,n){let i=E(e,t);if(!i||W(i)<n)return null;let r=P(e,t);return r?{symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:o?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function P(e,t){let o=E(e,t);return o&&I(o)||null}function E(e,t){let o=y(e,t.relativePath);return o.length===0?null:o.slice(t.startLine,t.endLine+1).join(`
|
|
2
2
|
`)}function S(e){let t=e.indexOf("{"),o=e.lastIndexOf("}");if(t>=0&&o>t)return e.slice(t+1,o);let n=e.indexOf("=>");return n>=0?e.slice(n+2).replace(/;+\s*$/,""):e}function W(e){return S(e).split(/\r?\n/).map(o=>o.trim()).filter(o=>o.length>0).length}function F(e){return A("sha256").update(e).digest("hex").slice(0,16)}function z(e,t){let o=e.ageCommits??-1;return(t.ageCommits??-1)-o||e.file.localeCompare(t.file)||e.startLine-t.startLine}function b(e){return e.functions.reduce((t,o)=>t+o.loc,0)}export{H as a,M as b,I as c,v as d,P as e,E as f,S as g};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-4333ETTV.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as f,n as b}from"./chunk-
|
|
1
|
+
import{m as f,n as b}from"./chunk-LBMJEAEW.js";import{a as d}from"./chunk-FECYOO5O.js";import{d as s,h as u,p as m,q as g}from"./chunk-XYADIZHU.js";import{y as c}from"./chunk-L7SPDE73.js";function x(e,r,i={}){let n=d(e,r);if(!n)return{definitions:[],referencedBy:[]};let t=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),a=g(t?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:p(a,t?.display_name??null,n.symbol),source:y(e,n.relativePath,n.startLine,n.endLine)}],S=f(e,n,{semantic:i.semantic,semanticEvidence:b}).map(l=>({relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?s(l.enclosingSymbol):"(top-level)"}));return{definitions:o,referencedBy:S}}function y(e,r,i,n){let t=c(e,r);if(!t)return null;let o=t.split(`
|
|
2
2
|
`).slice(i,n+1).join(`
|
|
3
3
|
`).trimEnd();return o.length>0?o:null}function p(e,r,i){let n=m(e);if(n&&!h(n))return n;let t=(r??"").trim();return t?u(i)&&!t.endsWith("()")?`${t}()`:t:s(i)}function h(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{x as a};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-4RSI5EMG.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{E as s}from"./chunk-YGAGTIDK.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4SALD7RU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c}from"./chunk-B75HZHUP.js";import{a,
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c}from"./chunk-B75HZHUP.js";import{a,b as n}from"./chunk-UOAV44HR.js";import{n as t}from"./chunk-LBMJEAEW.js";import{a as m}from"./chunk-FECYOO5O.js";import{d as o,h as r}from"./chunk-XYADIZHU.js";function N(s,y,b={}){let l=m(s,y);if(!l)return null;let i=b.semantic!==!1,f=n(s,l,{semantic:i,semanticEvidence:t}).filter(e=>r(e.symbol)).slice(0,50),p=c(a(s,l,{limit:50,additive:!0,callableOnly:!0,semantic:i,semanticEvidence:t}));return{symbol:l.symbol,shortName:o(l.symbol),callers:f.map(e=>({symbol:e.symbol,shortName:o(e.symbol),file:e.file})),callees:p.map(e=>({symbol:e.symbol,shortName:o(e.symbol),file:e.file}))}}export{N as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4T3LTWUS.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-FECYOO5O.js";import{b as g,d as m}from"./chunk-XYADIZHU.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-4XTA5OMB.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as M,b as I}from"./chunk-QZ4JVECJ.js";import{a as v}from"./chunk-35NLDRZC.js";import{b as P}from"./chunk-Q3AFUTGB.js";import{a as D}from"./chunk-7B3UPBVA.js";import{s as j}from"./chunk-XYADIZHU.js";import{p as x}from"./chunk-X6D5IC6I.js";import{a as U}from"./chunk-64MNV6AB.js";var O=/\.(test|spec)\.(ts|tsx|js|jsx|mts|cts)$/,V=new Map;function q(e,o,t,r){if(!o?.testPaths?.length)return[];let c=T(o),s=[];for(let i of k(e,o.testPaths)){let a=L(e,i,r),l=a?t(a):null;if(l)for(let g of x(e,i)){let b=g.sourcePath;if(!b)continue;let d=t(b);d&&d!==l&&(c.get(l)?.has(d)||s.push({testFile:i,ownerBoundary:l,importedFile:b,importedBoundary:d,reason:"outside-owner-policy"}))}}return z(s)}function T(e){let o=e.allowedDependencies??{},t=e.boundaries.map(i=>i.name),r=new Map,c=(i,a)=>{for(let l of o[i]??[])a.has(l)||(a.add(l),c(l,a))};for(let i of t){let a=new Set;c(i,a),r.set(i,a)}let s=new Map;for(let i of t){let a=new Set(r.get(i));for(let l of t)l!==i&&r.get(l)?.has(i)&&a.add(l);s.set(i,a)}return s}function k(e,o){let t=`${e.config.projectRoot}\0${o.join("\0")}`,r=V.get(t);if(r)return r;let c=new Set;for(let i of o)for(let a of I(e.config.projectRoot,i))O.test(a)&&c.add(a);let s=[...c].sort();return V.set(t,s),s}function L(e,o,t){let r=o.replace(/^tests\//,"src/").replace(/\.(test|spec)\.(\w+)$/,".$2");if(r!==o&&t(r))return r;let c=o.split("/").pop().replace(/\.(test|spec)\.(\w+)$/,".$2"),s=x(e,o).map(i=>i.sourcePath).filter(i=>!!i&&t(i)&&i.split("/").pop()===c);return s.length===1?s[0]:null}function z(e){let o=new Map;for(let t of e){let r=`${t.testFile}\0${t.importedBoundary}`;o.has(r)||o.set(r,t)}return[...o.values()].sort((t,r)=>t.testFile.localeCompare(r.testFile)||t.importedBoundary.localeCompare(r.importedBoundary))}var C="architecture:";function H(e,o,t,r={}){let c=K(e,o);if(!t||t.boundaries.length===0)return{configured:!1,boundaries:[],edges:[],forbiddenEdges:[],reciprocalPairs:[],cycles:[],coarseBoundaries:[],staleAllowances:[],boundaryLimits:[],fragileEdges:[],testBoundaryViolations:[],coverage:{totalFiles:c.length,mappedFiles:0,unmappedFiles:[],ambiguousFiles:[]},policyCoverage:{declaredRows:0,totalBoundaries:0,missingRows:[],requiresCompletePolicy:!1,requiresMinimalPolicy:!1}};let s=new Map,i=new Map(t.boundaries.map(n=>[n.name,new Set])),a=[],l=[];for(let n of c){let m=t.boundaries.filter(p=>p.paths.some(F=>M(F,n))).map(p=>p.name).sort();if(m.length===0)a.push(n);else if(m.length>1)l.push({file:n,boundaries:m});else{let p=m[0];s.set(n,p),i.get(p).add(n)}}let g=new Map;for(let[n,m]of e){let p=s.get(n);if(p)for(let F of m){let R=s.get(F);if(!R||p===R)continue;let $=B(p,R),w=g.get($);w||(w={from:p,to:R,fileEdges:[],importers:new Set,importedFiles:new Set},g.set($,w)),w.fileEdges.push({fromFile:n,toFile:F}),w.importers.add(n),w.importedFiles.add(F)}}let b=[...g.values()].map(n=>N(n,t)).sort(te),d=b,E=new Map(d.map(n=>[B(n.from,n.to),n])),S=new Map(t.boundaries.map(n=>[n.name,new Set]));for(let n of d)S.get(n.from).add(n.to);let f=[];for(let n of d){if(n.from>=n.to)continue;let m=E.get(B(n.to,n.from));m&&f.push({boundaries:[n.from,n.to],forward:n,reverse:m})}let{components:A}=v(S),y=A.filter(n=>n.length>1).map(n=>J(n,d,t.requireAcyclic===!0)).sort((n,m)=>m.boundaries.length-n.boundaries.length||n.boundaries.join("/").localeCompare(m.boundaries.join("/"))),h=t.allowedDependencies??{},u=t.boundaries.map(n=>n.name).filter(n=>!Object.hasOwn(h,n)).sort();return{configured:!0,boundaries:t.boundaries.map(n=>({name:n.name,paths:[...n.paths],fileCount:i.get(n.name).size,dependencyPolicyDeclared:Object.hasOwn(h,n.name)})).sort((n,m)=>n.name.localeCompare(m.name)),edges:b,forbiddenEdges:d.filter(n=>n.policyStatus==="forbidden"),reciprocalPairs:f,cycles:y,staleAllowances:W(t,d),boundaryLimits:Y(t,d,i),fragileEdges:d.filter(n=>n.fragile),testBoundaryViolations:r.testBoundaryViolations??[],coarseBoundaries:Q(e,i,r.isModuleHierarchyFile,t.requireResolvedBoundaries===!0,n=>t.boundaries.find(m=>m.name===n)?.subUnits??"directory"),coverage:{totalFiles:c.length,mappedFiles:s.size,unmappedFiles:a,ambiguousFiles:l},policyCoverage:{declaredRows:t.boundaries.length-u.length,totalBoundaries:t.boundaries.length,missingRows:u,requiresCompletePolicy:t.requireCompletePolicy===!0,requiresMinimalPolicy:t.requireMinimalPolicy===!0}}}function fe(e,o={}){let t=D(e,o.scope,{scipEdges:"imports-only",sourceEdges:"imports-and-reexports"}),r=U(e,{includeIgnored:!1}).filter(s=>!o.scope||s.includes(o.scope)),c=new Set(r);return H(t,r,e.config.architecture,{isModuleHierarchyFile:s=>_(e,s),testBoundaryViolations:q(e,e.config.architecture,s=>G(e.config.architecture,s),s=>c.has(s))})}function G(e,o){let t=(e?.boundaries??[]).filter(r=>r.paths.some(c=>M(c,o)));return t.length===1?t[0].name:null}function _(e,o){let t=P(o);return t==="test"||t==="entry"?!0:t!=="barrel"?!1:j(e,o).length===0}function me(e){let o=e.forbiddenEdges.map(r=>`${C}forbidden-edge:${encodeURIComponent(r.from)}:${encodeURIComponent(r.to)}`);if(e.policyCoverage.requiresCompletePolicy)for(let r of e.policyCoverage.missingRows)o.push(`${C}missing-policy-row:${encodeURIComponent(r)}`);if(e.policyCoverage.requiresMinimalPolicy)for(let r of e.staleAllowances)o.push(`${C}stale-allowance:${encodeURIComponent(r.from)}:${encodeURIComponent(r.to)}`);for(let r of e.testBoundaryViolations)o.push(`${C}test-boundary:${encodeURIComponent(r.testFile)}:${encodeURIComponent(r.importedBoundary)}`);for(let r of e.boundaryLimits)o.push(`${C}boundary-limit:${r.kind}:${encodeURIComponent(r.boundary)}`);let t=new Map;for(let r of e.coarseBoundaries)r.violatesPolicy&&t.set(r.boundary,(t.get(r.boundary)??0)+1);for(let[r,c]of t){let s=`${C}coarse-boundary:${encodeURIComponent(r)}`;o.push(s);for(let i=2;i<=c;i+=1)o.push(`${s}:component:${i}`)}for(let r of e.cycles)r.violatesPolicy&&o.push(`${C}cycle:${r.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`);return[...new Set(o)].sort()}function pe(e){return!!e&&(Object.keys(e.allowedDependencies??{}).length>0||e.requireCompletePolicy===!0||e.requireAcyclic===!0||e.requireResolvedBoundaries===!0||e.requireMinimalPolicy===!0||e.maxBoundaryFanOut!==void 0||e.maxBoundaryFiles!==void 0||e.boundaries.some(o=>o.maxFiles!==void 0)||(e.testPaths?.length??0)>0)}function K(e,o){let t=new Set(o);for(let[r,c]of e){t.add(r);for(let s of c)t.add(s)}return[...t].sort()}function N(e,o){let t=[...e.fileEdges].sort((r,c)=>r.fromFile.localeCompare(c.fromFile)||r.toFile.localeCompare(c.toFile));return{from:e.from,to:e.to,policyStatus:X(o,e.from,e.to),fileEdgeCount:t.length,importerCount:e.importers.size,importedFileCount:e.importedFiles.size,examples:t.slice(0,5),fragile:t.length===1}}function X(e,o,t){return!e.allowedDependencies||!Object.hasOwn(e.allowedDependencies,o)?"undeclared":e.allowedDependencies[o].includes(t)?"allowed":"forbidden"}function J(e,o,t){let r=[...e].sort(),c=new Set(r),s=o.filter(a=>c.has(a.from)&&c.has(a.to)),i=Math.min(...s.map(a=>a.fileEdgeCount));return{boundaries:r,internalEdges:s,narrowestEdges:s.filter(a=>a.fileEdgeCount===i),violatesPolicy:t}}function Q(e,o,t=Z,r=!1,c=()=>"directory"){let s=[];for(let[i,a]of o){let l=c(i)==="file"?f=>f:ee,g=[...a].filter(f=>!t(f));if(g.length<2)continue;let b=new Set(g),d=new Map,E=new Map;for(let f of g)E.set(l(f),new Set);for(let f of g)for(let A of e.get(f)??[]){if(!b.has(A))continue;let y=l(f),h=l(A);if(y===h)continue;let u=B(y,h),n=d.get(u);n||(n={from:y,to:h,fileEdges:[]},d.set(u,n)),n.fileEdges.push({fromFile:f,toFile:A}),E.get(y).add(h)}let{components:S}=v(E);for(let f of S){if(f.length<2)continue;let A=new Set(f),y=[...d.values()].filter(u=>A.has(u.from)&&A.has(u.to)).map(u=>({from:u.from,to:u.to,fileEdgeCount:u.fileEdges.length,examples:u.fileEdges.slice(0,5)})).sort((u,n)=>u.from.localeCompare(n.from)||u.to.localeCompare(n.to)),h=Math.min(...y.map(u=>u.fileEdgeCount));s.push({boundary:i,violatesPolicy:r,subUnits:[...f].sort(),internalEdges:y,narrowestEdges:y.filter(u=>u.fileEdgeCount===h)})}}return s.sort((i,a)=>a.subUnits.length-i.subUnits.length||i.boundary.localeCompare(a.boundary))}function W(e,o){let t=new Set(o.map(i=>B(i.from,i.to))),r=e.allowedDependencies??{},c=new Set(e.boundaries.map(i=>i.name)),s=[];for(let[i,a]of Object.entries(r))if(c.has(i))for(let l of a)!c.has(l)||t.has(B(i,l))||s.push({from:i,to:l});return s.sort((i,a)=>i.from.localeCompare(a.from)||i.to.localeCompare(a.to))}function Y(e,o,t){let r=[],c=new Map;for(let s of o)c.set(s.from,(c.get(s.from)??0)+1);for(let s of e.boundaries){if(e.maxBoundaryFanOut!==void 0){let a=c.get(s.name)??0;a>e.maxBoundaryFanOut&&r.push({boundary:s.name,kind:"fan-out",observed:a,limit:e.maxBoundaryFanOut})}let i=s.maxFiles??e.maxBoundaryFiles;if(i!==void 0){let a=t.get(s.name)?.size??0;a>i&&r.push({boundary:s.name,kind:"files",observed:a,limit:i})}}return r.sort((s,i)=>s.boundary.localeCompare(i.boundary)||s.kind.localeCompare(i.kind))}function Z(e){let o=P(e);return o==="test"||o==="entry"}function ee(e){let o=e.lastIndexOf("/");return o===-1?".":e.slice(0,o)}function B(e,o){return`${e}\0${o}`}function te(e,o){return e.from.localeCompare(o.from)||e.to.localeCompare(o.to)}export{C as a,H as b,fe as c,me as d,pe as e,Q as f};
|
|
2
|
+
//# sourceMappingURL=chunk-52ZYCAEO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-FECYOO5O.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-54HA4ZXH.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as x,m as k}from"./chunk-
|
|
1
|
+
import{h as x,m as k}from"./chunk-C7NIYIQ4.js";import he from"better-sqlite3";import{existsSync as bn}from"fs";import{dirname as yn,join as xn,resolve as ye}from"path";import G from"better-sqlite3";import{execFileSync as K}from"child_process";import{existsSync as X,readdirSync as J,readFileSync as B}from"fs";import{extname as m,join as I}from"path";import{readdirSync as we}from"fs";import{execFileSync as Ae}from"child_process";import{extname as De,join as _e}from"path";var H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],v=[".vue"],V=[".tsx",".jsx"],E=[".vue"],je=[...V,...E],$e=new Set(V),Ue=new Set(E),W=new Set(H.map(e=>e.toLowerCase())),He=[...W].sort().join(","),C=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var We=x("source-files",{clearGroups:[]});function ze(e={}){return{id:"auxiliary-documents",facts:["auxiliary-document"],run:n=>q({projectRoot:n.projectRoot,dbPath:n.dbPath,extensions:e.extensions,onStatus:n.onStatus})}}function q(e){let n=new Set((e.extensions??v).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!X(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=k(e.projectRoot),t=Y(e.projectRoot,n).filter(i=>!r.isIgnored(i)),o=new G(e.dbPath);try{let i=Q(o,t),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
2
2
|
VALUES (?, ?, NULL, ?)`),u=o.transaction(l=>{let d=0;for(let f of l){if(i.has(f))continue;let p=B(I(e.projectRoot,f),"utf-8"),U=s.run(Z(f),f,p);d+=Number(U.changes)}return d})(t),c={scanned:t.length,inserted:u,existing:t.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function Y(e,n){let r=z(e,n);if(r)return r;let t=[],o=i=>{let s=i?I(e,i):e,a;try{a=J(s,{withFileTypes:!0})}catch{return}for(let u of a){if(C.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(m(u.name).toLowerCase())&&t.push(c)}};return o(""),t.sort()}function z(e,n){try{return K("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
3
|
`).filter(t=>t&&n.has(m(t).toLowerCase())).sort()}catch{return null}}function Q(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function Z(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{readFileSync as en,writeFileSync as nn}from"fs";function tn(e,n){let r=Date.now(),t=e.run(n);return{stageId:e.id,facts:e.facts,durationMs:Date.now()-r,result:t}}function ee(){return{"missing-source-file":0,"missing-service-script":0,"no-definition":0,"same-file-definition":0,"unindexed-definition":0}}function S(){return{skippedReferences:0,skippedReferenceReasons:ee(),skippedReferenceSamples:[]}}function T(e,n){e.skippedReferences+=n.skippedReferences;for(let r of Object.keys(e.skippedReferenceReasons)){e.skippedReferenceReasons[r]+=n.skippedReferenceReasons[r];for(let t of n.skippedReferenceSamples.filter(o=>o.reason===r))e.skippedReferenceSamples.filter(i=>i.reason===r&&i.sourceFile===t.sourceFile).length<2&&e.skippedReferenceSamples.push(t)}}import{createRequire as ne}from"module";import{existsSync as te,readFileSync as b}from"fs";import{dirname as L,extname as re,join as F,relative as oe,resolve as cn}from"path";import{pathToFileURL as ie}from"url";function O(e,n){let{vueCore:r,ts:t,volarTs:o}=se(e),{parsed:i,vueOptions:s}=ae(r,t,n),a=L(n),u=r.createVueLanguagePlugin(t,i.options,s,p=>p),c=ue(r,t,u),l=ce(a,i),{languageServiceHost:d}=o.createLanguageServiceHost(t,t.sys,c,p=>p,l),f=t.createLanguageService(d);return{ts:t,language:c,languageService:f,fileNames:i.fileNames,configDir:a}}function se(e){let n=ne(ie(F(e,"package.json")).href);return{vueCore:R(n,"@vue/language-core",e),ts:R(n,"typescript",e),volarTs:R(n,"@volar/typescript",e)}}function ae(e,n,r){let t=n.readConfigFile(r,n.sys.readFile);if(t.error||!t.config)throw new Error(`Failed to read ${r}`);let i=e.createParsedCommandLine(n,n.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(t.config,n.sys,L(r),void 0,r,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function ue(e,n,r){let t={},o=e.createLanguage([r],new Map,i=>{if(!te(i))return;let s=b(i,"utf-8");t.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),r.getLanguageId(i)??fe(i))});return t.current=o,o}function ce(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function R(e,n,r){try{return e(n)}catch(t){throw(typeof t=="object"&&t!==null&&"code"in t?t.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:t}):t}}function w(e,n,r){let t=le(e);return o=>{if(!o.name)return null;let i=g(n,o.fileName),s=r.get(o.fileName);if(!s)return null;let a=r.positionAt(s,o.textSpan.start),u=t.get(i);if(!u)return null;let c=u.starts.find(d=>d.line===a.line&&d.displayName===o.name);if(c)return c.symbolId;let l=u.containingByLine.get(a.line);return l&&l.displayName===o.name?l.symbolId:de(u.starts,a.line,2,o.name)}}function le(e){let n=e.prepare(`
|
|
4
4
|
SELECT
|
|
@@ -13,4 +13,4 @@ import{h as x,m as k}from"./chunk-MP43RX4O.js";import he from"better-sqlite3";im
|
|
|
13
13
|
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
14
14
|
`).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId,displayName:t.displayName});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,{symbolId:t.symbolId,displayName:t.displayName})}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function de(e,n,r,t){let o=0,i=e.length-1;for(;o<=i;){let a=Math.floor((o+i)/2);e[a].line<n?o=a+1:i=a-1}let s=null;for(let a of[i,o]){let u=e[a];if(!u||u.displayName!==t)continue;let c=Math.abs(u.line-n);c>r||(!s||c<s.distance)&&(s={distance:c,symbolId:u.symbolId})}return s?.symbolId??null}function N(e,n){let r=me(n),t=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=Se(t,r,n,i);return o.set(i,s),s}}}function A(e,n,r,t,o){if(e.fileName.endsWith(".vue")){let i=t.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let a=t.language.maps.get(s,i);if(h(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(o)?r.get(e.fileName):null}return n(e)}function*P(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),t;for(;t=n.exec(e);){let o=t[0];r.has(o)||(yield{text:o,start:t.index,end:t.index+o.length})}}function D(e,n){for(let[r]of e.toGeneratedLocation(n,t=>!!t.navigation))return r;return null}function h(e,n){let r=e;for(let[t]of r.toSourceLocation(n,o=>!!o.navigation))return t;return null}function ge(e,n){let r=0,t=e.lineStarts.length-1;for(;r<=t;){let i=Math.floor((r+t)/2);e.lineStarts[i]<=n?r=i+1:t=i-1}let o=Math.max(0,t);return{line:o,character:n-e.lineStarts[o]}}function _(e,n){return g(e,n).startsWith("node_modules/")}function g(e,n){return oe(e,n).replaceAll("\\","/")}function fe(e){switch(re(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function M(){let e=new Map;return{get(n){if(e.has(n))return e.get(n)??null;try{let r=b(n,"utf-8"),t={text:r,lineStarts:pe(r)};return e.set(n,t),t}catch{return e.set(n,null),null}},positionAt:ge}}function pe(e){let n=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&n.push(r+1);return n}function me(e){try{let n=JSON.parse(b(F(e,"package.json"),"utf-8"));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function Se(e,n,r,t){let o=g(r,t),i=Re(n.name,n.version,o);return e.get(i)?.id??null}function Re(e,n,r){let t=r.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${t}/default.`}function Vn(e){let n=ye(e.projectRoot,e.tsconfig),r=new he(e.dbPath,{readonly:!0});try{let t=xe({db:r,projectRoot:e.projectRoot,configPath:n,vueSymbolLookup:N(r,e.projectRoot)});return ke({vueFiles:e.vueFiles??[],tasks:e.tasks,...t})}finally{r.close()}}function xe(e){let n=M();return{projectRoot:e.projectRoot,context:O(e.projectRoot,e.configPath),symbolLookup:w(e.db,e.projectRoot,n),vueSymbolLookup:e.vueSymbolLookup,sourceReader:n}}function ke(e){let n=[],r=S(),t=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of t){let i=ve(e,o);n.push(...i.occurrences),T(r,i)}return{occurrences:n,...r}}function ve(e,n){let r=e.sourceReader.get(n.fileName);if(!r)return j(e.projectRoot,n,"missing-source-file");let t=e.context.language.scripts.get(n.fileName),o=t?.generated?.languagePlugin.typescript?.getServiceScript(t.generated.root)?.code;if(!t||!o)return j(e.projectRoot,n,"missing-service-script");let i=e.context.language.maps.get(o,t),s=g(e.projectRoot,n.fileName),a=[...P(r.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Te(a),processedStarts:new Set};return Ve({...e,fileName:n.fileName,sourceInfo:r,sourceFile:s,map:i,tokenContext:u})}function Ve(e){let n=[],r=S();for(let t of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(t.start)||Ee(e.sourceInfo.text,t.start))continue;let o=D(e.map,t.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(l=>!_(e.projectRoot,l.fileName));if(!s){y(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"no-definition");continue}let a=g(e.projectRoot,s.fileName),u=Ce(e.sourceFile,t.text,a);if(u){y(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,u);continue}let c=A(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(c===null){y(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"unindexed-definition");continue}$(n,e.sourceReader,e.sourceInfo,e.sourceFile,t,a,c),e.tokenContext.processedStarts.add(t.start),Ie(n,e,t,o,a,c)}return{occurrences:n,...r}}function Ee(e,n){let r=e.lastIndexOf(`
|
|
15
15
|
`,n-1)+1,t=e.slice(r,n);return/\bfrom\s+['"][^'"]*$/.test(t)||/\bimport\s*\(\s*['"][^'"]*$/.test(t)}function Ce(e,n,r){return r===e?"same-file-definition":r.endsWith(".vue")&&n!==r.split("/").at(-1)?.replace(/\.vue$/,"")?"unindexed-definition":null}function j(e,n,r){let t=S();return n.countFileSkip&&(t.skippedReferences=1,t.skippedReferenceReasons[r]=1,t.skippedReferenceSamples.push({sourceFile:g(e,n.fileName),sourceLine:0,sourceStartChar:0,sourceEndChar:0,token:"",reason:r})),{occurrences:[],...t}}function y(e,n,r,t,o,i){if(e.skippedReferences++,e.skippedReferenceReasons[i]++,e.skippedReferenceSamples.filter(a=>a.reason===i&&a.sourceFile===t).length>=2)return;let s=n.positionAt(r,o.start);e.skippedReferenceSamples.push({sourceFile:t,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+o.text.length,token:o.text,reason:i})}function Ie(e,n,r,t,o,i){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let s of Le(n.context.languageService,n.fileName,t+1,n.map,r,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(s))continue;let a=n.tokenContext.tokenByStart.get(s);a&&($(e,n.sourceReader,n.sourceInfo,n.sourceFile,a,o,i),n.tokenContext.processedStarts.add(s))}}function $(e,n,r,t,o,i,s){let a=n.positionAt(r,o.start);e.push({sourceFile:t,sourceLine:a.line,sourceStartChar:a.character,sourceEndChar:a.character+o.text.length,sourceToken:o.text,definitionFile:i,symbolId:s})}function Te(e){let n=new Map;for(let r of e)n.set(r.text,(n.get(r.text)??0)+1);return n}function Le(e,n,r,t,o,i){let s=e.getDocumentHighlights?.(n,r,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let l=Fe(t,c.textSpan.start,i,o.text);l!==null&&a.push(l)}return a}function Fe(e,n,r,t){let o=r.get(n);if(o?.text===t)return o.start;let i=h(e,n);if(i===null)return null;let s=r.get(i);return s?.text===t?s.start:null}export{ze as a,tn as b,Vn as c};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-64RFXJT5.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-54HA4ZXH.js";function _(e,n,d){let i=r(e,n)??n,o=r(e,d)??d,t=e.get(`SELECT COUNT(DISTINCT gs.id) AS shared
|
|
2
2
|
FROM global_symbols gs
|
|
3
3
|
WHERE (
|
|
4
4
|
-- Defined in file1, referenced in file2
|
|
@@ -53,4 +53,4 @@ import{a as r}from"./chunk-SJ6XSCG7.js";function _(e,n,d){let i=r(e,n)??n,o=r(e,
|
|
|
53
53
|
GROUP BY def_d.id, ref_d.id
|
|
54
54
|
ORDER BY shared DESC
|
|
55
55
|
LIMIT ?`,...t,d).filter(s=>!e.isIgnored(s.file1)&&!e.isIgnored(s.file2)).map(s=>c(s.file1,s.file2,s.shared))}function c(e,n,d){return{file1:e,file2:n,sharedSymbols:d,actionTier:"signal",couplingKind:"shared-symbol-coupling",evidenceReasons:[`${d} symbol(s) are defined in one file and referenced by the other`],recommendation:"Review whether the shared symbol surface is an intentional boundary or hidden coordination pressure before moving code."}}export{_ as a,a as b};
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-6E7UTQY7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as f}from"./chunk-B3X6KU75.js";import{N as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as f}from"./chunk-B3X6KU75.js";import{N as d}from"./chunk-YGAGTIDK.js";function S(n,e={}){let{minComponentLines:o=300,minFileLines:i=800,minJsxTokens:u=80,minBehaviorTokens:s=40,limit:a=20,scope:m,scanLimit:c,filePattern:p}=e;return d(n).reactProfiles({scope:m,scanLimit:c}).filter(t=>t.kind==="component").filter(t=>!p||t.file.includes(p)||t.name.includes(p)).map(t=>C(t,{minComponentLines:o,minFileLines:i,minJsxTokens:u,minBehaviorTokens:s})).filter(t=>t!==null).sort((t,r)=>r.componentLines-t.componentLines||r.fileLines-t.fileLines||t.file.localeCompare(r.file)).slice(0,a)}function C(n,e){let o=Math.max(80,Math.floor(e.minComponentLines/2)),i=f(n,x({minComponentLines:e.minComponentLines,minFileLines:e.minFileLines,minJsxTokens:e.minJsxTokens,minBehaviorTokens:e.minBehaviorTokens,substantialComponentLines:o}),"component"),{reasons:u}=i;if(u.length===0)return null;let s=i.dominantPressure,a=i.pressureKinds,m=b(n),c=R(s,a,m);return{file:n.file,component:n.name,componentLines:n.loc,fileLines:n.fileLines,jsxTokens:n.jsxTokens.size,behaviorTokens:n.behaviorTokens.size,dominantPressure:s,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:v(c,m),reasons:u,loc:n.loc}}function x(n){return[{axis:"component",value:e=>e.loc,qualifies:(e,o)=>o>=n.minComponentLines,reason:(e,o)=>`${o} component line(s)`},{axis:"file",value:e=>e.fileLines,qualifies:(e,o)=>o>=n.minFileLines&&e.loc>=n.substantialComponentLines,reason:(e,o)=>`${o} file line(s)`},{axis:"jsx-structure",value:e=>e.jsxTokens.size,weightedValue:(e,o)=>o*3,qualifies:(e,o)=>o>=n.minJsxTokens,reason:(e,o)=>`${o} JSX structure token(s)`},{axis:"hook-behavior",value:e=>e.behaviorTokens.size,weightedValue:(e,o)=>o*4,qualifies:(e,o)=>o>=n.minBehaviorTokens,reason:(e,o)=>`${o} behavior token(s)`}]}function b(n){let e=n.file.split(/[\\/]+/).filter(Boolean),o=e.slice(0,-1).map(r=>r.toLowerCase()),i=(e.at(-1)??n.name).replace(/\.[^.]+$/,""),s=o.findIndex(r=>k.has(r))>=0,a=o.some(r=>h.has(r));if(L(i)||L(n.name))return"component";let c=T.has(i.toLowerCase()),p=/(?:Page|Route|Screen)$/.test(n.name),l=s&&/View$/.test(n.name),t=!a&&i.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()===n.name.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()&&/(?:Page|Route|Screen|View)$/.test(i);return c||p||l||t?"route-page":"component"}function L(n){let e=n.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return e.at(-1)&&g.has(e.at(-1))?!0:[...g].some(o=>n.endsWith(P(o)))}function R(n,e,o){return n==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":e.includes("hook-behavior")?"behavior-extraction":e.includes("jsx-structure")?"jsx-decomposition":e.includes("file")?"file-decomposition":n==="jsx-structure"?"jsx-decomposition":n==="file"&&!e.includes("component")?"file-decomposition":"component-decomposition"}function v(n,e){switch(n){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return e==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),g=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),k=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),T=new Set(["page","route","screen"]);function P(n){return n.charAt(0).toUpperCase()+n.slice(1)}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6NSFJYRC.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as O,p as A}from"./chunk-
|
|
1
|
+
import{o as O,p as A}from"./chunk-X6D5IC6I.js";import{c as F,g as S,i as _,s as y,w as C,x as N}from"./chunk-L7SPDE73.js";import{a as P}from"./chunk-64MNV6AB.js";var G=C({kind:"file-dependency-graph",invalidation:N("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:k}),I=F("file-dep-graph",{clearGroups:["whole-project"]});function W(e,n,t={}){let s=t.scipEdges??"all-references",i=t.sourceEdges??"imports-only",o=v(n,s,i);return I.get(e,o,()=>{let d=new Set(P(e,{includeIgnored:!1})),c=_(e),p=0,l=0,m=null,E=!1,a=0,h=0;return y("file-dep-graph.product",()=>{if(c){let r=G.read(e,o,c);if(r){E=!0;let f=R(r);return p=r.sourceFileCount,l=r.sourceEdgeCount,a=r.scipEdgeCount,h=f.size,m=r.sourceDependencyFingerprint,f}}let g=y("file-dep-graph.source-imports",()=>{let r=M(e,d,n,i);return p=r.files.length,l=r.edges.length,m=r.fingerprint,r},()=>({scope:n??null,sourceEdges:i,files:p,edges:l})),u=new Map,D=(r,f)=>j(e,u,d,r,f);y("file-dep-graph.scip-edges",()=>{for(let r of $(e,n,s))a+=1,D(r.from_file,r.to_file)},()=>({scope:n??null,edges:a}));for(let r of g.edges)D(r.fromFile,r.toFile);return h=u.size,c&&G.write(e,o,c,{sourceDependencyFingerprint:g.fingerprint,sourceFileCount:g.files.length,sourceEdgeCount:g.edges.length,scipEdgeCount:a,graph:w(u)}),u},()=>({scope:n??null,available:c!==null,hit:E,files:p,sourceEdges:l,sourceEdgeMode:i,scipEdges:a,graphFiles:h,sourceDependencyFingerprint:m}))})}function M(e,n,t,s){let i=[],o=[];for(let d of n)if(!(t&&!d.includes(t))){i.push(d);for(let c of A(e,d))c.sourcePath&&o.push({fromFile:d,toFile:c.sourcePath});if(s==="imports-and-reexports")for(let c of O(e,d))c.sourcePath&&o.push({fromFile:d,toFile:c.sourcePath})}return{files:i,edges:o,fingerprint:b(i,o)}}function b(e,n){let t=n.map(s=>`${s.fromFile}\0${s.toFile}`).sort();return S(JSON.stringify({files:e,edges:t}))}function v(e,n,t){return`edge-mode-v3:${n}:${t}:${e??"<all>"}`}function w(e){return[...e].map(([n,t])=>[n,[...t]])}function R(e){return new Map(e.graph.map(([n,t])=>[n,new Set(t)]))}function k(e){let n=JSON.parse(e);return x(n)?n:null}function x(e){if(!e||typeof e!="object")return!1;let n=e;return typeof n.sourceDependencyFingerprint=="string"&&typeof n.sourceFileCount=="number"&&typeof n.sourceEdgeCount=="number"&&typeof n.scipEdgeCount=="number"&&Array.isArray(n.graph)&&n.graph.every(J)}function J(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(n=>typeof n=="string")}function $(e,n,t){let s=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[],o=t==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
|
|
2
2
|
d1.relative_path AS from_file,
|
|
3
3
|
d2.relative_path AS to_file
|
|
4
4
|
FROM mentions m
|
|
@@ -17,4 +17,4 @@ import{o as O,p as A}from"./chunk-GAE7WCBK.js";import{c as F,g as S,i as _,s as
|
|
|
17
17
|
${o}
|
|
18
18
|
${e.pathExclusionsFor("d1","d2")}
|
|
19
19
|
${s}`,...i)}function j(e,n,t,s,i){if(s===i||e.isIgnored(s)||e.isIgnored(i)||!t.has(i))return;let o=n.get(s);o||(o=new Set,n.set(s,o)),o.add(i)}export{W as a};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-7B3UPBVA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as i}from"./chunk-CNKAGUPL.js";function l(n,o,s,t={}){let e=i(n,o,s,t);return e?{symbolA:e.symbolA,symbolB:e.symbolB,similarity:e.similarity,sharedCallees:e.sharedEvidence,uniqueToA:e.uniqueToA,uniqueToB:e.uniqueToB,consolidationStrategy:e.consolidationStrategy}:null}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7GXM52MI.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as k}from"./chunk-
|
|
1
|
+
import{b as k}from"./chunk-K2ERX4UT.js";import{c as D}from"./chunk-NH5ALKPW.js";import{f as v,g as L}from"./chunk-Q3AFUTGB.js";import{l as S}from"./chunk-LBMJEAEW.js";import{d as h,s as y}from"./chunk-XYADIZHU.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
|
|
2
2
|
FROM global_symbols gs
|
|
3
3
|
JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
4
4
|
JOIN documents d ON d.id = der.document_id
|
|
5
5
|
WHERE gs.symbol = ?
|
|
6
6
|
LIMIT 1`,n);return s?y(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=y(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-A2EZV2UM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as M}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as M}from"./chunk-4333ETTV.js";import{b as $}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{p as I}from"./chunk-U7DSEKOM.js";import{d as D}from"./chunk-MTDBHTSF.js";import{d as b,j as h,p as x,q as y,t as L}from"./chunk-XYADIZHU.js";import{a as g,e as S}from"./chunk-X6D5IC6I.js";import{y as d}from"./chunk-L7SPDE73.js";var B=new Set(D());function X(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=w(e,F(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=P(t);return r?m.slice(0,r):m}function F(e,n){let s=L(e,{scope:n.scope}).filter(i=>v(i)&&!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)),$(s,n.scanLimit)}function v(e){return!e.isFunctionLike||h(e.symbol)?!1:e.kind===null||B.has(e.kind)}function w(e,n,s){let i=[];for(let a of n){let o=G(e,a,s);o&&i.push({signature:o,definition:a,fn:z(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=C(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?M(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 z(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function P(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 C(e){return e<=5?"<=5":e<=20?"6-20":">20"}function G(e,n,s){if(s.semantic){let c=I(e,n);if(c)return c}let i=k(n.documentation),r=i?A(i):null;return r||E(N(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function k(e){return x(y(e))}function N(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=O(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,q(u)))return u}if(u&&u.includes("("))return u}return null}function q(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 A(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 E(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=R(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 R(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 O(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{X as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ABMYA4TN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-54HA4ZXH.js";import{a as h}from"./chunk-FECYOO5O.js";import{d as g}from"./chunk-XYADIZHU.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let i=h(t,e);return i?R(t,i,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),i;try{i=f(r,"utf-8")}catch{return null}let n=i.split(`
|
|
2
2
|
`),c=Math.max(0,e.startLine-a),l=Math.min(n.length-1,e.endLine+a),u=n.slice(c,l+1).join(`
|
|
3
3
|
`);return{symbol:e.symbol,shortName:g(e.symbol),relativePath:e.relativePath,startLine:c,endLine:l,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let i=m(t,e);if(!i)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",i);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),l;try{l=f(c,"utf-8")}catch{return null}let u=l.split(`
|
|
4
4
|
`),o=Math.max(0,a-1-r),p=Math.min(u.length-1,s-1+r),b=u.slice(o,p+1).join(`
|
|
5
5
|
`);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:p,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-B5NLK2B3.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-54HA4ZXH.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-SJ6XSCG7.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-BTEE5NZQ.js.map
|
|
@@ -64,4 +64,4 @@ Thumbs.db
|
|
|
64
64
|
${n}
|
|
65
65
|
${o}
|
|
66
66
|
ORDER BY relative_path`,...i).map(a=>a.relative_path),s=t.extensions?r.filter(a=>t.extensions.some(c=>a.toLowerCase().endsWith(c.toLowerCase()))):r;return t.includeIgnored===!1?s.filter(a=>!e.isIgnored(a)):s}export{V as a,ce as b,le as c,R as d,B as e,ye as f,d as g,ke as h,ve as i,De as j,ae as k,we as l,Ce as m};
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
67
|
+
//# sourceMappingURL=chunk-C7NIYIQ4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as C,b as B}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as C,b as B}from"./chunk-U6WNH5GC.js";import{a as R,c as P,e as a,f}from"./chunk-B3X6KU75.js";import{a as v,b as h,c as k}from"./chunk-KMVGRIO2.js";import{N as g}from"./chunk-YGAGTIDK.js";function D(e,o={}){let{minSimilarity:r=.62,minTokens:n=8,limit:l=20,scope:m,scanLimit:d,filePattern:p,focusFiles:u}=o,c=g(e).reactProfiles({scope:m,minJsxTokens:n,scanLimit:d}).filter(t=>t.kind==="component").map(t=>({file:t.file,component:t.name,tokens:t.jsxTokens,profile:t})),s=C(c,t=>t.tokens);return B({profiles:c,limit:l,filePattern:p,focusFiles:u,candidateIndex:s,profile:{name:"react-component-duplicates"},compare:(t,i)=>y(t,i,r),sort:(t,i)=>i.similarity-t.similarity||t.fileA.localeCompare(i.fileA)||t.componentA.localeCompare(i.componentA)||t.fileB.localeCompare(i.fileB)||t.componentB.localeCompare(i.componentB)})}function y(e,o,r){let n=v(e.tokens,o.tokens);if(n.size<6||!T(n))return null;let l=k(e.tokens,o.tokens);if(l<r)return null;let m=a(n,"component:"),d=a(n,"native:"),p=a(n,"prop:"),u=a(n,"event:"),c=a(n,"binding:"),s=b({sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c});return{fileA:e.file,componentA:e.component,fileB:o.file,componentB:o.component,similarity:l,tokenCountA:e.tokens.size,tokenCountB:o.tokens.size,sharedTokens:f(n),sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c,evidenceClass:s.evidenceClass,actionTier:s.actionTier,evidenceClassReasons:s.reasons,recommendation:s.recommendation,uniqueToA:f(h(e.tokens,o.tokens)).slice(0,25),uniqueToB:f(h(o.tokens,e.tokens)).slice(0,25),locA:e.profile.loc,locB:o.profile.loc}}function T(e){let o=0,r=0;for(let n of e)n.startsWith("component:")&&(o+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("native:")||n.startsWith("jsx:"))&&(r+=1);return P([{name:"component",count:o},{name:"shape",count:r}],[{min:{component:1},reason:"shared custom component"},{min:{shape:4},reason:"shared JSX structure"}]).pass}function b(e){return R({genericWords:w,primitiveGroups:[{values:e.sharedNativeTags,reasonPrefix:"shared native tags",bucket:"generic"},{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"}],recommendation:A})}function A(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific UI 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 w=new Set(["actions","app","button","card","children","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{D as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CFMXJPHH.js.map
|