@aroman22/codegraph-vba-darwin-arm64 1.7.3 → 1.9.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.
@@ -6,6 +6,11 @@
6
6
  import type CodeGraph from '../index';
7
7
  import type { QueryPool } from './query-pool';
8
8
  import type { PendingFile } from '../sync';
9
+ import { spawnSync } from 'child_process';
10
+ /** Narrow subprocess seam for testing CLI-only MCP wrappers. */
11
+ export declare const cliProcess: {
12
+ spawnSync: typeof spawnSync;
13
+ };
9
14
  /**
10
15
  * An expected, recoverable "codegraph can't serve this" condition — most
11
16
  * importantly a project with no index. The dispatch catch converts these to
@@ -167,6 +172,9 @@ export interface ToolAnnotations {
167
172
  interface PropertySchema {
168
173
  type: string;
169
174
  description: string;
175
+ items?: {
176
+ type: string;
177
+ };
170
178
  enum?: string[];
171
179
  default?: unknown;
172
180
  }
@@ -252,7 +260,8 @@ export declare class ToolHandler {
252
260
  /**
253
261
  * Optional allowlist of exposed tools, parsed from the CODEGRAPH_MCP_TOOLS
254
262
  * env var (comma-separated short names, e.g. "trace,search,node,context").
255
- * Unset/empty → every tool is exposed. Lets an operator (or an A/B harness)
263
+ * Unset/empty → legacy direct calls to read-only tools are allowed, while
264
+ * mutating lifecycle tools remain opt-in. Lets an operator (or an A/B harness)
256
265
  * trim the tool surface without rebuilding the client config; the ablated
257
266
  * tool is then truly absent from ListTools rather than merely denied on call.
258
267
  * Matching is on the short form, so "node" and "codegraph_node" both work.
@@ -344,6 +353,14 @@ export declare class ToolHandler {
344
353
  * Execute a tool by name
345
354
  */
346
355
  execute(toolName: string, args: Record<string, unknown>): Promise<ToolResult>;
356
+ /** Run the CLI sync command and preserve its complete process output. */
357
+ private handleSync;
358
+ /** Run the CLI-only affected command and preserve its complete process output. */
359
+ private handleAffected;
360
+ /** Resolve symlinks/junctions and enforce mutation-root boundaries. */
361
+ private validateMutationTarget;
362
+ /** Execute a mutating CodeGraph CLI command after enforcing its path allowlist. */
363
+ private executeMutatingTool;
347
364
  /**
348
365
  * Run a single read tool to completion and return its raw {@link ToolResult},
349
366
  * classifying expected failures the same way {@link execute}'s catch does so
@@ -365,6 +382,8 @@ export declare class ToolHandler {
365
382
  * NotIndexed/PathRefusal, which {@link executeReadTool} classifies.
366
383
  */
367
384
  private dispatchTool;
385
+ /** Run the CLI-only query command and preserve its JSON stdout verbatim. */
386
+ private handleQuery;
368
387
  /**
369
388
  * Handle codegraph_search
370
389
  */
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAe9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAY3C;;;;;;;;;;GAUG;AACH,qBAAa,eAAgB,SAAQ,KAAK;CAAG;AAE7C;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;CAAG;AA+C9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO5D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,eAAe,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,YAAY,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0EAA0E;IAC1E,2BAA2B,EAAE,MAAM,CAAC;IACpC,2CAA2C;IAC3C,oBAAoB,EAAE,OAAO,CAA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,aAAa;IAqCrB;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB;IA+CzB;;;OAGG;IACH,OAAO,CAAC,cAAc;IA0DtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,cAAc;IAgBtB;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,YAAY;IA4BpB;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,WAAW;CAMpB"}
@@ -5,7 +5,7 @@
5
5
  * Defines the tools exposed by the CodeGraph MCP server.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ToolHandler = exports.tools = exports.PathRefusalError = exports.NotIndexedError = void 0;
8
+ exports.ToolHandler = exports.tools = exports.PathRefusalError = exports.NotIndexedError = exports.cliProcess = void 0;
9
9
  exports.normalizeQuerySpelling = normalizeQuerySpelling;
