scip-query 0.11.0 → 0.13.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.
Files changed (157) hide show
  1. package/README.md +24 -0
  2. package/dist/{chunk-WQHWIVA7.js → chunk-27HMTUJE.js} +2 -2
  3. package/dist/{chunk-3KDUITBE.js → chunk-27XEGMCT.js} +2 -2
  4. package/dist/{chunk-3V6JQQM5.js → chunk-2TPCIPYA.js} +2 -2
  5. package/dist/{chunk-ALHNAPS2.js → chunk-2XRXEIRK.js} +2 -2
  6. package/dist/{chunk-K2HYR5A7.js → chunk-3AMWF6V5.js} +2 -2
  7. package/dist/{chunk-LWOOTRHC.js → chunk-3H5OSDF7.js} +2 -2
  8. package/dist/{chunk-UMPNL7T6.js → chunk-43GKP6LI.js} +2 -2
  9. package/dist/{chunk-DRPAQAFM.js → chunk-44P4SJFN.js} +2 -2
  10. package/dist/{chunk-XMR747CP.js → chunk-5JRMZMLM.js} +2 -2
  11. package/dist/{chunk-QJ3FK4TB.js → chunk-5VY3RIEI.js} +2 -2
  12. package/dist/{chunk-IFSX6YVU.js → chunk-6JUAGXR4.js} +2 -2
  13. package/dist/{chunk-BN5SXXQS.js → chunk-6KDOYKCB.js} +2 -2
  14. package/dist/chunk-6KMTPNZL.js +3 -0
  15. package/dist/{chunk-LZNLRE4X.js → chunk-72FR7KEZ.js} +2 -2
  16. package/dist/{chunk-FXG3PHVW.js → chunk-7COVQPQQ.js} +6 -6
  17. package/dist/chunk-7TVFPOD7.js +102 -0
  18. package/dist/{chunk-TTS75UF2.js → chunk-A6KSEIRN.js} +2 -2
  19. package/dist/{chunk-CMHYBXJB.js → chunk-AAMURYOK.js} +2 -2
  20. package/dist/{chunk-XEMQUN3Z.js → chunk-BP7S6V3M.js} +2 -2
  21. package/dist/{chunk-QXGTGE2C.js → chunk-BRBF3E5X.js} +2 -2
  22. package/dist/{chunk-M2YXL62V.js → chunk-BUNDZ6K2.js} +2 -2
  23. package/dist/{chunk-NAH5EAZS.js → chunk-BZXE3HO4.js} +2 -2
  24. package/dist/{chunk-ZEKBR4OK.js → chunk-CXQQOXSI.js} +2 -2
  25. package/dist/{chunk-WZLPXFZU.js → chunk-EDSD3VJK.js} +2 -2
  26. package/dist/chunk-EVZSAR3S.js +2 -0
  27. package/dist/{chunk-HZKMEXA3.js → chunk-GMOEX7EV.js} +2 -2
  28. package/dist/{chunk-BDRBPG7Y.js → chunk-GUDKRIGW.js} +2 -2
  29. package/dist/{chunk-WFGOH2UI.js → chunk-GULVO6NF.js} +2 -2
  30. package/dist/{chunk-RJMXSHKM.js → chunk-GY3HAWUA.js} +2 -2
  31. package/dist/{chunk-H56MGERE.js → chunk-HV27H2V2.js} +2 -2
  32. package/dist/chunk-HZZQKNVE.js +2 -0
  33. package/dist/{chunk-VGMUFW3J.js → chunk-I4R3SNMR.js} +2 -2
  34. package/dist/{chunk-X4O6K47U.js → chunk-IMQFJ53K.js} +2 -2
  35. package/dist/{chunk-NJJ7AS4F.js → chunk-IUSSGHJO.js} +2 -2
  36. package/dist/{chunk-Y6L4LXPG.js → chunk-JJUX2OAP.js} +2 -2
  37. package/dist/chunk-JZBGTSAB.js +13 -0
  38. package/dist/{chunk-N7PNFLGY.js → chunk-K5N5RNGM.js} +2 -2
  39. package/dist/{chunk-XHWLNQVZ.js → chunk-K7SPOJHZ.js} +2 -2
  40. package/dist/{chunk-STBXCPKY.js → chunk-KSJ544IV.js} +2 -2
  41. package/dist/{chunk-GHXRVCIY.js → chunk-KYB7FPXT.js} +2 -2
  42. package/dist/{chunk-ORBRX2QJ.js → chunk-LY7NMOBW.js} +2 -2
  43. package/dist/{chunk-NBXK32I6.js → chunk-M7EEHYSU.js} +2 -2
  44. package/dist/{chunk-U7I373V4.js → chunk-N23FT4EZ.js} +2 -2
  45. package/dist/{chunk-6Q6OFLFQ.js → chunk-N2OTJWC2.js} +2 -2
  46. package/dist/{chunk-P36UR5II.js → chunk-NCVFKOLB.js} +2 -2
  47. package/dist/{chunk-KKMOB3OJ.js → chunk-NOKUZU56.js} +2 -2
  48. package/dist/{chunk-WPSS37EW.js → chunk-OXTM2RX3.js} +2 -2
  49. package/dist/{chunk-FLJJLSGB.js → chunk-PEHDARNC.js} +2 -2
  50. package/dist/chunk-PESEPWZO.js +2 -0
  51. package/dist/{chunk-X6OGDTQH.js → chunk-PMY4UFGV.js} +2 -2
  52. package/dist/{chunk-H7NSJ7L2.js → chunk-Q7PWDXL5.js} +2 -2
  53. package/dist/{chunk-343O6EVV.js → chunk-QVGFVRKD.js} +2 -2
  54. package/dist/{chunk-7XL7J7PT.js → chunk-QYOPMTZ6.js} +2 -2
  55. package/dist/{chunk-VYF5HA76.js → chunk-QZOAOLLZ.js} +2 -2
  56. package/dist/{chunk-NLMRJ7SI.js → chunk-R7U2I55B.js} +2 -2
  57. package/dist/{chunk-UIKLA3F5.js → chunk-RLB6SG25.js} +2 -2
  58. package/dist/{chunk-3T2FNHIU.js → chunk-SFDVBARK.js} +2 -2
  59. package/dist/{chunk-ODVITBYU.js → chunk-TYCZ7S4I.js} +2 -2
  60. package/dist/{chunk-HINMXZ6J.js → chunk-U3VMUDXJ.js} +2 -2
  61. package/dist/chunk-UHPWZCYQ.js +3 -0
  62. package/dist/{chunk-N2Z3CU7X.js → chunk-V5W7H7V4.js} +2 -2
  63. package/dist/{chunk-C4ICAIJ4.js → chunk-WMO2VZZK.js} +2 -2
  64. package/dist/chunk-WPZPB42I.js +2 -0
  65. package/dist/{chunk-VXTNADIW.js → chunk-X3DTIEMU.js} +2 -2
  66. package/dist/chunk-X5C43YVI.js +2 -0
  67. package/dist/{chunk-PYZZBIEU.js → chunk-XC2PJOVM.js} +2 -2
  68. package/dist/{chunk-WGA5BBTA.js → chunk-XDESMVOL.js} +2 -2
  69. package/dist/{chunk-PZS6J5YG.js → chunk-XZBLZHXL.js} +2 -2
  70. package/dist/{chunk-7HB3CZFD.js → chunk-YQKECTPV.js} +2 -2
  71. package/dist/chunk-YTVKPJXW.js +2 -0
  72. package/dist/{chunk-75X52JTA.js → chunk-ZEO4CXQR.js} +2 -2
  73. package/dist/cli.js +259 -247
  74. package/dist/index.js +1 -1
  75. package/dist/queries/affected.js +1 -1
  76. package/dist/queries/bottlenecks.js +1 -1
  77. package/dist/queries/by-kind.js +1 -1
  78. package/dist/queries/call-graph.js +1 -1
  79. package/dist/queries/change-surface.js +1 -1
  80. package/dist/queries/cleanup-plan.js +1 -1
  81. package/dist/queries/co-change.js +1 -1
  82. package/dist/queries/code.js +1 -1
  83. package/dist/queries/complexity-hotspots.js +1 -1
  84. package/dist/queries/complexity.js +1 -1
  85. package/dist/queries/convergence.js +1 -1
  86. package/dist/queries/coupling.js +1 -1
  87. package/dist/queries/cycles.js +1 -1
  88. package/dist/queries/dataflow.js +1 -1
  89. package/dist/queries/dead.js +1 -1
  90. package/dist/queries/decorative-checkers.d.ts +34 -0
  91. package/dist/queries/decorative-checkers.js +2 -0
  92. package/dist/queries/deep-chains.js +1 -1
  93. package/dist/queries/deps.js +1 -1
  94. package/dist/queries/diff-gate.js +1 -1
  95. package/dist/queries/diff-impact.js +1 -1
  96. package/dist/queries/doc-drift.js +1 -1
  97. package/dist/queries/drift.js +1 -1
  98. package/dist/queries/duplicate-bodies.js +1 -1
  99. package/dist/queries/extract-candidates.js +1 -1
  100. package/dist/queries/fan.js +1 -1
  101. package/dist/queries/health.js +1 -1
  102. package/dist/queries/hierarchy.js +1 -1
  103. package/dist/queries/hotspots.js +1 -1
  104. package/dist/queries/imports.js +1 -1
  105. package/dist/queries/incomplete-migration.js +1 -1
  106. package/dist/queries/index.d.ts +3 -0
  107. package/dist/queries/index.js +1 -1
  108. package/dist/queries/isolated.js +1 -1
  109. package/dist/queries/locality-candidates.js +1 -1
  110. package/dist/queries/members.js +1 -1
  111. package/dist/queries/methods.js +1 -1
  112. package/dist/queries/not-implemented.d.ts +33 -0
  113. package/dist/queries/not-implemented.js +2 -0
  114. package/dist/queries/outline.js +1 -1
  115. package/dist/queries/passthrough-candidates.js +1 -1
  116. package/dist/queries/plan-context.js +1 -1
  117. package/dist/queries/recent-duplicates.js +1 -1
  118. package/dist/queries/redundant-reexports.js +1 -1
  119. package/dist/queries/refs.js +1 -1
  120. package/dist/queries/self-audit.js +1 -1
  121. package/dist/queries/similar-chains.js +1 -1
  122. package/dist/queries/similar-files.js +1 -1
  123. package/dist/queries/similar-signatures.js +1 -1
  124. package/dist/queries/similar.js +1 -1
  125. package/dist/queries/slice.js +1 -1
  126. package/dist/queries/stale-abstractions.js +1 -1
  127. package/dist/queries/surface.js +1 -1
  128. package/dist/queries/symbols.js +1 -1
  129. package/dist/queries/system.js +1 -1
  130. package/dist/queries/test-quality.d.ts +56 -0
  131. package/dist/queries/test-quality.js +2 -0
  132. package/dist/queries/trace.js +1 -1
  133. package/dist/queries/twin-ab.js +1 -1
  134. package/dist/queries/twin-drift.d.ts +23 -1
  135. package/dist/queries/twin-drift.js +1 -1
  136. package/dist/queries/unused-imports.js +1 -1
  137. package/dist/queries/unused-params.js +1 -1
  138. package/dist/queries/wrapper-candidates.js +1 -1
  139. package/dist/reindex-worker.js +9 -9
  140. package/dist/reindex.d.ts +20 -1
  141. package/dist/reindex.js +19 -19
  142. package/dist/runtime.js +1 -1
  143. package/docs/COMMAND_REFERENCE.md +6 -3
  144. package/docs/analyzer-inventory.md +16 -0
  145. package/package.json +32 -2
  146. package/skills/_shared/SKILL.md +4 -1
  147. package/skills/scip-calibrate/SKILL.md +124 -0
  148. package/skills/scip-calibrate/agents/openai.yaml +4 -0
  149. package/skills/scip-integrity-audit/SKILL.md +32 -0
  150. package/skills/scip-tla-model-system/SKILL.md +24 -14
  151. package/dist/chunk-2VSDXOG5.js +0 -2
  152. package/dist/chunk-GCN2P4EJ.js +0 -2
  153. package/dist/chunk-H4LUPLEJ.js +0 -2
  154. package/dist/chunk-HXXMPYEF.js +0 -2
  155. package/dist/chunk-MNEJYEHW.js +0 -3
  156. package/dist/chunk-R3JY4EZ4.js +0 -102
  157. package/dist/chunk-T2FQ4GHD.js +0 -9
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-2VSDXOG5.js";import"../chunk-XHWLNQVZ.js";import"../chunk-WQHWIVA7.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 symbols};
1
+ import{a}from"../chunk-EVZSAR3S.js";import"../chunk-K7SPOJHZ.js";import"../chunk-27HMTUJE.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as symbols};
2
2
  //# sourceMappingURL=symbols.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-7HB3CZFD.js";import"../chunk-XHWLNQVZ.js";import"../chunk-WQHWIVA7.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 system};
