@stupidloud/codegraph 0.7.20 → 0.9.5

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 (155) hide show
  1. package/README.md +127 -106
  2. package/dist/bin/codegraph.d.ts +4 -0
  3. package/dist/bin/codegraph.d.ts.map +1 -1
  4. package/dist/bin/codegraph.js +327 -8
  5. package/dist/bin/codegraph.js.map +1 -1
  6. package/dist/bin/node-version-check.d.ts +17 -0
  7. package/dist/bin/node-version-check.d.ts.map +1 -1
  8. package/dist/bin/node-version-check.js +37 -0
  9. package/dist/bin/node-version-check.js.map +1 -1
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +1 -11
  12. package/dist/config.js.map +1 -1
  13. package/dist/db/index.d.ts +30 -1
  14. package/dist/db/index.d.ts.map +1 -1
  15. package/dist/db/index.js +75 -25
  16. package/dist/db/index.js.map +1 -1
  17. package/dist/db/queries.d.ts +16 -0
  18. package/dist/db/queries.d.ts.map +1 -1
  19. package/dist/db/queries.js +80 -27
  20. package/dist/db/queries.js.map +1 -1
  21. package/dist/db/sqlite-adapter.d.ts +17 -23
  22. package/dist/db/sqlite-adapter.d.ts.map +1 -1
  23. package/dist/db/sqlite-adapter.js +51 -174
  24. package/dist/db/sqlite-adapter.js.map +1 -1
  25. package/dist/extraction/grammars.d.ts +7 -1
  26. package/dist/extraction/grammars.d.ts.map +1 -1
  27. package/dist/extraction/grammars.js +42 -2
  28. package/dist/extraction/grammars.js.map +1 -1
  29. package/dist/extraction/index.d.ts +9 -14
  30. package/dist/extraction/index.d.ts.map +1 -1
  31. package/dist/extraction/index.js +131 -124
  32. package/dist/extraction/index.js.map +1 -1
  33. package/dist/extraction/languages/index.d.ts.map +1 -1
  34. package/dist/extraction/languages/index.js +4 -0
  35. package/dist/extraction/languages/index.js.map +1 -1
  36. package/dist/extraction/languages/lua.d.ts +3 -0
  37. package/dist/extraction/languages/lua.d.ts.map +1 -0
  38. package/dist/extraction/languages/lua.js +150 -0
  39. package/dist/extraction/languages/lua.js.map +1 -0
  40. package/dist/extraction/languages/luau.d.ts +3 -0
  41. package/dist/extraction/languages/luau.d.ts.map +1 -0
  42. package/dist/extraction/languages/luau.js +37 -0
  43. package/dist/extraction/languages/luau.js.map +1 -0
  44. package/dist/extraction/tree-sitter.d.ts.map +1 -1
  45. package/dist/extraction/tree-sitter.js +38 -0
  46. package/dist/extraction/tree-sitter.js.map +1 -1
  47. package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  48. package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
  49. package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
  50. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
  51. package/dist/extraction/wasm-runtime-flags.js +105 -0
  52. package/dist/extraction/wasm-runtime-flags.js.map +1 -0
  53. package/dist/graph/traversal.d.ts.map +1 -1
  54. package/dist/graph/traversal.js +71 -36
  55. package/dist/graph/traversal.js.map +1 -1
  56. package/dist/index.d.ts +11 -5
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +28 -18
  59. package/dist/index.js.map +1 -1
  60. package/dist/installer/config-writer.d.ts.map +1 -1
  61. package/dist/installer/config-writer.js +3 -1
  62. package/dist/installer/config-writer.js.map +1 -1
  63. package/dist/installer/index.d.ts +66 -2
  64. package/dist/installer/index.d.ts.map +1 -1
  65. package/dist/installer/index.js +195 -5
  66. package/dist/installer/index.js.map +1 -1
  67. package/dist/installer/instructions-template.d.ts +2 -2
  68. package/dist/installer/instructions-template.d.ts.map +1 -1
  69. package/dist/installer/instructions-template.js +4 -2
  70. package/dist/installer/instructions-template.js.map +1 -1
  71. package/dist/installer/targets/claude.d.ts +26 -6
  72. package/dist/installer/targets/claude.d.ts.map +1 -1
  73. package/dist/installer/targets/claude.js +165 -10
  74. package/dist/installer/targets/claude.js.map +1 -1
  75. package/dist/installer/targets/cursor.d.ts.map +1 -1
  76. package/dist/installer/targets/cursor.js +57 -3
  77. package/dist/installer/targets/cursor.js.map +1 -1
  78. package/dist/installer/targets/hermes.d.ts +18 -0
  79. package/dist/installer/targets/hermes.d.ts.map +1 -0
  80. package/dist/installer/targets/hermes.js +305 -0
  81. package/dist/installer/targets/hermes.js.map +1 -0
  82. package/dist/installer/targets/registry.d.ts.map +1 -1
  83. package/dist/installer/targets/registry.js +2 -0
  84. package/dist/installer/targets/registry.js.map +1 -1
  85. package/dist/installer/targets/types.d.ts +1 -1
  86. package/dist/installer/targets/types.d.ts.map +1 -1
  87. package/dist/mcp/index.d.ts +12 -0
  88. package/dist/mcp/index.d.ts.map +1 -1
  89. package/dist/mcp/index.js +213 -18
  90. package/dist/mcp/index.js.map +1 -1
  91. package/dist/mcp/server-instructions.d.ts +1 -1
  92. package/dist/mcp/server-instructions.d.ts.map +1 -1
  93. package/dist/mcp/server-instructions.js +15 -0
  94. package/dist/mcp/server-instructions.js.map +1 -1
  95. package/dist/mcp/tools.d.ts +25 -1
  96. package/dist/mcp/tools.d.ts.map +1 -1
  97. package/dist/mcp/tools.js +221 -30
  98. package/dist/mcp/tools.js.map +1 -1
  99. package/dist/mcp/transport.d.ts +17 -0
  100. package/dist/mcp/transport.d.ts.map +1 -1
  101. package/dist/mcp/transport.js +63 -0
  102. package/dist/mcp/transport.js.map +1 -1
  103. package/dist/resolution/frameworks/drupal.d.ts +51 -0
  104. package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
  105. package/dist/resolution/frameworks/drupal.js +335 -0
  106. package/dist/resolution/frameworks/drupal.js.map +1 -0
  107. package/dist/resolution/frameworks/index.d.ts +2 -0
  108. package/dist/resolution/frameworks/index.d.ts.map +1 -1
  109. package/dist/resolution/frameworks/index.js +9 -1
  110. package/dist/resolution/frameworks/index.js.map +1 -1
  111. package/dist/resolution/frameworks/nestjs.d.ts +26 -0
  112. package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  113. package/dist/resolution/frameworks/nestjs.js +374 -0
  114. package/dist/resolution/frameworks/nestjs.js.map +1 -0
  115. package/dist/resolution/index.d.ts.map +1 -1
  116. package/dist/resolution/index.js +40 -7
  117. package/dist/resolution/index.js.map +1 -1
  118. package/dist/resolution/lru-cache.d.ts +24 -0
  119. package/dist/resolution/lru-cache.d.ts.map +1 -0
  120. package/dist/resolution/lru-cache.js +62 -0
  121. package/dist/resolution/lru-cache.js.map +1 -0
  122. package/dist/sync/git-hooks.d.ts +45 -0
  123. package/dist/sync/git-hooks.d.ts.map +1 -0
  124. package/dist/sync/git-hooks.js +223 -0
  125. package/dist/sync/git-hooks.js.map +1 -0
  126. package/dist/sync/index.d.ts +4 -0
  127. package/dist/sync/index.d.ts.map +1 -1
  128. package/dist/sync/index.js +12 -1
  129. package/dist/sync/index.js.map +1 -1
  130. package/dist/sync/watch-policy.d.ts +48 -0
  131. package/dist/sync/watch-policy.d.ts.map +1 -0
  132. package/dist/sync/watch-policy.js +124 -0
  133. package/dist/sync/watch-policy.js.map +1 -0
  134. package/dist/sync/watcher.d.ts +2 -4
  135. package/dist/sync/watcher.d.ts.map +1 -1
  136. package/dist/sync/watcher.js +14 -6
  137. package/dist/sync/watcher.js.map +1 -1
  138. package/dist/types.d.ts +1 -1
  139. package/dist/types.d.ts.map +1 -1
  140. package/dist/types.js +11 -0
  141. package/dist/types.js.map +1 -1
  142. package/dist/utils.js +1 -1
  143. package/package.json +4 -4
  144. package/scripts/add-lang/bench.sh +60 -0
  145. package/scripts/add-lang/check-grammar.mjs +75 -0
  146. package/scripts/add-lang/dump-ast.mjs +103 -0
  147. package/scripts/add-lang/verify-extraction.mjs +70 -0
  148. package/scripts/agent-eval/audit.sh +68 -0
  149. package/scripts/agent-eval/itrun.sh +1 -1
  150. package/scripts/agent-eval/run-all.sh +67 -0
  151. package/scripts/build-bundle.sh +118 -0
  152. package/scripts/npm-shim.js +246 -0
  153. package/scripts/pack-npm.sh +95 -0
  154. package/scripts/patch-tree-sitter-dart.js +0 -112
  155. package/scripts/release.sh +0 -68