10
10
  exports.getExploreBudget = getExploreBudget;
11
11
  exports.getExploreOutputBudget = getExploreOutputBudget;
@@ -23,10 +23,13 @@ const loadCodeGraph = () => require('../index').default;
23
23
  const worktree_1 = require("../sync/worktree");
24
24
  const query_utils_1 = require("../search/query-utils");
25
25
  const fs_1 = require("fs");
26
+ const child_process_1 = require("child_process");
26
27
  const utils_1 = require("../utils");
27
28
  const generated_detection_1 = require("../extraction/generated-detection");
28
29
  const dynamic_boundaries_1 = require("./dynamic-boundaries");
29
30
  const update_check_1 = require("../upgrade/update-check");
31
+ /** Narrow subprocess seam for testing CLI-only MCP wrappers. */
32
+ exports.cliProcess = { spawnSync: child_process_1.spawnSync };
30
33
  /**
31
34
  * An expected, recoverable "codegraph can't serve this" condition — most
32
35
  * importantly a project with no index. The dispatch catch converts these to
@@ -400,6 +403,115 @@ const READ_ONLY_ANNOTATIONS = {
400
403
  * All tools support cross-project queries via the optional `projectPath` parameter.
401
404
  */
402
405
  exports.tools = [
406
+ {
407
+ name: 'codegraph_affected',
408
+ description: 'Map changed source files to affected tests via the codegraph CLI. Read-only and disabled unless explicitly enabled via CODEGRAPH_MCP_TOOLS.',
409
+ inputSchema: {
410
+ type: 'object',
411
+ properties: {
412
+ files: {
413
+ type: 'array',
414
+ description: 'Changed source paths to map to affected test files.',
415
+ items: { type: 'string' },
416
+ },
417
+ path: {
418
+ type: 'string',
419
+ description: 'Project root (default: the selected project or current working directory).',
420
+ },
421
+ stdin: {
422
+ type: 'boolean',
423
+ description: 'Read additional changed paths from standard input.',
424
+ default: false,
425
+ },
426
+ depth: {
427
+ type: 'number',
428
+ description: 'Maximum dependency traversal depth (default: 5).',
429
+ default: 5,
430
+ },
431
+ filter: {
432
+ type: 'string',
433
+ description: 'Glob filter applied to affected test paths.',
434
+ },
435
+ json: {
436
+ type: 'boolean',
437
+ description: 'Request JSON output from the CLI.',
438
+ default: false,
439
+ },
440
+ quiet: {
441
+ type: 'boolean',
442
+ description: 'Suppress non-result CLI output.',
443
+ default: false,
444
+ },
445
+ projectPath: projectPathProperty,
446
+ },
447
+ required: ['files'],
448
+ },
449
+ annotations: READ_ONLY_ANNOTATIONS,
450
+ },
451
+ {
452
+ name: 'codegraph_index',
453
+ description: 'Rebuild a project index from scratch via the codegraph CLI. Idempotent and disabled unless explicitly enabled via CODEGRAPH_MCP_TOOLS.',
454
+ inputSchema: {
455
+ type: 'object',
456
+ properties: {
457
+ path: {
458
+ type: 'string',
459
+ description: 'Project directory to rebuild (default: current working directory).',
460
+ },
461
+ force: {
462
+ type: 'boolean',
463
+ description: 'Index even when the path looks like a home directory or filesystem root.',
464
+ default: false,
465
+ },
466
+ quiet: {
467
+ type: 'boolean',
468
+ description: 'Suppress progress output.',
469
+ default: false,
470
+ },
471
+ verbose: {
472
+ type: 'boolean',
473
+ description: 'Enable verbose CLI output.',
474
+ default: false,
475
+ },
476
+ projectPath: projectPathProperty,
477
+ },
478
+ },
479
+ annotations: {
480
+ readOnlyHint: false,
481
+ destructiveHint: false,
482
+ idempotentHint: true,
483
+ openWorldHint: false,
484
+ },
485
+ },
486
+ {
487
+ name: 'codegraph_query',
488
+ description: 'Run the canonical CodeGraph CLI symbol query and return its structured JSON output.',
489
+ inputSchema: {
490
+ type: 'object',
491
+ properties: {
492
+ query: {
493
+ type: 'string',
494
+ description: 'Symbol name or partial name to query',
495
+ },
496
+ path: {
497
+ type: 'string',
498
+ description: 'Validated project directory passed to the CLI; overrides projectPath when both are set. Defaults to the selected project root.',
499
+ },
500
+ limit: {
501
+ type: 'number',
502
+ description: 'Maximum results (default: 10)',
503
+ default: 10,
504
+ },
505
+ kind: {
506
+ type: 'string',
507
+ description: 'Filter by node kind',
508
+ },
509
+ projectPath: projectPathProperty,
510
+ },
511
+ required: ['query'],
512
+ },
513
+ annotations: READ_ONLY_ANNOTATIONS,
514
+ },
403
515
  {
404
516
  name: 'codegraph_search',
405
517
  description: 'Quick symbol search by name. Returns locations only (no code). Use codegraph_explore instead to get the actual source / understand an area in one call.',
@@ -564,6 +676,30 @@ exports.tools = [
564
676
  },
565
677
  annotations: READ_ONLY_ANNOTATIONS,
566
678
  },
679
+ {
680
+ name: 'codegraph_sync',
681
+ description: 'Synchronize an existing CodeGraph index with filesystem changes.',
682
+ inputSchema: {
683
+ type: 'object',
684
+ properties: {
685
+ path: {
686
+ type: 'string',
687
+ description: 'Project or directory whose full CodeGraph index should be synchronized.',
688
+ },
689
+ quiet: {
690
+ type: 'boolean',
691
+ description: 'Suppress progress output.',
692
+ },
693
+ projectPath: projectPathProperty,
694
+ },
695
+ },
696
+ annotations: {
697
+ readOnlyHint: false,
698
+ destructiveHint: false,
699
+ idempotentHint: true,
700
+ openWorldHint: false,
701
+ },
702
+ },
567
703
  {
568
704
  name: 'codegraph_status',
569
705
  description: 'Index health check (files / nodes / edges). Skip unless debugging.',
@@ -609,6 +745,62 @@ exports.tools = [
609
745
  },
610
746
  annotations: READ_ONLY_ANNOTATIONS,
611
747
  },
748
+ {
749
+ name: 'codegraph_uninit',
750
+ description: 'Remove a project\'s CodeGraph index by invoking the CLI. Destructive and disabled by default; re-enable with CODEGRAPH_MCP_TOOLS=explore,uninit.',
751
+ inputSchema: {
752
+ type: 'object',
753
+ properties: {
754
+ path: {
755
+ type: 'string',
756
+ description: 'Project directory to uninitialize (default: current working directory).',
757
+ },
758
+ force: {
759
+ type: 'boolean',
760
+ description: 'Skip the CLI confirmation prompt (default: false).',
761
+ default: false,
762
+ },
763
+ projectPath: projectPathProperty,
764
+ },
765
+ },
766
+ annotations: {
767
+ readOnlyHint: false,
768
+ destructiveHint: true,
769
+ idempotentHint: false,
770
+ openWorldHint: false,
771
+ },
772
+ },
773
+ {
774
+ name: 'codegraph_init',
775
+ description: 'Initialize and index a project by invoking the codegraph init CLI. This mutates the target project and is disabled unless explicitly enabled via CODEGRAPH_MCP_TOOLS.',
776
+ inputSchema: {
777
+ type: 'object',
778
+ properties: {
779
+ path: {
780
+ type: 'string',
781
+ description: 'Project directory to initialize and index.',
782
+ },
783
+ force: {
784
+ type: 'boolean',
785
+ description: 'Pass --force to allow initialization at a normally unsafe root.',
786
+ default: false,
787
+ },
788
+ verbose: {
789
+ type: 'boolean',
790
+ description: 'Pass --verbose to show detailed worker lifecycle and memory information.',
791
+ default: false,
792
+ },
793
+ projectPath: projectPathProperty,
794
+ },
795
+ required: ['path'],
796
+ },
797
+ annotations: {
798
+ readOnlyHint: false,
799
+ destructiveHint: true,
800
+ idempotentHint: false,
801
+ openWorldHint: false,
802
+ },
803
+ },
612
804
  ];