1
+ import{a}from"../chunk-YQKECTPV.js";import"../chunk-K7SPOJHZ.js";import"../chunk-27HMTUJE.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as system};
2
2
  //# sourceMappingURL=system.js.map
@@ -0,0 +1,56 @@
1
+ import { S as ScipDatabase } from '../db-_Bdx0E1W.js';
2
+ import 'better-sqlite3';
3
+ import '../config-types-BrHl3Bge.js';
4
+
5
+ /**
6
+ * test-quality (D3): the biggest uncovered surface — test files are not
7
+ * SCIP-indexed (house convention), so this detector works entirely from the
8
+ * source-facts layer (raw source text + `classifyFile`'s test-file
9
+ * classification), never the graph. Three independently reportable
10
+ * sub-checks:
11
+ * - assertion-free: `it`/`test` bodies with no reachable assertion call.
12
+ * - skipped: `it.skip`/`describe.skip`/`xit`/`.todo` inventory with
13
+ * git-blame age on the skip line.
14
+ * - mock-echo: a test asserting the same literal it stubbed into a mock.
15
+ */
16
+ type AssertionFreeSeverity = 'high' | 'low';
17
+ type SkippedTestKind = 'skip' | 'todo';
18
+ type SkipRot = 'rot' | 'workflow' | 'unknown';
19
+ interface AssertionFreeFinding {
20
+ file: string;
21
+ startLine: number;
22
+ endLine: number;
23
+ title: string;
24
+ severity: AssertionFreeSeverity;
25
+ }
26
+ interface SkippedTestFinding {
27
+ file: string;
28
+ startLine: number;
29
+ title: string;
30
+ skipKind: SkippedTestKind;
31
+ blockKind: 'it' | 'test' | 'describe';
32
+ ageDays: number | null;
33
+ rot: SkipRot;
34
+ }
35
+ interface MockEchoFinding {
36
+ file: string;
37
+ startLine: number;
38
+ endLine: number;
39
+ title: string;
40
+ echoedValue: string;
41
+ }
42
+ interface TestQualityReport {
43
+ assertionFree: AssertionFreeFinding[];
44
+ skipped: SkippedTestFinding[];
45
+ mockEcho: MockEchoFinding[];
46
+ }
47
+ interface TestQualityOptions {
48
+ scope?: string;
49
+ limit?: number;
50
+ scanLimit?: number;
51
+ /** Skips older than this many days are reported as 'rot' rather than 'workflow'. Default 60. */
52
+ rotDays?: number;
53
+ }
54
+ declare function testQuality(db: ScipDatabase, opts?: TestQualityOptions): TestQualityReport;
55
+
56
+ export { type AssertionFreeFinding, type AssertionFreeSeverity, type MockEchoFinding, type SkipRot, type SkippedTestFinding, type SkippedTestKind, type TestQualityOptions, type TestQualityReport, testQuality };
@@ -0,0 +1,2 @@
1
+ import{a}from"../chunk-UHPWZCYQ.js";import"../chunk-7COVQPQQ.js";import"../chunk-B75HZHUP.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-BP7S6V3M.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as testQuality};
2
+ //# sourceMappingURL=test-quality.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-CMHYBXJB.js";import"../chunk-WFGOH2UI.js";import"../chunk-C4ICAIJ4.js";import"../chunk-WQHWIVA7.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 trace};
1
+ import{a}from"../chunk-AAMURYOK.js";import"../chunk-GULVO6NF.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.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}from"../chunk-BN5SXXQS.js";import"../chunk-MNEJYEHW.js";import"../chunk-QARYU7R3.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 defaultTwinAbOutPath,b as twinAb};
1
+ import{a,b}from"../chunk-6KDOYKCB.js";import"../chunk-6KMTPNZL.js";import"../chunk-QARYU7R3.js";import"../chunk-K6UI6EBZ.js";import"../chunk-B75HZHUP.js";import"../chunk-IMQFJ53K.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-5VY3RIEI.js";import"../chunk-GULVO6NF.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-BP7S6V3M.js";import"../chunk-MTDBHTSF.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as defaultTwinAbOutPath,b as twinAb};
2
2
  //# sourceMappingURL=twin-ab.js.map
