scip-query 0.10.11 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/{vendor/scip/LICENSE.scip → LICENSE} +1 -0
- package/README.md +168 -55
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-2VSDXOG5.js +2 -0
- package/dist/chunk-343O6EVV.js +2 -0
- package/dist/chunk-3KDUITBE.js +7 -0
- package/dist/chunk-3T2FNHIU.js +2 -0
- package/dist/chunk-3V6JQQM5.js +2 -0
- package/dist/chunk-5AAAEZ2Z.js +2 -0
- package/dist/chunk-6Q6OFLFQ.js +8 -0
- package/dist/chunk-6XA4LDHY.js +2 -0
- package/dist/chunk-75X52JTA.js +2 -0
- package/dist/{chunk-54KGX7EX.js → chunk-7HB3CZFD.js} +2 -2
- package/dist/chunk-7JZRFDCU.js +2 -0
- package/dist/chunk-7XL7J7PT.js +3 -0
- package/dist/chunk-ALHNAPS2.js +2 -0
- package/dist/{chunk-JATUZIEH.js → chunk-BDRBPG7Y.js} +2 -2
- package/dist/chunk-BN5SXXQS.js +40 -0
- package/dist/chunk-C4ICAIJ4.js +3 -0
- package/dist/{chunk-LSET2TXH.js → chunk-CMHYBXJB.js} +2 -2
- package/dist/{chunk-YWYFU2V3.js → chunk-DRPAQAFM.js} +6 -6
- package/dist/chunk-FERAXG6Y.js +72 -0
- package/dist/chunk-FLJJLSGB.js +2 -0
- package/dist/chunk-FXG3PHVW.js +9 -0
- package/dist/chunk-GCN2P4EJ.js +2 -0
- package/dist/chunk-GHXRVCIY.js +21 -0
- package/dist/chunk-GNG622H3.js +3 -0
- package/dist/chunk-H4LUPLEJ.js +2 -0
- package/dist/{chunk-BASVXNY3.js → chunk-H56MGERE.js} +4 -4
- package/dist/chunk-H7NSJ7L2.js +5 -0
- package/dist/chunk-HINMXZ6J.js +2 -0
- package/dist/chunk-HXXMPYEF.js +2 -0
- package/dist/{chunk-Z3YYR4OS.js → chunk-HZKMEXA3.js} +2 -2
- package/dist/chunk-IFSX6YVU.js +4 -0
- package/dist/chunk-ISLWJ4PY.js +10 -0
- package/dist/chunk-J5WVNZ6O.js +2 -0
- package/dist/chunk-K2HYR5A7.js +3 -0
- package/dist/chunk-K6UI6EBZ.js +2 -0
- package/dist/chunk-KJCDEDQW.js +2 -0
- package/dist/{chunk-Z4HICZGY.js → chunk-KKMOB3OJ.js} +2 -2
- package/dist/{chunk-YWOOQ4FF.js → chunk-KMVGRIO2.js} +2 -2
- package/dist/chunk-LWOOTRHC.js +2 -0
- package/dist/{chunk-EY43NV4M.js → chunk-LZNLRE4X.js} +17 -8
- package/dist/chunk-M2YXL62V.js +23 -0
- package/dist/chunk-MNEJYEHW.js +3 -0
- package/dist/chunk-MTDBHTSF.js +2 -0
- package/dist/{chunk-ZQDIXAF5.js → chunk-N2Z3CU7X.js} +2 -2
- package/dist/chunk-N7PNFLGY.js +2 -0
- package/dist/chunk-NAH5EAZS.js +6 -0
- package/dist/chunk-NBXK32I6.js +2 -0
- package/dist/chunk-NJJ7AS4F.js +2 -0
- package/dist/{chunk-FDEQIPPK.js → chunk-NLMRJ7SI.js} +2 -2
- package/dist/chunk-ODVITBYU.js +26 -0
- package/dist/chunk-ORBRX2QJ.js +2 -0
- package/dist/chunk-P36UR5II.js +2 -0
- package/dist/chunk-PYZZBIEU.js +3 -0
- package/dist/chunk-PZS6J5YG.js +16 -0
- package/dist/{chunk-LM5SHAN4.js → chunk-QARYU7R3.js} +2 -2
- package/dist/chunk-QJ3FK4TB.js +38 -0
- package/dist/chunk-QXGTGE2C.js +35 -0
- package/dist/chunk-QZ4JVECJ.js +2 -0
- package/dist/chunk-R3JY4EZ4.js +102 -0
- package/dist/{chunk-VOYOYC5T.js → chunk-R5336VHZ.js} +2 -2
- package/dist/chunk-RJMXSHKM.js +2 -0
- package/dist/chunk-STBXCPKY.js +5 -0
- package/dist/chunk-T2FQ4GHD.js +9 -0
- package/dist/chunk-TFWDJDGO.js +2 -0
- package/dist/chunk-TG7QSYCJ.js +2 -0
- package/dist/{chunk-FKCGBZAC.js → chunk-TTS75UF2.js} +5 -5
- package/dist/{chunk-BVRS7RKQ.js → chunk-U7I373V4.js} +2 -2
- package/dist/chunk-UIKLA3F5.js +2 -0
- package/dist/{chunk-P753MDDE.js → chunk-UMPNL7T6.js} +2 -2
- package/dist/chunk-URSSPS5H.js +2 -0
- package/dist/chunk-VGMUFW3J.js +2 -0
- package/dist/chunk-VXTNADIW.js +18 -0
- package/dist/chunk-VYF5HA76.js +2 -0
- package/dist/chunk-WFGOH2UI.js +43 -0
- package/dist/chunk-WGA5BBTA.js +4 -0
- package/dist/chunk-WIBFXSYB.js +6 -0
- package/dist/chunk-WPSS37EW.js +2 -0
- package/dist/chunk-WQHWIVA7.js +3 -0
- package/dist/chunk-WS3Z6W3M.js +65 -0
- package/dist/chunk-WXVGNFAO.js +2 -0
- package/dist/{chunk-6LJHXREW.js → chunk-WZLPXFZU.js} +2 -2
- package/dist/chunk-X4O6K47U.js +2 -0
- package/dist/chunk-X6OGDTQH.js +2 -0
- package/dist/chunk-XEMQUN3Z.js +20 -0
- package/dist/{chunk-7B6LP46R.js → chunk-XHWLNQVZ.js} +2 -2
- package/dist/chunk-XMR747CP.js +2 -0
- package/dist/chunk-Y6L4LXPG.js +2 -0
- package/dist/chunk-YCPASUCX.js +2 -0
- package/dist/chunk-YZXV3CU3.js +60 -0
- package/dist/chunk-ZEKBR4OK.js +10 -0
- package/dist/chunk-ZMGBWSFZ.js +2 -0
- package/dist/cli.js +462 -274
- package/dist/{config-types-BDIWAYzr.d.ts → config-types-BrHl3Bge.d.ts} +61 -1
- package/dist/{db-Djj3Nqrb.d.ts → db-_Bdx0E1W.d.ts} +1 -1
- package/dist/diff-gate-types-CG2YQ_ei.d.ts +4 -0
- package/dist/{frontend-behavior-evidence-BxKpKWUu.d.ts → frontend-behavior-evidence-EfM4_9bc.d.ts} +1 -1
- package/dist/{health-D5J42g4D.d.ts → health-BEZ1Rt0S.d.ts} +54 -2
- package/dist/index.d.ts +10 -70
- package/dist/index.js +2 -2
- package/dist/postinstall.js +1 -4
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +12 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +7 -3
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +42 -4
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +12 -3
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +3 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +65 -8
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +21 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +29 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +15 -3
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +55 -0
- package/dist/queries/duplicate-bodies.js +2 -0
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +4 -3
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +12 -7
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +11 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +3 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +7 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +3 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +9 -4
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +17 -10
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +85 -17
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +55 -0
- package/dist/queries/twin-ab.js +2 -0
- package/dist/queries/twin-drift.d.ts +97 -0
- package/dist/queries/twin-drift.js +2 -0
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +7 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +3 -3
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +6 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +9 -9
- package/dist/reindex.d.ts +30 -4
- package/dist/reindex.js +19 -19
- package/dist/runtime.d.ts +12 -6
- package/dist/runtime.js +2 -2
- package/dist/{scip-cli-CnK9Va4O.d.ts → scip-cli-C7cg4ZHR.d.ts} +1 -1
- package/dist/symbol-types-DaoeXKUt.d.ts +66 -0
- package/docs/AGENT_GUIDE.md +20 -18
- package/docs/AI_FAILURE_MODES.md +36 -13
- package/docs/API.md +1 -1
- package/docs/COMMAND_REFERENCE.md +57 -14
- package/docs/DETECTOR_GUIDE.md +20 -3
- package/docs/REGEX_POLICY.md +34 -0
- package/docs/analyzer-inventory.md +48 -3
- package/docs/analyzer-validation-ledger.md +41 -6
- package/package.json +23 -7
- package/scripts/build-scip-windows.mjs +10 -7
- package/scripts/evidence-product-contract.mjs +197 -0
- package/skills/_shared/SKILL.md +243 -0
- package/skills/_shared/agents/openai.yaml +4 -0
- package/skills/scip-api-impact/SKILL.md +55 -71
- package/skills/scip-claim-audit/SKILL.md +105 -0
- package/skills/scip-claim-audit/agents/openai.yaml +4 -0
- package/skills/scip-cleanup-audit/SKILL.md +122 -0
- package/skills/scip-cleanup-audit/agents/openai.yaml +4 -0
- package/skills/scip-cleanup-improve/SKILL.md +84 -0
- package/skills/scip-cleanup-improve/agents/openai.yaml +4 -0
- package/skills/scip-concrete-plan/SKILL.md +181 -0
- package/skills/scip-concrete-plan/agents/openai.yaml +4 -0
- package/skills/scip-conductor/SKILL.md +133 -0
- package/skills/scip-conductor/agents/openai.yaml +4 -0
- package/skills/scip-debug/SKILL.md +60 -58
- package/skills/scip-diagram/SKILL.md +64 -94
- package/skills/scip-directory-architecture/SKILL.md +65 -107
- package/skills/scip-doc-reconcile/SKILL.md +56 -67
- package/skills/scip-explore/SKILL.md +78 -210
- package/skills/scip-hyper-optimization/SKILL.md +124 -198
- package/skills/scip-integrity-audit/SKILL.md +103 -0
- package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
- package/skills/scip-language-playbook/SKILL.md +56 -326
- package/skills/scip-maintainability/SKILL.md +80 -219
- package/skills/scip-probe-reachability/SKILL.md +92 -0
- package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
- package/skills/scip-query/SKILL.md +108 -124
- package/skills/scip-react-maintainability/SKILL.md +64 -82
- package/skills/scip-setup/SKILL.md +121 -0
- package/skills/scip-setup/agents/openai.yaml +4 -0
- package/skills/scip-tla-model-system/SKILL.md +138 -0
- package/skills/scip-tla-model-system/agents/openai.yaml +4 -0
- package/skills/scip-triage-issue/SKILL.md +53 -41
- package/skills/scip-twin-drift/SKILL.md +107 -0
- package/skills/scip-twin-drift/agents/openai.yaml +4 -0
- package/skills/scip-verify/SKILL.md +70 -88
- package/skills/scip-vue-maintainability/SKILL.md +67 -94
- package/dist/chunk-2KHTSEIL.js +0 -102
- package/dist/chunk-3VD3JMK2.js +0 -2
- package/dist/chunk-4UZO3XCV.js +0 -35
- package/dist/chunk-5GOLFJEO.js +0 -8
- package/dist/chunk-5OST6GYB.js +0 -2
- package/dist/chunk-65AU3HFZ.js +0 -2
- package/dist/chunk-6GN7FXCH.js +0 -2
- package/dist/chunk-6IR2AOBM.js +0 -7
- package/dist/chunk-6JRV4MY2.js +0 -23
- package/dist/chunk-6QSOCTZT.js +0 -18
- package/dist/chunk-72KY2ZFO.js +0 -2
- package/dist/chunk-7GO4EQF5.js +0 -2
- package/dist/chunk-7IVSJJZU.js +0 -7
- package/dist/chunk-7TWLSZK5.js +0 -2
- package/dist/chunk-A536TEU4.js +0 -3
- package/dist/chunk-AVWPHM2Q.js +0 -4
- package/dist/chunk-B32FX5KB.js +0 -2
- package/dist/chunk-B6MJ5VQV.js +0 -2
- package/dist/chunk-BFXPG2VN.js +0 -2
- package/dist/chunk-BSN22NRK.js +0 -9
- package/dist/chunk-BZ53S4ZN.js +0 -2
- package/dist/chunk-C5CTSJ6X.js +0 -6
- package/dist/chunk-CO5GJRP7.js +0 -2
- package/dist/chunk-CW5YFOCP.js +0 -5
- package/dist/chunk-DS6QEB3G.js +0 -5
- package/dist/chunk-E35O7UCB.js +0 -2
- package/dist/chunk-EXDQ35NN.js +0 -2
- package/dist/chunk-FAYI6KZ5.js +0 -2
- package/dist/chunk-FFVIFETB.js +0 -2
- package/dist/chunk-FG4NT6VY.js +0 -2
- package/dist/chunk-FXNWFMKW.js +0 -25
- package/dist/chunk-G5UPYQGL.js +0 -4
- package/dist/chunk-GQBMH2TQ.js +0 -2
- package/dist/chunk-GRJY65YT.js +0 -2
- package/dist/chunk-HF25DFSC.js +0 -3
- package/dist/chunk-HHN2B5KA.js +0 -2
- package/dist/chunk-IHUETYFW.js +0 -2
- package/dist/chunk-JCLDUKT6.js +0 -38
- package/dist/chunk-JGN2ZFJR.js +0 -2
- package/dist/chunk-JM72FNGA.js +0 -2
- package/dist/chunk-JME7OWD3.js +0 -2
- package/dist/chunk-KDFONWTW.js +0 -40
- package/dist/chunk-LPL4MA6R.js +0 -2
- package/dist/chunk-LZHUWKGD.js +0 -2
- package/dist/chunk-M4COR2H6.js +0 -2
- package/dist/chunk-NOJAM5ZV.js +0 -21
- package/dist/chunk-O6ZH6C6Y.js +0 -2
- package/dist/chunk-OBGRLXWF.js +0 -3
- package/dist/chunk-OLTESY4K.js +0 -3
- package/dist/chunk-ONPCQ2PM.js +0 -6
- package/dist/chunk-P4KYUPBD.js +0 -4
- package/dist/chunk-P5RYBRIO.js +0 -4
- package/dist/chunk-P7AL7Y37.js +0 -2
- package/dist/chunk-PFOCOG57.js +0 -2
- package/dist/chunk-QLAUCRDJ.js +0 -2
- package/dist/chunk-QPU7EXAW.js +0 -2
- package/dist/chunk-QYB5P7GL.js +0 -2
- package/dist/chunk-RNM6LMCF.js +0 -2
- package/dist/chunk-RVWSAMTT.js +0 -2
- package/dist/chunk-TK7O5ER5.js +0 -3
- package/dist/chunk-TQ5W2H3S.js +0 -4
- package/dist/chunk-USPV3T5K.js +0 -2
- package/dist/chunk-UUBMFL3F.js +0 -59
- package/dist/chunk-VCQYSG2M.js +0 -10
- package/dist/chunk-VUKC6F77.js +0 -20
- package/dist/chunk-W2CBNBEL.js +0 -71
- package/dist/chunk-W6BVEKYC.js +0 -3
- package/dist/chunk-WUCEKFQC.js +0 -3
- package/dist/chunk-XUGQU7PM.js +0 -41
- package/dist/chunk-Y5NBHMQX.js +0 -2
- package/dist/chunk-YCOFCT4B.js +0 -2
- package/dist/chunk-YZA6PPZL.js +0 -3
- package/skills/concrete-plan/SKILL.md +0 -372
- package/skills/concrete-plan/agents/openai.yaml +0 -4
- package/skills/scip-adoption/SKILL.md +0 -122
- package/skills/scip-adoption/agents/openai.yaml +0 -4
- package/skills/scip-ai-cleanup/SKILL.md +0 -153
- package/skills/scip-ai-cleanup/agents/openai.yaml +0 -4
- package/skills/scip-debloat/SKILL.md +0 -439
- package/skills/scip-debloat/agents/openai.yaml +0 -4
- package/skills/scip-health-audit/SKILL.md +0 -162
- package/skills/scip-health-audit/agents/openai.yaml +0 -4
- package/skills/scip-health-improve/SKILL.md +0 -155
- package/skills/scip-health-improve/agents/openai.yaml +0 -4
- package/skills/scip-query-setup/SKILL.md +0 -170
- package/skills/scip-query-setup/agents/openai.yaml +0 -3
- package/vendor/scip/README.md +0 -6
- package/vendor/scip/win32-arm64/scip.exe +0 -0
- package/vendor/scip/win32-x64/scip.exe +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-7JZRFDCU.js";import"../chunk-6XA4LDHY.js";import"../chunk-KMVGRIO2.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.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-_Bdx0E1W.js';
|
|
2
2
|
import 'better-sqlite3';
|
|
3
|
-
import '../config-types-
|
|
3
|
+
import '../config-types-BrHl3Bge.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-3KDUITBE.js";import"../chunk-QARYU7R3.js";import"../chunk-VGMUFW3J.js";import"../chunk-K6UI6EBZ.js";import"../chunk-B75HZHUP.js";import"../chunk-X4O6K47U.js";import"../chunk-NAH5EAZS.js";import"../chunk-BGBBVSH4.js";import"../chunk-QJ3FK4TB.js";import"../chunk-WFGOH2UI.js";import"../chunk-C4ICAIJ4.js";import"../chunk-WQHWIVA7.js";import"../chunk-XEMQUN3Z.js";import"../chunk-MTDBHTSF.js";import"../chunk-R3JY4EZ4.js";import"../chunk-HXXMPYEF.js";import"../chunk-T2FQ4GHD.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.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 w,b as L}from"./chunk-
|
|
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{
|
|
4
|
-
Install from: https://github.com/sourcegraph/scip/releases`);if(t("scip CLI not found on PATH. Attempting auto-install..."),!
|
|
5
|
-
Install manually from: https://github.com/sourcegraph/scip/releases`)}}function
|
|
1
|
+
import{a as w,b as C,c as L,d as M}from"./chunk-FERAXG6Y.js";import{a as b,b as k,c as X}from"./chunk-TFWDJDGO.js";import{execFileSync as Kt}from"child_process";import{closeSync as Qt,copyFileSync as Yt,existsSync as R,mkdirSync as J,mkdtempSync as Vt,openSync as Zt,readFileSync as I,renameSync as h,rmSync as y,writeFileSync as be}from"fs";import{basename as j,dirname as g,extname as en,join as f}from"path";import{platform as tn}from"os";import{execFileSync as Ne}from"child_process";import{existsSync as Ae,readdirSync as K}from"fs";import{extname as Q,join as Y}from"path";var Fe=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),Te=[{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:"clojure",files:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"],extensions:[".clj",".cljs",".cljc"]},{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 V(e){let t=[],n=Be(e),r=qe(e);for(let i of Te){if(_e(e,i.files)){t.push(i.language);continue}if(Ue(n,i.globs)){t.push(i.language);continue}ze(r,i.extensions)&&t.push(i.language)}return t.includes("typescript")&&H(t,"javascript"),t.includes("cpp")&&!r.has(".c")&&H(t,"c"),t}function Be(e){try{return K(e)}catch{return[]}}function _e(e,t){return t?.length?t.some(n=>Ae(Y(e,n))):!1}function Ue(e,t){return t?.length?e.some(n=>t.some(r=>We(n,r))):!1}function We(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 qe(e){let t=Je(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=K(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=Y(i,s.name);if(s.isDirectory()){Fe.has(s.name)||r.push(o);continue}let c=Q(s.name).toLowerCase();c&&n.add(c)}}return n}function Je(e){try{let t=Ne("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=Q(r).toLowerCase();i&&n.add(i)}return n}catch{return null}}function ze(e,t){return t?.length?t.some(n=>e.has(n)):!1}function H(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}import{existsSync as Z,readdirSync as Ge}from"fs";import{isAbsolute as Xe,join as D,resolve as He}from"path";var Ke={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"},clojure:{language:"clojure",indexerBinary:"scip-clojure",projectLocalBinaries:["node_modules/.bin/scip-clojure"],checkCommand:"scip-clojure -h",indexArgs:({projectRoot:e,outputPath:t,indexerBinary:n,configPath:r})=>{let i=["-root",e,"-output",t];return r&&i.push("-config",Xe(r)?r:He(e,r)),{binary:n,args:i}},markerFiles:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"],installMethods:[],installUrl:"https://github.com/PlunderStruck/scip-clojure"},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",ee(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",ee(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=D(e,"vendor","bin","scip-php"),r=D(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(n)?n:t]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function O(e){return Ke[e]}function ee(e,t){let n;try{n=Ge(e)}catch{return null}for(let r of t)for(let i of n)if(i.endsWith(r))return D(e,i);return null}import{readFileSync as Qe,writeFileSync as Ye}from"fs";import{create as E}from"@bufbuild/protobuf";import{deserializeSCIP as Ve,serializeSCIP as Ze,DocumentSchema as et,IndexSchema as tt,SymbolInformationSchema as nt}from"@c4312/scip";function rt(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let t=it(e),n=at(e.flatMap(i=>i.documents??[])),r=te(e.flatMap(i=>i.externalSymbols??[]));return E(tt,{metadata:t,documents:n,externalSymbols:r})}function $(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let n=e.map(i=>Ve(Qe(i))),r=rt(n);return Ye(t,Buffer.from(Ze(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function it(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 at(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,E(et,{language:r.language||n.language,relativePath:r.relativePath||n.relativePath,occurrences:st([...r.occurrences,...n.occurrences]),symbols:te([...r.symbols,...n.symbols]),text:ut(r.text,n.text),positionEncoding:r.positionEncoding||n.positionEncoding}))}return[...t.values()]}function st(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 te(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,E(nt,{symbol:r.symbol,documentation:ct([...r.documentation,...n.documentation]),relationships:ot([...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 ot(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 ut(e,t){return e?t?e.length>=t.length?e:t:e:t}function ct(e){return[...new Set(e)]}import{readFileSync as lt,writeFileSync as pt}from"fs";import{create as ne}from"@bufbuild/protobuf";import{deserializeSCIP as gt,DocumentSchema as dt,IndexSchema as ft,serializeSCIP as mt,SymbolRole as ht}from"@c4312/scip";function re(e){let t;try{t=gt(lt(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let n=yt(t);return n.removedDefinitionOccurrences>0&&pt(e,Buffer.from(mt(n.index))),{removedDefinitionOccurrences:n.removedDefinitionOccurrences,touchedDocuments:n.touchedDocuments}}function yt(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&ht.Definition)===0||t.has(o.symbol)?!0:(n+=1,!1));if(s.length===a.occurrences.length){i.push(a);continue}r+=1,i.push(ne(dt,{language:a.language,relativePath:a.relativePath,occurrences:s,symbols:a.symbols,text:a.text,positionEncoding:a.positionEncoding}))}return{index:n===0?e:ne(ft,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:n,touchedDocuments:r}}import{existsSync as Pt,readFileSync as St,readdirSync as vt,statSync as jt}from"fs";import p from"path";import{isAbsolute as xt,relative as bt}from"path";function ie(e,t){let n=bt(e,t);return n===""||!n.startsWith("..")&&!xt(n)}var Rt=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function ae(e,t=[]){let n=p.resolve(e),r=It(n),i=t.flatMap(c=>kt(n,c)),a=Ct([...r,...i]),s=Lt(n,a)?[n,...a]:a,o=s.length>0?s:[n];return[...new Set(o.map(c=>Dt(n,c)))].sort((c,u)=>c.localeCompare(u))}function It(e){let t=[],n=[e];for(;n.length>0;){let r=n.pop(),i;try{i=vt(r,{withFileTypes:!0})}catch{continue}for(let a of i){let s=p.join(r,a.name);if(a.isDirectory()){!Rt.has(a.name)&&!a.name.startsWith(".")&&n.push(s);continue}a.isFile()&&wt(s)&&t.push(p.dirname(s))}}return t}function kt(e,t){let n=t.trim();if(!n)return[];let r=p.resolve(e,n);if(!ie(e,r))return[];try{let i=jt(r);if(i.isDirectory())return[r];if(i.isFile()&&se(p.basename(r)))return[p.dirname(r)]}catch{return[]}return[]}function wt(e){if(!se(p.basename(e)))return!1;let t=oe(e);return t?p.basename(e)==="tsconfig.json"||"include"in t||"files"in t||"references"in t:!1}function se(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Ct(e){let t=[...new Set(e.map(n=>p.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&Ot(n,r)))}function Lt(e,t){if(t.length===0||t.some(r=>p.resolve(r)===e))return!1;let n=p.join(e,"tsconfig.json");return Pt(n)&&Mt(n)}function Mt(e){let n=oe(e)?.include;return Array.isArray(n)?n.some(r=>typeof r=="string"&&r.trim()!==""&&!r.startsWith("!")&&(r.includes("/")||r.includes("**")||!p.extname(r))):!1}function oe(e){try{let t=JSON.parse(St(e,"utf-8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function Dt(e,t){let n=p.relative(e,t);return n?n.split(p.sep).join("/"):"."}function Ot(e,t){let n=p.relative(e,t);return!!n&&!n.startsWith("..")&&!p.isAbsolute(n)}import{execFile as Et}from"child_process";import{existsSync as P,renameSync as A,rmSync as F}from"fs";import{cpus as $t}from"os";import{join as ue}from"path";function Nt(e,t,n){if(!e.defaultOutputPath)return;let r=ue(t,e.defaultOutputPath);n!==r&&P(r)&&A(r,n)}function At(e,t,n){if(!e.defaultOutputPath)return null;let r=ue(t,e.defaultOutputPath);if(r===n)return null;let i=`${n}.default-output-backup`;return F(i,{force:!0}),P(r)?(A(r,i),{defaultOutputPath:r,backupPath:i}):{defaultOutputPath:r,backupPath:null}}function Ft(e){e&&(F(e.defaultOutputPath,{force:!0}),e.backupPath&&P(e.backupPath)&&A(e.backupPath,e.defaultOutputPath))}function Tt(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,$t().length));return Math.max(1,Math.min(e,Math.floor(r)))}async function ce(e,t,n,r){let i=e.filter(u=>u.config.defaultOutputPath),a=e.filter(u=>!u.config.defaultOutputPath),s=[],o=Tt(a.length,r),c=await _t(a,o,u=>N(u,t,n));if(o>1){let u=new Map;for(let d of c.filter(l=>l.skipped)){let l=a.find(x=>x.id===d.id);l&&(n(`Retrying ${l.label} indexer serially after parallel failure...`),u.set(l.id,await N(l,t,n)))}s.push(...c.map(d=>u.get(d.id)??d))}else s.push(...c);for(let u of i)s.push(await N(u,t,n));return s.sort((u,d)=>e.findIndex(l=>l.id===u.id)-e.findIndex(l=>l.id===d.id))}async function N(e,t,n){n(`Indexing ${e.label} with ${e.resolvedBinary}...`),F(e.scipPath,{force:!0});let r=At(e.config,t,e.scipPath);try{await Bt(e.binary,e.args,{cwd:t,env:e.env,maxBuffer:50*1024*1024}),Nt(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{Ft(r)}if(!P(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 Bt(e,t,n){return new Promise((r,i)=>{Et(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 B}from"child_process";import{existsSync as T,readFileSync as Ut}from"fs";import{createRequire as Wt}from"module";import{platform as qt}from"os";import{dirname as le,join as S}from"path";var Jt=Wt(import.meta.url);function _(e){return[e.indexerBinary,...e.binaryAliases??[]]}function U(e){let t=_(e);return t.length===1?t[0]:t.join(" or ")}function v(e){for(let t of _(e))if(b(t))return t;return Gt(e)}function pe(e){return v(e)!==null||zt(e)}function zt(e){return ge(e)!==null}function Gt(e){let t=ge(e);if(!t)return null;let r=JSON.parse(Ut(t,"utf8")).bin;if(!r)return null;if(typeof r=="string")return S(le(t),r);for(let i of _(e)){let a=r[i];if(a)return S(le(t),a)}return null}function ge(e){if(!e.bundledNpmPackage)return null;try{return Jt.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function de(e,t){for(let n of e.projectLocalBinaries??[]){let r=S(t,n);if(T(r))return r}return null}function fe(e,t=process.env,n=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||he(n,t))return t;let r=Xt(n,t);return r?{...t,DOTNET_ROOT:r}:t}function me(e,t){let n=e.installMethods,r=U(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{B(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 Xt(e,t){for(let n of Ht(t))if(he(e,{...t,DOTNET_ROOT:n}))return n;return null}function Ht(e){let t=[],n=e.DOTNET_ROOT;if(n&&T(n)&&t.push(n),qt()==="darwin"&&b("brew"))try{let r=B("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),i=S(r,"libexec");T(i)&&!t.includes(i)&&t.push(i)}catch{}return t}function he(e,t){try{return B(e,["--version"],{stdio:"pipe",env:t}),!0}catch{return!1}}async function Pe(e){let{projectRoot:t,maxHeapMb:n=8192,onStatus:r=console.log,skipAutoInstall:i=!1}=e,a=nn(e),s=Date.now();J(g(a.outputScip),{recursive:!0}),J(g(a.outputDb),{recursive:!0});let o=e.languages??V(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=kn(t,o,{pnpmWorkspaces:e.pnpmWorkspaces,typescriptProjectMode:e.typescriptProjectMode,typescriptProjects:e.typescriptProjects,clojureConfigPath:e.clojureConfigPath}),u=await xn(f(g(a.outputDb),"index.lock"),{projectRoot:t,trigger:e.trigger,onStatus:r}),d=null;try{let l=rn({opts:e,paths:a,languages:o,fingerprint:c,start:s,onStatus:r});if(l)return l;await pn(i,r);let x=an(a);return d=x.runDir,await sn({opts:e,languages:o,projectRoot:t,paths:a,tempPaths:x,fingerprint:c,start:s,maxHeapMb:n,skipAutoInstall:i,onStatus:r})}catch(l){throw Ce(a.metaPath,G({trigger:e.trigger,result:"failed",start:s,error:l instanceof Error?l.message:String(l)})),l}finally{d&&y(d,{recursive:!0,force:!0}),u()}}function nn(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 rn(e){if(e.opts.skipIfUnchanged===!1||!R(e.paths.outputScip)||!R(e.paths.outputDb)||!wn(e.paths.metaPath,e.fingerprint))return null;C(w(),{projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let t=Date.now()-e.start,n=G({trigger:e.opts.trigger,result:"reused",start:e.start,languages:e.languages,skipped:[]});return Ce(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 an(e){let t=Vt(f(g(e.outputDb),"reindex-"));return{runDir:t,tempOutputScip:f(t,j(e.outputScip)),tempOutputDb:f(t,j(e.outputDb)),tempMetaPath:f(t,j(e.metaPath))}}async function sn(e){let t={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:n,skippedLanguages:r,reusedLanguages:i}=await on(e,t);i.length>0&&e.onStatus(`Reused ${i.length} cached language shard(s): ${i.join(", ")}`);let a=un(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 on(e,t){let n=cn(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}=gn({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,clojureConfigPath:e.opts.clojureConfigPath,onStatus:e.onStatus}),s=await ce(i,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:o}=fn(s,a),c=[...n,...o];return mn(c,a,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:c,skippedLanguages:a,reusedLanguages:[...r]}}function un(e,t,n,r){ln(e.paths.outputDb,n),hn(n,e.tempPaths.tempOutputScip,e.onStatus),yn(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,t,e.onStatus),C(w(),{projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus});let i=G({trigger:e.opts.trigger,result:"rebuilt",start:e.start,languages:n.map(a=>a.language),skipped:[...r]});return we(e.tempPaths.tempMetaPath,{version:3,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,languageFingerprints:je(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects,clojureConfigPath:e.opts.clojureConfigPath}),requestedLanguages:e.languages,indexedLanguages:n.map(a=>a.language),skipped:[...r],lastRefresh:i}),In({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 cn(e){let t;try{t=JSON.parse(I(e.paths.metaPath,"utf-8"))}catch{return[]}if(t.version!==3||!t.languageFingerprints)return[];let n=[],r=je(e.projectRoot,e.languages,{pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects,clojureConfigPath:e.opts.clojureConfigPath});for(let i of e.languages){let a=ke(e.paths.outputDb,i);R(a)&&m(t.languageFingerprints[i])===m(r[i])&&n.push({language:i,scipPath:a})}return n}function ln(e,t){for(let n of t){let r=ke(e,n.language);J(g(r),{recursive:!0}),n.scipPath!==r&&Yt(n.scipPath,r)}}async function pn(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(tn()==="win32")throw new Error("The scip CLI was not found. On Windows it ships via the npm sidecar package scip-query-scip-windows (installed automatically with scip-query). Reinstall with optional dependencies enabled, run 'npm install -g scip-query-scip-windows', or set SCIP_QUERY_SCIP_BIN to a local scip.exe path.");if(t("scip CLI not found on PATH. Attempting auto-install..."),!X(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 gn(e){let t=[],n=[],r=e.languages.map((i,a)=>({language:i,scipPath:e.languages.length>1?ve(e.tempOutputScip,i,a):e.tempOutputScip}));for(let{language:i,scipPath:a}of r){let s=dn({...e,language:i,scipPath:a});for(let o of s)"skipped"in o?Se(n,o.skipped):t.push(o.prepared)}return{preparedRuns:t,skippedLanguages:n}}function dn(e){if(e.language!=="typescript"||e.typescriptProjectMode!=="workspace")return[W({...e,id:e.language,label:e.language,outputScipPath:e.scipPath})];let t=ae(e.projectRoot,e.typescriptProjects);return t.length===0?[W({...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)=>W({...e,id:`typescript:${n}`,label:`typescript (${n})`,scipPath:ve(e.tempOutputScip,"typescript-project",r),outputScipPath:e.scipPath,pnpmWorkspaces:!1,projectPath:n})))}function W(e){let t=O(e.language),n=U(t),r=de(t,e.projectRoot);if(!r&&!pe(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...`),!me(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,configPath:e.language==="clojure"?e.clojureConfigPath:void 0});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:fe(t,e.env,i)}}}function fn(e,t){let n=new Map;for(let i of e)if(i.skipped)Se(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)$(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 Se(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 mn(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
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
8
|
`+t.map(a=>` - ${a.language}: ${a.reason}`).join(`
|
|
9
|
-
`))}function
|
|
10
|
-
`),()=>{try{
|
|
11
|
-
`),h(n,e)}function
|
|
12
|
-
`)}).then(()=>{process.exit(0)}).catch(e=>{console.error(`reindex-worker error: ${e}`),process.exit(1)});function
|
|
9
|
+
`))}function hn(e,t,n){e.length>1?(n(`Merging ${e.length} language indexes...`),$(e.map(r=>r.scipPath),t)):e[0].scipPath!==t&&h(e[0].scipPath,t)}function yn(e,t,n,r){if(r("Converting to SQLite..."),!R(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{let i=re(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");Kt(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 ve(e,t,n){let r=en(e)||".scip",i=j(e,r);return f(g(e),`${i}.${n+1}.${t}${r}`)}async function xn(e,t){for(let n=0;n<2;n++){let r=bn(e,t);if(r)return r;let i=Pn(e);if(i&&Sn(t.trigger,i)){if(t.onStatus(`Manual reindex preempting watcher refresh started at ${i.startedAt}.`),!await jn(i.pid))throw new Error(`Could not confirm the watcher's in-progress reindex (pid ${i.pid}) terminated for ${g(e)}; refusing to steal an active lock.`);y(e,{force:!0});continue}if(i&&!z(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 bn(e,t){let n;try{n=Zt(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 be(n,JSON.stringify(r)+`
|
|
10
|
+
`),()=>{try{Qt(n)}finally{y(e,{force:!0})}}}function Pn(e){try{let t=JSON.parse(I(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 Sn(e,t){return e?.kind==="manual-cli"&&vn(t?.trigger)}function vn(e){return e?.kind==="watch-source"||e?.kind==="watch-git-head"||e?.kind==="watch-git-index"||e?.kind==="watch-git-state"}async function jn(e){return ye(e,"SIGTERM"),await xe(e,2e3)?!0:(ye(e,"SIGKILL"),xe(e,1e3))}function ye(e,t){try{process.kill(-e,t)}catch{try{process.kill(e,t)}catch{}}}async function xe(e,t){let n=Date.now()+t;for(;Date.now()<n;){if(!z(e))return!0;await Rn(50)}return!z(e)}function z(e){try{return process.kill(e,0),!0}catch{return!1}}function Rn(e){return new Promise(t=>setTimeout(t,e))}function In(e){q(e.tempOutputScip,e.outputScip),q(e.tempOutputDb,e.outputDb),q(e.tempMetaPath,e.metaPath)}function q(e,t){y(`${t}.tmp-replace`,{force:!0}),h(e,`${t}.tmp-replace`),h(`${t}.tmp-replace`,t)}function kn(e,t,n){return{version:2,languages:[...t].sort(),pnpmWorkspaces:Ie(n),typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:L(n.typescriptProjects),clojureConfigPath:Re(n.clojureConfigPath),files:M(e)}}function je(e,t,n){return Object.fromEntries(t.map(r=>{let i=O(r).markerFiles,a=r==="typescript"?{typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:L(n.typescriptProjects)}:{typescriptProjectMode:"single",typescriptProjects:[]},s=r==="clojure"?Re(n.clojureConfigPath):void 0;return[r,{version:2,languages:[r],pnpmWorkspaces:r==="typescript"&&Ie(n),...a,clojureConfigPath:s,files:M(e,{language:r,markerFiles:i})}]}))}function Re(e){return e?.trim()||void 0}function Ie(e){return e.typescriptProjectMode!=="workspace"&&e.pnpmWorkspaces===!0}function ke(e,t){return f(g(e),"language-indexes",`${t}.scip`)}function wn(e,t){try{let n=JSON.parse(I(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 we(e,t){let n=`${e}.tmp-${process.pid}-${Date.now()}`;be(n,`${JSON.stringify(t,null,2)}
|
|
11
|
+
`),h(n,e)}function Ce(e,t){try{let n=JSON.parse(I(e,"utf-8"));if(n.version!==2&&n.version!==3)return;we(e,{...n,lastRefresh:t})}catch{}}function G(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 Oe=process.env.SCIP_REINDEX_PROJECT_ROOT,Ee=process.env.SCIP_REINDEX_OUTPUT_SCIP,$e=process.env.SCIP_REINDEX_OUTPUT_DB,Le=process.env.SCIP_REINDEX_LANGUAGES,Cn=Nn(process.env.SCIP_REINDEX_INDEXER_CONCURRENCY),Ln=process.env.SCIP_REINDEX_PNPM_WORKSPACES==="1",Me=$n(process.env.SCIP_REINDEX_TYPESCRIPT_CONFIG),Mn=process.env.SCIP_REINDEX_CLOJURE_CONFIG_PATH||void 0,Dn=En(process.env.SCIP_REINDEX_TRIGGER_KIND),On=process.env.SCIP_REINDEX_TRIGGER_DETAIL;(!Oe||!Ee||!$e)&&(console.error("reindex-worker: missing required env vars"),process.exit(1));var De=Le?Le.split(",").filter(Boolean):void 0;Pe({projectRoot:Oe,outputScip:Ee,outputDb:$e,languages:De?.length?De:void 0,pnpmWorkspaces:Ln,typescriptProjectMode:Me.projectMode,typescriptProjects:Me.projects,clojureConfigPath:Mn,indexerConcurrency:Cn,trigger:{kind:Dn,detail:On||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 En(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 $n(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 Nn(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,6 @@
|
|
|
1
|
-
import { a as SupportedLanguage, I as IndexerConfig, T as TypeScriptProjectMode } from './config-types-
|
|
2
|
-
import { R as RefreshTrigger, L as LastRefreshMetadata } from './scip-cli-
|
|
3
|
-
export { t as tryInstallScipCli } from './scip-cli-
|
|
1
|
+
import { a as SupportedLanguage, I as IndexerConfig, T as TypeScriptProjectMode } from './config-types-BrHl3Bge.js';
|
|
2
|
+
import { R as RefreshTrigger, L as LastRefreshMetadata } from './scip-cli-C7cg4ZHR.js';
|
|
3
|
+
export { t as tryInstallScipCli } from './scip-cli-C7cg4ZHR.js';
|
|
4
4
|
import { Index } from '@c4312/scip';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -9,6 +9,24 @@ import { Index } from '@c4312/scip';
|
|
|
9
9
|
*/
|
|
10
10
|
declare function detectLanguages(projectRoot: string): SupportedLanguage[];
|
|
11
11
|
|
|
12
|
+
type PostIndexAugmentationFact = 'auxiliary-document' | 'synthetic-symbol' | 'source-mapped-occurrence' | 'definition-mention' | 'replacement-chunk' | 'fingerprint-cache';
|
|
13
|
+
interface PostIndexAugmentationContext {
|
|
14
|
+
projectRoot: string;
|
|
15
|
+
dbPath: string;
|
|
16
|
+
onStatus?: (message: string) => void;
|
|
17
|
+
}
|
|
18
|
+
interface PostIndexAugmentationStage<Result> {
|
|
19
|
+
id: string;
|
|
20
|
+
facts: readonly PostIndexAugmentationFact[];
|
|
21
|
+
run(context: PostIndexAugmentationContext): Result;
|
|
22
|
+
}
|
|
23
|
+
declare function runPostIndexAugmentation<Result>(stage: PostIndexAugmentationStage<Result>, context: PostIndexAugmentationContext): {
|
|
24
|
+
stageId: string;
|
|
25
|
+
facts: readonly PostIndexAugmentationFact[];
|
|
26
|
+
durationMs: number;
|
|
27
|
+
result: Result;
|
|
28
|
+
};
|
|
29
|
+
|
|
12
30
|
interface AugmentAuxiliaryDocumentsOptions {
|
|
13
31
|
projectRoot: string;
|
|
14
32
|
dbPath: string;
|
|
@@ -20,6 +38,9 @@ interface AugmentAuxiliaryDocumentsResult {
|
|
|
20
38
|
inserted: number;
|
|
21
39
|
existing: number;
|
|
22
40
|
}
|
|
41
|
+
declare function auxiliaryDocumentsAugmentationStage(opts?: {
|
|
42
|
+
extensions?: readonly string[];
|
|
43
|
+
}): PostIndexAugmentationStage<AugmentAuxiliaryDocumentsResult>;
|
|
23
44
|
/**
|
|
24
45
|
* Add source files that upstream SCIP indexers skipped to the SQLite
|
|
25
46
|
* documents table. Vue SFCs are the motivating case: scip-typescript can
|
|
@@ -41,6 +62,9 @@ interface AugmentVueResolvedOptions {
|
|
|
41
62
|
tsconfig: string;
|
|
42
63
|
onStatus?: (message: string) => void;
|
|
43
64
|
}
|
|
65
|
+
declare function vueResolvedReferencesAugmentationStage(opts: {
|
|
66
|
+
tsconfig: string;
|
|
67
|
+
}): PostIndexAugmentationStage<AugmentVueResolvedResult>;
|
|
44
68
|
declare function augmentVueResolvedReferences(opts: AugmentVueResolvedOptions): AugmentVueResolvedResult;
|
|
45
69
|
|
|
46
70
|
/**
|
|
@@ -123,6 +147,8 @@ interface ReindexOptions {
|
|
|
123
147
|
typescriptProjectMode?: TypeScriptProjectMode;
|
|
124
148
|
/** Explicit TypeScript project roots or tsconfig paths for workspace mode. */
|
|
125
149
|
typescriptProjects?: string[];
|
|
150
|
+
/** Optional scip-clojure config path, relative to project root unless absolute. */
|
|
151
|
+
clojureConfigPath?: string;
|
|
126
152
|
/** Skip auto-install prompts */
|
|
127
153
|
skipAutoInstall?: boolean;
|
|
128
154
|
/** Reuse an existing index when tracked source inputs are unchanged (default true). */
|
|
@@ -159,4 +185,4 @@ interface ReindexResult {
|
|
|
159
185
|
*/
|
|
160
186
|
declare function reindex(opts: ReindexOptions): Promise<ReindexResult>;
|
|
161
187
|
|
|
162
|
-
export { INDEXER_CONFIGS, type ReindexOptions, type ReindexResult, augmentAuxiliaryDocuments, augmentVueResolvedReferences, describeIndexerBinary, detectLanguages, getIndexerConfig, getIndexerExecutionEnv, isBinaryAvailable, isIndexerInstalled, mergeScipFiles, mergeScipIndexes, reindex, resolveIndexerBinary, resolveProjectLocalIndexerBinary, tryInstallIndexer };
|
|
188
|
+
export { INDEXER_CONFIGS, type ReindexOptions, type ReindexResult, augmentAuxiliaryDocuments, augmentVueResolvedReferences, auxiliaryDocumentsAugmentationStage, describeIndexerBinary, detectLanguages, getIndexerConfig, getIndexerExecutionEnv, isBinaryAvailable, isIndexerInstalled, mergeScipFiles, mergeScipIndexes, reindex, resolveIndexerBinary, resolveProjectLocalIndexerBinary, runPostIndexAugmentation, tryInstallIndexer, vueResolvedReferencesAugmentationStage };
|