scip-query 0.10.0 → 0.10.2
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 +115 -58
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-3KLLFNT4.js +2 -0
- package/dist/{chunk-UIWAZ2NT.js → chunk-3UVJJ6Z7.js} +1 -1
- package/dist/chunk-3UW7VM4H.js +62 -0
- package/dist/chunk-3ZYF3ELZ.js +2 -0
- package/dist/{chunk-MN75T4UB.js → chunk-47UA45TU.js} +2 -2
- package/dist/{chunk-NC4IUW25.js → chunk-4ZUJJRWT.js} +2 -2
- package/dist/chunk-5B53WB6E.js +4 -0
- package/dist/{chunk-2WEH5QHC.js → chunk-5FOPAXWY.js} +2 -2
- package/dist/{chunk-VZRILF2Z.js → chunk-5M4TYWVI.js} +2 -2
- package/dist/{chunk-QJWN6LA5.js → chunk-5QJXH6ZL.js} +5 -5
- package/dist/{chunk-NN3O7TPH.js → chunk-64MNV6AB.js} +1 -1
- package/dist/chunk-77YBOOYT.js +2 -0
- package/dist/chunk-7KCSELEV.js +2 -0
- package/dist/{chunk-ZZ2W5P3D.js → chunk-7OHWPJ5N.js} +2 -2
- package/dist/chunk-7S5E7KWT.js +2 -0
- package/dist/chunk-A3VNUGKJ.js +2 -0
- package/dist/{chunk-ISCKLDSS.js → chunk-A4L36SZS.js} +3 -3
- package/dist/{chunk-IVAIPXNO.js → chunk-AUVBR62P.js} +2 -2
- package/dist/chunk-AW4N6MGC.js +18 -0
- package/dist/{chunk-PG3ZI5IH.js → chunk-B6MJ5VQV.js} +2 -2
- package/dist/chunk-B75HZHUP.js +2 -0
- package/dist/chunk-BGBBVSH4.js +2 -0
- package/dist/chunk-BKDXBJDQ.js +2 -0
- package/dist/{chunk-AQYBOORI.js → chunk-C2QSK7E7.js} +1 -1
- package/dist/chunk-C3MZZ2ZN.js +2 -0
- package/dist/{chunk-AP5GTKSG.js → chunk-CAWSSEVM.js} +2 -2
- package/dist/chunk-CFL2CNIF.js +10 -0
- package/dist/{chunk-4HTJZC6G.js → chunk-CJJP64OC.js} +2 -2
- package/dist/chunk-CNTEQMHA.js +2 -0
- package/dist/{chunk-WEJYUS5O.js → chunk-CRU42NJU.js} +2 -2
- package/dist/chunk-CSWZFD46.js +2 -0
- package/dist/{chunk-ZOT3WUZW.js → chunk-CTCAF3YA.js} +2 -2
- package/dist/chunk-D322LMSA.js +5 -0
- package/dist/{chunk-772YYL6I.js → chunk-DAI74TJU.js} +2 -2
- package/dist/chunk-DE7MA6OD.js +3 -0
- package/dist/chunk-DJMK4DBL.js +2 -0
- package/dist/chunk-DRAZH77R.js +7 -0
- package/dist/{chunk-L2KFPRMA.js → chunk-E44ZMVNA.js} +2 -2
- package/dist/{chunk-BNW3Q24R.js → chunk-E7KERP7E.js} +2 -2
- package/dist/{chunk-QKO474FG.js → chunk-EOZIZWW4.js} +2 -2
- package/dist/chunk-ERHOS6AW.js +2 -0
- package/dist/{chunk-ADRYSISR.js → chunk-ESG4HBEF.js} +2 -2
- package/dist/chunk-EWC3UK4V.js +3 -0
- package/dist/chunk-FGCL6NDB.js +8 -0
- package/dist/chunk-FIB4JPEX.js +2 -0
- package/dist/chunk-FNRPGGVI.js +2 -0
- package/dist/chunk-FOQHUKNZ.js +4 -0
- package/dist/chunk-FPMVCDIJ.js +2 -0
- package/dist/chunk-FUPDW5AC.js +3 -0
- package/dist/chunk-G3WGZU5Q.js +2 -0
- package/dist/chunk-GS33KGAY.js +2 -0
- package/dist/chunk-GZCQTZLK.js +2 -0
- package/dist/{chunk-VGBSY6N7.js → chunk-HVTYSC26.js} +2 -2
- package/dist/{chunk-2BMFRBV6.js → chunk-ICXVNWMI.js} +2 -2
- package/dist/chunk-JM72FNGA.js +2 -0
- package/dist/chunk-KPHKX4LP.js +71 -0
- package/dist/{chunk-6DEX3XP6.js → chunk-LPLGJ4HO.js} +2 -2
- package/dist/chunk-MHK7Z53U.js +2 -0
- package/dist/chunk-MHTDOFV7.js +5 -0
- package/dist/chunk-MUULWXSJ.js +2 -0
- package/dist/chunk-MZ7APUFN.js +3 -0
- package/dist/chunk-NNDYO2DX.js +2 -0
- package/dist/chunk-NP5HYVLX.js +20 -0
- package/dist/{chunk-Y5H7TBVE.js → chunk-NVFERV4U.js} +2 -2
- package/dist/{chunk-LWYIGRHR.js → chunk-NXIAHE7F.js} +1 -1
- package/dist/chunk-O3OKSF6O.js +2 -0
- package/dist/chunk-O4L4AB3T.js +2 -0
- package/dist/chunk-OBBDKQAG.js +3 -0
- package/dist/chunk-OLD6PBU6.js +7 -0
- package/dist/{chunk-V76FCF5F.js → chunk-PFOCOG57.js} +2 -2
- package/dist/chunk-PVZMPG5I.js +2 -0
- package/dist/chunk-QLNGUWR7.js +2 -0
- package/dist/chunk-QSXQT3NE.js +2 -0
- package/dist/{chunk-OLCKSG3Y.js → chunk-QVCCLDZI.js} +2 -2
- package/dist/chunk-RHTJBYZ5.js +2 -0
- package/dist/chunk-SPE4YCOT.js +7 -0
- package/dist/{chunk-FVIKFWUL.js → chunk-TM6GVHA6.js} +2 -2
- package/dist/chunk-TO54DY4O.js +2 -0
- package/dist/chunk-UMNENNTX.js +2 -0
- package/dist/chunk-UNJG7P2I.js +2 -0
- package/dist/{chunk-TKDJQ2WD.js → chunk-UUBMFL3F.js} +1 -1
- package/dist/chunk-VAA5FFIW.js +2 -0
- package/dist/chunk-WDUTG2ZR.js +4 -0
- package/dist/chunk-X7ZY6FFF.js +4 -0
- package/dist/{chunk-BGRPMGTD.js → chunk-YQH353VA.js} +2 -2
- package/dist/chunk-YTR4CO5S.js +38 -0
- package/dist/chunk-YUOAAR24.js +2 -0
- package/dist/{chunk-YWZBKYLS.js → chunk-YYD245WG.js} +2 -2
- package/dist/{chunk-SCEMECW7.js → chunk-Z4VHYJ5U.js} +2 -2
- package/dist/chunk-ZFMPHDAT.js +4 -0
- package/dist/chunk-ZQLO2SCU.js +6 -0
- package/dist/chunk-ZSLT7NWQ.js +61 -0
- package/dist/cli.js +276 -271
- package/dist/{config-types-CGIeLEpY.d.ts → config-types-Bj4sh28g.d.ts} +37 -1
- package/dist/{db-DdTPetj5.d.ts → db-CTarohbZ.d.ts} +1 -1
- package/dist/git-history-Dao3_Pu9.d.ts +12 -0
- package/dist/{health-C6r2VgpA.d.ts → health-Bx0x1HAG.d.ts} +64 -4
- package/dist/index.d.ts +7 -6
- package/dist/index.js +1 -1
- package/dist/postinstall.js +2 -2
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +6 -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 +40 -5
- 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 +6 -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 +10 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +6 -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 +66 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +20 -4
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +20 -3
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +10 -3
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +11 -3
- 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/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +16 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +20 -12
- 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 +51 -0
- package/dist/queries/locality-candidates.js +2 -0
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +8 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +4 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +31 -0
- package/dist/queries/react-component-duplicates.js +2 -0
- package/dist/queries/react-hook-candidates.d.ts +40 -0
- package/dist/queries/react-hook-candidates.js +2 -0
- package/dist/queries/react-large-component-pressure.d.ts +34 -0
- package/dist/queries/react-large-component-pressure.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +32 -3
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +7 -3
- 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 +21 -3
- 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 +10 -3
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-imports.d.ts +4 -0
- package/dist/queries/unused-imports.js +2 -0
- 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 +35 -0
- package/dist/queries/vue-component-duplicates.js +2 -0
- package/dist/queries/vue-composable-candidates.d.ts +40 -0
- package/dist/queries/vue-composable-candidates.js +2 -0
- package/dist/queries/vue-large-view-pressure.d.ts +37 -0
- package/dist/queries/vue-large-view-pressure.js +2 -0
- package/dist/queries/wrapper-candidates.d.ts +6 -3
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +10 -10
- package/dist/reindex.d.ts +1 -1
- package/dist/reindex.js +22 -22
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -2
- package/docs/AGENT_GUIDE.md +353 -0
- package/docs/AI_FAILURE_MODES.md +278 -0
- package/docs/API.md +40 -0
- package/docs/COMMAND_REFERENCE.md +131 -0
- package/docs/DETECTOR_GUIDE.md +119 -0
- package/docs/accuracy-hardening-goal.md +54 -0
- package/docs/analyzer-inventory.md +162 -0
- package/docs/analyzer-validation-ledger.md +262 -0
- package/docs/analyzer-validation-protocol.md +192 -0
- package/docs/assets/scip-query-logo-dark.svg +21 -0
- package/docs/assets/scip-query-logo.svg +24 -0
- package/docs/locality-analyzer-design.md +193 -0
- package/package.json +44 -5
- package/skills/scip-directory-architecture/SKILL.md +178 -0
- package/skills/scip-maintainability/SKILL.md +24 -3
- package/skills/scip-query/SKILL.md +4 -2
- package/skills/scip-query-setup/SKILL.md +118 -0
- package/skills/scip-react-maintainability/SKILL.md +114 -0
- package/skills/scip-vue-maintainability/SKILL.md +130 -0
- package/dist/chunk-4DAPXOWD.js +0 -2
- package/dist/chunk-4JQFTUKD.js +0 -2
- package/dist/chunk-4MHT7LKP.js +0 -3
- package/dist/chunk-5OHZEO3U.js +0 -3
- package/dist/chunk-5QJIEYFB.js +0 -34
- package/dist/chunk-6IGXZZQ4.js +0 -4
- package/dist/chunk-6K2JQ2VI.js +0 -61
- package/dist/chunk-6QVCPUK6.js +0 -2
- package/dist/chunk-6VL4AIEO.js +0 -8
- package/dist/chunk-A2VTV2QB.js +0 -7
- package/dist/chunk-AI2ECT7L.js +0 -2
- package/dist/chunk-BUAC4Q4G.js +0 -2
- package/dist/chunk-BZ6LCGE6.js +0 -2
- package/dist/chunk-CMXFASVD.js +0 -2
- package/dist/chunk-CO3AL7NZ.js +0 -2
- package/dist/chunk-FVVT7GV6.js +0 -4
- package/dist/chunk-HXXRN77A.js +0 -2
- package/dist/chunk-IC3RC3KJ.js +0 -4
- package/dist/chunk-ITHQJZTG.js +0 -2
- package/dist/chunk-IW7ASGVF.js +0 -2
- package/dist/chunk-JODYQDE4.js +0 -2
- package/dist/chunk-MCW36F2D.js +0 -2
- package/dist/chunk-MX6F756F.js +0 -2
- package/dist/chunk-NGI4V4AB.js +0 -18
- package/dist/chunk-O6KCZPJQ.js +0 -62
- package/dist/chunk-OAI5GEIN.js +0 -6
- package/dist/chunk-OH5HIAID.js +0 -4
- package/dist/chunk-OXKEUWMJ.js +0 -2
- package/dist/chunk-PBGTMPJ7.js +0 -2
- package/dist/chunk-PRVDXGSK.js +0 -2
- package/dist/chunk-QYKKTYBN.js +0 -6
- package/dist/chunk-R3G6ERW7.js +0 -7
- package/dist/chunk-R6XDPWJA.js +0 -10
- package/dist/chunk-SJR4SB7B.js +0 -2
- package/dist/chunk-SYKCO25G.js +0 -16
- package/dist/chunk-T22X7WT6.js +0 -2
- package/dist/chunk-TH4JVC34.js +0 -71
- package/dist/chunk-VDY4HYNK.js +0 -2
- package/dist/chunk-VDZIEDJB.js +0 -2
- package/dist/chunk-VDZL45XI.js +0 -2
- package/dist/chunk-WJIS6BNI.js +0 -3
- package/dist/chunk-WN5Z3UVT.js +0 -7
- package/dist/chunk-XCW7DYHM.js +0 -2
- package/dist/chunk-ZF6P2NAT.js +0 -63
- package/dist/chunk-ZGIK464P.js +0 -2
package/dist/queries/similar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"../chunk-MHTDOFV7.js";import"../chunk-3UVJJ6Z7.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{f as classifySimilarityEvidence,d as getAllCalleeFingerprints,c as insertTopSimilarResult,e as meaningfulCallees,a as similar,b as similarAll};
|
|
2
2
|
//# sourceMappingURL=similar.js.map
|
package/dist/queries/slice.d.ts
CHANGED
package/dist/queries/slice.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-FIB4JPEX.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as slice};
|
|
2
2
|
//# sourceMappingURL=slice.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
|
+
type StaleAbstractionActionTier = 'direct' | 'signal';
|
|
6
|
+
type StalenessKind = 'unused-abstraction' | 'misplaced-single-consumer-type' | 'single-consumer-abstraction' | 'one-to-one-class-encapsulation';
|
|
5
7
|
interface StaleAbstraction {
|
|
6
8
|
symbol: string;
|
|
7
9
|
shortName: string;
|
|
@@ -34,6 +36,11 @@ interface StaleAbstraction {
|
|
|
34
36
|
confidence: 'high' | 'medium' | 'low';
|
|
35
37
|
/** Short human-readable explanation of why this was flagged. */
|
|
36
38
|
reason: string;
|
|
39
|
+
/** Direct cleanup for unused abstractions; contextual signal for one-consumer ownership questions. */
|
|
40
|
+
actionTier: StaleAbstractionActionTier;
|
|
41
|
+
/** Reviewer-facing stale shape. */
|
|
42
|
+
stalenessKind: StalenessKind;
|
|
43
|
+
recommendation: string;
|
|
37
44
|
}
|
|
38
45
|
/**
|
|
39
46
|
* Find stale abstractions: type-level symbols (classes, interfaces, type
|
|
@@ -62,4 +69,4 @@ declare function staleAbstractions(db: ScipDatabase, opts?: {
|
|
|
62
69
|
semantic?: boolean;
|
|
63
70
|
}): StaleAbstraction[];
|
|
64
71
|
|
|
65
|
-
export { type StaleAbstraction, staleAbstractions };
|
|
72
|
+
export { type StaleAbstraction, type StaleAbstractionActionTier, type StalenessKind, staleAbstractions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-ZFMPHDAT.js";import"../chunk-RHTJBYZ5.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as staleAbstractions};
|
|
2
2
|
//# sourceMappingURL=stale-abstractions.js.map
|
package/dist/queries/stats.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
5
|
interface StatsResult {
|
|
6
6
|
documents: number;
|
package/dist/queries/stats.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-C2QSK7E7.js";export{a as stats};
|
|
2
2
|
//# sourceMappingURL=stats.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
5
|
interface SurfaceResult {
|
|
6
6
|
consumer: string;
|
package/dist/queries/surface.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-YQH353VA.js";import"../chunk-CTCAF3YA.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as surface};
|
|
2
2
|
//# sourceMappingURL=surface.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
5
|
interface SymbolResult {
|
|
6
6
|
startLine: number;
|
package/dist/queries/symbols.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-A3VNUGKJ.js";import"../chunk-CTCAF3YA.js";import"../chunk-MZ7APUFN.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as symbols};
|
|
2
2
|
//# sourceMappingURL=symbols.js.map
|
package/dist/queries/system.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import { SymbolResult } from './symbols.js';
|
|
3
3
|
import 'better-sqlite3';
|
|
4
|
-
import '../config-types-
|
|
4
|
+
import '../config-types-Bj4sh28g.js';
|
|
5
5
|
|
|
6
6
|
interface SystemResult {
|
|
7
7
|
files: string[];
|
package/dist/queries/system.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-ICXVNWMI.js";import"../chunk-CTCAF3YA.js";import"../chunk-MZ7APUFN.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as system};
|
|
2
2
|
//# sourceMappingURL=system.js.map
|
package/dist/queries/trace.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
5
|
interface TraceResult {
|
|
6
6
|
definitions: Array<{
|
package/dist/queries/trace.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-X7ZY6FFF.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as trace};
|
|
2
2
|
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c}from"../chunk-7OHWPJ5N.js";import"../chunk-CTCAF3YA.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as importedBy,a as imports,c as unusedImports};
|
|
2
|
+
//# sourceMappingURL=unused-imports.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
5
|
interface UnusedParamsFinding {
|
|
6
6
|
symbol: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-NNDYO2DX.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as unusedParams};
|
|
2
2
|
//# sourceMappingURL=unused-params.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
|
+
import 'better-sqlite3';
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
|
+
|
|
5
|
+
interface VueComponentDuplicateResult {
|
|
6
|
+
fileA: string;
|
|
7
|
+
fileB: string;
|
|
8
|
+
similarity: number;
|
|
9
|
+
sharedTokens: string[];
|
|
10
|
+
sharedComponents: string[];
|
|
11
|
+
sharedProps: string[];
|
|
12
|
+
sharedEvents: string[];
|
|
13
|
+
sharedDirectives: string[];
|
|
14
|
+
sharedSlots: string[];
|
|
15
|
+
sharedIdentifiers: string[];
|
|
16
|
+
uniqueToA: string[];
|
|
17
|
+
uniqueToB: string[];
|
|
18
|
+
locA: number;
|
|
19
|
+
locB: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Find Vue SFCs with similar template structure. This catches copy-paste UI
|
|
23
|
+
* variants that function/callee similarity cannot see because the duplicated
|
|
24
|
+
* work lives in component tags, bindings, slots, and directives.
|
|
25
|
+
*/
|
|
26
|
+
declare function vueComponentDuplicates(db: ScipDatabase, opts?: {
|
|
27
|
+
minSimilarity?: number;
|
|
28
|
+
minTokens?: number;
|
|
29
|
+
limit?: number;
|
|
30
|
+
scope?: string;
|
|
31
|
+
scanLimit?: number;
|
|
32
|
+
filePattern?: string;
|
|
33
|
+
}): VueComponentDuplicateResult[];
|
|
34
|
+
|
|
35
|
+
export { type VueComponentDuplicateResult, vueComponentDuplicates };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"../chunk-GS33KGAY.js";import"../chunk-PVZMPG5I.js";import"../chunk-3UVJJ6Z7.js";import"../chunk-ERHOS6AW.js";import"../chunk-D322LMSA.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComponentDuplicates};
|
|
2
|
+
//# sourceMappingURL=vue-component-duplicates.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
|
+
import 'better-sqlite3';
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
|
+
|
|
5
|
+
type VueComposableEvidenceClass = 'domain-behavior' | 'generic-workflow-scaffolding' | 'mixed' | 'shared-abstraction';
|
|
6
|
+
type VueComposableActionTier = 'signal' | 'support';
|
|
7
|
+
interface VueComposableCandidateResult {
|
|
8
|
+
fileA: string;
|
|
9
|
+
fileB: string;
|
|
10
|
+
similarity: number;
|
|
11
|
+
sharedTokens: string[];
|
|
12
|
+
sharedComposables: string[];
|
|
13
|
+
sharedStores: string[];
|
|
14
|
+
sharedReactivity: string[];
|
|
15
|
+
sharedLifecycle: string[];
|
|
16
|
+
sharedRequests: string[];
|
|
17
|
+
sharedFunctions: string[];
|
|
18
|
+
sharedFunctionVerbs: string[];
|
|
19
|
+
sharedBindings: string[];
|
|
20
|
+
sharedTemplateEvents: string[];
|
|
21
|
+
evidenceClass: VueComposableEvidenceClass;
|
|
22
|
+
actionTier: VueComposableActionTier;
|
|
23
|
+
evidenceClassReasons: string[];
|
|
24
|
+
recommendation: string;
|
|
25
|
+
uniqueToA: string[];
|
|
26
|
+
uniqueToB: string[];
|
|
27
|
+
reason: string;
|
|
28
|
+
locA: number;
|
|
29
|
+
locB: number;
|
|
30
|
+
}
|
|
31
|
+
declare function vueComposableCandidates(db: ScipDatabase, opts?: {
|
|
32
|
+
minSimilarity?: number;
|
|
33
|
+
minSharedBehaviors?: number;
|
|
34
|
+
limit?: number;
|
|
35
|
+
scope?: string;
|
|
36
|
+
scanLimit?: number;
|
|
37
|
+
filePattern?: string;
|
|
38
|
+
}): VueComposableCandidateResult[];
|
|
39
|
+
|
|
40
|
+
export { type VueComposableActionTier, type VueComposableCandidateResult, type VueComposableEvidenceClass, vueComposableCandidates };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"../chunk-O4L4AB3T.js";import"../chunk-PVZMPG5I.js";import"../chunk-3UVJJ6Z7.js";import"../chunk-ERHOS6AW.js";import"../chunk-D322LMSA.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComposableCandidates};
|
|
2
|
+
//# sourceMappingURL=vue-composable-candidates.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
|
+
import 'better-sqlite3';
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
|
+
|
|
5
|
+
type VueLargeViewPressureAxis = 'template' | 'script' | 'style' | 'external-script' | 'custom-block' | 'total';
|
|
6
|
+
type VueLargeViewContextKind = 'component' | 'route-page';
|
|
7
|
+
type VueLargeViewRecommendationKind = 'custom-block-review' | 'external-script-boundary' | 'route-page-decomposition' | 'script-behavior-extraction' | 'style-decomposition' | 'template-decomposition' | 'total-size-review';
|
|
8
|
+
interface VueLargeViewPressureResult {
|
|
9
|
+
file: string;
|
|
10
|
+
totalLines: number;
|
|
11
|
+
sfcLines: number;
|
|
12
|
+
templateLines: number;
|
|
13
|
+
scriptLines: number;
|
|
14
|
+
styleLines: number;
|
|
15
|
+
externalScriptLines: number;
|
|
16
|
+
externalScriptPaths: string[];
|
|
17
|
+
customBlockLines: number;
|
|
18
|
+
dominantPressure: VueLargeViewPressureAxis;
|
|
19
|
+
pressureKinds: VueLargeViewPressureAxis[];
|
|
20
|
+
contextKind: VueLargeViewContextKind;
|
|
21
|
+
recommendationKind: VueLargeViewRecommendationKind;
|
|
22
|
+
recommendation: string;
|
|
23
|
+
reasons: string[];
|
|
24
|
+
loc: number;
|
|
25
|
+
}
|
|
26
|
+
declare function vueLargeViewPressure(db: ScipDatabase, opts?: {
|
|
27
|
+
minTotalLines?: number;
|
|
28
|
+
minTemplateLines?: number;
|
|
29
|
+
minScriptLines?: number;
|
|
30
|
+
minStyleLines?: number;
|
|
31
|
+
limit?: number;
|
|
32
|
+
scope?: string;
|
|
33
|
+
scanLimit?: number;
|
|
34
|
+
filePattern?: string;
|
|
35
|
+
}): VueLargeViewPressureResult[];
|
|
36
|
+
|
|
37
|
+
export { type VueLargeViewContextKind, type VueLargeViewPressureAxis, type VueLargeViewPressureResult, type VueLargeViewRecommendationKind, vueLargeViewPressure };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-CTarohbZ.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-Bj4sh28g.js';
|
|
4
4
|
|
|
5
|
+
type WrapperActionTier = 'direct' | 'signal';
|
|
5
6
|
interface WrapperCandidate {
|
|
6
7
|
symbol: string;
|
|
7
8
|
shortName: string;
|
|
@@ -12,6 +13,8 @@ interface WrapperCandidate {
|
|
|
12
13
|
singleCaller: string;
|
|
13
14
|
singleCallerShort: string;
|
|
14
15
|
callerFanIn: number;
|
|
16
|
+
actionTier: WrapperActionTier;
|
|
17
|
+
boundaryEvidence: string[];
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
20
|
* Find wrapper candidates: symbols called by only one other symbol.
|
|
@@ -28,4 +31,4 @@ declare function wrapperCandidates(db: ScipDatabase, opts?: {
|
|
|
28
31
|
semantic?: boolean;
|
|
29
32
|
}): WrapperCandidate[];
|
|
30
33
|
|
|
31
|
-
export { type WrapperCandidate, wrapperCandidates };
|
|
34
|
+
export { type WrapperActionTier, type WrapperCandidate, wrapperCandidates };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-SPE4YCOT.js";import"../chunk-RHTJBYZ5.js";import"../chunk-VAA5FFIW.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-3ZYF3ELZ.js";import"../chunk-ZQLO2SCU.js";import"../chunk-BGBBVSH4.js";import"../chunk-GZCQTZLK.js";import"../chunk-YTR4CO5S.js";import"../chunk-HVTYSC26.js";import"../chunk-FUPDW5AC.js";import"../chunk-MZ7APUFN.js";import"../chunk-AUVBR62P.js";import"../chunk-FOQHUKNZ.js";import"../chunk-CRU42NJU.js";import"../chunk-3UW7VM4H.js";import"../chunk-JM72FNGA.js";import"../chunk-QLNGUWR7.js";import"../chunk-ERHOS6AW.js";import"../chunk-EWC3UK4V.js";import"../chunk-D322LMSA.js";import"../chunk-A4L36SZS.js";import"../chunk-OBBDKQAG.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as wrapperCandidates};
|
|
2
2
|
//# sourceMappingURL=wrapper-candidates.js.map
|
package/dist/reindex-worker.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
`)){if(!r)continue;let i=_(r).toLowerCase();i&&t.add(i)}return t}catch{return null}}function ve(e,n){return n?.length?n.some(t=>e.has(t)):!1}function F(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as W,readdirSync as Ie}from"fs";import{join as v}from"path";var ke={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:n,indexerBinary:t})=>{let r=["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return n&&r.splice(1,0,"--pnpm-workspaces"),{binary:t,args:r}},markerFiles:["tsconfig.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},javascript:{language:"javascript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--infer-tsconfig","--output",e,"--no-progress-bar"]}),markerFiles:["package.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},java:{language:"java",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["pom.xml","build.gradle"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},scala:{language:"scala",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.sbt"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},kotlin:{language:"kotlin",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.gradle.kts"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},rust:{language:"rust",indexerBinary:"rust-analyzer",checkCommand:"rust-analyzer --version",indexArgs:({outputPath:e})=>({binary:"rust-analyzer",args:["scip",".","--output",e]}),markerFiles:["Cargo.toml"],installMethods:[{label:"rustup",prerequisite:"rustup",binary:"rustup",args:["component","add","rust-analyzer"]}],installUrl:"https://github.com/rust-lang/rust-analyzer"},python:{language:"python",indexerBinary:"scip-python-plus",binaryAliases:["scip-python"],checkCommand:"scip-python-plus --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--output",e,"--project-name","project"]}),markerFiles:["pyproject.toml","setup.py"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-python-plus"]}],installUrl:"https://github.com/PlunderStruck/scip-python",bundledNpmPackage:"scip-python-plus"},ruby:{language:"ruby",indexerBinary:"scip-ruby",checkCommand:"scip-ruby --version",indexArgs:({indexerBinary:e})=>({binary:e,args:["--dir","."]}),defaultOutputPath:"index.scip",markerFiles:["Gemfile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-ruby/releases"},go:{language:"go",indexerBinary:"scip-go",checkCommand:"scip-go --version",indexArgs:({outputPath:e})=>({binary:"scip-go",args:["--output",e]}),markerFiles:["go.mod"],installMethods:[{label:"go install",prerequisite:"go",binary:"go",args:["install","github.com/sourcegraph/scip-go@latest"]}],installUrl:"https://github.com/sourcegraph/scip-go"},cpp:{language:"cpp",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},c:{language:"c",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},csharp:{language:"csharp",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",q(e,[".sln",".csproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.csproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},vb:{language:"vb",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",q(e,[".sln",".vbproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.vbproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},dart:{language:"dart",indexerBinary:"scip-dart",checkCommand:"scip-dart --version",indexArgs:({indexerBinary:e,outputPath:n})=>({binary:e,args:["--output",n]}),markerFiles:["pubspec.yaml"],installMethods:[{label:"dart pub",prerequisite:"dart",binary:"dart",args:["pub","global","activate","scip_dart"]}],installUrl:"https://github.com/Workiva/scip-dart/releases"},php:{language:"php",indexerBinary:"scip-php",projectLocalBinaries:["vendor/davidrjenni/scip-php/bin/scip-php","vendor/bin/scip-php"],checkCommand:"scip-php --version",indexArgs:({projectRoot:e,indexerBinary:n})=>{let t=v(e,"vendor","bin","scip-php"),r=v(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",W(r)?r:W(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function z(e){return ke[e]}function q(e,n){let t;try{t=Ie(e)}catch{return null}for(let r of t)if(n.some(i=>r.endsWith(i)))return v(e,r);return null}import{readFileSync as Re,writeFileSync as De}from"fs";import{create as I}from"@bufbuild/protobuf";import{deserializeSCIP as Ce,serializeSCIP as je,DocumentSchema as Oe,IndexSchema as Le,SymbolInformationSchema as we}from"@c4312/scip";function Ee(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let n=$e(e),t=Be(e.flatMap(i=>i.documents??[])),r=G(e.flatMap(i=>i.externalSymbols??[]));return I(Le,{metadata:n,documents:t,externalSymbols:r})}function J(e,n){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let t=e.map(i=>Ce(Re(i))),r=Ee(t);return De(n,Buffer.from(je(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function $e(e){let n=e[0]?.metadata;if(!n)return;let t=n.projectRoot;for(let r of e.slice(1)){let i=r.metadata?.projectRoot;if(t&&i&&i!==t)throw new Error(`Cannot merge SCIP indexes with different project roots: ${t} vs ${i}`)}return n}function Be(e){let n=new Map;for(let t of e){let r=n.get(t.relativePath);if(!r){n.set(t.relativePath,t);continue}n.set(t.relativePath,I(Oe,{language:r.language||t.language,relativePath:r.relativePath||t.relativePath,occurrences:[...r.occurrences,...t.occurrences],symbols:G([...r.symbols,...t.symbols]),text:Ne(r.text,t.text),positionEncoding:r.positionEncoding||t.positionEncoding}))}return[...n.values()]}function G(e){let n=new Map;for(let t of e){let r=n.get(t.symbol);if(!r){n.set(t.symbol,t);continue}n.set(t.symbol,I(we,{symbol:r.symbol,documentation:Fe([...r.documentation,...t.documentation]),relationships:Me([...r.relationships,...t.relationships]),kind:r.kind||t.kind,displayName:r.displayName||t.displayName,enclosingSymbol:r.enclosingSymbol||t.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??t.signatureDocumentation}))}return[...n.values()]}function Me(e){let n=new Set,t=[];for(let r of e){let i=[r.symbol,r.isReference?"1":"0",r.isImplementation?"1":"0",r.isTypeDefinition?"1":"0",r.isDefinition?"1":"0"].join("|");n.has(i)||(n.add(i),t.push(r))}return t}function Ne(e,n){return e?n?e.length>=n.length?e:n:e:n}function Fe(e){return[...new Set(e)]}import{readFileSync as Ae,writeFileSync as _e}from"fs";import{create as H}from"@bufbuild/protobuf";import{deserializeSCIP as Te,DocumentSchema as Ue,IndexSchema as We,serializeSCIP as qe,SymbolRole as ze}from"@c4312/scip";function X(e){let n;try{n=Te(Ae(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let t=Je(n);return t.removedDefinitionOccurrences>0&&_e(e,Buffer.from(qe(t.index))),{removedDefinitionOccurrences:t.removedDefinitionOccurrences,touchedDocuments:t.touchedDocuments}}function Je(e){let n=new Set;for(let a of e.documents)for(let s of a.symbols)s.symbol&&n.add(s.symbol);for(let a of e.externalSymbols)a.symbol&&n.add(a.symbol);let t=0,r=0,i=[];for(let a of e.documents){let s=a.occurrences.filter(o=>(o.symbolRoles&ze.Definition)===0||n.has(o.symbol)?!0:(t+=1,!1));if(s.length===a.occurrences.length){i.push(a);continue}r+=1,i.push(H(Ue,{language:a.language,relativePath:a.relativePath,occurrences:s,symbols:a.symbols,text:a.text,positionEncoding:a.positionEncoding}))}return{index:t===0?e:H(We,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:t,touchedDocuments:r}}import{execFile as Ge}from"child_process";import{existsSync as h,renameSync as R,rmSync as D}from"fs";import{cpus as He}from"os";import{join as Q}from"path";function Xe(e,n,t){if(!e.defaultOutputPath)return;let r=Q(n,e.defaultOutputPath);t!==r&&h(r)&&R(r,t)}function Qe(e,n,t){if(!e.defaultOutputPath)return null;let r=Q(n,e.defaultOutputPath);if(r===t)return null;let i=`${t}.default-output-backup`;return D(i,{force:!0}),h(r)?(R(r,i),{defaultOutputPath:r,backupPath:i}):{defaultOutputPath:r,backupPath:null}}function Ke(e){e&&(D(e.defaultOutputPath,{force:!0}),e.backupPath&&h(e.backupPath)&&R(e.backupPath,e.defaultOutputPath))}function Ve(e,n){if(e<=1)return 1;let t=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(n)&&n&&n>0?n:Number.isFinite(t)&&t>0?t:Math.min(2,Math.max(1,He().length-1));return Math.max(1,Math.min(e,Math.floor(r)))}async function K(e,n,t,r){let i=e.filter(u=>u.config.defaultOutputPath),a=e.filter(u=>!u.config.defaultOutputPath),s=[],o=Ve(a.length,r),c=await Ze(a,o,u=>k(u,n,t));if(o>1){let u=new Map;for(let p of c.filter(l=>l.skipped)){let l=a.find(f=>f.language===p.language);l&&(t(`Retrying ${l.language} indexer serially after parallel failure...`),u.set(l.language,await k(l,n,t)))}s.push(...c.map(p=>u.get(p.language)??p))}else s.push(...c);for(let u of i)s.push(await k(u,n,t));return s.sort((u,p)=>e.findIndex(l=>l.language===u.language)-e.findIndex(l=>l.language===p.language))}async function k(e,n,t){t(`Indexing ${e.language} with ${e.resolvedBinary}...`),D(e.scipPath,{force:!0});let r=Qe(e.config,n,e.scipPath);try{await Ye(e.binary,e.args,{cwd:n,env:e.env,maxBuffer:50*1024*1024}),Xe(e.config,n,e.scipPath)}catch(i){let a=i instanceof Error?i.message:String(i),s=`${e.resolvedBinary} indexer failed: ${a.split(`
|
|
3
|
-
`)[0]}`;return t(`Skipping ${e.language}: ${s}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:s}}}finally{
|
|
4
|
-
Install from: https://github.com/sourcegraph/scip/releases`);if(n("scip CLI not found on PATH. Attempting auto-install..."),!
|
|
5
|
-
Install manually from: https://github.com/sourcegraph/scip/releases`)}}function
|
|
1
|
+
import{a as v,b as I}from"./chunk-KPHKX4LP.js";import{a as m,e as A}from"./chunk-NXIAHE7F.js";import{execFileSync as gn}from"child_process";import{closeSync as dn,copyFileSync as mn,existsSync as P,mkdirSync as B,mkdtempSync as fn,openSync as hn,readFileSync as ie,renameSync as M,rmSync as N,writeFileSync as se}from"fs";import{basename as S,dirname as d,extname as xn,join as g}from"path";import{execFileSync as fe}from"child_process";import{existsSync as he,readdirSync as T}from"fs";import{extname as U,join as W}from"path";var xe=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),ye=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function q(e){let n=[],t=be(e),r=Ie(e);for(let a of ye){if(Se(e,a.files)){n.push(a.language);continue}if(Pe(t,a.globs)){n.push(a.language);continue}ke(r,a.extensions)&&n.push(a.language)}return n.includes("typescript")&&_(n,"javascript"),n.includes("cpp")&&!r.has(".c")&&_(n,"c"),n}function be(e){try{return T(e)}catch{return[]}}function Se(e,n){return n?.length?n.some(t=>he(W(e,t))):!1}function Pe(e,n){return n?.length?e.some(t=>n.some(r=>ve(t,r))):!1}function ve(e,n){if(n==="*")return!0;if(!n.includes("*"))return e===n;let[t,r]=n.split("*");return e.startsWith(t??"")&&e.endsWith(r??"")}function Ie(e){let n=Re(e);if(n)return n;let t=new Set,r=[e];for(;r.length>0;){let a=r.pop();if(!a)continue;let i;try{i=T(a,{withFileTypes:!0})}catch{continue}for(let s of i){if(s.name.startsWith(".")&&!s.name.endsWith("proj")&&!s.name.endsWith("sln")&&s.isDirectory())continue;let o=W(a,s.name);if(s.isDirectory()){xe.has(s.name)||r.push(o);continue}let p=U(s.name).toLowerCase();p&&t.add(p)}}return t}function Re(e){try{let n=fe("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),t=new Set;for(let r of n.split(`
|
|
2
|
+
`)){if(!r)continue;let a=U(r).toLowerCase();a&&t.add(a)}return t}catch{return null}}function ke(e,n){return n?.length?n.some(t=>e.has(t)):!1}function _(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as z,readdirSync as De}from"fs";import{join as R}from"path";var Oe={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:n,indexerBinary:t})=>{let r=["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return n&&r.splice(1,0,"--pnpm-workspaces"),{binary:t,args:r}},markerFiles:["tsconfig.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},javascript:{language:"javascript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--infer-tsconfig","--output",e,"--no-progress-bar"]}),markerFiles:["package.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},java:{language:"java",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["pom.xml","build.gradle"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},scala:{language:"scala",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.sbt"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},kotlin:{language:"kotlin",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.gradle.kts"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},rust:{language:"rust",indexerBinary:"rust-analyzer",checkCommand:"rust-analyzer --version",indexArgs:({outputPath:e})=>({binary:"rust-analyzer",args:["scip",".","--output",e]}),markerFiles:["Cargo.toml"],installMethods:[{label:"rustup",prerequisite:"rustup",binary:"rustup",args:["component","add","rust-analyzer"]}],installUrl:"https://github.com/rust-lang/rust-analyzer"},python:{language:"python",indexerBinary:"scip-python-plus",binaryAliases:["scip-python"],checkCommand:"scip-python-plus --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--output",e,"--project-name","project"]}),markerFiles:["pyproject.toml","setup.py"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-python-plus"]}],installUrl:"https://github.com/PlunderStruck/scip-python",bundledNpmPackage:"scip-python-plus"},ruby:{language:"ruby",indexerBinary:"scip-ruby",checkCommand:"scip-ruby --version",indexArgs:({indexerBinary:e})=>({binary:e,args:["--dir","."]}),defaultOutputPath:"index.scip",markerFiles:["Gemfile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-ruby/releases"},go:{language:"go",indexerBinary:"scip-go",checkCommand:"scip-go --version",indexArgs:({outputPath:e})=>({binary:"scip-go",args:["--output",e]}),markerFiles:["go.mod"],installMethods:[{label:"go install",prerequisite:"go",binary:"go",args:["install","github.com/sourcegraph/scip-go@latest"]}],installUrl:"https://github.com/sourcegraph/scip-go"},cpp:{language:"cpp",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},c:{language:"c",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},csharp:{language:"csharp",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",J(e,[".sln",".csproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.csproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},vb:{language:"vb",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",J(e,[".sln",".vbproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.vbproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},dart:{language:"dart",indexerBinary:"scip-dart",checkCommand:"scip-dart --version",indexArgs:({indexerBinary:e,outputPath:n})=>({binary:e,args:["--output",n]}),markerFiles:["pubspec.yaml"],installMethods:[{label:"dart pub",prerequisite:"dart",binary:"dart",args:["pub","global","activate","scip_dart"]}],installUrl:"https://github.com/Workiva/scip-dart/releases"},php:{language:"php",indexerBinary:"scip-php",projectLocalBinaries:["vendor/davidrjenni/scip-php/bin/scip-php","vendor/bin/scip-php"],checkCommand:"scip-php --version",indexArgs:({projectRoot:e,indexerBinary:n})=>{let t=R(e,"vendor","bin","scip-php"),r=R(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",z(r)?r:z(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function k(e){return Oe[e]}function J(e,n){let t;try{t=De(e)}catch{return null}for(let r of t)if(n.some(a=>r.endsWith(a)))return R(e,r);return null}import{readFileSync as Le,writeFileSync as je}from"fs";import{create as D}from"@bufbuild/protobuf";import{deserializeSCIP as Ce,serializeSCIP as we,DocumentSchema as Ee,IndexSchema as $e,SymbolInformationSchema as Fe}from"@c4312/scip";function Be(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let n=Me(e),t=Ne(e.flatMap(a=>a.documents??[])),r=H(e.flatMap(a=>a.externalSymbols??[]));return D($e,{metadata:n,documents:t,externalSymbols:r})}function G(e,n){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let t=e.map(a=>Ce(Le(a))),r=Be(t);return je(n,Buffer.from(we(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function Me(e){let n=e[0]?.metadata;if(!n)return;let t=n.projectRoot;for(let r of e.slice(1)){let a=r.metadata?.projectRoot;if(t&&a&&a!==t)throw new Error(`Cannot merge SCIP indexes with different project roots: ${t} vs ${a}`)}return n}function Ne(e){let n=new Map;for(let t of e){let r=n.get(t.relativePath);if(!r){n.set(t.relativePath,t);continue}n.set(t.relativePath,D(Ee,{language:r.language||t.language,relativePath:r.relativePath||t.relativePath,occurrences:[...r.occurrences,...t.occurrences],symbols:H([...r.symbols,...t.symbols]),text:_e(r.text,t.text),positionEncoding:r.positionEncoding||t.positionEncoding}))}return[...n.values()]}function H(e){let n=new Map;for(let t of e){let r=n.get(t.symbol);if(!r){n.set(t.symbol,t);continue}n.set(t.symbol,D(Fe,{symbol:r.symbol,documentation:Te([...r.documentation,...t.documentation]),relationships:Ae([...r.relationships,...t.relationships]),kind:r.kind||t.kind,displayName:r.displayName||t.displayName,enclosingSymbol:r.enclosingSymbol||t.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??t.signatureDocumentation}))}return[...n.values()]}function Ae(e){let n=new Set,t=[];for(let r of e){let a=[r.symbol,r.isReference?"1":"0",r.isImplementation?"1":"0",r.isTypeDefinition?"1":"0",r.isDefinition?"1":"0"].join("|");n.has(a)||(n.add(a),t.push(r))}return t}function _e(e,n){return e?n?e.length>=n.length?e:n:e:n}function Te(e){return[...new Set(e)]}import{readFileSync as Ue,writeFileSync as We}from"fs";import{create as X}from"@bufbuild/protobuf";import{deserializeSCIP as qe,DocumentSchema as ze,IndexSchema as Je,serializeSCIP as Ge,SymbolRole as He}from"@c4312/scip";function Q(e){let n;try{n=qe(Ue(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let t=Xe(n);return t.removedDefinitionOccurrences>0&&We(e,Buffer.from(Ge(t.index))),{removedDefinitionOccurrences:t.removedDefinitionOccurrences,touchedDocuments:t.touchedDocuments}}function Xe(e){let n=new Set;for(let i of e.documents)for(let s of i.symbols)s.symbol&&n.add(s.symbol);for(let i of e.externalSymbols)i.symbol&&n.add(i.symbol);let t=0,r=0,a=[];for(let i of e.documents){let s=i.occurrences.filter(o=>(o.symbolRoles&He.Definition)===0||n.has(o.symbol)?!0:(t+=1,!1));if(s.length===i.occurrences.length){a.push(i);continue}r+=1,a.push(X(ze,{language:i.language,relativePath:i.relativePath,occurrences:s,symbols:i.symbols,text:i.text,positionEncoding:i.positionEncoding}))}return{index:t===0?e:X(Je,{metadata:e.metadata,documents:a,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:t,touchedDocuments:r}}import{execFile as Qe}from"child_process";import{existsSync as x,renameSync as L,rmSync as j}from"fs";import{cpus as Ke}from"os";import{join as K}from"path";function Ve(e,n,t){if(!e.defaultOutputPath)return;let r=K(n,e.defaultOutputPath);t!==r&&x(r)&&L(r,t)}function Ye(e,n,t){if(!e.defaultOutputPath)return null;let r=K(n,e.defaultOutputPath);if(r===t)return null;let a=`${t}.default-output-backup`;return j(a,{force:!0}),x(r)?(L(r,a),{defaultOutputPath:r,backupPath:a}):{defaultOutputPath:r,backupPath:null}}function Ze(e){e&&(j(e.defaultOutputPath,{force:!0}),e.backupPath&&x(e.backupPath)&&L(e.backupPath,e.defaultOutputPath))}function en(e,n){if(e<=1)return 1;let t=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(n)&&n&&n>0?n:Number.isFinite(t)&&t>0?t:Math.min(2,Math.max(1,Ke().length-1));return Math.max(1,Math.min(e,Math.floor(r)))}async function V(e,n,t,r){let a=e.filter(u=>u.config.defaultOutputPath),i=e.filter(u=>!u.config.defaultOutputPath),s=[],o=en(i.length,r),p=await tn(i,o,u=>O(u,n,t));if(o>1){let u=new Map;for(let c of p.filter(l=>l.skipped)){let l=i.find(h=>h.language===c.language);l&&(t(`Retrying ${l.language} indexer serially after parallel failure...`),u.set(l.language,await O(l,n,t)))}s.push(...p.map(c=>u.get(c.language)??c))}else s.push(...p);for(let u of a)s.push(await O(u,n,t));return s.sort((u,c)=>e.findIndex(l=>l.language===u.language)-e.findIndex(l=>l.language===c.language))}async function O(e,n,t){t(`Indexing ${e.language} with ${e.resolvedBinary}...`),j(e.scipPath,{force:!0});let r=Ye(e.config,n,e.scipPath);try{await nn(e.binary,e.args,{cwd:n,env:e.env,maxBuffer:50*1024*1024}),Ve(e.config,n,e.scipPath)}catch(a){let i=a instanceof Error?a.message:String(a),s=`${e.resolvedBinary} indexer failed: ${i.split(`
|
|
3
|
+
`)[0]}`;return t(`Skipping ${e.language}: ${s}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:s}}}finally{Ze(r)}if(!x(e.scipPath)){let a=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`;return t(`Skipping ${e.language}: ${a}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:a}}}return{language:e.language,scipPath:e.scipPath}}function nn(e,n,t){return new Promise((r,a)=>{Qe(e,[...n],t,i=>{i?a(i):r()})})}async function tn(e,n,t){if(e.length===0)return[];let r=new Array(e.length),a=0,i=Math.max(1,Math.min(e.length,n)),s=Array.from({length:i},async()=>{for(;a<e.length;){let o=a++;r[o]=await t(e[o])}});return await Promise.all(s),r}import{execFileSync as w}from"child_process";import{existsSync as C,readFileSync as rn}from"fs";import{createRequire as an}from"module";import{platform as sn}from"os";import{dirname as Y,join as y}from"path";var on=an(import.meta.url);function E(e){return[e.indexerBinary,...e.binaryAliases??[]]}function $(e){let n=E(e);return n.length===1?n[0]:n.join(" or ")}function b(e){for(let n of E(e))if(m(n))return n;return ln(e)}function Z(e){return b(e)!==null||un(e)}function un(e){return ee(e)!==null}function ln(e){let n=ee(e);if(!n)return null;let r=JSON.parse(rn(n,"utf8")).bin;if(!r)return null;if(typeof r=="string")return y(Y(n),r);for(let a of E(e)){let i=r[a];if(i)return y(Y(n),i)}return null}function ee(e){if(!e.bundledNpmPackage)return null;try{return on.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function ne(e,n){for(let t of e.projectLocalBinaries??[]){let r=y(n,t);if(C(r))return r}return null}function te(e,n=process.env,t=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||ae(t,n))return n;let r=pn(t,n);return r?{...n,DOTNET_ROOT:r}:n}function re(e,n){let t=e.installMethods,r=$(e);if(!t?.length)return n(`No auto-install method available for ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1;for(let a of t)if(m(a.prerequisite)){n(`Installing ${r} via ${a.label}...`);try{w(a.binary,a.args,{stdio:"inherit",timeout:3e5,env:process.env});let i=b(e);if(i){let s=i===e.indexerBinary?"":` (using ${i})`;return n(`Successfully installed ${r} via ${a.label}${s}`),!0}n(`${a.label} command completed but ${r} was not found on PATH`)}catch(i){let s=i instanceof Error?i.message:String(i);n(`${a.label} install failed: ${s}`)}}return n(`Could not auto-install ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1}function pn(e,n){for(let t of cn(n))if(ae(e,{...n,DOTNET_ROOT:t}))return t;return null}function cn(e){let n=[],t=e.DOTNET_ROOT;if(t&&C(t)&&n.push(t),sn()==="darwin"&&m("brew"))try{let r=w("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),a=y(r,"libexec");C(a)&&!n.includes(a)&&n.push(a)}catch{}return n}function ae(e,n){try{return w(e,["--version"],{stdio:"pipe",env:n}),!0}catch{return!1}}async function oe(e){let{projectRoot:n,maxHeapMb:t=8192,onStatus:r=console.log,skipAutoInstall:a=!1}=e,i=yn(e),s=Date.now();B(d(i.outputScip),{recursive:!0}),B(d(i.outputDb),{recursive:!0});let o=e.languages??q(n);if(o.length===0)throw new Error("No supported languages detected in this project. Looked for: tsconfig.json, Cargo.toml, go.mod, pyproject.toml, etc.");r(`Detected languages: ${o.join(", ")}`);let p=Mn(n,o,{pnpmWorkspaces:e.pnpmWorkspaces}),u=Fn(g(d(i.outputDb),"index.lock")),c=null;try{let l=bn({opts:e,paths:i,languages:o,fingerprint:p,start:s,onStatus:r});if(l)return l;Dn(a,r);let h=Sn(i);return c=h.runDir,await Pn({opts:e,languages:o,projectRoot:n,paths:i,tempPaths:h,fingerprint:p,start:s,maxHeapMb:t,skipAutoInstall:a,onStatus:r})}finally{c&&N(c,{recursive:!0,force:!0}),u()}}function yn(e){let n=e.outputScip??g(e.projectRoot,"index.scip"),t=e.outputDb??g(e.projectRoot,"index.db");return{outputScip:n,outputDb:t,metaPath:g(d(t),"meta.json")}}function bn(e){if(e.opts.skipIfUnchanged===!1||!P(e.paths.outputScip)||!P(e.paths.outputDb)||!Nn(e.paths.metaPath,e.fingerprint))return null;v({projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let n=Date.now()-e.start;return e.onStatus(`Index unchanged; reused existing SQLite index in ${(n/1e3).toFixed(1)}s`),{languages:e.languages,indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:n,reused:!0,skipped:[]}}function Sn(e){let n=fn(g(d(e.outputDb),"reindex-"));return{runDir:n,tempOutputScip:g(n,S(e.outputScip)),tempOutputDb:g(n,S(e.outputDb)),tempMetaPath:g(n,S(e.metaPath))}}async function Pn(e){let n={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:t,skippedLanguages:r,reusedLanguages:a}=await vn(e,n);a.length>0&&e.onStatus(`Reused ${a.length} cached language shard(s): ${a.join(", ")}`),In(e,n,t,r);let i=Date.now()-e.start;return e.onStatus(`Done in ${(i/1e3).toFixed(1)}s`),{languages:t.map(s=>s.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:i,reused:!1,skipped:r}}async function vn(e,n){let t=Rn(e),r=new Set(t.map(u=>u.language));for(let u of r)e.onStatus(`Reusing cached ${u} SCIP shard (language inputs unchanged).`);let{preparedRuns:a,skippedLanguages:i}=On({languages:e.languages.filter(u=>!r.has(u)),tempOutputScip:e.tempPaths.tempOutputScip,projectRoot:e.projectRoot,env:n,skipAutoInstall:e.skipAutoInstall,pnpmWorkspaces:e.opts.pnpmWorkspaces,onStatus:e.onStatus}),s=await V(a,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:o}=jn(s,i),p=[...t,...o];return Cn(p,i,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:p,skippedLanguages:i,reusedLanguages:[...r]}}function In(e,n,t,r){kn(e.paths.outputDb,t),wn(t,e.tempPaths.tempOutputScip,e.onStatus),En(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,n,e.onStatus),v({projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus}),An(e.tempPaths.tempMetaPath,{version:3,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,languageFingerprints:ue(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces}),requestedLanguages:e.languages,indexedLanguages:t.map(a=>a.language),skipped:[...r]}),Bn({tempOutputScip:e.tempPaths.tempOutputScip,tempOutputDb:e.tempPaths.tempOutputDb,tempMetaPath:e.tempPaths.tempMetaPath,outputScip:e.paths.outputScip,outputDb:e.paths.outputDb,metaPath:e.paths.metaPath})}function Rn(e){let n;try{n=JSON.parse(ie(e.paths.metaPath,"utf-8"))}catch{return[]}if(n.version!==3||!n.languageFingerprints)return[];let t=[],r=ue(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces});for(let a of e.languages){let i=le(e.paths.outputDb,a);P(i)&&f(n.languageFingerprints[a])===f(r[a])&&t.push({language:a,scipPath:i})}return t}function kn(e,n){for(let t of n){let r=le(e,t.language);B(d(r),{recursive:!0}),t.scipPath!==r&&mn(t.scipPath,r)}}function Dn(e,n){if(!m("scip")){if(e)throw new Error(`The scip CLI is required but not found on PATH.
|
|
4
|
+
Install from: https://github.com/sourcegraph/scip/releases`);if(n("scip CLI not found on PATH. Attempting auto-install..."),!A(n))throw new Error(`The scip CLI is required but could not be installed.
|
|
5
|
+
Install manually from: https://github.com/sourcegraph/scip/releases`)}}function On(e){let n=[],t=[],r=e.languages.map((a,i)=>({language:a,scipPath:e.languages.length>1?$n(e.tempOutputScip,a,i):e.tempOutputScip}));for(let{language:a,scipPath:i}of r){let s=Ln({...e,language:a,scipPath:i});"skipped"in s?t.push(s.skipped):n.push(s.prepared)}return{preparedRuns:n,skippedLanguages:t}}function Ln(e){let n=k(e.language),t=$(n),r=ne(n,e.projectRoot);if(!r&&!Z(n)){if(e.skipAutoInstall){let o=`${t} not found on PATH (auto-install disabled). ${n.installUrl??""}`.trim();return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}if(e.onStatus(`${t} not found. Attempting auto-install...`),!re(n,e.onStatus)){let o=`${t} could not be auto-installed. ${n.installUrl?`Install manually from ${n.installUrl}`:`Install ${t} and put it on PATH.`}`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}}let a=r??b(n);if(!a){let o=`${t} was not found after installation checks.`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}let{binary:i,args:s}=n.indexArgs({projectRoot:e.projectRoot,outputPath:e.scipPath,pnpmWorkspaces:e.pnpmWorkspaces,indexerBinary:a});return{prepared:{language:e.language,scipPath:e.scipPath,config:n,resolvedBinary:a,binary:i,args:s,env:te(n,e.env,a)}}}function jn(e,n){let t=[];for(let r of e)r.skipped?n.push(r.skipped):t.push({language:r.language,scipPath:r.scipPath});return{indexedOutputs:t}}function Cn(e,n,t,r,a){if(e.length===0){let i=n.map(s=>` - ${s.language}: ${s.reason}`).join(`
|
|
6
6
|
`);throw new Error(`No language indexers ran successfully. Install at least one indexer for the languages in this project.
|
|
7
|
-
`+
|
|
8
|
-
`+n.map(
|
|
9
|
-
`))}function
|
|
10
|
-
`),()=>{try{
|
|
11
|
-
`)}function
|
|
7
|
+
`+i)}if(n.length!==0&&(a(`Indexed ${e.length} of ${t.length} languages; skipped ${n.map(i=>i.language).join(", ")}.`),!r))throw new Error(`Failed to index all required languages; preserving the previous index. Pass --allow-partial to intentionally write an incomplete index.
|
|
8
|
+
`+n.map(i=>` - ${i.language}: ${i.reason}`).join(`
|
|
9
|
+
`))}function wn(e,n,t){e.length>1?(t(`Merging ${e.length} language indexes...`),G(e.map(r=>r.scipPath),n)):e[0].scipPath!==n&&M(e[0].scipPath,n)}function En(e,n,t,r){if(r("Converting to SQLite..."),!P(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{let a=Q(e);a.removedDefinitionOccurrences>0&&r(`Sanitized ${a.removedDefinitionOccurrences} invalid definition occurrences across ${a.touchedDocuments} documents before SQLite conversion.`),gn("scip",["expt-convert","--output",n,e],{env:t,stdio:"pipe",maxBuffer:50*1024*1024})}catch(a){let i=a instanceof Error?a.message:String(a);throw new Error(`Failed to convert SCIP index to SQLite: ${i}`,{cause:a})}}function $n(e,n,t){let r=xn(e)||".scip",a=S(e,r);return g(d(e),`${a}.${t+1}.${n}${r}`)}function Fn(e){let n;try{n=hn(e,"wx")}catch(t){throw(typeof t=="object"&&t&&"code"in t?t.code:void 0)==="EEXIST"?new Error(`Another scip-query reindex is already running for ${d(e)}.`,{cause:t}):t}return se(n,JSON.stringify({pid:process.pid,startedAt:new Date().toISOString()})+`
|
|
10
|
+
`),()=>{try{dn(n)}finally{N(e,{force:!0})}}}function Bn(e){F(e.tempOutputScip,e.outputScip),F(e.tempOutputDb,e.outputDb),F(e.tempMetaPath,e.metaPath)}function F(e,n){N(`${n}.tmp-replace`,{force:!0}),M(e,`${n}.tmp-replace`),M(`${n}.tmp-replace`,n)}function Mn(e,n,t){return{version:1,languages:[...n].sort(),pnpmWorkspaces:t.pnpmWorkspaces===!0,files:I(e)}}function ue(e,n,t){return Object.fromEntries(n.map(r=>{let a=k(r).markerFiles;return[r,{version:1,languages:[r],pnpmWorkspaces:r==="typescript"&&t.pnpmWorkspaces===!0,files:I(e,{language:r,markerFiles:a})}]}))}function le(e,n){return g(d(e),"language-indexes",`${n}.scip`)}function Nn(e,n){try{let t=JSON.parse(ie(e,"utf-8"));return(t.version===2||t.version===3)&&t.status==="complete"&&f(t.fingerprint)===f(n)&&f([...t.indexedLanguages??[]].sort())===f(n.languages)}catch{return!1}}function An(e,n){se(e,`${JSON.stringify(n,null,2)}
|
|
11
|
+
`)}function f(e){return JSON.stringify(e)}var ge=process.env.SCIP_REINDEX_PROJECT_ROOT,de=process.env.SCIP_REINDEX_OUTPUT_SCIP,me=process.env.SCIP_REINDEX_OUTPUT_DB,pe=process.env.SCIP_REINDEX_LANGUAGES,_n=process.env.SCIP_REINDEX_PNPM_WORKSPACES==="1";(!ge||!de||!me)&&(console.error("reindex-worker: missing required env vars"),process.exit(1));var ce=pe?pe.split(",").filter(Boolean):void 0;oe({projectRoot:ge,outputScip:de,outputDb:me,languages:ce?.length?ce:void 0,pnpmWorkspaces:_n,onStatus:e=>process.stderr.write(`[reindex] ${e}
|
|
12
12
|
`)}).then(()=>{process.exit(0)}).catch(e=>{console.error(`reindex-worker error: ${e}`),process.exit(1)});
|
|
13
13
|
//# sourceMappingURL=reindex-worker.js.map
|
package/dist/reindex.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SupportedLanguage, I as IndexerConfig } from './config-types-
|
|
1
|
+
import { a as SupportedLanguage, I as IndexerConfig } from './config-types-Bj4sh28g.js';
|
|
2
2
|
import { Index } from '@c4312/scip';
|
|
3
3
|
export { t as tryInstallScipCli } from './scip-cli-a-xOztiK.js';
|
|
4
4
|
|