@@ -93,5 +93,27 @@ declare function groupTwins(records: readonly TwinDriftRecord[], opts?: {
93
93
  */
94
94
  isDelegatePair?: (from: TwinDriftRecord, to: TwinDriftRecord, clusterMembers: readonly TwinDriftRecord[]) => boolean;
95
95
  }): TwinGroup[];
96
+ /**
97
+ * Structural (source-text-only) check for a thin forwarding body: at most
98
+ * two top-level statements, no branching/looping, and the last statement is
99
+ * nothing more than a single call expression (optionally `return`ed and/or
100
+ * `await`ed). This is the shape a controller/service/storage delegate has —
101
+ * `return this.service.jsonHandler(req, res);` — as opposed to a body that
102
+ * actually implements the behavior. Purely structural; whether the call
103
+ * target is actually the other twin is a separate, DB-backed check (see
104
+ * `buildDelegationChecker`). Exported so other detectors that need the same
105
+ * "is this body just a forwarding call?" shape (decorative-checkers'
106
+ * one-hop delegate resolution) reuse it instead of re-deriving the same
107
+ * statement-count/control-flow/call-shape check.
108
+ */
109
+ declare function isThinForwarderBody(rawSnippet: string): boolean;
110
+ /**
111
+ * Split a statement block on top-level `;` (ignoring `;` nested inside
112
+ * `()`/`[]`/`{}`). Exported so other detectors that need a body's top-level
113
+ * statement shape (not-implemented's throw-stub check, decorative-checkers'
114
+ * single-statement body check) reuse this instead of re-deriving the same
115
+ * depth-tracked splitter.
116
+ */
117
+ declare function splitTopLevelStatements(body: string): string[];
96
118
 
