scip-query 0.10.5 → 0.10.7
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 +6 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-CJJP64OC.js → chunk-27FU2KX7.js} +2 -2
- package/dist/chunk-3C4NIBY5.js +2 -0
- package/dist/chunk-3LQFMQPY.js +3 -0
- package/dist/{chunk-QVCCLDZI.js → chunk-5JXH6VGF.js} +2 -2
- package/dist/{chunk-77YBOOYT.js → chunk-5LM7RJMQ.js} +2 -2
- package/dist/{chunk-EWC3UK4V.js → chunk-5MHQI4RR.js} +2 -2
- package/dist/{chunk-X7ZY6FFF.js → chunk-72QDTW5U.js} +2 -2
- package/dist/{chunk-MZ7APUFN.js → chunk-733EF5FD.js} +2 -2
- package/dist/chunk-7AOMEMOA.js +4 -0
- package/dist/chunk-A536TEU4.js +3 -0
- package/dist/chunk-BZ2RRK7Y.js +8 -0
- package/dist/chunk-C6ROZBJA.js +32 -0
- package/dist/chunk-CMXD5VC4.js +2 -0
- package/dist/{chunk-BNKE4TT5.js → chunk-CQEJU32R.js} +2 -2
- package/dist/{chunk-5FOPAXWY.js → chunk-DBTL56LR.js} +2 -2
- package/dist/chunk-DOZ2X6TS.js +2 -0
- package/dist/{chunk-D322LMSA.js → chunk-DS6QEB3G.js} +5 -5
- package/dist/chunk-EOUTP32Q.js +4 -0
- package/dist/{chunk-QSXQT3NE.js → chunk-EPPCGQUI.js} +2 -2
- package/dist/{chunk-CSWZFD46.js → chunk-EW64FEJL.js} +2 -2
- package/dist/{chunk-O3OKSF6O.js → chunk-FG4NT6VY.js} +2 -2
- package/dist/chunk-FKYPOK7P.js +5 -0
- package/dist/chunk-FPYQA7JK.js +21 -0
- package/dist/{chunk-FIB4JPEX.js → chunk-FRIASDLG.js} +2 -2
- package/dist/chunk-FXI3AAKO.js +2 -0
- package/dist/{chunk-QUJBXLBY.js → chunk-FXWV2V7K.js} +2 -2
- package/dist/chunk-G2CGUNQU.js +4 -0
- package/dist/{chunk-LPLGJ4HO.js → chunk-GIOT3O6P.js} +2 -2
- package/dist/{chunk-YUTRW57I.js → chunk-GKRRO3WC.js} +2 -2
- package/dist/{chunk-Z4VHYJ5U.js → chunk-GOWLZ4NA.js} +2 -2
- package/dist/{chunk-4ZUJJRWT.js → chunk-GRZRMELG.js} +2 -2
- package/dist/{chunk-CFL2CNIF.js → chunk-H6RLM7D7.js} +2 -2
- package/dist/chunk-HDBQHJNY.js +2 -0
- package/dist/{chunk-AW4N6MGC.js → chunk-IA7Q6HVP.js} +2 -2
- package/dist/{chunk-E44ZMVNA.js → chunk-IL2EVPYP.js} +2 -2
- package/dist/{chunk-E7KERP7E.js → chunk-J43GIAVM.js} +2 -2
- package/dist/{chunk-56UN3DMK.js → chunk-JOGZKF5W.js} +2 -2
- package/dist/{chunk-CTCAF3YA.js → chunk-KT2ZO3CE.js} +2 -2
- package/dist/{chunk-DAI74TJU.js → chunk-KUIIQPDA.js} +2 -2
- package/dist/{chunk-VAA5FFIW.js → chunk-LM5SHAN4.js} +2 -2
- package/dist/chunk-LONIY5FF.js +2 -0
- package/dist/{chunk-FNRPGGVI.js → chunk-LQSLW7K7.js} +2 -2
- package/dist/{chunk-WBJZNPUT.js → chunk-M3YEHOCD.js} +2 -2
- package/dist/{chunk-GZCQTZLK.js → chunk-MFWAZFYD.js} +2 -2
- package/dist/{chunk-EYLXU575.js → chunk-MHATKJ3J.js} +2 -2
- package/dist/{chunk-ZQLO2SCU.js → chunk-MJXJ56LG.js} +2 -2
- package/dist/{chunk-47UA45TU.js → chunk-NIGHS7UP.js} +2 -2
- package/dist/{chunk-NVFERV4U.js → chunk-OFO7BIRK.js} +2 -2
- package/dist/{chunk-7OHWPJ5N.js → chunk-OMGE3V2Q.js} +2 -2
- package/dist/{chunk-ICXVNWMI.js → chunk-OT6CDRKC.js} +2 -2
- package/dist/{chunk-6UFMPECA.js → chunk-OWXN6ZS5.js} +2 -2
- package/dist/{chunk-QLNGUWR7.js → chunk-OZUJ3VZS.js} +2 -2
- package/dist/chunk-P3K7LX7M.js +4 -0
- package/dist/{chunk-ZSLT7NWQ.js → chunk-PQ6QG3EX.js} +2 -2
- package/dist/chunk-PTKQNPWX.js +23 -0
- package/dist/{chunk-YYD245WG.js → chunk-QMH2D6S5.js} +2 -2
- package/dist/{chunk-5M4TYWVI.js → chunk-QPTVFG4O.js} +2 -2
- package/dist/{chunk-MUULWXSJ.js → chunk-QR337MAA.js} +2 -2
- package/dist/{chunk-SPE4YCOT.js → chunk-QVS4SYAX.js} +2 -2
- package/dist/{chunk-AUVBR62P.js → chunk-RISLKTKQ.js} +2 -2
- package/dist/{chunk-OLD6PBU6.js → chunk-S7DNZ6IW.js} +2 -2
- package/dist/{chunk-EOZIZWW4.js → chunk-SXESPZUX.js} +2 -2
- package/dist/{chunk-TM6GVHA6.js → chunk-TDBTVMHY.js} +2 -2
- package/dist/{chunk-3UW7VM4H.js → chunk-TJXOD4IK.js} +2 -2
- package/dist/chunk-U73YFD3P.js +3 -0
- package/dist/{chunk-YUOAAR24.js → chunk-UBDFQBSE.js} +2 -2
- package/dist/chunk-UJEVABIR.js +2 -0
- package/dist/{chunk-5QJXH6ZL.js → chunk-VA3FJ3AY.js} +2 -2
- package/dist/{chunk-3KLLFNT4.js → chunk-VOYOYC5T.js} +2 -2
- package/dist/chunk-W2CBNBEL.js +71 -0
- package/dist/chunk-W2TIXAGN.js +40 -0
- package/dist/{chunk-CAWSSEVM.js → chunk-WMIQMXSK.js} +2 -2
- package/dist/{chunk-YQH353VA.js → chunk-WVRTGVHJ.js} +2 -2
- package/dist/{chunk-DJMK4DBL.js → chunk-WXMVK53S.js} +2 -2
- package/dist/{chunk-YTR4CO5S.js → chunk-XAYARHNF.js} +3 -3
- package/dist/{chunk-ESG4HBEF.js → chunk-XBIF45WK.js} +2 -2
- package/dist/{chunk-DE7MA6OD.js → chunk-XYI7XRZC.js} +2 -2
- package/dist/{chunk-7KCSELEV.js → chunk-YNLK3G63.js} +2 -2
- package/dist/{chunk-NNDYO2DX.js → chunk-YOCYR7KJ.js} +2 -2
- package/dist/chunk-YZA6PPZL.js +3 -0
- package/dist/{chunk-5UDFZC4D.js → chunk-ZUTV7DDX.js} +2 -2
- package/dist/cli.js +274 -237
- package/dist/{config-types-Bj4sh28g.d.ts → config-types-BDIWAYzr.d.ts} +13 -1
- package/dist/{db-CTarohbZ.d.ts → db-BAVwb4Pb.d.ts} +1 -1
- package/dist/{health-Bx0x1HAG.d.ts → health-B17sVFYf.d.ts} +6 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +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/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 +8 -5
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +7 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/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 +5 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +3 -3
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +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 +5 -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 +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/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 +11 -11
- package/dist/reindex.d.ts +11 -2
- package/dist/reindex.js +22 -22
- package/dist/runtime.d.ts +17 -20
- package/dist/runtime.js +2 -2
- package/dist/scip-cli-CnK9Va4O.d.ts +56 -0
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/COMMAND_REFERENCE.md +3 -2
- package/docs/analyzer-inventory.md +2 -2
- package/docs/analyzer-validation-ledger.md +2 -2
- package/package.json +1 -1
- package/skills/concrete-plan/SKILL.md +2 -2
- package/skills/scip-adoption/SKILL.md +4 -2
- package/skills/scip-ai-cleanup/SKILL.md +1 -1
- package/skills/scip-api-impact/SKILL.md +6 -2
- package/skills/scip-debloat/SKILL.md +1 -1
- package/skills/scip-debug/SKILL.md +6 -2
- package/skills/scip-diagram/SKILL.md +3 -1
- package/skills/scip-directory-architecture/SKILL.md +7 -3
- package/skills/scip-doc-reconcile/SKILL.md +3 -1
- package/skills/scip-explore/SKILL.md +2 -2
- package/skills/scip-health-audit/SKILL.md +6 -2
- package/skills/scip-health-improve/SKILL.md +6 -2
- package/skills/scip-maintainability/SKILL.md +6 -3
- package/skills/scip-query/SKILL.md +10 -6
- package/skills/scip-query-setup/SKILL.md +10 -5
- package/skills/scip-react-maintainability/SKILL.md +7 -2
- package/skills/scip-triage-issue/SKILL.md +4 -2
- package/skills/scip-verify/SKILL.md +5 -3
- package/skills/scip-vue-maintainability/SKILL.md +7 -2
- package/dist/chunk-237YUOPK.js +0 -8
- package/dist/chunk-3UVJJ6Z7.js +0 -2
- package/dist/chunk-3ZYF3ELZ.js +0 -2
- package/dist/chunk-7JOTOWZO.js +0 -4
- package/dist/chunk-A3VNUGKJ.js +0 -2
- package/dist/chunk-A4L36SZS.js +0 -22
- package/dist/chunk-A7RNHUJH.js +0 -20
- package/dist/chunk-AYYIZ4BA.js +0 -4
- package/dist/chunk-BKDXBJDQ.js +0 -2
- package/dist/chunk-C3MZZ2ZN.js +0 -2
- package/dist/chunk-CRU42NJU.js +0 -2
- package/dist/chunk-ERHOS6AW.js +0 -2
- package/dist/chunk-FOQHUKNZ.js +0 -4
- package/dist/chunk-FUPDW5AC.js +0 -3
- package/dist/chunk-G3WGZU5Q.js +0 -2
- package/dist/chunk-HVTYSC26.js +0 -40
- package/dist/chunk-KPHKX4LP.js +0 -71
- package/dist/chunk-MA7OVFHI.js +0 -2
- package/dist/chunk-OBBDKQAG.js +0 -3
- package/dist/chunk-RHTJBYZ5.js +0 -2
- package/dist/chunk-UQJGTVHV.js +0 -5
- package/dist/chunk-ZFMPHDAT.js +0 -4
- package/dist/scip-cli-Bh1M_JPu.d.ts +0 -20
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-BAVwb4Pb.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BDIWAYzr.js';
|
|
4
4
|
|
|
5
5
|
type StaleAbstractionActionTier = 'direct' | 'signal';
|
|
6
6
|
type StalenessKind = 'unused-abstraction' | 'misplaced-single-consumer-type' | 'single-consumer-abstraction' | 'one-to-one-class-encapsulation';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-EOUTP32Q.js";import"../chunk-FXI3AAKO.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-LONIY5FF.js";import"../chunk-MJXJ56LG.js";import"../chunk-BGBBVSH4.js";import"../chunk-MFWAZFYD.js";import"../chunk-XAYARHNF.js";import"../chunk-W2TIXAGN.js";import"../chunk-U73YFD3P.js";import"../chunk-733EF5FD.js";import"../chunk-RISLKTKQ.js";import"../chunk-G2CGUNQU.js";import"../chunk-3LQFMQPY.js";import"../chunk-TJXOD4IK.js";import"../chunk-JM72FNGA.js";import"../chunk-OZUJ3VZS.js";import"../chunk-YZA6PPZL.js";import"../chunk-5MHQI4RR.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.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-BAVwb4Pb.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BDIWAYzr.js';
|
|
4
4
|
|
|
5
5
|
interface StatsResult {
|
|
6
6
|
documents: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-BAVwb4Pb.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BDIWAYzr.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-WVRTGVHJ.js";import"../chunk-KT2ZO3CE.js";import"../chunk-LONIY5FF.js";import"../chunk-MJXJ56LG.js";import"../chunk-BGBBVSH4.js";import"../chunk-MFWAZFYD.js";import"../chunk-XAYARHNF.js";import"../chunk-W2TIXAGN.js";import"../chunk-U73YFD3P.js";import"../chunk-733EF5FD.js";import"../chunk-RISLKTKQ.js";import"../chunk-G2CGUNQU.js";import"../chunk-3LQFMQPY.js";import"../chunk-TJXOD4IK.js";import"../chunk-JM72FNGA.js";import"../chunk-OZUJ3VZS.js";import"../chunk-YZA6PPZL.js";import"../chunk-5MHQI4RR.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.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-BAVwb4Pb.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BDIWAYzr.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-3C4NIBY5.js";import"../chunk-KT2ZO3CE.js";import"../chunk-733EF5FD.js";import"../chunk-TJXOD4IK.js";import"../chunk-JM72FNGA.js";import"../chunk-OZUJ3VZS.js";import"../chunk-YZA6PPZL.js";import"../chunk-5MHQI4RR.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.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-BAVwb4Pb.js';
|
|
2
2
|
import { SymbolResult } from './symbols.js';
|
|
3
3
|
import 'better-sqlite3';
|
|
4
|
-
import '../config-types-
|
|
4
|
+
import '../config-types-BDIWAYzr.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-OT6CDRKC.js";import"../chunk-KT2ZO3CE.js";import"../chunk-733EF5FD.js";import"../chunk-TJXOD4IK.js";import"../chunk-JM72FNGA.js";import"../chunk-OZUJ3VZS.js";import"../chunk-YZA6PPZL.js";import"../chunk-5MHQI4RR.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.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-BAVwb4Pb.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BDIWAYzr.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-72QDTW5U.js";import"../chunk-W2TIXAGN.js";import"../chunk-U73YFD3P.js";import"../chunk-733EF5FD.js";import"../chunk-G2CGUNQU.js";import"../chunk-3LQFMQPY.js";import"../chunk-TJXOD4IK.js";import"../chunk-JM72FNGA.js";import"../chunk-OZUJ3VZS.js";import"../chunk-YZA6PPZL.js";import"../chunk-5MHQI4RR.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as trace};
|
|
2
2
|
//# sourceMappingURL=trace.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-OMGE3V2Q.js";import"../chunk-KT2ZO3CE.js";import"../chunk-U73YFD3P.js";import"../chunk-733EF5FD.js";import"../chunk-G2CGUNQU.js";import"../chunk-3LQFMQPY.js";import"../chunk-TJXOD4IK.js";import"../chunk-JM72FNGA.js";import"../chunk-OZUJ3VZS.js";import"../chunk-YZA6PPZL.js";import"../chunk-5MHQI4RR.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as importedBy,a as imports,c as unusedImports};
|
|
2
2
|
//# sourceMappingURL=unused-imports.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-BAVwb4Pb.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BDIWAYzr.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-YOCYR7KJ.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-LONIY5FF.js";import"../chunk-MJXJ56LG.js";import"../chunk-BGBBVSH4.js";import"../chunk-MFWAZFYD.js";import"../chunk-XAYARHNF.js";import"../chunk-W2TIXAGN.js";import"../chunk-U73YFD3P.js";import"../chunk-733EF5FD.js";import"../chunk-RISLKTKQ.js";import"../chunk-G2CGUNQU.js";import"../chunk-3LQFMQPY.js";import"../chunk-TJXOD4IK.js";import"../chunk-JM72FNGA.js";import"../chunk-OZUJ3VZS.js";import"../chunk-YZA6PPZL.js";import"../chunk-5MHQI4RR.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as unusedParams};
|
|
2
2
|
//# sourceMappingURL=unused-params.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-BAVwb4Pb.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BDIWAYzr.js';
|
|
4
4
|
|
|
5
5
|
interface VueComponentDuplicateResult {
|
|
6
6
|
fileA: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-CQEJU32R.js";import"../chunk-FXWV2V7K.js";import"../chunk-PVZMPG5I.js";import"../chunk-HDBQHJNY.js";import"../chunk-YZA6PPZL.js";import"../chunk-DS6QEB3G.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComponentDuplicates};
|
|
2
2
|
//# sourceMappingURL=vue-component-duplicates.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-BAVwb4Pb.js';
|
|
2
2
|
import { F as FrontendBehaviorActionTier, a as FrontendBehaviorEvidenceClass } from '../frontend-behavior-evidence-BxKpKWUu.js';
|
|
3
3
|
import 'better-sqlite3';
|
|
4
|
-
import '../config-types-
|
|
4
|
+
import '../config-types-BDIWAYzr.js';
|
|
5
5
|
|
|
6
6
|
type VueComposableEvidenceClass = FrontendBehaviorEvidenceClass;
|
|
7
7
|
type VueComposableActionTier = FrontendBehaviorActionTier;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-ZUTV7DDX.js";import"../chunk-FXWV2V7K.js";import"../chunk-PVZMPG5I.js";import"../chunk-HDBQHJNY.js";import"../chunk-YZA6PPZL.js";import"../chunk-DS6QEB3G.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueComposableCandidates};
|
|
2
2
|
//# sourceMappingURL=vue-composable-candidates.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-BAVwb4Pb.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BDIWAYzr.js';
|
|
4
4
|
|
|
5
5
|
type VueLargeViewPressureAxis = 'template' | 'script' | 'style' | 'external-script' | 'custom-block' | 'total';
|
|
6
6
|
type VueLargeViewContextKind = 'component' | 'route-page';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-FG4NT6VY.js";import"../chunk-YZA6PPZL.js";import"../chunk-DS6QEB3G.js";import"../chunk-A536TEU4.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as vueLargeViewPressure};
|
|
2
2
|
//# sourceMappingURL=vue-large-view-pressure.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ScipDatabase } from '../db-
|
|
1
|
+
import { S as ScipDatabase } from '../db-BAVwb4Pb.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BDIWAYzr.js';
|
|
4
4
|
|
|
5
5
|
type WrapperActionTier = 'direct' | 'signal';
|
|
6
6
|
interface WrapperCandidate {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-QVS4SYAX.js";import"../chunk-FXI3AAKO.js";import"../chunk-LM5SHAN4.js";import"../chunk-PFOCOG57.js";import"../chunk-B75HZHUP.js";import"../chunk-LONIY5FF.js";import"../chunk-MJXJ56LG.js";import"../chunk-BGBBVSH4.js";import"../chunk-MFWAZFYD.js";import"../chunk-XAYARHNF.js";import"../chunk-W2TIXAGN.js";import"../chunk-U73YFD3P.js";import"../chunk-733EF5FD.js";import"../chunk-RISLKTKQ.js";import"../chunk-G2CGUNQU.js";import"../chunk-3LQFMQPY.js";import"../chunk-TJXOD4IK.js";import"../chunk-JM72FNGA.js";import"../chunk-OZUJ3VZS.js";import"../chunk-YZA6PPZL.js";import"../chunk-5MHQI4RR.js";import"../chunk-DS6QEB3G.js";import"../chunk-C6ROZBJA.js";import"../chunk-A536TEU4.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 a=W(r).toLowerCase();a&&t.add(a)}return t}catch{return null}}function De(e,n){return n?.length?n.some(t=>e.has(t)):!1}function T(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as J,readdirSync as Oe}from"fs";import{join as k}from"path";var Le={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",G(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",G(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=k(e,"vendor","bin","scip-php"),r=k(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",J(r)?r:J(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function D(e){return Le[e]}function G(e,n){let t;try{t=Oe(e)}catch{return null}for(let r of t)if(n.some(a=>r.endsWith(a)))return k(e,r);return null}import{readFileSync as Ce,writeFileSync as je}from"fs";import{create as O}from"@bufbuild/protobuf";import{deserializeSCIP as we,serializeSCIP as Ee,DocumentSchema as $e,IndexSchema as Be,SymbolInformationSchema as Fe}from"@c4312/scip";function Me(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let n=Ne(e),t=Ae(e.flatMap(a=>a.documents??[])),r=X(e.flatMap(a=>a.externalSymbols??[]));return O(Be,{metadata:n,documents:t,externalSymbols:r})}function H(e,n){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let t=e.map(a=>we(Ce(a))),r=Me(t);return je(n,Buffer.from(Ee(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function Ne(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 Ae(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,O($e,{language:r.language||t.language,relativePath:r.relativePath||t.relativePath,occurrences:[...r.occurrences,...t.occurrences],symbols:X([...r.symbols,...t.symbols]),text:Te(r.text,t.text),positionEncoding:r.positionEncoding||t.positionEncoding}))}return[...n.values()]}function X(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,O(Fe,{symbol:r.symbol,documentation:Ue([...r.documentation,...t.documentation]),relationships:_e([...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 _e(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 Te(e,n){return e?n?e.length>=n.length?e:n:e:n}function Ue(e){return[...new Set(e)]}import{readFileSync as We,writeFileSync as qe}from"fs";import{create as Q}from"@bufbuild/protobuf";import{deserializeSCIP as ze,DocumentSchema as Je,IndexSchema as Ge,serializeSCIP as He,SymbolRole as Xe}from"@c4312/scip";function K(e){let n;try{n=ze(We(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let t=Qe(n);return t.removedDefinitionOccurrences>0&&qe(e,Buffer.from(He(t.index))),{removedDefinitionOccurrences:t.removedDefinitionOccurrences,touchedDocuments:t.touchedDocuments}}function Qe(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&Xe.Definition)===0||n.has(o.symbol)?!0:(t+=1,!1));if(s.length===i.occurrences.length){a.push(i);continue}r+=1,a.push(Q(Je,{language:i.language,relativePath:i.relativePath,occurrences:s,symbols:i.symbols,text:i.text,positionEncoding:i.positionEncoding}))}return{index:t===0?e:Q(Ge,{metadata:e.metadata,documents:a,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:t,touchedDocuments:r}}import{execFile as Ke}from"child_process";import{existsSync as x,renameSync as C,rmSync as j}from"fs";import{cpus as Ve}from"os";import{join as V}from"path";function Ye(e,n,t){if(!e.defaultOutputPath)return;let r=V(n,e.defaultOutputPath);t!==r&&x(r)&&C(r,t)}function Ze(e,n,t){if(!e.defaultOutputPath)return null;let r=V(n,e.defaultOutputPath);if(r===t)return null;let a=`${t}.default-output-backup`;return j(a,{force:!0}),x(r)?(C(r,a),{defaultOutputPath:r,backupPath:a}):{defaultOutputPath:r,backupPath:null}}function en(e){e&&(j(e.defaultOutputPath,{force:!0}),e.backupPath&&x(e.backupPath)&&C(e.backupPath,e.defaultOutputPath))}function nn(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,Ve().length-1));return Math.max(1,Math.min(e,Math.floor(r)))}async function Y(e,n,t,r){let a=e.filter(u=>u.config.defaultOutputPath),i=e.filter(u=>!u.config.defaultOutputPath),s=[],o=nn(i.length,r),p=await rn(i,o,u=>L(u,n,t));if(o>1){let u=new Map;for(let c of p.filter(l=>l.skipped)){let l=i.find(f=>f.language===c.language);l&&(t(`Retrying ${l.language} indexer serially after parallel failure...`),u.set(l.language,await L(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 L(u,n,t));return s.sort((u,c)=>e.findIndex(l=>l.language===u.language)-e.findIndex(l=>l.language===c.language))}async function L(e,n,t){t(`Indexing ${e.language} with ${e.resolvedBinary}...`),j(e.scipPath,{force:!0});let r=Ze(e.config,n,e.scipPath);try{await tn(e.binary,e.args,{cwd:n,env:e.env,maxBuffer:50*1024*1024}),Ye(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
|
|
4
|
-
Install from: https://github.com/sourcegraph/scip/releases`);if(
|
|
5
|
-
Install manually from: https://github.com/sourcegraph/scip/releases`)}}function
|
|
1
|
+
import{a as w,b as L}from"./chunk-W2CBNBEL.js";import{a as b,b as k,f as z}from"./chunk-ONPCQ2PM.js";import{execFileSync as Jt}from"child_process";import{closeSync as qt,copyFileSync as zt,existsSync as I,mkdirSync as U,mkdtempSync as Gt,openSync as Xt,readFileSync as j,renameSync as h,rmSync as y,writeFileSync as he}from"fs";import{basename as R,dirname as g,extname as Ht,join as f}from"path";import{execFileSync as Ce}from"child_process";import{existsSync as Ee,readdirSync as X}from"fs";import{extname as H,join as K}from"path";var $e=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),Ne=[{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 t=[],n=Fe(e),r=_e(e);for(let i of Ne){if(Ae(e,i.files)){t.push(i.language);continue}if(Te(n,i.globs)){t.push(i.language);continue}Ue(r,i.extensions)&&t.push(i.language)}return t.includes("typescript")&&G(t,"javascript"),t.includes("cpp")&&!r.has(".c")&&G(t,"c"),t}function Fe(e){try{return X(e)}catch{return[]}}function Ae(e,t){return t?.length?t.some(n=>Ee(K(e,n))):!1}function Te(e,t){return t?.length?e.some(n=>t.some(r=>Be(n,r))):!1}function Be(e,t){if(t==="*")return!0;if(!t.includes("*"))return e===t;let[n,r]=t.split("*");return e.startsWith(n??"")&&e.endsWith(r??"")}function _e(e){let t=We(e);if(t)return t;let n=new Set,r=[e];for(;r.length>0;){let i=r.pop();if(!i)continue;let a;try{a=X(i,{withFileTypes:!0})}catch{continue}for(let s of a){if(s.name.startsWith(".")&&!s.name.endsWith("proj")&&!s.name.endsWith("sln")&&s.isDirectory())continue;let o=K(i,s.name);if(s.isDirectory()){$e.has(s.name)||r.push(o);continue}let c=H(s.name).toLowerCase();c&&n.add(c)}}return n}function We(e){try{let t=Ce("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),n=new Set;for(let r of t.split(`
|
|
2
|
+
`)){if(!r)continue;let i=H(r).toLowerCase();i&&n.add(i)}return n}catch{return null}}function Ue(e,t){return t?.length?t.some(n=>e.has(n)):!1}function G(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}import{existsSync as Y,readdirSync as Je}from"fs";import{join as M}from"path";var qe={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:t,indexerBinary:n,projectPath:r})=>{let i=r?["index","--output",e,"--no-progress-bar",r]:["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return t&&!r&&i.splice(1,0,"--pnpm-workspaces"),{binary:n,args:i}},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:t})=>({binary:t,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:t})=>({binary:t,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:t})=>({binary:"scip-dotnet",args:["index",V(e,[".sln",".csproj"])??e,"--output",t,"--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:t})=>({binary:"scip-dotnet",args:["index",V(e,[".sln",".vbproj"])??e,"--output",t,"--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:t})=>({binary:e,args:["--output",t]}),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:t})=>{let n=M(e,"vendor","bin","scip-php"),r=M(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",Y(r)?r:Y(n)?n:t]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function D(e){return qe[e]}function V(e,t){let n;try{n=Je(e)}catch{return null}for(let r of t)for(let i of n)if(i.endsWith(r))return M(e,i);return null}import{readFileSync as ze,writeFileSync as Ge}from"fs";import{create as O}from"@bufbuild/protobuf";import{deserializeSCIP as Xe,serializeSCIP as He,DocumentSchema as Ke,IndexSchema as Qe,SymbolInformationSchema as Ye}from"@c4312/scip";function Ve(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let t=Ze(e),n=et(e.flatMap(i=>i.documents??[])),r=Z(e.flatMap(i=>i.externalSymbols??[]));return O(Qe,{metadata:t,documents:n,externalSymbols:r})}function C(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let n=e.map(i=>Xe(ze(i))),r=Ve(n);return Ge(t,Buffer.from(He(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function Ze(e){let t=e[0]?.metadata;if(!t)return;let n=t.projectRoot;for(let r of e.slice(1)){let i=r.metadata?.projectRoot;if(n&&i&&i!==n)throw new Error(`Cannot merge SCIP indexes with different project roots: ${n} vs ${i}`)}return t}function et(e){let t=new Map;for(let n of e){let r=t.get(n.relativePath);if(!r){t.set(n.relativePath,n);continue}t.set(n.relativePath,O(Ke,{language:r.language||n.language,relativePath:r.relativePath||n.relativePath,occurrences:tt([...r.occurrences,...n.occurrences]),symbols:Z([...r.symbols,...n.symbols]),text:rt(r.text,n.text),positionEncoding:r.positionEncoding||n.positionEncoding}))}return[...t.values()]}function tt(e){let t=new Set,n=[];for(let r of e){let i=JSON.stringify(r);t.has(i)||(t.add(i),n.push(r))}return n}function Z(e){let t=new Map;for(let n of e){let r=t.get(n.symbol);if(!r){t.set(n.symbol,n);continue}t.set(n.symbol,O(Ye,{symbol:r.symbol,documentation:it([...r.documentation,...n.documentation]),relationships:nt([...r.relationships,...n.relationships]),kind:r.kind||n.kind,displayName:r.displayName||n.displayName,enclosingSymbol:r.enclosingSymbol||n.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??n.signatureDocumentation}))}return[...t.values()]}function nt(e){let t=new Set,n=[];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("|");t.has(i)||(t.add(i),n.push(r))}return n}function rt(e,t){return e?t?e.length>=t.length?e:t:e:t}function it(e){return[...new Set(e)]}import{readFileSync as at,writeFileSync as st}from"fs";import{create as ee}from"@bufbuild/protobuf";import{deserializeSCIP as ot,DocumentSchema as ut,IndexSchema as ct,serializeSCIP as pt,SymbolRole as lt}from"@c4312/scip";function te(e){let t;try{t=ot(at(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let n=gt(t);return n.removedDefinitionOccurrences>0&&st(e,Buffer.from(pt(n.index))),{removedDefinitionOccurrences:n.removedDefinitionOccurrences,touchedDocuments:n.touchedDocuments}}function gt(e){let t=new Set;for(let a of e.documents)for(let s of a.symbols)s.symbol&&t.add(s.symbol);for(let a of e.externalSymbols)a.symbol&&t.add(a.symbol);let n=0,r=0,i=[];for(let a of e.documents){let s=a.occurrences.filter(o=>(o.symbolRoles<.Definition)===0||t.has(o.symbol)?!0:(n+=1,!1));if(s.length===a.occurrences.length){i.push(a);continue}r+=1,i.push(ee(ut,{language:a.language,relativePath:a.relativePath,occurrences:s,symbols:a.symbols,text:a.text,positionEncoding:a.positionEncoding}))}return{index:n===0?e:ee(ct,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:n,touchedDocuments:r}}import{existsSync as dt,readFileSync as ft,readdirSync as mt,statSync as ht}from"fs";import l from"path";var yt=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function ne(e,t=[]){let n=l.resolve(e),r=xt(n),i=t.flatMap(c=>bt(n,c)),a=Pt([...r,...i]),s=vt(n,a)?[n,...a]:a,o=s.length>0?s:[n];return[...new Set(o.map(c=>It(n,c)))].sort((c,u)=>c.localeCompare(u))}function xt(e){let t=[],n=[e];for(;n.length>0;){let r=n.pop(),i;try{i=mt(r,{withFileTypes:!0})}catch{continue}for(let a of i){let s=l.join(r,a.name);if(a.isDirectory()){!yt.has(a.name)&&!a.name.startsWith(".")&&n.push(s);continue}a.isFile()&&St(s)&&t.push(l.dirname(s))}}return t}function bt(e,t){let n=t.trim();if(!n)return[];let r=l.resolve(e,n);if(!kt(e,r))return[];try{let i=ht(r);if(i.isDirectory())return[r];if(i.isFile()&&re(l.basename(r)))return[l.dirname(r)]}catch{return[]}return[]}function St(e){if(!re(l.basename(e)))return!1;let t=ie(e);return t?l.basename(e)==="tsconfig.json"||"include"in t||"files"in t||"references"in t:!1}function re(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Pt(e){let t=[...new Set(e.map(n=>l.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&jt(n,r)))}function vt(e,t){if(t.length===0||t.some(r=>l.resolve(r)===e))return!1;let n=l.join(e,"tsconfig.json");return dt(n)&&Rt(n)}function Rt(e){let n=ie(e)?.include;return Array.isArray(n)?n.some(r=>typeof r=="string"&&r.trim()!==""&&!r.startsWith("!")&&(r.includes("/")||r.includes("**")||!l.extname(r))):!1}function ie(e){try{let t=JSON.parse(ft(e,"utf-8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function It(e,t){let n=l.relative(e,t);return n?n.split(l.sep).join("/"):"."}function jt(e,t){let n=l.relative(e,t);return!!n&&!n.startsWith("..")&&!l.isAbsolute(n)}function kt(e,t){let n=l.relative(e,t);return!n.startsWith("..")&&!l.isAbsolute(n)}import{execFile as wt}from"child_process";import{existsSync as S,renameSync as $,rmSync as N}from"fs";import{cpus as Lt}from"os";import{join as ae}from"path";function Mt(e,t,n){if(!e.defaultOutputPath)return;let r=ae(t,e.defaultOutputPath);n!==r&&S(r)&&$(r,n)}function Dt(e,t,n){if(!e.defaultOutputPath)return null;let r=ae(t,e.defaultOutputPath);if(r===n)return null;let i=`${n}.default-output-backup`;return N(i,{force:!0}),S(r)?($(r,i),{defaultOutputPath:r,backupPath:i}):{defaultOutputPath:r,backupPath:null}}function Ot(e){e&&(N(e.defaultOutputPath,{force:!0}),e.backupPath&&S(e.backupPath)&&$(e.backupPath,e.defaultOutputPath))}function Ct(e,t){if(e<=1)return 1;let n=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(t)&&t&&t>0?t:Number.isFinite(n)&&n>0?n:Math.min(8,Math.max(1,Lt().length));return Math.max(1,Math.min(e,Math.floor(r)))}async function se(e,t,n,r){let i=e.filter(u=>u.config.defaultOutputPath),a=e.filter(u=>!u.config.defaultOutputPath),s=[],o=Ct(a.length,r),c=await $t(a,o,u=>E(u,t,n));if(o>1){let u=new Map;for(let d of c.filter(p=>p.skipped)){let p=a.find(x=>x.id===d.id);p&&(n(`Retrying ${p.label} indexer serially after parallel failure...`),u.set(p.id,await E(p,t,n)))}s.push(...c.map(d=>u.get(d.id)??d))}else s.push(...c);for(let u of i)s.push(await E(u,t,n));return s.sort((u,d)=>e.findIndex(p=>p.id===u.id)-e.findIndex(p=>p.id===d.id))}async function E(e,t,n){n(`Indexing ${e.label} with ${e.resolvedBinary}...`),N(e.scipPath,{force:!0});let r=Dt(e.config,t,e.scipPath);try{await Et(e.binary,e.args,{cwd:t,env:e.env,maxBuffer:50*1024*1024}),Mt(e.config,t,e.scipPath)}catch(i){let a=i instanceof Error?i.message:String(i),s=`${e.resolvedBinary} indexer failed: ${a.split(`
|
|
3
|
+
`)[0]}`,o=e.label===e.language?s:`${e.label}: ${s}`;return n(`Skipping ${e.label}: ${s}`),{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,skipped:{language:e.language,reason:o}}}finally{Ot(r)}if(!S(e.scipPath)){let i=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`,a=e.label===e.language?i:`${e.label}: ${i}`;return n(`Skipping ${e.label}: ${i}`),{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,skipped:{language:e.language,reason:a}}}return{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath}}function Et(e,t,n){return new Promise((r,i)=>{wt(e,[...t],n,a=>{a?i(a):r()})})}async function $t(e,t,n){if(e.length===0)return[];let r=new Array(e.length),i=0,a=Math.max(1,Math.min(e.length,t)),s=Array.from({length:a},async()=>{for(;i<e.length;){let o=i++;r[o]=await n(e[o])}});return await Promise.all(s),r}import{execFileSync as A}from"child_process";import{existsSync as F,readFileSync as Nt}from"fs";import{createRequire as Ft}from"module";import{platform as At}from"os";import{dirname as oe,join as P}from"path";var Tt=Ft(import.meta.url);function T(e){return[e.indexerBinary,...e.binaryAliases??[]]}function B(e){let t=T(e);return t.length===1?t[0]:t.join(" or ")}function v(e){for(let t of T(e))if(b(t))return t;return _t(e)}function ue(e){return v(e)!==null||Bt(e)}function Bt(e){return ce(e)!==null}function _t(e){let t=ce(e);if(!t)return null;let r=JSON.parse(Nt(t,"utf8")).bin;if(!r)return null;if(typeof r=="string")return P(oe(t),r);for(let i of T(e)){let a=r[i];if(a)return P(oe(t),a)}return null}function ce(e){if(!e.bundledNpmPackage)return null;try{return Tt.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function pe(e,t){for(let n of e.projectLocalBinaries??[]){let r=P(t,n);if(F(r))return r}return null}function le(e,t=process.env,n=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||de(n,t))return t;let r=Wt(n,t);return r?{...t,DOTNET_ROOT:r}:t}function ge(e,t){let n=e.installMethods,r=B(e);if(!n?.length)return t(`No auto-install method available for ${r}.`),e.installUrl&&t(`Install manually from: ${e.installUrl}`),!1;for(let i of n)if(b(i.prerequisite)){t(`Installing ${r} via ${i.label}...`);try{A(i.binary,i.args,{stdio:"inherit",timeout:3e5,env:process.env});let a=v(e);if(a){let s=a===e.indexerBinary?"":` (using ${a})`;return t(`Successfully installed ${r} via ${i.label}${s}`),!0}t(`${i.label} command completed but ${r} was not found on PATH`)}catch(a){let s=a instanceof Error?a.message:String(a);t(`${i.label} install failed: ${s}`)}}return t(`Could not auto-install ${r}.`),e.installUrl&&t(`Install manually from: ${e.installUrl}`),!1}function Wt(e,t){for(let n of Ut(t))if(de(e,{...t,DOTNET_ROOT:n}))return n;return null}function Ut(e){let t=[],n=e.DOTNET_ROOT;if(n&&F(n)&&t.push(n),At()==="darwin"&&b("brew"))try{let r=A("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),i=P(r,"libexec");F(i)&&!t.includes(i)&&t.push(i)}catch{}return t}function de(e,t){try{return A(e,["--version"],{stdio:"pipe",env:t}),!0}catch{return!1}}async function ye(e){let{projectRoot:t,maxHeapMb:n=8192,onStatus:r=console.log,skipAutoInstall:i=!1}=e,a=Kt(e),s=Date.now();U(g(a.outputScip),{recursive:!0}),U(g(a.outputDb),{recursive:!0});let o=e.languages??Q(t);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 c=bn(t,o,{pnpmWorkspaces:e.pnpmWorkspaces,typescriptProjectMode:e.typescriptProjectMode,typescriptProjects:e.typescriptProjects}),u=await ln(f(g(a.outputDb),"index.lock"),{projectRoot:t,trigger:e.trigger,onStatus:r}),d=null;try{let p=Qt({opts:e,paths:a,languages:o,fingerprint:c,start:s,onStatus:r});if(p)return p;rn(i,r);let x=Yt(a);return d=x.runDir,await Vt({opts:e,languages:o,projectRoot:t,paths:a,tempPaths:x,fingerprint:c,start:s,maxHeapMb:n,skipAutoInstall:i,onStatus:r})}catch(p){throw je(a.metaPath,q({trigger:e.trigger,result:"failed",start:s,error:p instanceof Error?p.message:String(p)})),p}finally{d&&y(d,{recursive:!0,force:!0}),u()}}function Kt(e){let t=e.outputScip??f(e.projectRoot,"index.scip"),n=e.outputDb??f(e.projectRoot,"index.db");return{outputScip:t,outputDb:n,metaPath:f(g(n),"meta.json")}}function Qt(e){if(e.opts.skipIfUnchanged===!1||!I(e.paths.outputScip)||!I(e.paths.outputDb)||!Sn(e.paths.metaPath,e.fingerprint))return null;w({projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let t=Date.now()-e.start,n=q({trigger:e.opts.trigger,result:"reused",start:e.start,languages:e.languages,skipped:[]});return je(e.paths.metaPath,n),e.onStatus(`Index unchanged; reused existing SQLite index in ${(t/1e3).toFixed(1)}s`),{languages:e.languages,indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:t,reused:!0,skipped:[],lastRefresh:n}}function Yt(e){let t=Gt(f(g(e.outputDb),"reindex-"));return{runDir:t,tempOutputScip:f(t,R(e.outputScip)),tempOutputDb:f(t,R(e.outputDb)),tempMetaPath:f(t,R(e.metaPath))}}async function Vt(e){let t={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:n,skippedLanguages:r,reusedLanguages:i}=await Zt(e,t);i.length>0&&e.onStatus(`Reused ${i.length} cached language shard(s): ${i.join(", ")}`);let a=en(e,t,n,r),s=a.durationMs;return e.onStatus(`Done in ${(s/1e3).toFixed(1)}s`),{languages:n.map(o=>o.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:s,reused:!1,skipped:r,lastRefresh:a}}async function Zt(e,t){let n=tn(e),r=new Set(n.map(u=>u.language));for(let u of r)e.onStatus(`Reusing cached ${u} SCIP shard (language inputs unchanged).`);let{preparedRuns:i,skippedLanguages:a}=an({languages:e.languages.filter(u=>!r.has(u)),tempOutputScip:e.tempPaths.tempOutputScip,projectRoot:e.projectRoot,env:t,skipAutoInstall:e.skipAutoInstall,pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects,onStatus:e.onStatus}),s=await se(i,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:o}=on(s,a),c=[...n,...o];return un(c,a,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:c,skippedLanguages:a,reusedLanguages:[...r]}}function en(e,t,n,r){nn(e.paths.outputDb,n),cn(n,e.tempPaths.tempOutputScip,e.onStatus),pn(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,t,e.onStatus),w({projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus});let i=q({trigger:e.opts.trigger,result:"rebuilt",start:e.start,languages:n.map(a=>a.language),skipped:[...r]});return Ie(e.tempPaths.tempMetaPath,{version:3,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,languageFingerprints:Se(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects}),requestedLanguages:e.languages,indexedLanguages:n.map(a=>a.language),skipped:[...r],lastRefresh:i}),xn({tempOutputScip:e.tempPaths.tempOutputScip,tempOutputDb:e.tempPaths.tempOutputDb,tempMetaPath:e.tempPaths.tempMetaPath,outputScip:e.paths.outputScip,outputDb:e.paths.outputDb,metaPath:e.paths.metaPath}),i}function tn(e){let t;try{t=JSON.parse(j(e.paths.metaPath,"utf-8"))}catch{return[]}if(t.version!==3||!t.languageFingerprints)return[];let n=[],r=Se(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects});for(let i of e.languages){let a=Re(e.paths.outputDb,i);I(a)&&m(t.languageFingerprints[i])===m(r[i])&&n.push({language:i,scipPath:a})}return n}function nn(e,t){for(let n of t){let r=Re(e,n.language);U(g(r),{recursive:!0}),n.scipPath!==r&&zt(n.scipPath,r)}}function rn(e,t){if(!k()){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(t("scip CLI not found on PATH. Attempting auto-install..."),!z(t))throw new Error(`The scip CLI is required but could not be installed.
|
|
5
|
+
Install manually from: https://github.com/sourcegraph/scip/releases`)}}function an(e){let t=[],n=[],r=e.languages.map((i,a)=>({language:i,scipPath:e.languages.length>1?be(e.tempOutputScip,i,a):e.tempOutputScip}));for(let{language:i,scipPath:a}of r){let s=sn({...e,language:i,scipPath:a});for(let o of s)"skipped"in o?xe(n,o.skipped):t.push(o.prepared)}return{preparedRuns:t,skippedLanguages:n}}function sn(e){if(e.language!=="typescript"||e.typescriptProjectMode!=="workspace")return[_({...e,id:e.language,label:e.language,outputScipPath:e.scipPath})];let t=ne(e.projectRoot,e.typescriptProjects);return t.length===0?[_({...e,id:e.language,label:e.language,outputScipPath:e.scipPath})]:(e.onStatus(`Indexing TypeScript workspace as ${t.length} project shard(s).`),t.map((n,r)=>_({...e,id:`typescript:${n}`,label:`typescript (${n})`,scipPath:be(e.tempOutputScip,"typescript-project",r),outputScipPath:e.scipPath,pnpmWorkspaces:!1,projectPath:n})))}function _(e){let t=D(e.language),n=B(t),r=pe(t,e.projectRoot);if(!r&&!ue(t)){if(e.skipAutoInstall){let o=`${n} not found on PATH (auto-install disabled). ${t.installUrl??""}`.trim();return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}if(e.onStatus(`${n} not found. Attempting auto-install...`),!ge(t,e.onStatus)){let o=`${n} could not be auto-installed. ${t.installUrl?`Install manually from ${t.installUrl}`:`Install ${n} and put it on PATH.`}`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}}let i=r??v(t);if(!i){let o=`${n} was not found after installation checks.`;return e.onStatus(`Skipping ${e.language}: ${o}`),{skipped:{language:e.language,reason:o}}}let{binary:a,args:s}=t.indexArgs({projectRoot:e.projectRoot,outputPath:e.scipPath,pnpmWorkspaces:e.pnpmWorkspaces,indexerBinary:i,projectPath:e.projectPath});return{prepared:{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,config:t,resolvedBinary:i,binary:a,args:s,env:le(t,e.env,i)}}}function on(e,t){let n=new Map;for(let i of e)if(i.skipped)xe(t,i.skipped);else{let a=`${i.language}\0${i.outputScipPath}`,s=n.get(a)??{language:i.language,outputScipPath:i.outputScipPath,scipPaths:[]};s.scipPaths.push(i.scipPath),n.set(a,s)}let r=[];for(let i of n.values())if(i.scipPaths.length>1)C(i.scipPaths,i.outputScipPath),r.push({language:i.language,scipPath:i.outputScipPath});else{let a=i.scipPaths[0];a!==i.outputScipPath&&h(a,i.outputScipPath),r.push({language:i.language,scipPath:i.outputScipPath})}return{indexedOutputs:r}}function xe(e,t){let n=e.find(r=>r.language===t.language);if(!n){e.push(t);return}n.reason.includes(t.reason)||(n.reason=`${n.reason}; ${t.reason}`)}function un(e,t,n,r,i){if(e.length===0){let a=t.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
|
-
`+
|
|
9
|
-
`))}function
|
|
10
|
-
`),()=>{try{
|
|
11
|
-
`)}function m(e){return JSON.stringify(e)}var
|
|
12
|
-
`)}).then(()=>{process.exit(0)}).catch(e=>{console.error(`reindex-worker error: ${e}`),process.exit(1)});
|
|
7
|
+
`+a)}if(t.length!==0&&(i(`Indexed ${e.length} language output(s); skipped or incomplete: ${t.map(a=>a.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
|
+
`+t.map(a=>` - ${a.language}: ${a.reason}`).join(`
|
|
9
|
+
`))}function cn(e,t,n){e.length>1?(n(`Merging ${e.length} language indexes...`),C(e.map(r=>r.scipPath),t)):e[0].scipPath!==t&&h(e[0].scipPath,t)}function pn(e,t,n,r){if(r("Converting to SQLite..."),!I(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{let i=te(e);i.removedDefinitionOccurrences>0&&r(`Sanitized ${i.removedDefinitionOccurrences} invalid definition occurrences across ${i.touchedDocuments} documents before SQLite conversion.`);let a=k();if(!a)throw new Error("scip CLI is not available");Jt(a,["expt-convert","--output",t,e],{env:n,stdio:"pipe",maxBuffer:50*1024*1024})}catch(i){let a=i instanceof Error?i.message:String(i);throw new Error(`Failed to convert SCIP index to SQLite: ${a}`,{cause:i})}}function be(e,t,n){let r=Ht(e)||".scip",i=R(e,r);return f(g(e),`${i}.${n+1}.${t}${r}`)}async function ln(e,t){for(let n=0;n<2;n++){let r=gn(e,t);if(r)return r;let i=dn(e);if(i&&fn(t.trigger,i)){t.onStatus(`Manual reindex preempting watcher refresh started at ${i.startedAt}.`),await hn(i.pid),y(e,{force:!0});continue}if(i&&!J(i.pid)){y(e,{force:!0});continue}throw new Error(`Another scip-query reindex is already running for ${g(e)}.`)}throw new Error(`Could not acquire scip-query reindex lock for ${g(e)}.`)}function gn(e,t){let n;try{n=Xt(e,"wx")}catch(i){if((typeof i=="object"&&i&&"code"in i?i.code:void 0)==="EEXIST")return null;throw i}let r={version:1,pid:process.pid,projectRoot:t.projectRoot,startedAt:new Date().toISOString(),trigger:t.trigger};return he(n,JSON.stringify(r)+`
|
|
10
|
+
`),()=>{try{qt(n)}finally{y(e,{force:!0})}}}function dn(e){try{let t=JSON.parse(j(e,"utf-8"));return typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0?null:{version:1,pid:t.pid,projectRoot:typeof t.projectRoot=="string"?t.projectRoot:g(e),startedAt:typeof t.startedAt=="string"?t.startedAt:"unknown",trigger:t.trigger}}catch{return null}}function fn(e,t){return e?.kind==="manual-cli"&&mn(t?.trigger)}function mn(e){return e?.kind==="watch-source"||e?.kind==="watch-git-head"||e?.kind==="watch-git-index"||e?.kind==="watch-git-state"}async function hn(e){fe(e,"SIGTERM"),!await me(e,2e3)&&(fe(e,"SIGKILL"),await me(e,1e3))}function fe(e,t){try{process.kill(-e,t)}catch{try{process.kill(e,t)}catch{}}}async function me(e,t){let n=Date.now()+t;for(;Date.now()<n;){if(!J(e))return!0;await yn(50)}return!J(e)}function J(e){try{return process.kill(e,0),!0}catch{return!1}}function yn(e){return new Promise(t=>setTimeout(t,e))}function xn(e){W(e.tempOutputScip,e.outputScip),W(e.tempOutputDb,e.outputDb),W(e.tempMetaPath,e.metaPath)}function W(e,t){y(`${t}.tmp-replace`,{force:!0}),h(e,`${t}.tmp-replace`),h(`${t}.tmp-replace`,t)}function bn(e,t,n){return{version:2,languages:[...t].sort(),pnpmWorkspaces:ve(n),typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:Pe(n.typescriptProjects),files:L(e)}}function Se(e,t,n){return Object.fromEntries(t.map(r=>{let i=D(r).markerFiles,a=r==="typescript"?{typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:Pe(n.typescriptProjects)}:{typescriptProjectMode:"single",typescriptProjects:[]};return[r,{version:2,languages:[r],pnpmWorkspaces:r==="typescript"&&ve(n),...a,files:L(e,{language:r,markerFiles:i})}]}))}function Pe(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function ve(e){return e.typescriptProjectMode!=="workspace"&&e.pnpmWorkspaces===!0}function Re(e,t){return f(g(e),"language-indexes",`${t}.scip`)}function Sn(e,t){try{let n=JSON.parse(j(e,"utf-8"));return(n.version===2||n.version===3)&&n.status==="complete"&&m(n.fingerprint)===m(t)&&m([...n.indexedLanguages??[]].sort())===m(t.languages)}catch{return!1}}function Ie(e,t){let n=`${e}.tmp-${process.pid}-${Date.now()}`;he(n,`${JSON.stringify(t,null,2)}
|
|
11
|
+
`),h(n,e)}function je(e,t){try{let n=JSON.parse(j(e,"utf-8"));if(n.version!==2&&n.version!==3)return;Ie(e,{...n,lastRefresh:t})}catch{}}function q(e){return{trigger:e.trigger??{kind:"unknown"},result:e.result,startedAt:new Date(e.start).toISOString(),completedAt:new Date().toISOString(),durationMs:Date.now()-e.start,indexedLanguages:e.languages?[...e.languages]:void 0,skipped:e.skipped?[...e.skipped]:void 0,error:e.error}}function m(e){return JSON.stringify(e)}var Me=process.env.SCIP_REINDEX_PROJECT_ROOT,De=process.env.SCIP_REINDEX_OUTPUT_SCIP,Oe=process.env.SCIP_REINDEX_OUTPUT_DB,ke=process.env.SCIP_REINDEX_LANGUAGES,Pn=wn(process.env.SCIP_REINDEX_INDEXER_CONCURRENCY),vn=process.env.SCIP_REINDEX_PNPM_WORKSPACES==="1",we=kn(process.env.SCIP_REINDEX_TYPESCRIPT_CONFIG),Rn=jn(process.env.SCIP_REINDEX_TRIGGER_KIND),In=process.env.SCIP_REINDEX_TRIGGER_DETAIL;(!Me||!De||!Oe)&&(console.error("reindex-worker: missing required env vars"),process.exit(1));var Le=ke?ke.split(",").filter(Boolean):void 0;ye({projectRoot:Me,outputScip:De,outputDb:Oe,languages:Le?.length?Le:void 0,pnpmWorkspaces:vn,typescriptProjectMode:we.projectMode,typescriptProjects:we.projects,indexerConcurrency:Pn,trigger:{kind:Rn,detail:In||void 0},onStatus:e=>process.stderr.write(`[reindex] ${e}
|
|
12
|
+
`)}).then(()=>{process.exit(0)}).catch(e=>{console.error(`reindex-worker error: ${e}`),process.exit(1)});function jn(e){switch(e){case"manual-cli":case"setup":case"watch-source":case"watch-git-head":case"watch-git-index":case"watch-git-state":return e;default:return"unknown"}}function kn(e){if(!e)return{};try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};let n=t,r=n.projectMode==="single"||n.projectMode==="workspace"?n.projectMode:void 0,i=Array.isArray(n.projects)?n.projects.filter(a=>typeof a=="string"&&a.trim()!==""):void 0;return{projectMode:r,projects:i&&i.length>0?i:void 0}}catch{return{}}}function wn(e){if(!e)return;let t=Number(e);return Number.isInteger(t)&&t>0?t:void 0}
|
|
13
13
|
//# sourceMappingURL=reindex-worker.js.map
|
package/dist/reindex.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as SupportedLanguage, I as IndexerConfig } from './config-types-
|
|
1
|
+
import { a as SupportedLanguage, I as IndexerConfig, T as TypeScriptProjectMode } from './config-types-BDIWAYzr.js';
|
|
2
|
+
import { R as RefreshTrigger, L as LastRefreshMetadata } from './scip-cli-CnK9Va4O.js';
|
|
3
|
+
export { t as tryInstallScipCli } from './scip-cli-CnK9Va4O.js';
|
|
2
4
|
import { Index } from '@c4312/scip';
|
|
3
|
-
export { t as tryInstallScipCli } from './scip-cli-Bh1M_JPu.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Detect which languages are present in a project directory by checking for
|
|
@@ -118,6 +119,10 @@ interface ReindexOptions {
|
|
|
118
119
|
onStatus?: (message: string) => void;
|
|
119
120
|
/** Extra flags for pnpm-workspace-aware TS indexing */
|
|
120
121
|
pnpmWorkspaces?: boolean;
|
|
122
|
+
/** TypeScript indexing strategy (default: single inferred project). */
|
|
123
|
+
typescriptProjectMode?: TypeScriptProjectMode;
|
|
124
|
+
/** Explicit TypeScript project roots or tsconfig paths for workspace mode. */
|
|
125
|
+
typescriptProjects?: string[];
|
|
121
126
|
/** Skip auto-install prompts */
|
|
122
127
|
skipAutoInstall?: boolean;
|
|
123
128
|
/** Reuse an existing index when tracked source inputs are unchanged (default true). */
|
|
@@ -126,6 +131,8 @@ interface ReindexOptions {
|
|
|
126
131
|
allowPartial?: boolean;
|
|
127
132
|
/** Number of language indexers to run at once (default: conservative auto). */
|
|
128
133
|
indexerConcurrency?: number;
|
|
134
|
+
/** Source that requested this refresh, persisted for status and setup diagnostics. */
|
|
135
|
+
trigger?: RefreshTrigger;
|
|
129
136
|
}
|
|
130
137
|
interface ReindexResult {
|
|
131
138
|
/** Languages that were successfully indexed. */
|
|
@@ -143,6 +150,8 @@ interface ReindexResult {
|
|
|
143
150
|
language: SupportedLanguage;
|
|
144
151
|
reason: string;
|
|
145
152
|
}[];
|
|
153
|
+
/** Persisted description of this refresh attempt. */
|
|
154
|
+
lastRefresh?: LastRefreshMetadata;
|
|
146
155
|
}
|
|
147
156
|
/**
|
|
148
157
|
* Reindex a project: detect languages, run the appropriate SCIP indexer(s),
|