ghagga 3.1.0 → 3.3.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 (85) hide show
  1. package/dist/commands/index-cmd.d.ts +49 -0
  2. package/dist/commands/index-cmd.d.ts.map +1 -0
  3. package/dist/commands/index-cmd.js +367 -0
  4. package/dist/commands/index-cmd.js.map +1 -0
  5. package/dist/commands/index-cmd.test.d.ts +17 -0
  6. package/dist/commands/index-cmd.test.d.ts.map +1 -0
  7. package/dist/commands/index-cmd.test.js +541 -0
  8. package/dist/commands/index-cmd.test.js.map +1 -0
  9. package/dist/commands/indexer-registry.d.ts +93 -0
  10. package/dist/commands/indexer-registry.d.ts.map +1 -0
  11. package/dist/commands/indexer-registry.js +342 -0
  12. package/dist/commands/indexer-registry.js.map +1 -0
  13. package/dist/commands/indexer-registry.test.d.ts +10 -0
  14. package/dist/commands/indexer-registry.test.d.ts.map +1 -0
  15. package/dist/commands/indexer-registry.test.js +538 -0
  16. package/dist/commands/indexer-registry.test.js.map +1 -0
  17. package/dist/commands/memory/backfill.d.ts +13 -0
  18. package/dist/commands/memory/backfill.d.ts.map +1 -0
  19. package/dist/commands/memory/backfill.js +47 -0
  20. package/dist/commands/memory/backfill.js.map +1 -0
  21. package/dist/commands/memory/backfill.test.d.ts +11 -0
  22. package/dist/commands/memory/backfill.test.d.ts.map +1 -0
  23. package/dist/commands/memory/backfill.test.js +127 -0
  24. package/dist/commands/memory/backfill.test.js.map +1 -0
  25. package/dist/commands/memory/clear.test.js +9 -0
  26. package/dist/commands/memory/clear.test.js.map +1 -1
  27. package/dist/commands/memory/delete.test.js +9 -0
  28. package/dist/commands/memory/delete.test.js.map +1 -1
  29. package/dist/commands/memory/index.d.ts +3 -3
  30. package/dist/commands/memory/index.d.ts.map +1 -1
  31. package/dist/commands/memory/index.js +5 -3
  32. package/dist/commands/memory/index.js.map +1 -1
  33. package/dist/commands/memory/list.test.js +9 -0
  34. package/dist/commands/memory/list.test.js.map +1 -1
  35. package/dist/commands/memory/search.test.js +9 -0
  36. package/dist/commands/memory/search.test.js.map +1 -1
  37. package/dist/commands/memory/show.test.js +9 -0
  38. package/dist/commands/memory/show.test.js.map +1 -1
  39. package/dist/commands/memory/stats.test.js +9 -0
  40. package/dist/commands/memory/stats.test.js.map +1 -1
  41. package/dist/commands/memory/utils.d.ts.map +1 -1
  42. package/dist/commands/memory/utils.js +14 -1
  43. package/dist/commands/memory/utils.js.map +1 -1
  44. package/dist/commands/review-blast-radius.test.d.ts +13 -0
  45. package/dist/commands/review-blast-radius.test.d.ts.map +1 -0
  46. package/dist/commands/review-blast-radius.test.js +179 -0
  47. package/dist/commands/review-blast-radius.test.js.map +1 -0
  48. package/dist/commands/review-output.test.js +9 -0
  49. package/dist/commands/review-output.test.js.map +1 -1
  50. package/dist/commands/review.d.ts +112 -1
  51. package/dist/commands/review.d.ts.map +1 -1
  52. package/dist/commands/review.js +278 -4
  53. package/dist/commands/review.js.map +1 -1
  54. package/dist/commands/review.test.js +299 -0
  55. package/dist/commands/review.test.js.map +1 -1
  56. package/dist/commands/triage.d.ts +14 -0
  57. package/dist/commands/triage.d.ts.map +1 -0
  58. package/dist/commands/triage.js +153 -0
  59. package/dist/commands/triage.js.map +1 -0
  60. package/dist/commands/triage.test.d.ts +8 -0
  61. package/dist/commands/triage.test.d.ts.map +1 -0
  62. package/dist/commands/triage.test.js +184 -0
  63. package/dist/commands/triage.test.js.map +1 -0
  64. package/dist/index.js +35 -0
  65. package/dist/index.js.map +1 -1
  66. package/dist/lib/cli-gitlab-client-port.test.js +38 -24
  67. package/dist/lib/cli-gitlab-client-port.test.js.map +1 -1
  68. package/dist/lib/config.d.ts +11 -0
  69. package/dist/lib/config.d.ts.map +1 -1
  70. package/dist/lib/config.js.map +1 -1
  71. package/dist/lib/embedding.d.ts +23 -0
  72. package/dist/lib/embedding.d.ts.map +1 -0
  73. package/dist/lib/embedding.js +39 -0
  74. package/dist/lib/embedding.js.map +1 -0
  75. package/dist/lib/embedding.test.d.ts +8 -0
  76. package/dist/lib/embedding.test.d.ts.map +1 -0
  77. package/dist/lib/embedding.test.js +101 -0
  78. package/dist/lib/embedding.test.js.map +1 -0
  79. package/dist/lib/gitlab-e2e.manual.test.d.ts +38 -5
  80. package/dist/lib/gitlab-e2e.manual.test.d.ts.map +1 -1
  81. package/dist/lib/gitlab-e2e.manual.test.js +93 -15
  82. package/dist/lib/gitlab-e2e.manual.test.js.map +1 -1
  83. package/dist/lib/pr-postback.test.js +40 -24
  84. package/dist/lib/pr-postback.test.js.map +1 -1
  85. package/package.json +8 -7
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Per-language SCIP indexer registry (D1) + marker-file language detection.
3
+ *
4
+ * Hand-rolled, not a scip-io orchestrator wrapper (D1): full control over
5
+ * invocation flags, per-language degradation, and trivially mockable in
6
+ * tests. Tier A shipped the Go entry (refactored from the previous
7
+ * Go-hardcoded `index-cmd.ts`); Tier B added TS/JS, Python, and Rust. Tier C
8
+ * (this PR) adds Java+Kotlin (shared `scip-java` indexer, `heavy` maturity)
9
+ * and C# (`scip-dotnet`, `experimental` maturity — scip-dotnet 0.2.x is an
10
+ * immature upstream indexer, not merely "heavy" like scip-java). Tier D
11
+ * (this PR) adds PHP (`scip-php`, `experimental`).
12
+ */
13
+ import { type SupportedLanguage } from 'ghagga-core';
14
+ export type IndexerMaturity = 'stable' | 'heavy' | 'experimental';
15
+ export interface IndexerEntry {
16
+ /** The underlying SCIP indexer binary, e.g. `scip-go`. */
17
+ bin: string;
18
+ /** Languages this indexer produces documents for (scip-java → java+kotlin). */
19
+ languages: SupportedLanguage[];
20
+ /** Marker files whose presence (any one) triggers detection for this entry. */
21
+ markers: string[];
22
+ /** True when the indexer binary (and any required toolchain) is on PATH. */
23
+ toolchainCheck(): boolean;
24
+ /**
25
+ * Run the indexer against `dir`, writing its SCIP output to `outPath`
26
+ * (an absolute path chosen by the DISPATCHER — D3: centralized under
27
+ * `<repoPath>/.ghagga/scip/`, disambiguated per marker directory) and
28
+ * returning `outPath`. Entries never compute their own output path —
29
+ * once runs multiply (one dir → many possible marker dirs per entry),
30
+ * the dispatcher owns the output namespace to avoid same-bin collisions
31
+ * (e.g. two `scip-python` runs both wanting `scip-python.scip`).
32
+ * Throws on runtime failure — the dispatcher catches and degrades.
33
+ */
34
+ run(dir: string, outPath: string): string;
35
+ /** Human-readable install instructions, shown when the toolchain is absent. */
36
+ installHint: string;
37
+ maturity: IndexerMaturity;
38
+ }
39
+ /** Directory (relative to repo root) where isolated per-indexer `.scip` outputs live. */
40
+ export declare const SCIP_OUTPUT_DIR = ".ghagga/scip";
41
+ /** Absolute isolated output path for a given indexer bin name, under `dir`. */
42
+ export declare function scipOutputPath(dir: string, bin: string): string;
43
+ /**
44
+ * Tier A shipped the Go entry; Tier B added TS/JS, Python, Rust. Tier C/D
45
+ * (this PR) add Java+Kotlin, C#, and PHP — the dispatcher (`index-cmd.ts`)
46
+ * and `detectPresentLanguages` already generalize over N entries.
47
+ */
48
+ export declare const INDEXER_REGISTRY: IndexerEntry[];
49
+ /** One `{indexer entry, marker directory}` pair discovered by the marker walk. */
50
+ export interface MarkerDirPair {
51
+ entry: IndexerEntry;
52
+ /** Absolute path to the directory the marker was found in. */
53
+ dir: string;
54
+ }
55
+ export interface DetectMarkerDirectoriesOptions {
56
+ /** Maximum depth (repo root = 0) the walk descends to. Default `DEFAULT_MARKER_DEPTH`. */
57
+ maxDepth?: number;
58
+ /** Directory names to skip, IN ADDITION TO `EXCLUDED_DIRS`. */
59
+ extraExcludedDirs?: Set<string>;
60
+ }
61
+ /**
62
+ * Default marker-walk depth bound (D2). biogas-scale monorepos put
63
+ * `apps/*` and `services/*` marker dirs at depth 2; depth 4 gives headroom
64
+ * for `packages/x/y`-shaped nesting while bounding pathological repos'
65
+ * walk time. Configurable via `opts.maxDepth`.
66
+ */
67
+ export declare const DEFAULT_MARKER_DEPTH = 4;
68
+ /**
69
+ * Walk `repoPath` depth-bounded (default `DEFAULT_MARKER_DEPTH`), evaluating
70
+ * every `INDEXER_REGISTRY` entry's markers against EVERY visited directory's
71
+ * entries (not just repo root) — reusing `markerPresent` per dir. Skips
72
+ * `EXCLUDED_DIRS` (plus `opts.extraExcludedDirs`). Root = depth 0.
73
+ *
74
+ * One pair is emitted per (entry that matches, directory) — this is how
75
+ * multi-lang-per-dir and same-lang-multi-dir both fall out naturally,
76
+ * deduped structurally (a Set keyed by `bin:dir`) so an entry with multiple
77
+ * matching markers in the same dir (e.g. `package.json` + `tsconfig.json`)
78
+ * still yields exactly one pair for that dir.
79
+ *
80
+ * Does not check toolchain availability — that remains the dispatcher's job.
81
+ */
82
+ export declare function detectMarkerDirectories(repoPath: string, opts?: DetectMarkerDirectoriesOptions): MarkerDirPair[];
83
+ /**
84
+ * Detect which registry entries are "present" in `repoPath`, based on
85
+ * marker files at the repo root only (depth 0 wrapper over
86
+ * `detectMarkerDirectories`, kept for back-compat with callers that only
87
+ * care about "which languages", not "in which directories").
88
+ * Does not check toolchain availability — that's a separate step so the
89
+ * dispatcher can warn about missing toolchains for detected-but-unavailable
90
+ * languages instead of silently skipping them.
91
+ */
92
+ export declare function detectPresentLanguages(repoPath: string): IndexerEntry[];
93
+ //# sourceMappingURL=indexer-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer-registry.d.ts","sourceRoot":"","sources":["../../src/commands/indexer-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIpE,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,+EAA+E;IAC/E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,4EAA4E;IAC5E,cAAc,IAAI,OAAO,CAAC;IAC1B;;;;;;;;;OASG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1C,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAID,yFAAyF;AACzF,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAE9C,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/D;AAgPD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAAY,EAQ1C,CAAC;AAoBF,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,8BAA8B;IAC7C,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,8BAAmC,GACxC,aAAa,EAAE,CAsCjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,EAAE,CAUvE"}
@@ -0,0 +1,342 @@
1
+ /**
2
+ * Per-language SCIP indexer registry (D1) + marker-file language detection.
3
+ *
4
+ * Hand-rolled, not a scip-io orchestrator wrapper (D1): full control over
5
+ * invocation flags, per-language degradation, and trivially mockable in
6
+ * tests. Tier A shipped the Go entry (refactored from the previous
7
+ * Go-hardcoded `index-cmd.ts`); Tier B added TS/JS, Python, and Rust. Tier C
8
+ * (this PR) adds Java+Kotlin (shared `scip-java` indexer, `heavy` maturity)
9
+ * and C# (`scip-dotnet`, `experimental` maturity — scip-dotnet 0.2.x is an
10
+ * immature upstream indexer, not merely "heavy" like scip-java). Tier D
11
+ * (this PR) adds PHP (`scip-php`, `experimental`).
12
+ */
13
+ import { execFileSync } from 'node:child_process';
14
+ import { existsSync, mkdirSync, readdirSync, renameSync, rmSync } from 'node:fs';
15
+ import { dirname, join } from 'node:path';
16
+ import { EXCLUDED_DIRS } from 'ghagga-core';
17
+ // ─── Output Isolation Helpers (D2) ───────────────────────────────
18
+ /** Directory (relative to repo root) where isolated per-indexer `.scip` outputs live. */
19
+ export const SCIP_OUTPUT_DIR = '.ghagga/scip';
20
+ /** Absolute isolated output path for a given indexer bin name, under `dir`. */
21
+ export function scipOutputPath(dir, bin) {
22
+ return join(dir, SCIP_OUTPUT_DIR, `${bin}.scip`);
23
+ }
24
+ // ─── Go Entry ───────────────────────────────────────────────────
25
+ const SCIP_GO_INSTALL_HINT = 'go install github.com/scip-code/scip-go/cmd/scip-go@latest';
26
+ /** Check whether a command is resolvable on PATH. */
27
+ function commandExists(cmd) {
28
+ try {
29
+ const finder = process.platform === 'win32' ? 'where' : 'which';
30
+ execFileSync(finder, [cmd], { stdio: 'ignore' });
31
+ return true;
32
+ }
33
+ catch {
34
+ return false;
35
+ }
36
+ }
37
+ const goEntry = {
38
+ bin: 'scip-go',
39
+ languages: ['go'],
40
+ markers: ['go.mod'],
41
+ toolchainCheck() {
42
+ return commandExists('go') && commandExists('scip-go');
43
+ },
44
+ run(dir, outPath) {
45
+ const producedPath = join(dir, 'index.scip');
46
+ // Guard against a stale root-level `index.scip` from a prior manual
47
+ // `scip-go` run being mistaken for output from THIS run.
48
+ if (existsSync(producedPath)) {
49
+ rmSync(producedPath);
50
+ }
51
+ // scip-go always writes `index.scip` in its cwd — no native --output
52
+ // flag — so run in cwd then move to the dispatcher-chosen path (D2/D3
53
+ // run-then-move fallback).
54
+ execFileSync('scip-go', [], { cwd: dir, stdio: 'inherit' });
55
+ if (!existsSync(producedPath)) {
56
+ throw new Error(`scip-go did not produce an index at ${producedPath}`);
57
+ }
58
+ // The isolated output dir (.ghagga/scip/) is not guaranteed to exist on
59
+ // a fresh repo — create it before moving the produced file into it.
60
+ mkdirSync(dirname(outPath), { recursive: true });
61
+ renameSync(producedPath, outPath);
62
+ return outPath;
63
+ },
64
+ installHint: SCIP_GO_INSTALL_HINT,
65
+ maturity: 'stable',
66
+ };
67
+ // ─── TypeScript/JavaScript Entry ─────────────────────────────────
68
+ const SCIP_TYPESCRIPT_INSTALL_HINT = 'npm install -g @sourcegraph/scip-typescript';
69
+ const tsEntry = {
70
+ bin: 'scip-typescript',
71
+ languages: ['typescript', 'javascript'],
72
+ markers: ['package.json', 'tsconfig.json'],
73
+ toolchainCheck() {
74
+ return commandExists('scip-typescript');
75
+ },
76
+ run(dir, outPath) {
77
+ mkdirSync(dirname(outPath), { recursive: true });
78
+ // scip-typescript supports a native --output flag, unlike scip-go — no
79
+ // run-then-move needed (D2: still isolated, just directly).
80
+ execFileSync('scip-typescript', ['index', '--cwd', dir, '--infer-tsconfig', '--output', outPath], {
81
+ cwd: dir,
82
+ stdio: 'inherit',
83
+ });
84
+ if (!existsSync(outPath)) {
85
+ throw new Error(`scip-typescript did not produce an index at ${outPath}`);
86
+ }
87
+ return outPath;
88
+ },
89
+ installHint: SCIP_TYPESCRIPT_INSTALL_HINT,
90
+ maturity: 'stable',
91
+ };
92
+ // ─── Python Entry ─────────────────────────────────────────────────
93
+ const SCIP_PYTHON_INSTALL_HINT = 'npm install -g @sourcegraph/scip-python';
94
+ const pythonEntry = {
95
+ bin: 'scip-python',
96
+ languages: ['python'],
97
+ markers: ['pyproject.toml', 'requirements.txt', 'setup.py'],
98
+ toolchainCheck() {
99
+ return commandExists('scip-python');
100
+ },
101
+ run(dir, outPath) {
102
+ mkdirSync(dirname(outPath), { recursive: true });
103
+ // scip-python also supports a native --output flag.
104
+ execFileSync('scip-python', ['index', '--cwd', dir, '--output', outPath], {
105
+ cwd: dir,
106
+ stdio: 'inherit',
107
+ });
108
+ if (!existsSync(outPath)) {
109
+ throw new Error(`scip-python did not produce an index at ${outPath}`);
110
+ }
111
+ return outPath;
112
+ },
113
+ installHint: SCIP_PYTHON_INSTALL_HINT,
114
+ maturity: 'stable',
115
+ };
116
+ // ─── Rust Entry ─────────────────────────────────────────────────
117
+ const RUST_ANALYZER_INSTALL_HINT = 'rustup component add rust-analyzer';
118
+ const rustEntry = {
119
+ bin: 'rust-analyzer',
120
+ languages: ['rust'],
121
+ markers: ['Cargo.toml'],
122
+ toolchainCheck() {
123
+ return commandExists('rust-analyzer');
124
+ },
125
+ run(dir, outPath) {
126
+ mkdirSync(dirname(outPath), { recursive: true });
127
+ // rust-analyzer's `scip` subcommand also supports a native --output flag.
128
+ execFileSync('rust-analyzer', ['scip', dir, '--output', outPath], {
129
+ cwd: dir,
130
+ stdio: 'inherit',
131
+ });
132
+ if (!existsSync(outPath)) {
133
+ throw new Error(`rust-analyzer did not produce an index at ${outPath}`);
134
+ }
135
+ return outPath;
136
+ },
137
+ installHint: RUST_ANALYZER_INSTALL_HINT,
138
+ maturity: 'stable',
139
+ };
140
+ // ─── Java/Kotlin Entry ────────────────────────────────────────────
141
+ // Coordinate VERIFIED 2026-07-15 against Maven Central: `org.scip-code:scip-java`
142
+ // resolves (latest 0.13.1); the older `com.sourcegraph:scip-java` is 404 (only
143
+ // the Scala-suffixed `com.sourcegraph:scip-java_2.13` @ 0.12.x exists). The hint
144
+ // below is correct — closes the BL-SCIP-JAVA-INSTALL-HINT "possibly-wrong" concern.
145
+ const SCIP_JAVA_INSTALL_HINT = 'curl -fLo coursier https://git.io/coursier-cli && chmod +x coursier && ' +
146
+ './coursier bootstrap --standalone -o scip-java org.scip-code:scip-java:latest.stable ' +
147
+ '--main org.scip_code.scip_java.ScipJava (requires a JDK 17+ host JVM and a ' +
148
+ 'Gradle or Maven build in the target repo — Kotlin support is Gradle-only)';
149
+ const javaEntry = {
150
+ bin: 'scip-java',
151
+ languages: ['java', 'kotlin'],
152
+ markers: ['pom.xml', 'build.gradle', 'build.gradle.kts'],
153
+ toolchainCheck() {
154
+ return commandExists('scip-java') && (commandExists('gradle') || commandExists('mvn'));
155
+ },
156
+ run(dir, outPath) {
157
+ mkdirSync(dirname(outPath), { recursive: true });
158
+ // scip-java's `index` command supports a native --output flag (unlike
159
+ // scip-go/scip-php) — it auto-detects Gradle vs Maven in `dir` and shells
160
+ // out to it (D2: still isolated, just directly, like tsEntry/pythonEntry).
161
+ execFileSync('scip-java', ['index', '--output', outPath], {
162
+ cwd: dir,
163
+ stdio: 'inherit',
164
+ });
165
+ if (!existsSync(outPath)) {
166
+ throw new Error(`scip-java did not produce an index at ${outPath}`);
167
+ }
168
+ return outPath;
169
+ },
170
+ installHint: SCIP_JAVA_INSTALL_HINT,
171
+ maturity: 'heavy',
172
+ };
173
+ // ─── C# Entry ─────────────────────────────────────────────────────
174
+ const SCIP_DOTNET_INSTALL_HINT = 'dotnet tool install --global scip-dotnet (requires .NET 8.0+ SDK; experimental indexer)';
175
+ const csharpEntry = {
176
+ bin: 'scip-dotnet',
177
+ languages: ['csharp'],
178
+ markers: ['*.csproj', '*.sln'],
179
+ toolchainCheck() {
180
+ return commandExists('scip-dotnet') && commandExists('dotnet');
181
+ },
182
+ run(dir, outPath) {
183
+ mkdirSync(dirname(outPath), { recursive: true });
184
+ // scip-dotnet's `index` command supports a native --output flag plus
185
+ // --working-directory (its own project/solution auto-discovery arg is
186
+ // positional and optional — omitted here to let it self-discover).
187
+ execFileSync('scip-dotnet', ['index', '--output', outPath, '--working-directory', dir], {
188
+ cwd: dir,
189
+ stdio: 'inherit',
190
+ });
191
+ if (!existsSync(outPath)) {
192
+ throw new Error(`scip-dotnet did not produce an index at ${outPath}`);
193
+ }
194
+ return outPath;
195
+ },
196
+ installHint: SCIP_DOTNET_INSTALL_HINT,
197
+ maturity: 'experimental',
198
+ };
199
+ // ─── PHP Entry ────────────────────────────────────────────────────
200
+ const SCIP_PHP_INSTALL_HINT = 'composer require --dev davidrjenni/scip-php && composer dump-autoload ' +
201
+ '(requires a composer.json with autoload psr-4/classmap entries covering ' +
202
+ 'the sources to index; experimental, solo-maintained indexer)';
203
+ const phpEntry = {
204
+ bin: 'scip-php',
205
+ languages: ['php'],
206
+ markers: ['composer.json'],
207
+ toolchainCheck() {
208
+ return commandExists('scip-php');
209
+ },
210
+ run(dir, outPath) {
211
+ const producedPath = join(dir, 'index.scip');
212
+ // Guard against a stale root-level `index.scip` from a prior manual run
213
+ // (same rationale as goEntry).
214
+ if (existsSync(producedPath)) {
215
+ rmSync(producedPath);
216
+ }
217
+ // scip-php has no --output flag — it always writes `index.scip` to its
218
+ // cwd (verified against davidrjenni/scip-php's bin/scip-php source,
219
+ // which hardcodes `file_put_contents('index.scip', ...)`). Run-then-move
220
+ // (D2 fallback), same pattern as scip-go.
221
+ execFileSync('scip-php', [], { cwd: dir, stdio: 'inherit' });
222
+ if (!existsSync(producedPath)) {
223
+ throw new Error(`scip-php did not produce an index at ${producedPath}`);
224
+ }
225
+ mkdirSync(dirname(outPath), { recursive: true });
226
+ renameSync(producedPath, outPath);
227
+ return outPath;
228
+ },
229
+ installHint: SCIP_PHP_INSTALL_HINT,
230
+ maturity: 'experimental',
231
+ };
232
+ // ─── Registry ───────────────────────────────────────────────────
233
+ /**
234
+ * Tier A shipped the Go entry; Tier B added TS/JS, Python, Rust. Tier C/D
235
+ * (this PR) add Java+Kotlin, C#, and PHP — the dispatcher (`index-cmd.ts`)
236
+ * and `detectPresentLanguages` already generalize over N entries.
237
+ */
238
+ export const INDEXER_REGISTRY = [
239
+ goEntry,
240
+ tsEntry,
241
+ pythonEntry,
242
+ rustEntry,
243
+ javaEntry,
244
+ csharpEntry,
245
+ phpEntry,
246
+ ];
247
+ // ─── Language Detection ─────────────────────────────────────────
248
+ /**
249
+ * Match a single marker against the repo root's entries. Most markers are
250
+ * exact filenames (`Set.has`); a marker starting with `*.` is a minimal
251
+ * glob — any-present file with that extension (e.g. C#'s `*.csproj`/`*.sln`,
252
+ * which have no fixed name).
253
+ */
254
+ function markerPresent(marker, present, rootEntries) {
255
+ if (marker.startsWith('*.')) {
256
+ const ext = marker.slice(1);
257
+ return rootEntries.some((f) => f.endsWith(ext));
258
+ }
259
+ return present.has(marker);
260
+ }
261
+ /**
262
+ * Default marker-walk depth bound (D2). biogas-scale monorepos put
263
+ * `apps/*` and `services/*` marker dirs at depth 2; depth 4 gives headroom
264
+ * for `packages/x/y`-shaped nesting while bounding pathological repos'
265
+ * walk time. Configurable via `opts.maxDepth`.
266
+ */
267
+ export const DEFAULT_MARKER_DEPTH = 4;
268
+ /**
269
+ * Walk `repoPath` depth-bounded (default `DEFAULT_MARKER_DEPTH`), evaluating
270
+ * every `INDEXER_REGISTRY` entry's markers against EVERY visited directory's
271
+ * entries (not just repo root) — reusing `markerPresent` per dir. Skips
272
+ * `EXCLUDED_DIRS` (plus `opts.extraExcludedDirs`). Root = depth 0.
273
+ *
274
+ * One pair is emitted per (entry that matches, directory) — this is how
275
+ * multi-lang-per-dir and same-lang-multi-dir both fall out naturally,
276
+ * deduped structurally (a Set keyed by `bin:dir`) so an entry with multiple
277
+ * matching markers in the same dir (e.g. `package.json` + `tsconfig.json`)
278
+ * still yields exactly one pair for that dir.
279
+ *
280
+ * Does not check toolchain availability — that remains the dispatcher's job.
281
+ */
282
+ export function detectMarkerDirectories(repoPath, opts = {}) {
283
+ const maxDepth = opts.maxDepth ?? DEFAULT_MARKER_DEPTH;
284
+ const excluded = opts.extraExcludedDirs
285
+ ? new Set([...EXCLUDED_DIRS, ...opts.extraExcludedDirs])
286
+ : EXCLUDED_DIRS;
287
+ const pairs = [];
288
+ const seen = new Set();
289
+ function walk(dir, depth) {
290
+ let dirents;
291
+ try {
292
+ dirents = readdirSync(dir, { withFileTypes: true });
293
+ }
294
+ catch {
295
+ return;
296
+ }
297
+ const names = dirents.map((d) => d.name);
298
+ const present = new Set(names);
299
+ for (const entry of INDEXER_REGISTRY) {
300
+ if (!entry.markers.some((marker) => markerPresent(marker, present, names)))
301
+ continue;
302
+ const key = `${entry.bin}:${dir}`;
303
+ if (seen.has(key))
304
+ continue;
305
+ seen.add(key);
306
+ pairs.push({ entry, dir });
307
+ }
308
+ if (depth >= maxDepth)
309
+ return;
310
+ for (const dirent of dirents) {
311
+ if (!dirent.isDirectory())
312
+ continue;
313
+ if (excluded.has(dirent.name))
314
+ continue;
315
+ walk(join(dir, dirent.name), depth + 1);
316
+ }
317
+ }
318
+ walk(repoPath, 0);
319
+ return pairs;
320
+ }
321
+ /**
322
+ * Detect which registry entries are "present" in `repoPath`, based on
323
+ * marker files at the repo root only (depth 0 wrapper over
324
+ * `detectMarkerDirectories`, kept for back-compat with callers that only
325
+ * care about "which languages", not "in which directories").
326
+ * Does not check toolchain availability — that's a separate step so the
327
+ * dispatcher can warn about missing toolchains for detected-but-unavailable
328
+ * languages instead of silently skipping them.
329
+ */
330
+ export function detectPresentLanguages(repoPath) {
331
+ const pairs = detectMarkerDirectories(repoPath, { maxDepth: 0 });
332
+ const entries = [];
333
+ const seen = new Set();
334
+ for (const { entry } of pairs) {
335
+ if (seen.has(entry))
336
+ continue;
337
+ seen.add(entry);
338
+ entries.push(entry);
339
+ }
340
+ return entries;
341
+ }
342
+ //# sourceMappingURL=indexer-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer-registry.js","sourceRoot":"","sources":["../../src/commands/indexer-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AA+BpE,oEA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language SCIP indexer registry (D1) and marker-file
3
+ * language detection (spec "Language Detection").
4
+ *
5
+ * Mocked: `execFileSync` (toolchain checks/`run` under the hood) — no real
6
+ * toolchains are ever invoked. `detectPresentLanguages` only touches the
7
+ * filesystem (marker files), so it's tested against a real temp dir.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=indexer-registry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer-registry.test.d.ts","sourceRoot":"","sources":["../../src/commands/indexer-registry.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}