97
- export { type TwinDriftRecord, type TwinGroup, type TwinMember, type TwinRelationship, allTwinGroups, groupTwins, twinDrift };
119
+ export { type TwinDriftRecord, type TwinGroup, type TwinMember, type TwinRelationship, allTwinGroups, groupTwins, isThinForwarderBody, splitTopLevelStatements, twinDrift };
@@ -1,2 +1,2 @@
1
- import{a,b,c}from"../chunk-H4LUPLEJ.js";import"../chunk-K2HYR5A7.js";import"../chunk-FXG3PHVW.js";import"../chunk-B75HZHUP.js";import"../chunk-NAH5EAZS.js";import"../chunk-BGBBVSH4.js";import"../chunk-XEMQUN3Z.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{b as allTwinGroups,c as groupTwins,a as twinDrift};
1
+ import{a,b,c,d,e}from"../chunk-HZZQKNVE.js";import"../chunk-3AMWF6V5.js";import"../chunk-7COVQPQQ.js";import"../chunk-B75HZHUP.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-BP7S6V3M.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{b as allTwinGroups,c as groupTwins,d as isThinForwarderBody,e as splitTopLevelStatements,a as twinDrift};
2
2
  //# sourceMappingURL=twin-drift.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c}from"../chunk-QXGTGE2C.js";import"../chunk-XHWLNQVZ.js";import"../chunk-C4ICAIJ4.js";import"../chunk-WQHWIVA7.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{b as importedBy,a as imports,c as unusedImports};
1
+ import{a,b,c}from"../chunk-BRBF3E5X.js";import"../chunk-K7SPOJHZ.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.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,2 +1,2 @@
1
- import{a}from"../chunk-NBXK32I6.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 unusedParams};
1
+ import{a}from"../chunk-M7EEHYSU.js";import"../chunk-K6UI6EBZ.js";import"../chunk-B75HZHUP.js";import"../chunk-IMQFJ53K.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-5VY3RIEI.js";import"../chunk-GULVO6NF.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-BP7S6V3M.js";import"../chunk-MTDBHTSF.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.js";import"../chunk-ISLWJ4PY.js";import"../chunk-WS3Z6W3M.js";import"../chunk-GNG622H3.js";import"../chunk-64MNV6AB.js";import"../chunk-7S5E7KWT.js";export{a as unusedParams};
2
2
  //# sourceMappingURL=unused-params.js.map