@@ -2,7 +2,8 @@
2
2
  * CodeGraph Interactive Installer
3
3
  *
4
4
  * Multi-target: writes MCP server config + instructions for the
5
- * agents the user picks (Claude Code, Cursor, Codex CLI, opencode).
5
+ * agents the user picks (Claude Code, Cursor, Codex CLI, opencode,
6
+ * Hermes Agent).
6
7
  * Defaults to the Claude-only behavior for backwards compatibility
7
8
  * when no targets are explicitly chosen and nothing else is detected.
8
9
  *
@@ -10,7 +11,7 @@
10
11
  * is the non-interactive entry point used by the `--target` /
11
12
  * `--print-config` CLI flags.
12
13
  */
13
- import type { AgentTarget, Location, WriteResult } from './targets/types';
14
+ import type { AgentTarget, Location, TargetId, WriteResult } from './targets/types';
14
15
  export { writeMcpConfig, writePermissions, writeClaudeMd, hasMcpConfig, hasPermissions, hasClaudeMdSection, } from './config-writer';
15
16
  export type { InstallLocation } from './config-writer';
16
17
  export interface RunInstallerOptions {
@@ -33,6 +34,57 @@ export interface RunInstallerOptions {
33
34
  */
34
35
  export declare function runInstaller(): Promise<void>;
35
36
  export declare function runInstallerWithOptions(opts: RunInstallerOptions): Promise<void>;
37
+ export interface RunUninstallerOptions {
38
+ /**
39
+ * Comma-separated target list, or `auto` / `all` / `none`. Defaults
40
+ * to `all` — uninstall sweeps every known agent and reports which
41
+ * ones it actually touched, so the user doesn't have to know where
42
+ * they configured it.
43
+ */
44
+ target?: string;
45
+ /** Skip the location prompt; use this value directly. */
46
+ location?: Location;
47
+ /** Non-interactive: location=global, target=all, no prompts. */
48
+ yes?: boolean;
49
+ }
50
+ export type UninstallStatus = 'removed' | 'not-configured' | 'unsupported';
51
+ /**
52
+ * Per-target outcome of an uninstall sweep. `removed` means we deleted
53
+ * at least one thing; `not-configured` means the agent had no codegraph
54
+ * config at this location (nothing to do); `unsupported` means the
55
+ * agent has no config concept for this location (e.g. Codex is
56
+ * global-only, so a `local` uninstall skips it).
57
+ */
58
+ export interface UninstallReport {
59
+ id: TargetId;
60
+ displayName: string;
61
+ status: UninstallStatus;
62
+ /** Absolute paths we actually edited/removed (action === 'removed'). */
63
+ removedPaths: string[];
64
+ /** Verbatim notes from the target (rare for uninstall). */
65
+ notes: string[];
66
+ }
67
+ /**
68
+ * Pure uninstall sweep — no prompts, no I/O beyond the targets' own
69
+ * file edits. Exposed (and unit-tested) separately from the clack UI in
70
+ * `runUninstaller` so the aggregation logic can be asserted directly.
71
+ *
72
+ * Each target's `uninstall()` is already safe to call when nothing was
73
+ * installed (it returns `not-found` actions), so this is safe to run
74
+ * across every target unconditionally.
75
+ */
76
+ export declare function uninstallTargets(targets: readonly AgentTarget[], location: Location): UninstallReport[];
77
+ /**
78
+ * Interactive uninstaller — the inverse of `runInstallerWithOptions`.
79
+ * Asks global-vs-local first (unless `--location`/`--yes` is given),
80
+ * then sweeps every agent target (or the `--target` subset) and prints
81
+ * one block per agent so the user sees exactly which providers it hit.
82
+ *
83
+ * Removes only what install wrote (MCP server entry, instructions
84
+ * block, permissions) — never the `.codegraph/` index, which `codegraph
85
+ * uninit` owns.
86
+ */
87
+ export declare function runUninstaller(opts: RunUninstallerOptions): Promise<void>;
36
88
  /**
37
89
  * For every target that has a global config and exposes
38
90
  * `wireProjectSurfaces`, write its project-local surfaces (e.g.
@@ -50,4 +102,16 @@ export declare function wireProjectSurfacesForGlobalAgents(): Array<{
50
102
  target: AgentTarget;
51
103
  file: WriteResult['files'][number];
52
104
  }>;
105
+ /**
106
+ * When the live file watcher will be disabled for this project (e.g. WSL2
107
+ * /mnt drives, or CODEGRAPH_NO_WATCH), the index would silently go stale.
108
+ * Explain that, and offer to keep it fresh automatically via git hooks
109
+ * (commit / pull / checkout) instead of manual `codegraph sync`.
110
+ *
111
+ * No-op on environments where the watcher runs normally, so it's safe to
112
+ * call unconditionally after init.
113
+ */
114
+ export declare function offerWatchFallback(clack: typeof import('@clack/prompts'), projectPath: string, opts?: {
115
+ yes?: boolean;
116
+ }): Promise<void>;
53
117
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/installer/index.ts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AAO,CAAC,CAAC,MAAM,CAAC,CAAC;CACpC,CAAC,CAcD;AAsHD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,cAAc,gBAAgB,CAAC,EACtC,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3B,OAAO,CAAC,IAAI,CAAC,CAwDf"}
@@ -3,7 +3,8 @@
3
3
  * CodeGraph Interactive Installer
4
4
  *
5
5
  * Multi-target: writes MCP server config + instructions for the
6
- * agents the user picks (Claude Code, Cursor, Codex CLI, opencode).
6
+ * agents the user picks (Claude Code, Cursor, Codex CLI, opencode,
7
+ * Hermes Agent).
7
8
  * Defaults to the Claude-only behavior for backwards compatibility
8
9
  * when no targets are explicitly chosen and nothing else is detected.
9
10
  *
@@ -48,12 +49,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
48
49
  exports.hasClaudeMdSection = exports.hasPermissions = exports.hasMcpConfig = exports.writeClaudeMd = exports.writePermissions = exports.writeMcpConfig = void 0;
49
50
  exports.runInstaller = runInstaller;
50
51
  exports.runInstallerWithOptions = runInstallerWithOptions;
52
+ exports.uninstallTargets = uninstallTargets;
53
+ exports.runUninstaller = runUninstaller;
51
54
  exports.wireProjectSurfacesForGlobalAgents = wireProjectSurfacesForGlobalAgents;
55
+ exports.offerWatchFallback = offerWatchFallback;
52
56
  const child_process_1 = require("child_process");
53
57
  const path = __importStar(require("path"));
54
58
  const fs = __importStar(require("fs"));
55
59
  const registry_1 = require("./targets/registry");
56
60
  const glyphs_1 = require("../ui/glyphs");
61
+ // Import the lightweight submodules directly (not the ../sync barrel, which
62
+ // re-exports FileWatcher and would transitively pull in ../extraction — the
63
+ // installer must stay importable even when native modules can't load).
64
+ const watch_policy_1 = require("../sync/watch-policy");
65
+ const git_hooks_1 = require("../sync/git-hooks");
57
66
  // Backwards-compat: keep these named exports — downstream code may
58
67
  // import them. The shim in `config-writer.ts` continues to re-export
59
68
  // them too.
@@ -206,7 +215,7 @@ async function runInstallerWithOptions(opts) {
206
215
  }
207
216
  // Step 6: for local install, initialize the project.
208
217
  if (location === 'local') {
209
- await initializeLocalProject(clack);
218
+ await initializeLocalProject(clack, useDefaults);
210
219
  }
211
220
  if (location === 'global') {
212
221
  clack.note('cd your-project\ncodegraph init -i', 'Quick start');
@@ -216,6 +225,125 @@ async function runInstallerWithOptions(opts) {
216
225
  : 'Done!';
217
226
  clack.outro(finalNote);
218
227
  }
228
+ /**
229
+ * Pure uninstall sweep — no prompts, no I/O beyond the targets' own
230
+ * file edits. Exposed (and unit-tested) separately from the clack UI in
231
+ * `runUninstaller` so the aggregation logic can be asserted directly.
232
+ *
233
+ * Each target's `uninstall()` is already safe to call when nothing was
234
+ * installed (it returns `not-found` actions), so this is safe to run
235
+ * across every target unconditionally.
236
+ */
237
+ function uninstallTargets(targets, location) {
238
+ return targets.map((target) => {
239
+ if (!target.supportsLocation(location)) {
240
+ const only = location === 'local' ? 'global' : 'local';
241
+ return {
242
+ id: target.id,
243
+ displayName: target.displayName,
244
+ status: 'unsupported',
245
+ removedPaths: [],
246
+ notes: [`no ${location} config — this agent is ${only}-only`],
247
+ };
248
+ }
249
+ const result = target.uninstall(location);
250
+ const removedPaths = result.files
251
+ .filter((f) => f.action === 'removed')
252
+ .map((f) => f.path);
253
+ return {
254
+ id: target.id,
255
+ displayName: target.displayName,
256
+ status: removedPaths.length > 0 ? 'removed' : 'not-configured',
257
+ removedPaths,
258
+ notes: result.notes ?? [],
259
+ };
260
+ });
261
+ }
262
+ /**
263
+ * Interactive uninstaller — the inverse of `runInstallerWithOptions`.
264
+ * Asks global-vs-local first (unless `--location`/`--yes` is given),
265
+ * then sweeps every agent target (or the `--target` subset) and prints
266
+ * one block per agent so the user sees exactly which providers it hit.
267
+ *
268
+ * Removes only what install wrote (MCP server entry, instructions
269
+ * block, permissions) — never the `.codegraph/` index, which `codegraph
270
+ * uninit` owns.
271
+ */
272
+ async function runUninstaller(opts) {
273
+ const clack = await importESM('@clack/prompts');
274
+ clack.intro(`CodeGraph v${getVersion()} — uninstall`);
275
+ const useDefaults = opts.yes === true;
276
+ // Step 1: which location — asked FIRST, the one decision the user
277
+ // must make. Global sweeps ~/.claude, ~/.codex, etc.; local sweeps
278
+ // the configs in this project directory.
279
+ let location;
280
+ if (opts.location) {
281
+ location = opts.location;
282
+ }
283
+ else if (useDefaults) {
284
+ location = 'global';
285
+ }
286
+ else {
287
+ const sel = await clack.select({
288
+ message: 'Remove CodeGraph from all your projects, or just this one?',
289
+ options: [
290
+ { value: 'global', label: 'All projects (global)', hint: '~/.claude, ~/.cursor, ~/.codex, ~/.config/opencode, ~/.hermes' },
291
+ { value: 'local', label: 'Just this project (local)', hint: './.claude, ./.cursor, ./opencode.jsonc' },
292
+ ],
293
+ initialValue: 'global',
294
+ });
295
+ if (clack.isCancel(sel)) {
296
+ clack.cancel('Uninstall cancelled.');
297
+ process.exit(0);
298
+ }
299
+ location = sel;
300
+ }
301
+ // Step 2: which agents. Default is every agent, so the user doesn't
302
+ // have to remember where they installed it — unconfigured agents are
303
+ // reported as "nothing to remove" and left untouched. An explicit
304
+ // --target subsets this.
305
+ let targets;
306
+ if (opts.target !== undefined) {
307
+ targets = (0, registry_1.resolveTargetFlag)(opts.target, location);
308
+ }
309
+ else {
310
+ targets = [...registry_1.ALL_TARGETS];
311
+ }
312
+ if (targets.length === 0) {
313
+ clack.outro('No agent targets selected — nothing to do.');
314
+ return;
315
+ }
316
+ // Step 3: sweep + per-agent feedback.
317
+ const reports = uninstallTargets(targets, location);
318
+ const removed = reports.filter((r) => r.status === 'removed');
319
+ for (const r of reports) {
320
+ if (r.status === 'removed') {
321
+ for (const p of r.removedPaths) {
322
+ clack.log.success(`${r.displayName}: removed ${tildify(p)}`);
323
+ }
324
+ }
325
+ else if (r.status === 'not-configured') {
326
+ clack.log.info(`${r.displayName}: not configured — nothing to remove`);
327
+ }
328
+ else {
329
+ clack.log.info(`${r.displayName}: skipped — ${r.notes[0] ?? 'unsupported location'}`);
330
+ }
331
+ }
332
+ // Step 4: for local uninstall, the index dir is separate — point at
333
+ // `uninit` so the user knows it's still there (and how to remove it).
334
+ if (location === 'local' && fs.existsSync(path.join(process.cwd(), '.codegraph'))) {
335
+ clack.log.info('The .codegraph/ index for this project is still here. Run `codegraph uninit` to delete it.');
336
+ }
337
+ // Step 5: summary.
338
+ if (removed.length > 0) {
339
+ const names = removed.map((r) => r.displayName).join(', ');
340
+ clack.outro(`Removed CodeGraph from ${removed.length} agent${removed.length > 1 ? 's' : ''}: ${names}. ` +
341
+ `Restart ${removed.length > 1 ? 'them' : 'it'} to apply.`);
342
+ }
343
+ else {
344
+ clack.outro(`CodeGraph was not configured in any ${location} agent — nothing to remove.`);
345
+ }
346
+ }
219
347
  /**
220
348
  * For every target that has a global config and exposes
221
349
  * `wireProjectSurfaces`, write its project-local surfaces (e.g.
@@ -296,10 +424,11 @@ async function resolveTargets(clack, opts, location, useDefaults) {
296
424
  .filter((t) => t !== undefined);
297
425
  }
298
426
  /**
299
- * Initialize CodeGraph in the current project (for local installs).
300
- * Unchanged from the pre-refactor version agent-agnostic by nature.
427
+ * Initialize CodeGraph in the current project (for local installs), then
428
+ * offer the watch fallback when the live watcher won't run here (see
429
+ * offerWatchFallback). Agent-agnostic by nature.
301
430
  */
302
- async function initializeLocalProject(clack) {
431
+ async function initializeLocalProject(clack, useDefaults = false) {
303
432
  const projectPath = process.cwd();
304
433
  let CodeGraph;
305
434
  try {
@@ -314,6 +443,7 @@ async function initializeLocalProject(clack) {
314
443
  // Check if already initialized
315
444
  if (CodeGraph.isInitialized(projectPath)) {
316
445
  clack.log.info('CodeGraph already initialized in this project');
446
+ await offerWatchFallback(clack, projectPath, { yes: useDefaults });
317
447
  return;
318
448
  }
319
449
  // Initialize
@@ -336,5 +466,65 @@ async function initializeLocalProject(clack) {
336
466
  clack.log.success(`Indexed ${formatNumber(result.filesIndexed)} files (${formatNumber(result.nodesCreated)} symbols)`);
337
467
  }
338
468
  cg.close();
469
+ await offerWatchFallback(clack, projectPath, { yes: useDefaults });
470
+ }
471
+ /**
472
+ * When the live file watcher will be disabled for this project (e.g. WSL2
473
+ * /mnt drives, or CODEGRAPH_NO_WATCH), the index would silently go stale.
474
+ * Explain that, and offer to keep it fresh automatically via git hooks
475
+ * (commit / pull / checkout) instead of manual `codegraph sync`.
476
+ *
477
+ * No-op on environments where the watcher runs normally, so it's safe to
478
+ * call unconditionally after init.
479
+ */
480
+ async function offerWatchFallback(clack, projectPath, opts = {}) {
481
+ const reason = (0, watch_policy_1.watchDisabledReason)(projectPath);
482
+ if (!reason)
483
+ return; // Watcher runs normally — nothing to set up.
484
+ clack.log.warn(`Live file watching is disabled here — ${reason}.`);
485
+ clack.log.info('Until you re-sync, the CodeGraph index stays frozen — it will not pick up edits on its own.');
486
+ // No git repo → the commit-hook path doesn't apply; point at manual sync.
487
+ if (!(0, git_hooks_1.isGitRepo)(projectPath)) {
488
+ clack.log.info('Run `codegraph sync` after changing files to refresh the index.');
489
+ return;
490
+ }
491
+ // Already wired up on a previous run — confirm and move on without nagging.
492
+ if ((0, git_hooks_1.isSyncHookInstalled)(projectPath)) {
493
+ clack.log.info('Git sync hooks are already installed — the index refreshes after commit / pull / checkout.');
494
+ return;
495
+ }
496
+ let choice;
497
+ if (opts.yes) {
498
+ choice = 'hook';
499
+ }
500
+ else {
501
+ const sel = await clack.select({
502
+ message: 'How should CodeGraph keep its index fresh?',
503
+ options: [
504
+ { value: 'hook', label: 'Sync on git commit / pull / checkout', hint: 'installs git hooks (recommended)' },
505
+ { value: 'manual', label: 'I\'ll run `codegraph sync` myself', hint: 'fully manual' },
506
+ ],
507
+ initialValue: 'hook',
508
+ });
509
+ if (clack.isCancel(sel)) {
510
+ clack.log.info('Skipped — run `codegraph sync` after changes to refresh the index.');
511
+ return;
512
+ }
513
+ choice = sel;
514
+ }
515
+ if (choice === 'manual') {
516
+ clack.log.info('Run `codegraph sync` after changing files to refresh the index.');
517
+ return;
518
+ }
519
+ const result = (0, git_hooks_1.installGitSyncHook)(projectPath);
520
+ if (result.installed.length > 0) {
521
+ clack.log.success(`Installed git ${result.installed.join(', ')} hook${result.installed.length > 1 ? 's' : ''} — ` +
522
+ 'the index refreshes in the background after each.');
523
+ clack.log.info('Run `codegraph sync` anytime to refresh immediately.');
524
+ }
525
+ else {
526
+ clack.log.warn(`Could not install git hooks${result.skipped ? ` (${result.skipped})` : ''}. ` +
527
+ 'Run `codegraph sync` after changes instead.');
528
+ }
339
529
  }
340
530
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/installer/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEH,oCAEC;AAED,0DAkIC;AAeD,gFAiBC;AAtOD,iDAAyC;AACzC,2CAA6B;AAC7B,uCAAyB;AACzB,iDAK4B;AAE5B,yCAAyC;AAEzC,mEAAmE;AACnE,qEAAqE;AACrE,YAAY;AACZ,iDAOyB;AANvB,+GAAA,cAAc,OAAA;AACd,iHAAA,gBAAgB,OAAA;AAChB,8GAAA,aAAa,OAAA;AACb,6GAAA,YAAY,OAAA;AACZ,+GAAA,cAAc,OAAA;AACd,mHAAA,kBAAkB,OAAA;AAIpB,0EAA0E;AAC1E,uEAAuE;AACvE,8DAA8D;AAC9D,MAAM,SAAS,GAAG,IAAI,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CACL,CAAC;AAElE,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,CAAC,CAAC,cAAc,EAAE,CAAC;AAC5B,CAAC;AAED,SAAS,UAAU;IACjB,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QACzE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,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H,CAAC"}
@@ -18,11 +18,11 @@ export declare const CODEGRAPH_SECTION_END = "<!-- CODEGRAPH_END -->";
18
18
  * instructions file. Includes the start/end markers so the section
19
19
  * can be detected and replaced on re-install.
20
20
  */
21
- export declare const INSTRUCTIONS_TEMPLATE = "<!-- CODEGRAPH_START -->\n## CodeGraph\n\nThis project has a CodeGraph MCP server (`codegraph_*` tools) configured. CodeGraph is a tree-sitter-parsed knowledge graph of every symbol, edge, and file. Reads are sub-millisecond and return structural information grep cannot.\n\n### When to prefer codegraph over native search\n\nUse codegraph for **structural** questions \u2014 what calls what, what would break, where is X defined, what is X's signature. Use native grep/read only for **literal text** queries (string contents, comments, log messages) or after you already have a specific file open.\n\n| Question | Tool |\n|---|---|\n| \"How does X work? / trace X / explain a system / architecture\" | `codegraph_explore` (seed with symbol names) |\n| \"Where is X defined?\" / \"Find symbol named X\" | `codegraph_search` |\n| \"What calls function Y?\" | `codegraph_callers` |\n| \"What does Y call?\" | `codegraph_callees` |\n| \"What would break if I changed Z?\" | `codegraph_impact` |\n| \"Show me Y's signature / source / docstring\" | `codegraph_node` |\n| \"Give me focused context for a task/area\" | `codegraph_context` |\n| \"What files exist under path/\" | `codegraph_files` |\n| \"Is the index healthy?\" | `codegraph_status` |\n\n### Rules of thumb\n\n- **`codegraph_explore` is the workhorse for understanding questions** (\"how does X work\", \"trace\u2026\", \"explain the Y system\"). Feed it the key symbol/file names and read its output (line-numbered source from many files in one call). If the question names nothing concrete, do one quick `codegraph_search`/`codegraph_context` to surface the names, then explore with them. Fill gaps with `codegraph_node`/Read \u2014 don't grep-and-read your way through; that's the loop explore replaces.\n- **Delegating exploration to a subagent?** Tell it to call `codegraph_explore` first and trust the result. A generic \"explore\"-style agent defaults to grep+Read and treats codegraph as just a search index, throwing away the token savings.\n- **Trust codegraph results.** They come from a full AST parse. Do NOT re-verify them with grep \u2014 that's slower, less accurate, and wastes context.\n- **Don't grep first** when looking up a symbol by name. `codegraph_search` is faster and returns kind + location + signature in one call.\n- **Index lag**: the file watcher debounces ~500ms behind writes; don't re-query immediately after editing a file in the same turn.\n\n### If `.codegraph/` doesn't exist\n\nThe MCP server returns \"not initialized.\" Ask the user: *\"I notice this project doesn't have CodeGraph initialized. Want me to run `codegraph init -i` to build the index?\"*\n<!-- CODEGRAPH_END -->";
21
+ export declare const INSTRUCTIONS_TEMPLATE = "<!-- CODEGRAPH_START -->\n## CodeGraph\n\nThis project has a CodeGraph MCP server (`codegraph_*` tools) configured. CodeGraph is a tree-sitter-parsed knowledge graph of every symbol, edge, and file. Reads are sub-millisecond and return structural information grep cannot.\n\n### When to prefer codegraph over native search\n\nUse codegraph for **structural** questions \u2014 what calls what, what would break, where is X defined, what is X's signature. Use native grep/read only for **literal text** queries (string contents, comments, log messages) or after you already have a specific file open.\n\n| Question | Tool |\n|---|---|\n| \"How does X work? / trace X / explain a system / architecture\" | `codegraph_explore` (seed with symbol names) |\n| \"Where is X defined?\" / \"Find symbol named X\" | `codegraph_search` |\n| \"What calls function Y?\" | `codegraph_callers` |\n| \"What does Y call?\" | `codegraph_callees` |\n| \"What would break if I changed Z?\" | `codegraph_impact` |\n| \"Show me Y's signature / source / docstring\" | `codegraph_node` |\n| \"Give me focused context for a task/area\" | `codegraph_context` |\n| \"See several related symbols' source at once\" | `codegraph_explore` |\n| \"What files exist under path/\" | `codegraph_files` |\n| \"Is the index healthy?\" | `codegraph_status` |\n\n### Rules of thumb\n\n- **Answer directly \u2014 don't delegate exploration.** For \"how does X work\" / architecture / trace questions, answer with 2-3 codegraph calls: `codegraph_context` first, then ONE `codegraph_explore` for the source of the symbols it surfaces. Codegraph IS the pre-built index, so spawning a separate file-reading sub-task/agent \u2014 or running a grep + read loop \u2014 repeats work codegraph already did and costs more for the same answer.\n- **Trust codegraph results.** They come from a full AST parse. Do NOT re-verify them with grep \u2014 that's slower, less accurate, and wastes context.\n- **Don't grep first** when looking up a symbol by name. `codegraph_search` is faster and returns kind + location + signature in one call.\n- **Don't chain `codegraph_search` + `codegraph_node`** when you just want context \u2014 `codegraph_context` is one call.\n- **Don't loop `codegraph_node` over many symbols** \u2014 one `codegraph_explore` call returns several symbols' source grouped in a single capped call, while each separate node/Read call re-reads the whole context and costs far more.\n- **Index lag**: the file watcher debounces ~500ms behind writes; don't re-query immediately after editing a file in the same turn.\n\n### If `.codegraph/` doesn't exist\n\nThe MCP server returns \"not initialized.\" Ask the user: *\"I notice this project doesn't have CodeGraph initialized. Want me to run `codegraph init -i` to build the index?\"*\n<!-- CODEGRAPH_END -->";
22
22
  /**
23
23
  * Backwards-compat alias. Existing downstream code may import
24
24
  * `CLAUDE_MD_TEMPLATE` from this module via the re-export shim in
25
25
  * `claude-md-template.ts`.
26
26
  */
27
- export declare const CLAUDE_MD_TEMPLATE = "<!-- CODEGRAPH_START -->\n## CodeGraph\n\nThis project has a CodeGraph MCP server (`codegraph_*` tools) configured. CodeGraph is a tree-sitter-parsed knowledge graph of every symbol, edge, and file. Reads are sub-millisecond and return structural information grep cannot.\n\n### When to prefer codegraph over native search\n\nUse codegraph for **structural** questions \u2014 what calls what, what would break, where is X defined, what is X's signature. Use native grep/read only for **literal text** queries (string contents, comments, log messages) or after you already have a specific file open.\n\n| Question | Tool |\n|---|---|\n| \"How does X work? / trace X / explain a system / architecture\" | `codegraph_explore` (seed with symbol names) |\n| \"Where is X defined?\" / \"Find symbol named X\" | `codegraph_search` |\n| \"What calls function Y?\" | `codegraph_callers` |\n| \"What does Y call?\" | `codegraph_callees` |\n| \"What would break if I changed Z?\" | `codegraph_impact` |\n| \"Show me Y's signature / source / docstring\" | `codegraph_node` |\n| \"Give me focused context for a task/area\" | `codegraph_context` |\n| \"What files exist under path/\" | `codegraph_files` |\n| \"Is the index healthy?\" | `codegraph_status` |\n\n### Rules of thumb\n\n- **`codegraph_explore` is the workhorse for understanding questions** (\"how does X work\", \"trace\u2026\", \"explain the Y system\"). Feed it the key symbol/file names and read its output (line-numbered source from many files in one call). If the question names nothing concrete, do one quick `codegraph_search`/`codegraph_context` to surface the names, then explore with them. Fill gaps with `codegraph_node`/Read \u2014 don't grep-and-read your way through; that's the loop explore replaces.\n- **Delegating exploration to a subagent?** Tell it to call `codegraph_explore` first and trust the result. A generic \"explore\"-style agent defaults to grep+Read and treats codegraph as just a search index, throwing away the token savings.\n- **Trust codegraph results.** They come from a full AST parse. Do NOT re-verify them with grep \u2014 that's slower, less accurate, and wastes context.\n- **Don't grep first** when looking up a symbol by name. `codegraph_search` is faster and returns kind + location + signature in one call.\n- **Index lag**: the file watcher debounces ~500ms behind writes; don't re-query immediately after editing a file in the same turn.\n\n### If `.codegraph/` doesn't exist\n\nThe MCP server returns \"not initialized.\" Ask the user: *\"I notice this project doesn't have CodeGraph initialized. Want me to run `codegraph init -i` to build the index?\"*\n<!-- CODEGRAPH_END -->";
27
+ export declare const CLAUDE_MD_TEMPLATE = "<!-- CODEGRAPH_START -->\n## CodeGraph\n\nThis project has a CodeGraph MCP server (`codegraph_*` tools) configured. CodeGraph is a tree-sitter-parsed knowledge graph of every symbol, edge, and file. Reads are sub-millisecond and return structural information grep cannot.\n\n### When to prefer codegraph over native search\n\nUse codegraph for **structural** questions \u2014 what calls what, what would break, where is X defined, what is X's signature. Use native grep/read only for **literal text** queries (string contents, comments, log messages) or after you already have a specific file open.\n\n| Question | Tool |\n|---|---|\n| \"How does X work? / trace X / explain a system / architecture\" | `codegraph_explore` (seed with symbol names) |\n| \"Where is X defined?\" / \"Find symbol named X\" | `codegraph_search` |\n| \"What calls function Y?\" | `codegraph_callers` |\n| \"What does Y call?\" | `codegraph_callees` |\n| \"What would break if I changed Z?\" | `codegraph_impact` |\n| \"Show me Y's signature / source / docstring\" | `codegraph_node` |\n| \"Give me focused context for a task/area\" | `codegraph_context` |\n| \"See several related symbols' source at once\" | `codegraph_explore` |\n| \"What files exist under path/\" | `codegraph_files` |\n| \"Is the index healthy?\" | `codegraph_status` |\n\n### Rules of thumb\n\n- **Answer directly \u2014 don't delegate exploration.** For \"how does X work\" / architecture / trace questions, answer with 2-3 codegraph calls: `codegraph_context` first, then ONE `codegraph_explore` for the source of the symbols it surfaces. Codegraph IS the pre-built index, so spawning a separate file-reading sub-task/agent \u2014 or running a grep + read loop \u2014 repeats work codegraph already did and costs more for the same answer.\n- **Trust codegraph results.** They come from a full AST parse. Do NOT re-verify them with grep \u2014 that's slower, less accurate, and wastes context.\n- **Don't grep first** when looking up a symbol by name. `codegraph_search` is faster and returns kind + location + signature in one call.\n- **Don't chain `codegraph_search` + `codegraph_node`** when you just want context \u2014 `codegraph_context` is one call.\n- **Don't loop `codegraph_node` over many symbols** \u2014 one `codegraph_explore` call returns several symbols' source grouped in a single capped call, while each separate node/Read call re-reads the whole context and costs far more.\n- **Index lag**: the file watcher debounces ~500ms behind writes; don't re-query immediately after editing a file in the same turn.\n\n### If `.codegraph/` doesn't exist\n\nThe MCP server returns \"not initialized.\" Ask the user: *\"I notice this project doesn't have CodeGraph initialized. Want me to run `codegraph init -i` to build the index?\"*\n<!-- CODEGRAPH_END -->";
28
28
  //# sourceMappingURL=instructions-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instructions-template.d.ts","sourceRoot":"","sources":["../../src/installer/instructions-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,uBAAuB,6BAA6B,CAAC;AAClE,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,0nFAgCT,CAAC;AAE1B;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,0nFAAwB,CAAC"}
1
+ {"version":3,"file":"instructions-template.d.ts","sourceRoot":"","sources":["../../src/installer/instructions-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,uBAAuB,6BAA6B,CAAC;AAClE,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,wwFAkCT,CAAC;AAE1B;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,wwFAAwB,CAAC"}
@@ -39,15 +39,17 @@ Use codegraph for **structural** questions — what calls what, what would break
39
39
  | "What would break if I changed Z?" | \`codegraph_impact\` |
40
40
  | "Show me Y's signature / source / docstring" | \`codegraph_node\` |
41
41
  | "Give me focused context for a task/area" | \`codegraph_context\` |
42
+ | "See several related symbols' source at once" | \`codegraph_explore\` |
42
43
  | "What files exist under path/" | \`codegraph_files\` |
43
44
  | "Is the index healthy?" | \`codegraph_status\` |
44
45
 
45
46
  ### Rules of thumb
46
47
 
47
- - **\`codegraph_explore\` is the workhorse for understanding questions** ("how does X work", "trace…", "explain the Y system"). Feed it the key symbol/file names and read its output (line-numbered source from many files in one call). If the question names nothing concrete, do one quick \`codegraph_search\`/\`codegraph_context\` to surface the names, then explore with them. Fill gaps with \`codegraph_node\`/Read don't grep-and-read your way through; that's the loop explore replaces.
48
- - **Delegating exploration to a subagent?** Tell it to call \`codegraph_explore\` first and trust the result. A generic "explore"-style agent defaults to grep+Read and treats codegraph as just a search index, throwing away the token savings.
48
+ - **Answer directly don't delegate exploration.** For "how does X work" / architecture / trace questions, answer with 2-3 codegraph calls: \`codegraph_context\` first, then ONE \`codegraph_explore\` for the source of the symbols it surfaces. Codegraph IS the pre-built index, so spawning a separate file-reading sub-task/agent or running a grep + read loop repeats work codegraph already did and costs more for the same answer.
49
49
  - **Trust codegraph results.** They come from a full AST parse. Do NOT re-verify them with grep — that's slower, less accurate, and wastes context.
50
50
  - **Don't grep first** when looking up a symbol by name. \`codegraph_search\` is faster and returns kind + location + signature in one call.
51
+ - **Don't chain \`codegraph_search\` + \`codegraph_node\`** when you just want context — \`codegraph_context\` is one call.
52
+ - **Don't loop \`codegraph_node\` over many symbols** — one \`codegraph_explore\` call returns several symbols' source grouped in a single capped call, while each separate node/Read call re-reads the whole context and costs far more.
51
53
  - **Index lag**: the file watcher debounces ~500ms behind writes; don't re-query immediately after editing a file in the same turn.
52
54
 
53
55
  ### If \`.codegraph/\` doesn't exist
@@ -1 +1 @@
1
- {"version":3,"file":"instructions-template.js","sourceRoot":"","sources":["../../src/installer/instructions-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,4DAA4D;AAC/C,QAAA,uBAAuB,GAAG,0BAA0B,CAAC;AACrD,QAAA,qBAAqB,GAAG,wBAAwB,CAAC;AAE9D;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,GAAG,+BAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgC7D,6BAAqB,EAAE,CAAC;AAE1B;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,6BAAqB,CAAC"}
1
+ {"version":3,"file":"instructions-template.js","sourceRoot":"","sources":["../../src/installer/instructions-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,4DAA4D;AAC/C,QAAA,uBAAuB,GAAG,0BAA0B,CAAC;AACrD,QAAA,qBAAqB,GAAG,wBAAwB,CAAC;AAE9D;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,GAAG,+BAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkC7D,6BAAqB,EAAE,CAAC;AAE1B;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,6BAAqB,CAAC"}
@@ -1,16 +1,20 @@
1
1
  /**
2
- * Claude Code target — the historical default. Writes:
2
+ * Claude Code target. Writes:
3
3
  *
4
- * - MCP server entry to `~/.claude.json` (global) or
5
- * `./.claude.json` (local).
4
+ * - MCP server entry to `~/.claude.json` (global = user scope, loads
5
+ * in every project) or `./.mcp.json` (local = project scope, the
6
+ * file Claude Code actually reads for a single project). See the
7
+ * scope table at https://code.claude.com/docs/en/mcp.
6
8
  * - Permissions to `~/.claude/settings.json` (global) or
7
9
  * `./.claude/settings.json` (local), gated on `autoAllow`.
8
10
  * - Instructions to `~/.claude/CLAUDE.md` (global) or
9
11
  * `./.claude/CLAUDE.md` (local).
10
12
  *
11
- * All paths and shapes ported verbatim from the original
12
- * `config-writer.ts` so existing Claude Code installs upgrade in
13
- * place no migration on disk required.
13
+ * Earlier versions wrote the local MCP entry to `./.claude.json` — a
14
+ * file Claude Code never reads — so the server silently never loaded
15
+ * until the user manually renamed it to `.mcp.json` (issue #207). We
16
+ * now write `./.mcp.json` and migrate any stale `./.claude.json` entry
17
+ * out of the way on install and uninstall.
14
18
  */
15
19
  import { AgentTarget, Location, WriteResult } from './types';
16
20
  /**
@@ -21,6 +25,22 @@ import { AgentTarget, Location, WriteResult } from './types';
21
25
  * cause side effects callers don't expect.
22
26
  */
23
27
  export declare function writeMcpEntry(loc: Location): WriteResult['files'][number];
28
+ /**
29
+ * Remove stale codegraph auto-sync hooks from Claude `settings.json`.
30
+ *
31
+ * Surgical at the individual-command level: only entries matching
32
+ * `isLegacyCodegraphHookCommand` are dropped, so a sibling hook sharing
33
+ * a matcher group (or the Stop event) with ours survives. We prune a
34
+ * matcher group only once its `hooks` array is empty, an event only
35
+ * once it has no groups left, and `hooks` itself only once every event
36
+ * is gone — and none of that runs unless we actually removed a
37
+ * codegraph command, so a settings.json with no legacy hooks is left
38
+ * byte-for-byte untouched and reported `unchanged`.
39
+ *
40
+ * Exported so it can be unit-tested directly and reused by both
41
+ * `install` (an upgrade self-heals) and `uninstall`.
42
+ */
43
+ export declare function cleanupLegacyHooks(loc: Location): WriteResult['files'][number];
24
44
  export declare function writePermissionsEntry(loc: Location): WriteResult['files'][number];
25
45
  export declare function writeInstructionsEntry(loc: Location): WriteResult['files'][number];
26
46
  export declare const claudeTarget: AgentTarget;
@@ -1 +1 @@
1
- {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EACL,WAAW,EAGX,QAAQ,EACR,WAAW,EACZ,MAAM,SAAS,CAAC;AAqIjB;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAqBzE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAoBjF;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CA0ClF;AAED,eAAO,MAAM,YAAY,EAAE,WAAoC,CAAC"}
1
+ {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EACL,WAAW,EAGX,QAAQ,EACR,WAAW,EACZ,MAAM,SAAS,CAAC;AAkLjB;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAsBzE;AA6CD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CA0C9E;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAoBjF;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CA0ClF;AAED,eAAO,MAAM,YAAY,EAAE,WAAoC,CAAC"}