@colbymchenry/codegraph-win32-arm64 1.5.0 → 1.6.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 (212) hide show
  1. package/lib/dist/bin/codegraph.js +145 -29
  2. package/lib/dist/bin/codegraph.js.map +1 -1
  3. package/lib/dist/context/formatter.d.ts +7 -1
  4. package/lib/dist/context/formatter.d.ts.map +1 -1
  5. package/lib/dist/context/formatter.js +12 -6
  6. package/lib/dist/context/formatter.js.map +1 -1
  7. package/lib/dist/context/index.d.ts +12 -0
  8. package/lib/dist/context/index.d.ts.map +1 -1
  9. package/lib/dist/context/index.js +60 -14
  10. package/lib/dist/context/index.js.map +1 -1
  11. package/lib/dist/db/index.d.ts +37 -0
  12. package/lib/dist/db/index.d.ts.map +1 -1
  13. package/lib/dist/db/index.js +101 -1
  14. package/lib/dist/db/index.js.map +1 -1
  15. package/lib/dist/db/migrations.d.ts +1 -1
  16. package/lib/dist/db/migrations.d.ts.map +1 -1
  17. package/lib/dist/db/migrations.js +25 -1
  18. package/lib/dist/db/migrations.js.map +1 -1
  19. package/lib/dist/db/queries.d.ts +160 -3
  20. package/lib/dist/db/queries.d.ts.map +1 -1
  21. package/lib/dist/db/queries.js +400 -33
  22. package/lib/dist/db/queries.js.map +1 -1
  23. package/lib/dist/db/schema.sql +16 -3
  24. package/lib/dist/directory.d.ts +29 -0
  25. package/lib/dist/directory.d.ts.map +1 -1
  26. package/lib/dist/directory.js +52 -0
  27. package/lib/dist/directory.js.map +1 -1
  28. package/lib/dist/extraction/extraction-version.d.ts +1 -1
  29. package/lib/dist/extraction/extraction-version.js +1 -1
  30. package/lib/dist/extraction/function-ref.d.ts.map +1 -1
  31. package/lib/dist/extraction/function-ref.js +6 -0
  32. package/lib/dist/extraction/function-ref.js.map +1 -1
  33. package/lib/dist/extraction/generated-detection.d.ts +48 -12
  34. package/lib/dist/extraction/generated-detection.d.ts.map +1 -1
  35. package/lib/dist/extraction/generated-detection.js +176 -11
  36. package/lib/dist/extraction/generated-detection.js.map +1 -1
  37. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  38. package/lib/dist/extraction/grammars.js +38 -2
  39. package/lib/dist/extraction/grammars.js.map +1 -1
  40. package/lib/dist/extraction/index.d.ts +106 -0
  41. package/lib/dist/extraction/index.d.ts.map +1 -1
  42. package/lib/dist/extraction/index.js +284 -53
  43. package/lib/dist/extraction/index.js.map +1 -1
  44. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  45. package/lib/dist/extraction/languages/c-cpp.js +19 -4
  46. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  47. package/lib/dist/extraction/languages/erlang.d.ts.map +1 -1
  48. package/lib/dist/extraction/languages/erlang.js +58 -22
  49. package/lib/dist/extraction/languages/erlang.js.map +1 -1
  50. package/lib/dist/extraction/languages/objc.d.ts.map +1 -1
  51. package/lib/dist/extraction/languages/objc.js +4 -0
  52. package/lib/dist/extraction/languages/objc.js.map +1 -1
  53. package/lib/dist/extraction/languages/rust.d.ts +20 -0
  54. package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
  55. package/lib/dist/extraction/languages/rust.js +47 -20
  56. package/lib/dist/extraction/languages/rust.js.map +1 -1
  57. package/lib/dist/extraction/parse-pool.d.ts +7 -0
  58. package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
  59. package/lib/dist/extraction/parse-pool.js +20 -1
  60. package/lib/dist/extraction/parse-pool.js.map +1 -1
  61. package/lib/dist/extraction/tree-sitter-types.d.ts +2 -0
  62. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  63. package/lib/dist/extraction/tree-sitter.d.ts +5 -1
  64. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  65. package/lib/dist/extraction/tree-sitter.js +106 -50
  66. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  67. package/lib/dist/graph/queries.d.ts.map +1 -1
  68. package/lib/dist/graph/queries.js +2 -0
  69. package/lib/dist/graph/queries.js.map +1 -1
  70. package/lib/dist/graph/traversal.js +1 -1
  71. package/lib/dist/graph/traversal.js.map +1 -1
  72. package/lib/dist/index.d.ts +22 -0
  73. package/lib/dist/index.d.ts.map +1 -1
  74. package/lib/dist/index.js +117 -1
  75. package/lib/dist/index.js.map +1 -1
  76. package/lib/dist/installer/index.d.ts +4 -3
  77. package/lib/dist/installer/index.d.ts.map +1 -1
  78. package/lib/dist/installer/index.js +8 -6
  79. package/lib/dist/installer/index.js.map +1 -1
  80. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  81. package/lib/dist/installer/targets/claude.js +37 -5
  82. package/lib/dist/installer/targets/claude.js.map +1 -1
  83. package/lib/dist/installer/targets/codex.d.ts +22 -8
  84. package/lib/dist/installer/targets/codex.d.ts.map +1 -1
  85. package/lib/dist/installer/targets/codex.js +65 -48
  86. package/lib/dist/installer/targets/codex.js.map +1 -1
  87. package/lib/dist/installer/targets/copilot-cli.d.ts +32 -0
  88. package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -0
  89. package/lib/dist/installer/targets/copilot-cli.js +209 -0
  90. package/lib/dist/installer/targets/copilot-cli.js.map +1 -0
  91. package/lib/dist/installer/targets/copilot-jetbrains.d.ts +42 -0
  92. package/lib/dist/installer/targets/copilot-jetbrains.d.ts.map +1 -0
  93. package/lib/dist/installer/targets/copilot-jetbrains.js +238 -0
  94. package/lib/dist/installer/targets/copilot-jetbrains.js.map +1 -0
  95. package/lib/dist/installer/targets/copilot-vscode.d.ts +47 -0
  96. package/lib/dist/installer/targets/copilot-vscode.d.ts.map +1 -0
  97. package/lib/dist/installer/targets/copilot-vscode.js +219 -0
  98. package/lib/dist/installer/targets/copilot-vscode.js.map +1 -0
  99. package/lib/dist/installer/targets/registry.d.ts.map +1 -1
  100. package/lib/dist/installer/targets/registry.js +6 -0
  101. package/lib/dist/installer/targets/registry.js.map +1 -1
  102. package/lib/dist/installer/targets/toml.d.ts +6 -5
  103. package/lib/dist/installer/targets/toml.d.ts.map +1 -1
  104. package/lib/dist/installer/targets/toml.js +99 -20
  105. package/lib/dist/installer/targets/toml.js.map +1 -1
  106. package/lib/dist/installer/targets/types.d.ts +5 -5
  107. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  108. package/lib/dist/mcp/daemon-manager.d.ts +1 -1
  109. package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
  110. package/lib/dist/mcp/daemon-manager.js +1 -1
  111. package/lib/dist/mcp/daemon-manager.js.map +1 -1
  112. package/lib/dist/mcp/daemon-paths.d.ts +6 -0
  113. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
  114. package/lib/dist/mcp/daemon-paths.js +54 -0
  115. package/lib/dist/mcp/daemon-paths.js.map +1 -1
  116. package/lib/dist/mcp/daemon-registry.d.ts +10 -0
  117. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
  118. package/lib/dist/mcp/daemon-registry.js +51 -3
  119. package/lib/dist/mcp/daemon-registry.js.map +1 -1
  120. package/lib/dist/mcp/daemon.d.ts +9 -6
  121. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  122. package/lib/dist/mcp/daemon.js +10 -8
  123. package/lib/dist/mcp/daemon.js.map +1 -1
  124. package/lib/dist/mcp/engine.d.ts +3 -0
  125. package/lib/dist/mcp/engine.d.ts.map +1 -1
  126. package/lib/dist/mcp/engine.js +45 -3
  127. package/lib/dist/mcp/engine.js.map +1 -1
  128. package/lib/dist/mcp/explore-dedup.d.ts +137 -0
  129. package/lib/dist/mcp/explore-dedup.d.ts.map +1 -0
  130. package/lib/dist/mcp/explore-dedup.js +236 -0
  131. package/lib/dist/mcp/explore-dedup.js.map +1 -0
  132. package/lib/dist/mcp/explore-diagnostics.d.ts +289 -0
  133. package/lib/dist/mcp/explore-diagnostics.d.ts.map +1 -0
  134. package/lib/dist/mcp/explore-diagnostics.js +558 -0
  135. package/lib/dist/mcp/explore-diagnostics.js.map +1 -0
  136. package/lib/dist/mcp/explore-session-state.d.ts +217 -0
  137. package/lib/dist/mcp/explore-session-state.d.ts.map +1 -0
  138. package/lib/dist/mcp/explore-session-state.js +322 -0
  139. package/lib/dist/mcp/explore-session-state.js.map +1 -0
  140. package/lib/dist/mcp/index.d.ts +24 -0
  141. package/lib/dist/mcp/index.d.ts.map +1 -1
  142. package/lib/dist/mcp/index.js +67 -6
  143. package/lib/dist/mcp/index.js.map +1 -1
  144. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  145. package/lib/dist/mcp/liveness-watchdog.js +3 -1
  146. package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
  147. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  148. package/lib/dist/mcp/proxy.js +6 -1
  149. package/lib/dist/mcp/proxy.js.map +1 -1
  150. package/lib/dist/mcp/server-instructions.d.ts +2 -2
  151. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  152. package/lib/dist/mcp/server-instructions.js +8 -3
  153. package/lib/dist/mcp/server-instructions.js.map +1 -1
  154. package/lib/dist/mcp/session.d.ts +16 -0
  155. package/lib/dist/mcp/session.d.ts.map +1 -1
  156. package/lib/dist/mcp/session.js +36 -13
  157. package/lib/dist/mcp/session.js.map +1 -1
  158. package/lib/dist/mcp/tools.d.ts +276 -10
  159. package/lib/dist/mcp/tools.d.ts.map +1 -1
  160. package/lib/dist/mcp/tools.js +2402 -241
  161. package/lib/dist/mcp/tools.js.map +1 -1
  162. package/lib/dist/project-config.d.ts +23 -0
  163. package/lib/dist/project-config.d.ts.map +1 -1
  164. package/lib/dist/project-config.js +39 -2
  165. package/lib/dist/project-config.js.map +1 -1
  166. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  167. package/lib/dist/resolution/c-fnptr-synthesizer.js +21 -19
  168. package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  169. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  170. package/lib/dist/resolution/callback-synthesizer.js +39 -11
  171. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  172. package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -1
  173. package/lib/dist/resolution/frameworks/swift.js +11 -1
  174. package/lib/dist/resolution/frameworks/swift.js.map +1 -1
  175. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  176. package/lib/dist/resolution/import-resolver.js +18 -2
  177. package/lib/dist/resolution/import-resolver.js.map +1 -1
  178. package/lib/dist/resolution/index.d.ts.map +1 -1
  179. package/lib/dist/resolution/index.js +15 -4
  180. package/lib/dist/resolution/index.js.map +1 -1
  181. package/lib/dist/resolution/name-matcher.d.ts +30 -0
  182. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  183. package/lib/dist/resolution/name-matcher.js +295 -5
  184. package/lib/dist/resolution/name-matcher.js.map +1 -1
  185. package/lib/dist/resolution/path-aliases.d.ts +6 -4
  186. package/lib/dist/resolution/path-aliases.d.ts.map +1 -1
  187. package/lib/dist/resolution/path-aliases.js +125 -17
  188. package/lib/dist/resolution/path-aliases.js.map +1 -1
  189. package/lib/dist/search/identifier-segments.d.ts +10 -0
  190. package/lib/dist/search/identifier-segments.d.ts.map +1 -1
  191. package/lib/dist/search/identifier-segments.js +29 -0
  192. package/lib/dist/search/identifier-segments.js.map +1 -1
  193. package/lib/dist/search/query-paths.d.ts +57 -0
  194. package/lib/dist/search/query-paths.d.ts.map +1 -0
  195. package/lib/dist/search/query-paths.js +298 -0
  196. package/lib/dist/search/query-paths.js.map +1 -0
  197. package/lib/dist/search/query-utils.d.ts +1 -1
  198. package/lib/dist/search/query-utils.d.ts.map +1 -1
  199. package/lib/dist/search/query-utils.js +13 -3
  200. package/lib/dist/search/query-utils.js.map +1 -1
  201. package/lib/dist/sync/watcher.d.ts +22 -0
  202. package/lib/dist/sync/watcher.d.ts.map +1 -1
  203. package/lib/dist/sync/watcher.js +51 -5
  204. package/lib/dist/sync/watcher.js.map +1 -1
  205. package/lib/dist/types.d.ts +20 -1
  206. package/lib/dist/types.d.ts.map +1 -1
  207. package/lib/dist/types.js +1 -0
  208. package/lib/dist/types.js.map +1 -1
  209. package/lib/kernel/codegraph-kernel.node +0 -0
  210. package/lib/node_modules/.package-lock.json +1 -1
  211. package/lib/package.json +1 -1
  212. package/package.json +1 -1
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+ /**
3
+ * GitHub Copilot CLI target.
4
+ *
5
+ * - MCP server entry to `~/.copilot/mcp-config.json` under the
6
+ * `mcpServers` key (same wrapper as Claude/Cursor). Entry shape per
7
+ * the GitHub docs: `{ "type": "stdio", "command", "args", "tools" }`
8
+ * — `type` accepts `"local"` or `"stdio"`; we write `"stdio"` (the
9
+ * standard MCP name, recommended by the docs for cross-client
10
+ * compatibility). `"tools": ["*"]` mirrors the docs' example and is
11
+ * the documented default.
12
+ * - The config dir is `~/.copilot` unless the user moved it via
13
+ * `COPILOT_HOME` (documented override) — we honor it so install and
14
+ * detect follow the CLI's own resolution.
15
+ *
16
+ * Copilot CLI as of 2026-07 has no project-local MCP config — per-repo
17
+ * config (`.github/mcp.json`) is an open feature request
18
+ * (github/copilot-cli#2528). `supportsLocation('local')` returns false;
19
+ * the orchestrator skips this target for local installs with a clear
20
+ * message (same pattern as Codex).
21
+ *
22
+ * The file is machine-written by the CLI's own `/mcp add` flow, so it's
23
+ * plain JSON — no JSONC handling needed; surgical edits go through the
24
+ * shared read/mutate/write helpers (Cursor pattern), preserving sibling
25
+ * servers.
26
+ *
27
+ * No instructions file (MCP `initialize` instructions are the single
28
+ * source of truth, #529) and no permissions concept — `autoAllow` is
29
+ * silently ignored.
30
+ */
31
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
32
+ if (k2 === undefined) k2 = k;
33
+ var desc = Object.getOwnPropertyDescriptor(m, k);
34
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
35
+ desc = { enumerable: true, get: function() { return m[k]; } };
36
+ }
37
+ Object.defineProperty(o, k2, desc);
38
+ }) : (function(o, m, k, k2) {
39
+ if (k2 === undefined) k2 = k;
40
+ o[k2] = m[k];
41
+ }));
42
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
43
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
44
+ }) : function(o, v) {
45
+ o["default"] = v;
46
+ });
47
+ var __importStar = (this && this.__importStar) || (function () {
48
+ var ownKeys = function(o) {
49
+ ownKeys = Object.getOwnPropertyNames || function (o) {
50
+ var ar = [];
51
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
52
+ return ar;
53
+ };
54
+ return ownKeys(o);
55
+ };
56
+ return function (mod) {
57
+ if (mod && mod.__esModule) return mod;
58
+ var result = {};
59
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
60
+ __setModuleDefault(result, mod);
61
+ return result;
62
+ };
63
+ })();
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ exports.copilotCliTarget = void 0;
66
+ const fs = __importStar(require("fs"));
67
+ const path = __importStar(require("path"));
68
+ const os = __importStar(require("os"));
69
+ const shared_1 = require("./shared");
70
+ function configDir() {
71
+ const override = process.env.COPILOT_HOME;
72
+ if (override && override.trim().length > 0)
73
+ return override;
74
+ return path.join(os.homedir(), '.copilot');
75
+ }
76
+ function mcpConfigPath() {
77
+ return path.join(configDir(), 'mcp-config.json');
78
+ }
79
+ /**
80
+ * `~/.copilot` existing is NOT proof the CLI is installed: the VS Code
81
+ * Copilot Chat extension drops MCP socket-handoff lock files into
82
+ * `~/.copilot/ide/` on launch, so a machine with only the VS Code
83
+ * extension still has the dir (with a lone `ide` entry). Count the dir
84
+ * as a CLI footprint only when it holds anything besides `ide` — the
85
+ * CLI writes `config.json` (and later `mcp-config.json`, history state)
86
+ * on first run.
87
+ */
88
+ function cliConfigDirPresent() {
89
+ let entries;
90
+ try {
91
+ entries = fs.readdirSync(configDir());
92
+ }
93
+ catch {
94
+ return false;
95
+ }
96
+ return entries.some((e) => e !== 'ide');
97
+ }
98
+ /**
99
+ * Best-effort check that the `copilot` binary is reachable on PATH.
100
+ * A plain fs scan (no shell-out) — cheap enough to run inside
101
+ * `detectAll()` for the multiselect prompt.
102
+ */
103
+ function copilotOnPath() {
104
+ const pathVar = process.env.PATH || '';
105
+ const exts = process.platform === 'win32'
106
+ ? ['.exe', '.cmd', '.bat', '.ps1']
107
+ : [''];
108
+ for (const dir of pathVar.split(path.delimiter)) {
109
+ if (!dir)
110
+ continue;
111
+ for (const ext of exts) {
112
+ try {
113
+ if (fs.existsSync(path.join(dir, 'copilot' + ext)))
114
+ return true;
115
+ }
116
+ catch { /* ignore unreadable PATH entries */ }
117
+ }
118
+ }
119
+ return false;
120
+ }
121
+ function buildCopilotMcpConfig() {
122
+ const base = (0, shared_1.getMcpServerConfig)();
123
+ return { ...base, tools: ['*'] };
124
+ }
125
+ class CopilotCliTarget {
126
+ id = 'copilot-cli';
127
+ displayName = 'GitHub Copilot CLI';
128
+ docsUrl = 'https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers';
129
+ supportsLocation(loc) {
130
+ return loc === 'global';
131
+ }
132
+ detect(loc) {
133
+ if (loc !== 'global') {
134
+ return { installed: false, alreadyConfigured: false };
135
+ }
136
+ const file = mcpConfigPath();
137
+ const config = (0, shared_1.readJsonFile)(file);
138
+ const alreadyConfigured = !!config.mcpServers?.codegraph;
139
+ const installed = cliConfigDirPresent() || copilotOnPath();
140
+ return { installed, alreadyConfigured, configPath: file };
141
+ }
142
+ install(loc, _opts) {
143
+ if (loc !== 'global') {
144
+ return {
145
+ files: [],
146
+ notes: ['Copilot CLI has no project-local config — re-run with --location=global to install.'],
147
+ };
148
+ }
149
+ return {
150
+ files: [writeMcpEntry()],
151
+ notes: ['Restart any running Copilot CLI session to pick up the MCP server.'],
152
+ };
153
+ }
154
+ uninstall(loc) {
155
+ if (loc !== 'global')
156
+ return { files: [] };
157
+ const file = mcpConfigPath();
158
+ if (!fs.existsSync(file)) {
159
+ return { files: [{ path: file, action: 'not-found' }] };
160
+ }
161
+ const config = (0, shared_1.readJsonFile)(file);
162
+ if (!config.mcpServers?.codegraph) {
163
+ return { files: [{ path: file, action: 'not-found' }] };
164
+ }
165
+ delete config.mcpServers.codegraph;
166
+ if (Object.keys(config.mcpServers).length === 0) {
167
+ delete config.mcpServers;
168
+ }
169
+ if (Object.keys(config).length === 0) {
170
+ // Nothing left but the `{}` we'd write back — delete the file so
171
+ // uninstall fully reverses a from-scratch install. A leftover
172
+ // empty file would keep detect() reporting the CLI as installed.
173
+ fs.unlinkSync(file);
174
+ }
175
+ else {
176
+ (0, shared_1.writeJsonFile)(file, config);
177
+ }
178
+ return { files: [{ path: file, action: 'removed' }] };
179
+ }
180
+ printConfig(loc) {
181
+ if (loc !== 'global') {
182
+ return '# Copilot CLI has no project-local config — use --location=global.\n';
183
+ }
184
+ const snippet = JSON.stringify({ mcpServers: { codegraph: buildCopilotMcpConfig() } }, null, 2);
185
+ return `# Add to ${mcpConfigPath()}\n\n${snippet}\n`;
186
+ }
187
+ describePaths(loc) {
188
+ if (loc !== 'global')
189
+ return [];
190
+ return [mcpConfigPath()];
191
+ }
192
+ }
193
+ function writeMcpEntry() {
194
+ const file = mcpConfigPath();
195
+ const existing = (0, shared_1.readJsonFile)(file);
196
+ const before = existing.mcpServers?.codegraph;
197
+ const after = buildCopilotMcpConfig();
198
+ if ((0, shared_1.jsonDeepEqual)(before, after)) {
199
+ return { path: file, action: 'unchanged' };
200
+ }
201
+ const existed = fs.existsSync(file);
202
+ if (!existing.mcpServers)
203
+ existing.mcpServers = {};
204
+ existing.mcpServers.codegraph = after;
205
+ (0, shared_1.writeJsonFile)(file, existing);
206
+ return { path: file, action: existed ? 'updated' : 'created' };
207
+ }
208
+ exports.copilotCliTarget = new CopilotCliTarget();
209
+ //# sourceMappingURL=copilot-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copilot-cli.js","sourceRoot":"","sources":["../../../src/installer/targets/copilot-c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C,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACjE,CAAC;AAEY,QAAA,gBAAgB,GAAgB,IAAI,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * JetBrains IDEs (GitHub Copilot plugin) target.
3
+ *
4
+ * - MCP server entry to the plugin's user-level `mcp.json`, which
5
+ * lives under the shared `github-copilot` config dir (the same dir
6
+ * the Copilot ecosystem uses for `hosts.json`):
7
+ *
8
+ * macOS/Linux: $XDG_CONFIG_HOME|~/.config/github-copilot/intellij/mcp.json
9
+ * Windows: %LOCALAPPDATA%\github-copilot\intellij\mcp.json
10
+ *
11
+ * `$XDG_CONFIG_HOME` is honored on every platform when set —
12
+ * matching the plugin family's own resolution (copilot.vim /
13
+ * copilot-language-server check it before the OS default).
14
+ * - Shape is VS Code-compatible: `{ "servers": { "<name>": { "type":
15
+ * "stdio", "command", "args" } } }` — the plugin documents mcp.json
16
+ * parity with `.vscode/mcp.json`.
17
+ * - **Global-only.** The plugin reads exactly one user-level file; a
18
+ * project-level mcp.json is an open feature request
19
+ * (microsoft/copilot-intellij-feedback#701, still open 2026-07).
20
+ * `supportsLocation('local')` returns false so the orchestrator
21
+ * skips local installs with a clear message (Codex pattern).
22
+ * - No `--path` injection: the config is user-global and the plugin
23
+ * documents no `${workspaceFolder}`-style variable expansion for
24
+ * this file, so we ship the plain entry and let the MCP server
25
+ * resolve the project from the client's roots/cwd as with other
26
+ * global installs.
27
+ * - No instructions file (MCP `initialize` instructions are the
28
+ * single source of truth, #529) and no permissions concept —
29
+ * `autoAllow` is silently ignored.
30
+ *
31
+ * The IDE opens this file in a JSON editor for hand-editing (Settings →
32
+ * Tools → GitHub Copilot → MCP → Configure), so reads + writes go
33
+ * through `jsonc-parser` — surgical edits that preserve sibling
34
+ * servers, user comments, and formatting (same approach as the
35
+ * copilot-vscode target).
36
+ *
37
+ * The plugin only re-reads mcp.json on IDE restart
38
+ * (microsoft/copilot-intellij-feedback#1139) — hence the restart note.
39
+ */
40
+ import { AgentTarget } from './types';
41
+ export declare const copilotJetbrainsTarget: AgentTarget;
42
+ //# sourceMappingURL=copilot-jetbrains.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copilot-jetbrains.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/copilot-jetbrains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAMH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AAmLjB,eAAO,MAAM,sBAAsB,EAAE,WAA0C,CAAC"}
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+ /**
3
+ * JetBrains IDEs (GitHub Copilot plugin) target.
4
+ *
5
+ * - MCP server entry to the plugin's user-level `mcp.json`, which
6
+ * lives under the shared `github-copilot` config dir (the same dir
7
+ * the Copilot ecosystem uses for `hosts.json`):
8
+ *
9
+ * macOS/Linux: $XDG_CONFIG_HOME|~/.config/github-copilot/intellij/mcp.json
10
+ * Windows: %LOCALAPPDATA%\github-copilot\intellij\mcp.json
11
+ *
12
+ * `$XDG_CONFIG_HOME` is honored on every platform when set —
13
+ * matching the plugin family's own resolution (copilot.vim /
14
+ * copilot-language-server check it before the OS default).
15
+ * - Shape is VS Code-compatible: `{ "servers": { "<name>": { "type":
16
+ * "stdio", "command", "args" } } }` — the plugin documents mcp.json
17
+ * parity with `.vscode/mcp.json`.
18
+ * - **Global-only.** The plugin reads exactly one user-level file; a
19
+ * project-level mcp.json is an open feature request
20
+ * (microsoft/copilot-intellij-feedback#701, still open 2026-07).
21
+ * `supportsLocation('local')` returns false so the orchestrator
22
+ * skips local installs with a clear message (Codex pattern).
23
+ * - No `--path` injection: the config is user-global and the plugin
24
+ * documents no `${workspaceFolder}`-style variable expansion for
25
+ * this file, so we ship the plain entry and let the MCP server
26
+ * resolve the project from the client's roots/cwd as with other
27
+ * global installs.
28
+ * - No instructions file (MCP `initialize` instructions are the
29
+ * single source of truth, #529) and no permissions concept —
30
+ * `autoAllow` is silently ignored.
31
+ *
32
+ * The IDE opens this file in a JSON editor for hand-editing (Settings →
33
+ * Tools → GitHub Copilot → MCP → Configure), so reads + writes go
34
+ * through `jsonc-parser` — surgical edits that preserve sibling
35
+ * servers, user comments, and formatting (same approach as the
36
+ * copilot-vscode target).
37
+ *
38
+ * The plugin only re-reads mcp.json on IDE restart
39
+ * (microsoft/copilot-intellij-feedback#1139) — hence the restart note.
40
+ */
41
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
42
+ if (k2 === undefined) k2 = k;
43
+ var desc = Object.getOwnPropertyDescriptor(m, k);
44
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
45
+ desc = { enumerable: true, get: function() { return m[k]; } };
46
+ }
47
+ Object.defineProperty(o, k2, desc);
48
+ }) : (function(o, m, k, k2) {
49
+ if (k2 === undefined) k2 = k;
50
+ o[k2] = m[k];
51
+ }));
52
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
53
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
54
+ }) : function(o, v) {
55
+ o["default"] = v;
56
+ });
57
+ var __importStar = (this && this.__importStar) || (function () {
58
+ var ownKeys = function(o) {
59
+ ownKeys = Object.getOwnPropertyNames || function (o) {
60
+ var ar = [];
61
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
62
+ return ar;
63
+ };
64
+ return ownKeys(o);
65
+ };
66
+ return function (mod) {
67
+ if (mod && mod.__esModule) return mod;
68
+ var result = {};
69
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
70
+ __setModuleDefault(result, mod);
71
+ return result;
72
+ };
73
+ })();
74
+ Object.defineProperty(exports, "__esModule", { value: true });
75
+ exports.copilotJetbrainsTarget = void 0;
76
+ const fs = __importStar(require("fs"));
77
+ const path = __importStar(require("path"));
78
+ const os = __importStar(require("os"));
79
+ const jsonc_parser_1 = require("jsonc-parser");
80
+ const shared_1 = require("./shared");
81
+ /**
82
+ * The `github-copilot` config root, resolved the way the Copilot
83
+ * plugin family resolves it: `$XDG_CONFIG_HOME` first on every
84
+ * platform, then `%LOCALAPPDATA%` on Windows, then `~/.config`.
85
+ */
86
+ function copilotConfigRoot() {
87
+ const xdg = process.env.XDG_CONFIG_HOME;
88
+ if (xdg && xdg.trim().length > 0) {
89
+ return path.join(xdg, 'github-copilot');
90
+ }
91
+ if (process.platform === 'win32') {
92
+ const localAppData = process.env.LOCALAPPDATA && process.env.LOCALAPPDATA.trim().length > 0
93
+ ? process.env.LOCALAPPDATA
94
+ : path.join(os.homedir(), 'AppData', 'Local');
95
+ return path.join(localAppData, 'github-copilot');
96
+ }
97
+ return path.join(os.homedir(), '.config', 'github-copilot');
98
+ }
99
+ function intellijDir() {
100
+ return path.join(copilotConfigRoot(), 'intellij');
101
+ }
102
+ function mcpJsonPath() {
103
+ return path.join(intellijDir(), 'mcp.json');
104
+ }
105
+ /**
106
+ * Best-effort "a JetBrains IDE exists here" heuristic for the
107
+ * multiselect default — the per-OS dir every JetBrains IDE creates on
108
+ * first launch. False positives (IDE without the Copilot plugin) are
109
+ * acceptable per the `DetectionResult` contract.
110
+ */
111
+ function jetbrainsConfigDirExists() {
112
+ const home = os.homedir();
113
+ if (process.platform === 'darwin') {
114
+ return fs.existsSync(path.join(home, 'Library', 'Application Support', 'JetBrains'));
115
+ }
116
+ if (process.platform === 'win32') {
117
+ const appData = process.env.APPDATA && process.env.APPDATA.trim().length > 0
118
+ ? process.env.APPDATA
119
+ : path.join(home, 'AppData', 'Roaming');
120
+ return fs.existsSync(path.join(appData, 'JetBrains'));
121
+ }
122
+ const xdg = process.env.XDG_CONFIG_HOME && process.env.XDG_CONFIG_HOME.trim().length > 0
123
+ ? process.env.XDG_CONFIG_HOME
124
+ : path.join(home, '.config');
125
+ return fs.existsSync(path.join(xdg, 'JetBrains'));
126
+ }
127
+ function readConfigText(file) {
128
+ if (!fs.existsSync(file))
129
+ return '';
130
+ return fs.readFileSync(file, 'utf-8');
131
+ }
132
+ function parseConfig(text) {
133
+ if (!text.trim())
134
+ return {};
135
+ const errors = [];
136
+ const result = (0, jsonc_parser_1.parse)(text, errors, { allowTrailingComma: true });
137
+ if (result == null || typeof result !== 'object' || Array.isArray(result)) {
138
+ return {};
139
+ }
140
+ return result;
141
+ }
142
+ const FORMATTING = { tabSize: 2, insertSpaces: true, eol: '\n' };
143
+ class CopilotJetbrainsTarget {
144
+ id = 'copilot-jetbrains';
145
+ displayName = 'JetBrains IDEs (Copilot plugin)';
146
+ docsUrl = 'https://docs.github.com/en/copilot/how-tos/provide-context/use-mcp/extend-copilot-chat-with-mcp';
147
+ supportsLocation(loc) {
148
+ return loc === 'global';
149
+ }
150
+ detect(loc) {
151
+ if (loc !== 'global') {
152
+ return { installed: false, alreadyConfigured: false };
153
+ }
154
+ const file = mcpJsonPath();
155
+ const config = parseConfig(readConfigText(file));
156
+ const alreadyConfigured = !!config.servers?.codegraph;
157
+ // The `intellij/` subdir is created by the Copilot plugin itself;
158
+ // fall back to "some JetBrains IDE is installed" for first-time
159
+ // plugin users.
160
+ const installed = fs.existsSync(intellijDir()) || jetbrainsConfigDirExists();
161
+ return { installed, alreadyConfigured, configPath: file };
162
+ }
163
+ install(loc, _opts) {
164
+ if (loc !== 'global') {
165
+ return {
166
+ files: [],
167
+ notes: ['The JetBrains Copilot plugin has no project-local MCP config — re-run with --location=global to install.'],
168
+ };
169
+ }
170
+ return {
171
+ files: [writeMcpEntry()],
172
+ notes: ['Restart your JetBrains IDE — the Copilot plugin only reads mcp.json on startup.'],
173
+ };
174
+ }
175
+ uninstall(loc) {
176
+ if (loc !== 'global')
177
+ return { files: [] };
178
+ return { files: [removeMcpEntry()] };
179
+ }
180
+ printConfig(loc) {
181
+ if (loc !== 'global') {
182
+ return '# The JetBrains Copilot plugin has no project-local MCP config — use --location=global.\n';
183
+ }
184
+ const snippet = JSON.stringify({ servers: { codegraph: (0, shared_1.getMcpServerConfig)() } }, null, 2);
185
+ return `# Add to ${mcpJsonPath()}\n# (Settings → Tools → GitHub Copilot → Model Context Protocol → Configure)\n\n${snippet}\n`;
186
+ }
187
+ describePaths(loc) {
188
+ if (loc !== 'global')
189
+ return [];
190
+ return [mcpJsonPath()];
191
+ }
192
+ }
193
+ function writeMcpEntry() {
194
+ const file = mcpJsonPath();
195
+ const existed = fs.existsSync(file);
196
+ let text = readConfigText(file);
197
+ if (!text.trim())
198
+ text = '{}\n';
199
+ const config = parseConfig(text);
200
+ const before = config.servers?.codegraph;
201
+ const after = (0, shared_1.getMcpServerConfig)();
202
+ if ((0, shared_1.jsonDeepEqual)(before, after)) {
203
+ return { path: file, action: 'unchanged' };
204
+ }
205
+ // Surgical edit — preserves comments, formatting, and sibling
206
+ // servers ("servers" is created when missing).
207
+ const edits = (0, jsonc_parser_1.modify)(text, ['servers', 'codegraph'], after, {
208
+ formattingOptions: FORMATTING,
209
+ });
210
+ const updated = (0, jsonc_parser_1.applyEdits)(text, edits);
211
+ (0, shared_1.atomicWriteFileSync)(file, updated);
212
+ return { path: file, action: existed ? 'updated' : 'created' };
213
+ }
214
+ function removeMcpEntry() {
215
+ const file = mcpJsonPath();
216
+ if (!fs.existsSync(file))
217
+ return { path: file, action: 'not-found' };
218
+ const text = readConfigText(file);
219
+ const config = parseConfig(text);
220
+ if (!config.servers?.codegraph)
221
+ return { path: file, action: 'not-found' };
222
+ let edits = (0, jsonc_parser_1.modify)(text, ['servers', 'codegraph'], undefined, {
223
+ formattingOptions: FORMATTING,
224
+ });
225
+ let updated = (0, jsonc_parser_1.applyEdits)(text, edits);
226
+ // Drop an emptied `servers` wrapper; the file itself is left in
227
+ // place — the plugin owns it and siblings may remain.
228
+ const afterParsed = parseConfig(updated);
229
+ if (afterParsed.servers && typeof afterParsed.servers === 'object' &&
230
+ Object.keys(afterParsed.servers).length === 0) {
231
+ edits = (0, jsonc_parser_1.modify)(updated, ['servers'], undefined, { formattingOptions: FORMATTING });
232
+ updated = (0, jsonc_parser_1.applyEdits)(updated, edits);
233
+ }
234
+ (0, shared_1.atomicWriteFileSync)(file, updated);
235
+ return { path: file, action: 'removed' };
236
+ }
237
+ exports.copilotJetbrainsTarget = new CopilotJetbrainsTarget();
238
+ //# sourceMappingURL=copilot-jetbrains.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copilot-jetbrains.js","sourceRoot":"","sources":["../../../src/installer/targets/copilot-jetbrains.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,+CAAuE;AAQvE,qCAIkB;AAElB;;;;GAIG;AACH,SAAS,iBAAiB;IACxB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IACxC,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;YACzF,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY;YAC1B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAChD,OAA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AAsB,GAAgB,IAAI,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * VS Code (GitHub Copilot Chat) target.
3
+ *
4
+ * - MCP server entry to `.vscode/mcp.json` (local, workspace-scoped)
5
+ * or the user-level `mcp.json` in the VS Code User dir (global):
6
+ *
7
+ * macOS: ~/Library/Application Support/Code/User/mcp.json
8
+ * Windows: %APPDATA%\Code\User\mcp.json
9
+ * Linux: $XDG_CONFIG_HOME|~/.config/Code/User/mcp.json
10
+ *
11
+ * VS Code moved MCP config out of settings.json into this dedicated
12
+ * `mcp.json` (v1.102, "MCP: Open User Configuration"). Shape is
13
+ * `{ "servers": { "<name>": { "type": "stdio", "command", "args" } } }`
14
+ * — note `servers`, not the `mcpServers` wrapper Claude/Cursor use.
15
+ * - No instructions file: Copilot Chat consumes the MCP `initialize`
16
+ * instructions, the single source of truth (#529).
17
+ * - No permissions concept — `autoAllow` is silently ignored.
18
+ *
19
+ * ## Why `--path` only for local installs (NOT the Cursor pattern)
20
+ *
21
+ * Unlike Cursor, VS Code DOCUMENTS the launch cwd for stdio MCP
22
+ * servers: "Working directory for the server command. Defaults to the
23
+ * workspace folder when run in a workspace" (mcp-configuration
24
+ * reference). The codegraph server resolves its project via the MCP
25
+ * roots/list dance with a cwd fallback, so cwd alone is sufficient:
26
+ *
27
+ * - `local` install: absolute `--path` (known at install time) —
28
+ * deterministic, and free of variables.
29
+ * - `global` install: NO `--path`. Do not be tempted to pin it with
30
+ * `${workspaceFolder}`: VS Code refuses to start a user-level
31
+ * server whose entry uses that variable whenever a window has no
32
+ * folder open (loose files, welcome tab), surfacing an error toast
33
+ * "Variable workspaceFolder can not be resolved" in every such
34
+ * window — exactly the error-noise that teaches users to disable
35
+ * the server. With no `--path`, a folderless window still starts
36
+ * the server fine and it serves the "no project" guidance.
37
+ *
38
+ * ## JSONC
39
+ *
40
+ * VS Code parses its config files as JSONC (comments + trailing commas
41
+ * allowed), so reads + writes go through `jsonc-parser` — surgical
42
+ * edits that preserve sibling servers, user comments, and formatting
43
+ * across install / re-install / uninstall (same approach as opencode).
44
+ */
45
+ import { AgentTarget } from './types';
46
+ export declare const copilotVscodeTarget: AgentTarget;
47
+ //# sourceMappingURL=copilot-vscode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copilot-vscode.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/copilot-vscode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAMH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AA4JjB,eAAO,MAAM,mBAAmB,EAAE,WAAuC,CAAC"}