@@ -1,2 +1,2 @@
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};
1
+ import{a}from"../chunk-27XEGMCT.js";import"../chunk-QARYU7R3.js";import"../chunk-I4R3SNMR.js";import"../chunk-K6UI6EBZ.js";import"../chunk-B75HZHUP.js";import"../chunk-IMQFJ53K.js";import"../chunk-BZXE3HO4.js";import"../chunk-BGBBVSH4.js";import"../chunk-5VY3RIEI.js";import"../chunk-GULVO6NF.js";import"../chunk-WMO2VZZK.js";import"../chunk-27HMTUJE.js";import"../chunk-BP7S6V3M.js";import"../chunk-MTDBHTSF.js";import"../chunk-7TVFPOD7.js";import"../chunk-X5C43YVI.js";import"../chunk-JZBGTSAB.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
@@ -1,13 +1,13 @@
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(`
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 Q}from"./chunk-TFWDJDGO.js";import{execFileSync as Vt}from"child_process";import{createHash as Zt}from"crypto";import{closeSync as en,copyFileSync as tn,existsSync as v,mkdirSync as J,mkdtempSync as nn,openSync as rn,readFileSync as I,renameSync as y,rmSync as x,statSync as an,writeFileSync as Re}from"fs";import{basename as j,dirname as d,extname as sn,join as f}from"path";import{platform as on}from"os";import{execFileSync as Fe}from"child_process";import{existsSync as Te,readdirSync as V}from"fs";import{extname as Z,join as ee}from"path";var Be=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),_e=[{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 te(e){let t=[],n=We(e),r=ze(e);for(let i of _e){if(Ue(e,i.files)){t.push(i.language);continue}if(qe(n,i.globs)){t.push(i.language);continue}Xe(r,i.extensions)&&t.push(i.language)}return t.includes("typescript")&&Y(t,"javascript"),t.includes("cpp")&&!r.has(".c")&&Y(t,"c"),t}function We(e){try{return V(e)}catch{return[]}}function Ue(e,t){return t?.length?t.some(n=>Te(ee(e,n))):!1}function qe(e,t){return t?.length?e.some(n=>t.some(r=>Je(n,r))):!1}function Je(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 ze(e){let t=Ge(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=V(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=ee(i,s.name);if(s.isDirectory()){Be.has(s.name)||r.push(o);continue}let c=Z(s.name).toLowerCase();c&&n.add(c)}}return n}function Ge(e){try{let t=Fe("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=Z(r).toLowerCase();i&&n.add(i)}return n}catch{return null}}function Xe(e,t){return t?.length?t.some(n=>e.has(n)):!1}function Y(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}import{existsSync as ne,readdirSync as He}from"fs";import{isAbsolute as Ke,join as D,resolve as Qe}from"path";var Ye={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",Ke(r)?r:Qe(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",re(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",re(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",ne(r)?r:ne(n)?n:t]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function O(e){return Ye[e]}function re(e,t){let n;try{n=He(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 Ve,writeFileSync as Ze}from"fs";import{create as E}from"@bufbuild/protobuf";import{deserializeSCIP as et,serializeSCIP as tt,DocumentSchema as nt,IndexSchema as rt,SymbolInformationSchema as it}from"@c4312/scip";function at(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let t=st(e),n=ot(e.flatMap(i=>i.documents??[])),r=ie(e.flatMap(i=>i.externalSymbols??[]));return E(rt,{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=>et(Ve(i))),r=at(n);return Ze(t,Buffer.from(tt(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function st(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 ot(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(nt,{language:r.language||n.language,relativePath:r.relativePath||n.relativePath,occurrences:ut([...r.occurrences,...n.occurrences]),symbols:ie([...r.symbols,...n.symbols]),text:lt(r.text,n.text),positionEncoding:r.positionEncoding||n.positionEncoding}))}return[...t.values()]}function ut(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 ie(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(it,{symbol:r.symbol,documentation:pt([...r.documentation,...n.documentation]),relationships:ct([...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 ct(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 lt(e,t){return e?t?e.length>=t.length?e:t:e:t}function pt(e){return[...new Set(e)]}import{readFileSync as gt,writeFileSync as dt}from"fs";import{create as ae}from"@bufbuild/protobuf";import{deserializeSCIP as ft,DocumentSchema as mt,IndexSchema as ht,serializeSCIP as yt,SymbolRole as xt}from"@c4312/scip";function se(e){let t;try{t=ft(gt(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let n=bt(t);return n.removedDefinitionOccurrences>0&&dt(e,Buffer.from(yt(n.index))),{removedDefinitionOccurrences:n.removedDefinitionOccurrences,touchedDocuments:n.touchedDocuments}}function bt(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&xt.Definition)===0||t.has(o.symbol)?!0:(n+=1,!1));if(s.length===a.occurrences.length){i.push(a);continue}r+=1,i.push(ae(mt,{language:a.language,relativePath:a.relativePath,occurrences:s,symbols:a.symbols,text:a.text,positionEncoding:a.positionEncoding}))}return{index:n===0?e:ae(ht,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:n,touchedDocuments:r}}import{existsSync as Rt,readFileSync as jt,readdirSync as vt,statSync as It}from"fs";import p from"path";import{isAbsolute as Pt,relative as St}from"path";function oe(e,t){let n=St(e,t);return n===""||!n.startsWith("..")&&!Pt(n)}var kt=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function ue(e,t=[]){let n=p.resolve(e),r=wt(n),i=t.flatMap(c=>Ct(n,c)),a=Mt([...r,...i]),s=Dt(n,a)?[n,...a]:a,o=s.length>0?s:[n];return[...new Set(o.map(c=>Et(n,c)))].sort((c,l)=>c.localeCompare(l))}function wt(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()){!kt.has(a.name)&&!a.name.startsWith(".")&&n.push(s);continue}a.isFile()&&Lt(s)&&t.push(p.dirname(s))}}return t}function Ct(e,t){let n=t.trim();if(!n)return[];let r=p.resolve(e,n);if(!oe(e,r))return[];try{let i=It(r);if(i.isDirectory())return[r];if(i.isFile()&&ce(p.basename(r)))return[p.dirname(r)]}catch{return[]}return[]}function Lt(e){if(!ce(p.basename(e)))return!1;let t=le(e);return t?p.basename(e)==="tsconfig.json"||"include"in t||"files"in t||"references"in t:!1}function ce(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Mt(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&&$t(n,r)))}function Dt(e,t){if(t.length===0||t.some(r=>p.resolve(r)===e))return!1;let n=p.join(e,"tsconfig.json");return Rt(n)&&Ot(n)}function Ot(e){let n=le(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 le(e){try{let t=JSON.parse(jt(e,"utf-8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function Et(e,t){let n=p.relative(e,t);return n?n.split(p.sep).join("/"):"."}function $t(e,t){let n=p.relative(e,t);return!!n&&!n.startsWith("..")&&!p.isAbsolute(n)}import{execFile as Nt}from"child_process";import{existsSync as P,renameSync as A,rmSync as F,statSync as At}from"fs";import{cpus as Ft}from"os";import{join as pe}from"path";function Tt(e,t,n){if(!e.defaultOutputPath)return;let r=pe(t,e.defaultOutputPath);n!==r&&P(r)&&A(r,n)}function Bt(e,t,n){if(!e.defaultOutputPath)return null;let r=pe(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 _t(e){e&&(F(e.defaultOutputPath,{force:!0}),e.backupPath&&P(e.backupPath)&&A(e.backupPath,e.defaultOutputPath))}function Wt(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,Ft().length));return Math.max(1,Math.min(e,Math.floor(r)))}async function ge(e,t,n,r){let i=e.filter(l=>l.config.defaultOutputPath),a=e.filter(l=>!l.config.defaultOutputPath),s=[],o=Wt(a.length,r),c=await qt(a,o,l=>N(l,t,n));if(o>1){let l=new Map;for(let g of c.filter(u=>u.skipped)){let u=a.find(m=>m.id===g.id);u&&(n(`Retrying ${u.label} indexer serially after parallel failure...`),l.set(u.id,await N(u,t,n)))}s.push(...c.map(g=>l.get(g.id)??g))}else s.push(...c);for(let l of i)s.push(await N(l,t,n));return s.sort((l,g)=>e.findIndex(u=>u.id===l.id)-e.findIndex(u=>u.id===g.id))}async function N(e,t,n){n(`Indexing ${e.label} with ${e.resolvedBinary}...`),F(e.scipPath,{force:!0});let r=Bt(e.config,t,e.scipPath),i=[e.binary,...e.args].join(" "),a=Date.now();try{await Ut(e.binary,e.args,{cwd:t,env:e.env,maxBuffer:50*1024*1024}),Tt(e.config,t,e.scipPath)}catch(o){let c=o instanceof Error?o.message:String(o),l=`${e.resolvedBinary} indexer failed: ${c.split(`
3
+ `)[0]}`,g=e.label===e.language?l:`${e.label}: ${l}`;return n(`Skipping ${e.label}: ${l}`),{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,durationMs:Date.now()-a,command:i,skipped:{language:e.language,reason:g}}}finally{_t(r)}if(!P(e.scipPath)){let o=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`,c=e.label===e.language?o:`${e.label}: ${o}`;return n(`Skipping ${e.label}: ${o}`),{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,durationMs:Date.now()-a,command:i,skipped:{language:e.language,reason:c}}}let s;try{s=At(e.scipPath).size}catch{s=void 0}return{id:e.id,language:e.language,label:e.label,scipPath:e.scipPath,outputScipPath:e.outputScipPath,durationMs:Date.now()-a,command:i,outputBytes:s}}function Ut(e,t,n){return new Promise((r,i)=>{Nt(e,[...t],n,a=>{a?i(a):r()})})}async function qt(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 Jt}from"fs";import{createRequire as zt}from"module";import{platform as Gt}from"os";import{dirname as de,join as S}from"path";var Xt=zt(import.meta.url);function _(e){return[e.indexerBinary,...e.binaryAliases??[]]}function W(e){let t=_(e);return t.length===1?t[0]:t.join(" or ")}function R(e){for(let t of _(e))if(b(t))return t;return Kt(e)}function fe(e){return R(e)!==null||Ht(e)}function Ht(e){return me(e)!==null}function Kt(e){let t=me(e);if(!t)return null;let r=JSON.parse(Jt(t,"utf8")).bin;if(!r)return null;if(typeof r=="string")return S(de(t),r);for(let i of _(e)){let a=r[i];if(a)return S(de(t),a)}return null}function me(e){if(!e.bundledNpmPackage)return null;try{return Xt.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function he(e,t){for(let n of e.projectLocalBinaries??[]){let r=S(t,n);if(T(r))return r}return null}function ye(e,t=process.env,n=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||be(n,t))return t;let r=Qt(n,t);return r?{...t,DOTNET_ROOT:r}:t}function xe(e,t){let n=e.installMethods,r=W(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=R(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 Qt(e,t){for(let n of Yt(t))if(be(e,{...t,DOTNET_ROOT:n}))return n;return null}function Yt(e){let t=[],n=e.DOTNET_ROOT;if(n&&T(n)&&t.push(n),Gt()==="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 be(e,t){try{return B(e,["--version"],{stdio:"pipe",env:t}),!0}catch{return!1}}async function je(e){let{projectRoot:t,maxHeapMb:n=8192,onStatus:r=console.log,skipAutoInstall:i=!1}=e,a=un(e),s=Date.now();J(d(a.outputScip),{recursive:!0}),J(d(a.outputDb),{recursive:!0});let o=e.languages??te(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=En(t,o,{pnpmWorkspaces:e.pnpmWorkspaces,typescriptProjectMode:e.typescriptProjectMode,typescriptProjects:e.typescriptProjects,clojureConfigPath:e.clojureConfigPath}),l=await In(f(d(a.outputDb),"index.lock"),{projectRoot:t,trigger:e.trigger,onStatus:r}),g=null;try{let u=cn({opts:e,paths:a,languages:o,fingerprint:c,start:s,onStatus:r});if(u)return u;await xn(i,r);let m=pn(a);return g=m.runDir,await gn({opts:e,languages:o,projectRoot:t,paths:a,tempPaths:m,fingerprint:c,start:s,maxHeapMb:n,skipAutoInstall:i,onStatus:r})}catch(u){throw Me(a.metaPath,K({trigger:e.trigger,result:"failed",start:s,error:u instanceof Error?u.message:String(u)})),u}finally{g&&x(g,{recursive:!0,force:!0}),l()}}function un(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(d(n),"meta.json")}}function cn(e){if(e.opts.skipIfUnchanged===!1||!v(e.paths.outputScip)||!v(e.paths.outputDb)||!$n(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=K({trigger:e.opts.trigger,result:"reused",start:e.start,languages:e.languages,skipped:[]});return Me(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,shards:ln(e.paths,e.opts.projectRoot,e.languages,e.opts)}}function ln(e,t,n,r){let i=X(t,n,r);return n.map(a=>({id:a,language:a,reused:!0,fingerprint:z(i[a]),outputBytes:ve(H(e.outputDb,a)),durationMs:0}))}function pn(e){let t=nn(f(d(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 gn(e){let t={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:n,skippedLanguages:r,reusedLanguages:i,shards:a}=await dn(e,t);i.length>0&&e.onStatus(`Reused ${i.length} cached language shard(s): ${i.join(", ")}`);let s=hn(e,t,n,r),o=s.durationMs;return e.onStatus(`Done in ${(o/1e3).toFixed(1)}s`),{languages:n.map(c=>c.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:o,reused:!1,skipped:r,lastRefresh:s,shards:a}}async function dn(e,t){let n=fn({paths:e.paths,projectRoot:e.projectRoot,languages:e.languages,pnpmWorkspaces:e.opts.pnpmWorkspaces,typescriptProjectMode:e.opts.typescriptProjectMode,typescriptProjects:e.opts.typescriptProjects,clojureConfigPath:e.opts.clojureConfigPath}),r=[],i=new Set;for(let[u,m]of n)m.reused&&(r.push({language:u,scipPath:m.scipPath}),i.add(u));for(let u of i)e.onStatus(`Reusing cached ${u} SCIP shard (language inputs unchanged).`);let{preparedRuns:a,skippedLanguages:s}=bn({languages:e.languages.filter(u=>!i.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}),o=await ge(a,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:c}=Sn(o,s),l=[...r,...c];Rn(l,s,e.languages,e.opts.allowPartial,e.onStatus);let g=mn(n,o);return{indexedOutputs:l,skippedLanguages:s,reusedLanguages:[...i],shards:g}}function fn(e){let t;try{t=JSON.parse(I(e.paths.metaPath,"utf-8"))}catch{t=null}let n=X(e.projectRoot,e.languages,e),r=new Map;for(let i of e.languages){let a=H(e.paths.outputDb,i),s=n[i];if(!t){r.set(i,{reused:!1,reason:"no reindex metadata found",fingerprint:s,scipPath:a});continue}if(t.version!==3){r.set(i,{reused:!1,reason:`metadata version ${String(t.version??"unknown")} predates per-language shard caching`,fingerprint:s,scipPath:a});continue}if(!t.languageFingerprints){r.set(i,{reused:!1,reason:"no per-language fingerprints recorded in metadata",fingerprint:s,scipPath:a});continue}let o=t.languageFingerprints[i];if(!o){r.set(i,{reused:!1,reason:"no cached fingerprint for this language",fingerprint:s,scipPath:a});continue}if(!v(a)){r.set(i,{reused:!1,reason:"cached shard file missing on disk",fingerprint:s,scipPath:a});continue}if(h(o)!==h(s)){r.set(i,{reused:!1,reason:"language inputs changed since last index",fingerprint:s,scipPath:a});continue}r.set(i,{reused:!0,fingerprint:s,scipPath:a})}return r}function mn(e,t){let n=[];for(let[r,i]of e)i.reused&&n.push({id:r,language:r,reused:!0,fingerprint:z(i.fingerprint),outputBytes:ve(i.scipPath),durationMs:0});for(let r of t){let i=e.get(r.language);n.push({id:r.id,language:r.language,reused:!1,missReason:i?.reason??r.skipped?.reason,fingerprint:i?z(i.fingerprint):"unknown",outputBytes:r.outputBytes??null,durationMs:r.durationMs,command:r.command})}return n}function z(e){return Zt("sha256").update(h(e)).digest("hex").slice(0,16)}function ve(e){try{return an(e).size}catch{return null}}function hn(e,t,n,r){yn(e.paths.outputDb,n),jn(n,e.tempPaths.tempOutputScip,e.onStatus),vn(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,t,e.onStatus),C(w(),{projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus});let i=K({trigger:e.opts.trigger,result:"rebuilt",start:e.start,languages:n.map(a=>a.language),skipped:[...r]});return Le(e.tempPaths.tempMetaPath,{version:3,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,languageFingerprints:X(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}),On({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 yn(e,t){for(let n of t){let r=H(e,n.language);J(d(r),{recursive:!0}),n.scipPath!==r&&tn(n.scipPath,r)}}async function xn(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(on()==="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..."),!Q(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 bn(e){let t=[],n=[],r=e.languages.map((i,a)=>({language:i,scipPath:e.languages.length>1?ke(e.tempOutputScip,i,a):e.tempOutputScip}));for(let{language:i,scipPath:a}of r){let s=Pn({...e,language:i,scipPath:a});for(let o of s)"skipped"in o?Ie(n,o.skipped):t.push(o.prepared)}return{preparedRuns:t,skippedLanguages:n}}function Pn(e){if(e.language!=="typescript"||e.typescriptProjectMode!=="workspace")return[U({...e,id:e.language,label:e.language,outputScipPath:e.scipPath})];let t=ue(e.projectRoot,e.typescriptProjects);return t.length===0?[U({...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)=>U({...e,id:`typescript:${n}`,label:`typescript (${n})`,scipPath:ke(e.tempOutputScip,"typescript-project",r),outputScipPath:e.scipPath,pnpmWorkspaces:!1,projectPath:n})))}function U(e){let t=O(e.language),n=W(t),r=he(t,e.projectRoot);if(!r&&!fe(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...`),!xe(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??R(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:ye(t,e.env,i)}}}function Sn(e,t){let n=new Map;for(let i of e)if(i.skipped)Ie(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&&y(a,i.outputScipPath),r.push({language:i.language,scipPath:i.outputScipPath})}return{indexedOutputs:r}}function Ie(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 Rn(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 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}
9
+ `))}function jn(e,t,n){e.length>1?(n(`Merging ${e.length} language indexes...`),$(e.map(r=>r.scipPath),t)):e[0].scipPath!==t&&y(e[0].scipPath,t)}function vn(e,t,n,r){if(r("Converting to SQLite..."),!v(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{let i=se(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");Vt(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 ke(e,t,n){let r=sn(e)||".scip",i=j(e,r);return f(d(e),`${i}.${n+1}.${t}${r}`)}async function In(e,t){for(let n=0;n<2;n++){let r=kn(e,t);if(r)return r;let i=wn(e);if(i&&Cn(t.trigger,i)){if(t.onStatus(`Manual reindex preempting watcher refresh started at ${i.startedAt}.`),!await Mn(i.pid))throw new Error(`Could not confirm the watcher's in-progress reindex (pid ${i.pid}) terminated for ${d(e)}; refusing to steal an active lock.`);x(e,{force:!0});continue}if(i&&!G(i.pid)){x(e,{force:!0});continue}throw new Error(`Another scip-query reindex is already running for ${d(e)}.`)}throw new Error(`Could not acquire scip-query reindex lock for ${d(e)}.`)}function kn(e,t){let n;try{n=rn(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 Re(n,JSON.stringify(r)+`
10
+ `),()=>{try{en(n)}finally{x(e,{force:!0})}}}function wn(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:d(e),startedAt:typeof t.startedAt=="string"?t.startedAt:"unknown",trigger:t.trigger}}catch{return null}}function Cn(e,t){return e?.kind==="manual-cli"&&Ln(t?.trigger)}function Ln(e){return e?.kind==="watch-source"||e?.kind==="watch-git-head"||e?.kind==="watch-git-index"||e?.kind==="watch-git-state"}async function Mn(e){return Pe(e,"SIGTERM"),await Se(e,2e3)?!0:(Pe(e,"SIGKILL"),Se(e,1e3))}function Pe(e,t){try{process.kill(-e,t)}catch{try{process.kill(e,t)}catch{}}}async function Se(e,t){let n=Date.now()+t;for(;Date.now()<n;){if(!G(e))return!0;await Dn(50)}return!G(e)}function G(e){try{return process.kill(e,0),!0}catch{return!1}}function Dn(e){return new Promise(t=>setTimeout(t,e))}function On(e){q(e.tempOutputScip,e.outputScip),q(e.tempOutputDb,e.outputDb),q(e.tempMetaPath,e.metaPath)}function q(e,t){x(`${t}.tmp-replace`,{force:!0}),y(e,`${t}.tmp-replace`),y(`${t}.tmp-replace`,t)}function En(e,t,n){return{version:2,languages:[...t].sort(),pnpmWorkspaces:Ce(n),typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:L(n.typescriptProjects),clojureConfigPath:we(n.clojureConfigPath),files:M(e)}}function X(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"?we(n.clojureConfigPath):void 0;return[r,{version:2,languages:[r],pnpmWorkspaces:r==="typescript"&&Ce(n),...a,clojureConfigPath:s,files:M(e,{language:r,markerFiles:i})}]}))}function we(e){return e?.trim()||void 0}function Ce(e){return e.typescriptProjectMode!=="workspace"&&e.pnpmWorkspaces===!0}function H(e,t){return f(d(e),"language-indexes",`${t}.scip`)}function $n(e,t){try{let n=JSON.parse(I(e,"utf-8"));return(n.version===2||n.version===3)&&n.status==="complete"&&h(n.fingerprint)===h(t)&&h([...n.indexedLanguages??[]].sort())===h(t.languages)}catch{return!1}}function Le(e,t){let n=`${e}.tmp-${process.pid}-${Date.now()}`;Re(n,`${JSON.stringify(t,null,2)}
11
+ `),y(n,e)}function Me(e,t){try{let n=JSON.parse(I(e,"utf-8"));if(n.version!==2&&n.version!==3)return;Le(e,{...n,lastRefresh:t})}catch{}}function K(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 h(e){return JSON.stringify(e)}var $e=process.env.SCIP_REINDEX_PROJECT_ROOT,Ne=process.env.SCIP_REINDEX_OUTPUT_SCIP,Ae=process.env.SCIP_REINDEX_OUTPUT_DB,De=process.env.SCIP_REINDEX_LANGUAGES,Nn=Un(process.env.SCIP_REINDEX_INDEXER_CONCURRENCY),An=process.env.SCIP_REINDEX_PNPM_WORKSPACES==="1",Oe=Wn(process.env.SCIP_REINDEX_TYPESCRIPT_CONFIG),Fn=process.env.SCIP_REINDEX_CLOJURE_CONFIG_PATH||void 0,Tn=_n(process.env.SCIP_REINDEX_TRIGGER_KIND),Bn=process.env.SCIP_REINDEX_TRIGGER_DETAIL;(!$e||!Ne||!Ae)&&(console.error("reindex-worker: missing required env vars"),process.exit(1));var Ee=De?De.split(",").filter(Boolean):void 0;je({projectRoot:$e,outputScip:Ne,outputDb:Ae,languages:Ee?.length?Ee:void 0,pnpmWorkspaces:An,typescriptProjectMode:Oe.projectMode,typescriptProjects:Oe.projects,clojureConfigPath:Fn,indexerConcurrency:Nn,trigger:{kind:Tn,detail:Bn||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 _n(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 Wn(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 Un(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
@@ -160,6 +160,23 @@ interface ReindexOptions {
160
160
  /** Source that requested this refresh, persisted for status and setup diagnostics. */
161
161
  trigger?: RefreshTrigger;
162
162
  }
163
+ interface ReindexShardDiagnostic {
164
+ /** Unique id for this shard: the language, or `<language>:<projectPath>` for a TS workspace sub-project. */
165
+ id: string;
166
+ language: SupportedLanguage;
167
+ /** True when the cached shard was reused without rerunning its indexer. */
168
+ reused: boolean;
169
+ /** Present only when `reused` is false: why the cached shard could not be used. */
170
+ missReason?: string;
171
+ /** Short hash of this shard's fingerprint inputs (source content + indexer options). */
172
+ fingerprint: string;
173
+ /** Size in bytes of the shard's cached SCIP output, or null when unavailable. */
174
+ outputBytes: number | null;
175
+ /** Wall time spent producing this shard; 0 when reused. */
176
+ durationMs: number;
177
+ /** Indexer command invoked to produce this shard; absent when reused. */
178
+ command?: string;
179
+ }
163
180
  interface ReindexResult {
164
181
  /** Languages that were successfully indexed. */
165
182
  languages: SupportedLanguage[];
@@ -178,6 +195,8 @@ interface ReindexResult {
178
195
  }[];
179
196
  /** Persisted description of this refresh attempt. */
180
197
  lastRefresh?: LastRefreshMetadata;
198
+ /** Per-shard reuse diagnostics (plan6 6.5.2); one entry per language/workspace shard. */
199
+ shards?: ReindexShardDiagnostic[];
181
200
  }
182
201
  /**
183
202
  * Reindex a project: detect languages, run the appropriate SCIP indexer(s),
@@ -185,4 +204,4 @@ interface ReindexResult {
185
204
  */
186
205
  declare function reindex(opts: ReindexOptions): Promise<ReindexResult>;
187
206
 
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 };
207
+ export { INDEXER_CONFIGS, type ReindexOptions, type ReindexResult, type ReindexShardDiagnostic, augmentAuxiliaryDocuments, augmentVueResolvedReferences, auxiliaryDocumentsAugmentationStage, describeIndexerBinary, detectLanguages, getIndexerConfig, getIndexerExecutionEnv, isBinaryAvailable, isIndexerInstalled, mergeScipFiles, mergeScipIndexes, reindex, resolveIndexerBinary, resolveProjectLocalIndexerBinary, runPostIndexAugmentation, tryInstallIndexer, vueResolvedReferencesAugmentationStage };