613
805
  /**
614
806
  * Return `defs` with `projectPath` marked `required` in each tool's inputSchema.
@@ -630,6 +822,10 @@ exports.tools = [
630
822
  */
631
823
  function withRequiredProjectPath(defs) {
632
824
  return defs.map((tool) => {
825
+ // Lifecycle tools operate on their own required `path`; they do not need a
826
+ // pre-opened default index, so their cross-project hint remains optional.
827
+ if (tool.annotations?.readOnlyHint === false && tool.inputSchema.required?.includes('path'))
828
+ return tool;
633
829
  if (!tool.inputSchema.properties.projectPath)
634
830
  return tool;
635
831
  const required = tool.inputSchema.required ?? [];
@@ -784,7 +980,8 @@ class ToolHandler {
784
980
  /**
785
981
  * Optional allowlist of exposed tools, parsed from the CODEGRAPH_MCP_TOOLS
786
982
  * env var (comma-separated short names, e.g. "trace,search,node,context").
787
- * Unset/empty → every tool is exposed. Lets an operator (or an A/B harness)
983
+ * Unset/empty → legacy direct calls to read-only tools are allowed, while
984
+ * mutating lifecycle tools remain opt-in. Lets an operator (or an A/B harness)
788
985
  * trim the tool surface without rebuilding the client config; the ablated
789
986
  * tool is then truly absent from ListTools rather than merely denied on call.
790
987
  * Matching is on the short form, so "node" and "codegraph_node" both work.
@@ -800,7 +997,12 @@ class ToolHandler {
800
997
  /** Whether a tool name passes the CODEGRAPH_MCP_TOOLS allowlist (if any). */
801
998
  isToolAllowed(name) {
802
999
  const allow = this.toolAllowlist();
803
- return !allow || allow.has(name.replace(/^codegraph_/, ''));
1000
+ const shortName = name.replace(/^codegraph_/, '');
1001
+ if (allow)
1002
+ return allow.has(shortName);
1003
+ // Preserve backwards compatibility for direct read-only calls. Mutating
1004
+ // lifecycle tools must be explicitly enabled even when tools/list is bypassed.
1005
+ return shortName !== 'init' && shortName !== 'sync' && shortName !== 'index' && shortName !== 'affected';
804
1006
  }
805
1007
  /**
806
1008
  * Get tool definitions with dynamic descriptions based on project size.
@@ -860,7 +1062,7 @@ class ToolHandler {
860
1062
  'codegraph_search',
861
1063
  'codegraph_node',
862
1064
  ]);
863
- if (stats.fileCount < TINY_REPO_FILE_THRESHOLD) {
1065
+ if (!allow && stats.fileCount < TINY_REPO_FILE_THRESHOLD) {
864
1066
  visible = visible.filter(t => TINY_REPO_CORE_TOOLS.has(t.name));
865
1067
  }
866
1068
  return visible.map(tool => {
@@ -1226,6 +1428,15 @@ class ToolHandler {
1226
1428
  if (typeof check === 'object' && check !== undefined)
1227
1429
  return check;
1228
1430
  }
1431
+ if (toolName === 'codegraph_init') {
1432
+ return this.executeMutatingTool('init', args);
1433
+ }
1434
+ if (toolName === 'codegraph_index') {
1435
+ return this.executeMutatingTool('index', args);
1436
+ }
1437
+ if (toolName === 'codegraph_affected') {
1438
+ return this.handleAffected(args);
1439
+ }
1229
1440
  // codegraph_status reports watcher state (pending files, degraded mode,
1230
1441
  // worktree warning) and embeds its own sections — it must run on the MAIN
1231
1442
  // thread against the watched default instance, so it is NEVER off-loaded to
@@ -1234,6 +1445,12 @@ class ToolHandler {
1234
1445
  if (toolName === 'codegraph_status') {
1235
1446
  return await this.handleStatus(args);
1236
1447
  }
1448
+ if (toolName === 'codegraph_uninit') {
1449
+ return this.executeMutatingTool('uninit', args);
1450
+ }
1451
+ if (toolName === 'codegraph_sync') {
1452
+ return this.handleSync(args);
1453
+ }
1237
1454
  // Read tools: off-load the CPU-heavy dispatch to the worker pool when one
1238
1455
  // is attached, healthy, AND has finished its first cold start (daemon
1239
1456
  // mode), so the daemon's single event loop stays free for the MCP
@@ -1270,6 +1487,164 @@ class ToolHandler {
1270
1487
  'continue without codegraph for this task.');
1271
1488
  }
1272
1489
  }
1490
+ /** Run the CLI sync command and preserve its complete process output. */
1491
+ handleSync(args) {
1492
+ if (args.quiet !== undefined && typeof args.quiet !== 'boolean') {
1493
+ return this.errorResult('quiet must be a boolean');
1494
+ }
1495
+ const target = args.path ?? args.projectPath ?? this.cg?.getProjectRoot() ?? process.cwd();
1496
+ if (typeof target !== 'string')
1497
+ return this.errorResult('path must be a string');
1498
+ const resolvedTarget = this.validateMutationTarget(target);
1499
+ if (typeof resolvedTarget !== 'string')
1500
+ return resolvedTarget;
1501
+ const commandArgs = [(0, path_1.resolve)(__dirname, '../../dist/bin/codegraph.js'), 'sync', resolvedTarget];
1502
+ if (args.quiet === true)
1503
+ commandArgs.push('--quiet');
1504
+ const result = (0, child_process_1.spawnSync)(process.execPath, commandArgs, {
1505
+ encoding: 'utf8',
1506
+ windowsHide: true,
1507
+ });
1508
+ const stdout = result.stdout ?? '';
1509
+ const stderr = result.stderr ?? '';
1510
+ const output = [stdout, stderr].filter(Boolean).join(stdout && stderr ? '\n' : '');
1511
+ if (result.error) {
1512
+ return this.errorResult(`${result.error.message}${output ? `\n${output}` : ''}`);
1513
+ }
1514
+ if (result.status !== 0) {
1515
+ return {
1516
+ content: [{
1517
+ type: 'text',
1518
+ text: [output, `codegraph sync exited with code ${result.status}`].filter(Boolean).join('\n'),
1519
+ }],
1520
+ isError: true,
1521
+ };
1522
+ }
1523
+ return this.textResult(output || 'codegraph sync exited with code 0');
1524
+ }
1525
+ /** Run the CLI-only affected command and preserve its complete process output. */
1526
+ handleAffected(args) {
1527
+ if (!Array.isArray(args.files) || args.files.some(file => typeof file !== 'string')) {
1528
+ return this.errorResult('files must be an array of strings');
1529
+ }
1530
+ for (const flag of ['stdin', 'json', 'quiet']) {
1531
+ if (args[flag] !== undefined && typeof args[flag] !== 'boolean') {
1532
+ return this.errorResult(`${flag} must be a boolean`);
1533
+ }
1534
+ }
1535
+ const target = args.path ?? args.projectPath ?? this.cg?.getProjectRoot() ?? process.cwd();
1536
+ if (typeof target !== 'string')
1537
+ return this.errorResult('path must be a string');
1538
+ const pathError = (0, utils_1.validateProjectPath)(target);
1539
+ if (pathError)
1540
+ return this.errorResult(pathError);
1541
+ const depth = args.depth === undefined ? 5 : Number(args.depth);
1542
+ if (!Number.isInteger(depth) || depth < 0) {
1543
+ return this.errorResult('depth must be a non-negative integer');
1544
+ }
1545
+ let filter;
1546
+ if (args.filter !== undefined) {
1547
+ const validated = this.validateString(args.filter, 'filter');
1548
+ if (typeof validated !== 'string')
1549
+ return validated;
1550
+ filter = validated;
1551
+ }
1552
+ const cliEntry = (0, path_1.resolve)(__dirname, '../bin/codegraph.js');
1553
+ const commandArgs = [cliEntry, 'affected', ...args.files, '-p', target, '-d', String(depth)];
1554
+ if (filter !== undefined)
1555
+ commandArgs.push('-f', filter);
1556
+ if (args.json === true)
1557
+ commandArgs.push('--json');
1558
+ if (args.quiet === true)
1559
+ commandArgs.push('--quiet');
1560
+ if (args.stdin === true)
1561
+ commandArgs.push('--stdin');
1562
+ const result = exports.cliProcess.spawnSync(process.execPath, commandArgs, {
1563
+ encoding: 'utf8',
1564
+ timeout: 30_000,
1565
+ });
1566
+ const stdout = result.stdout ?? '';
1567
+ const stderr = result.stderr ?? '';
1568
+ let output = [stdout, stderr, result.error?.message].filter(Boolean).join('\n');
1569
+ const failed = result.status !== 0 || result.error !== undefined;
1570
+ if (!failed && args.json === true) {
1571
+ try {
1572
+ output = JSON.stringify(JSON.parse(stdout));
1573
+ }
1574
+ catch (error) {
1575
+ return this.errorResult(`codegraph affected returned invalid JSON: ${error instanceof Error ? error.message : String(error)}\n${output}`);
1576
+ }
1577
+ }
1578
+ return {
1579
+ content: [{
1580
+ type: 'text',
1581
+ text: output || result.error?.message || `codegraph affected exited with status ${result.status}`,
1582
+ }],
1583
+ ...(failed ? { isError: true } : {}),
1584
+ };
1585
+ }
1586
+ /** Resolve symlinks/junctions and enforce mutation-root boundaries. */
1587
+ validateMutationTarget(target) {
1588
+ const canonicalize = (candidate) => {
1589
+ let existing = (0, path_1.resolve)(candidate);
1590
+ const missing = [];
1591
+ while (!(0, fs_1.existsSync)(existing)) {
1592
+ const parent = (0, path_1.resolve)(existing, '..');
1593
+ if (parent === existing)
1594
+ break;
1595
+ missing.unshift((0, path_1.basename)(existing));
1596
+ existing = parent;
1597
+ }
1598
+ return (0, path_1.resolve)(fs_1.realpathSync.native(existing), ...missing);
1599
+ };
1600
+ const resolvedTarget = canonicalize(target);
1601
+ const rawAllowlist = process.env.CODEGRAPH_MCP_ALLOWLIST?.trim();
1602
+ if (rawAllowlist && rawAllowlist !== '*') {
1603
+ const allowed = rawAllowlist.split(path_1.delimiter).map(entry => entry.trim()).filter(Boolean).some(entry => {
1604
+ const relativePath = (0, path_1.relative)(canonicalize(entry), resolvedTarget);
1605
+ return relativePath === '' || (!relativePath.startsWith('..') && !(0, path_1.isAbsolute)(relativePath));
1606
+ });
1607
+ if (!allowed)
1608
+ return this.errorResult(`Path is outside CODEGRAPH_MCP_ALLOWLIST: ${resolvedTarget}`);
1609
+ }
1610
+ return resolvedTarget;
1611
+ }
1612
+ /** Execute a mutating CodeGraph CLI command after enforcing its path allowlist. */
1613
+ executeMutatingTool(command, args) {
1614
+ const rawTarget = args.path ?? args.projectPath ?? (command === 'init' ? undefined : process.cwd());
1615
+ const target = this.validateString(rawTarget, 'path');
1616
+ if (typeof target !== 'string')
1617
+ return target;
1618
+ const resolvedTarget = this.validateMutationTarget(target);
1619
+ if (typeof resolvedTarget !== 'string')
1620
+ return resolvedTarget;
1621
+ const adjacentCli = (0, path_1.resolve)(__dirname, '../bin/codegraph.js');
1622
+ const builtCli = (0, fs_1.existsSync)(adjacentCli) ? adjacentCli : (0, path_1.resolve)(__dirname, '../../dist/bin/codegraph.js');
1623
+ const cliArgs = [builtCli, command];
1624
+ if (command === 'init') {
1625
+ if (args.force === true)
1626
+ cliArgs.push('--force');
1627
+ if (args.verbose === true)
1628
+ cliArgs.push('--verbose');
1629
+ cliArgs.push(resolvedTarget);
1630
+ }
1631
+ else {
1632
+ cliArgs.push(resolvedTarget);
1633
+ if (args.force === true)
1634
+ cliArgs.push('--force');
1635
+ if (command === 'index' && args.quiet === true)
1636
+ cliArgs.push('--quiet');
1637
+ if (command === 'index' && args.verbose === true)
1638
+ cliArgs.push('--verbose');
1639
+ }
1640
+ const result = (0, child_process_1.spawnSync)(process.execPath, cliArgs, { encoding: 'utf8' });
1641
+ const output = [result.stdout, result.stderr].filter(Boolean).join('');
1642
+ const failed = result.status !== 0 || result.error !== undefined;
1643
+ return {
1644
+ content: [{ type: 'text', text: output || result.error?.message || `codegraph ${command} exited with status ${result.status}` }],
1645
+ ...(command === 'uninit' ? (failed ? { isError: true } : {}) : { isError: failed }),
1646
+ };
1647
+ }
1273
1648
  /**
1274
1649
  * Run a single read tool to completion and return its raw {@link ToolResult},
1275
1650
  * classifying expected failures the same way {@link execute}'s catch does so
@@ -1307,6 +1682,7 @@ class ToolHandler {
1307
1682
  */
1308
1683
  async dispatchTool(toolName, args) {
1309
1684
  switch (toolName) {
1685
+ case 'codegraph_query': return await this.handleQuery(args);
1310
1686
  case 'codegraph_search': return await this.handleSearch(args);
1311
1687
  case 'codegraph_callers': return await this.handleCallers(args);
1312
1688
  case 'codegraph_callees': return await this.handleCallees(args);
@@ -1317,6 +1693,42 @@ class ToolHandler {
1317
1693
  default: return this.errorResult(`Unknown tool: ${toolName}`);
1318
1694
  }
1319
1695
  }
1696
+ /** Run the CLI-only query command and preserve its JSON stdout verbatim. */
1697
+ async handleQuery(args) {
1698
+ const query = this.validateString(args.query, 'query');
1699
+ if (typeof query !== 'string')
1700
+ return query;
1701
+ let projectPath;
1702
+ if (args.path !== undefined) {
1703
+ const explicitPath = this.validateString(args.path, 'path');
1704
+ if (typeof explicitPath !== 'string')
1705
+ return explicitPath;
1706
+ projectPath = explicitPath;
1707
+ const pathError = (0, utils_1.validateProjectPath)(projectPath);
1708
+ if (pathError)
1709
+ return this.errorResult(pathError);
1710
+ }
1711
+ else {
1712
+ projectPath = this.getCodeGraph(args.projectPath).getProjectRoot();
1713
+ }
1714
+ const limit = (0, utils_1.clamp)(Number(args.limit) || 10, 1, 100);
1715
+ const commandArgs = ['query', query, '-p', projectPath, '-l', String(limit)];
1716
+ if (args.kind !== undefined) {
1717
+ const kind = this.validateString(args.kind, 'kind');
1718
+ if (typeof kind !== 'string')
1719
+ return kind;
1720
+ commandArgs.push('-k', kind);
1721
+ }
1722
+ commandArgs.push('--json');
1723
+ const cliEntry = (0, path_1.resolve)(__dirname, '../bin/codegraph.js'); // Keep CLI and MCP on the same package version.
1724
+ const result = exports.cliProcess.spawnSync(process.execPath, [cliEntry, ...commandArgs], { encoding: 'utf8', timeout: 30_000 });
1725
+ if (result.error)
1726
+ return this.errorResult(`codegraph query failed: ${result.error.message}`);
1727
+ if (result.status !== 0) {
1728
+ return this.errorResult(`codegraph query failed: ${(result.stderr || '').trim() || `exit code ${result.status}`}`);
1729
+ }
1730
+ return this.textResult(result.stdout || '');
1731
+ }
1320
1732
  /**
1321
1733
  * Handle codegraph_search
1322
1734
  */