aegiscode 7.0.26 → 7.0.27

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 (118) hide show
  1. package/SOURCE-OFFER.txt +9 -0
  2. package/package.json +4 -7
  3. package/scripts/check.mjs +1 -52
  4. package/scripts/demo.mjs +1 -94
  5. package/scripts/predist.mjs +1 -75
  6. package/scripts/runtests.mjs +1 -56
  7. package/scripts/seal-gate.mjs +1 -74
  8. package/src/agents.js +1 -139
  9. package/src/app.js +1 -2957
  10. package/src/art.js +1 -289
  11. package/src/chatflow.js +1 -3023
  12. package/src/checkpoint.js +1 -90
  13. package/src/clipboard.js +1 -424
  14. package/src/cloudsync.js +1 -528
  15. package/src/commands.js +1 -4089
  16. package/src/config.js +1 -581
  17. package/src/connect.js +1 -349
  18. package/src/credentials.js +1 -33
  19. package/src/deps.js +1 -232
  20. package/src/devrun.js +1 -187
  21. package/src/diff.js +1 -333
  22. package/src/diffview.js +1 -296
  23. package/src/engine.js +1 -297
  24. package/src/entitlement.js +1 -355
  25. package/src/events.js +1 -707
  26. package/src/export.js +1 -67
  27. package/src/filepreview.js +1 -153
  28. package/src/fingerprint.js +1 -592
  29. package/src/format.js +1 -259
  30. package/src/fuzzy.js +1 -119
  31. package/src/history.js +1 -423
  32. package/src/init.js +1 -175
  33. package/src/input.js +1 -139
  34. package/src/keys.js +1 -183
  35. package/src/markdown.js +1 -306
  36. package/src/models.js +1 -507
  37. package/src/naming.js +1 -57
  38. package/src/overlays.js +1 -462
  39. package/src/panels.js +1 -1418
  40. package/src/ping.js +1 -226
  41. package/src/presence.js +1 -238
  42. package/src/render.js +1 -516
  43. package/src/screen.js +1 -518
  44. package/src/screens.js +1 -896
  45. package/src/secret.js +1 -59
  46. package/src/securefs.js +1 -359
  47. package/src/settings.js +1 -155
  48. package/src/shared.js +1 -52
  49. package/src/sharedpaths.js +1 -53
  50. package/src/signup.js +1 -156
  51. package/src/summarize.js +1 -95
  52. package/src/sysdiag.js +1 -585
  53. package/src/system.js +1 -40
  54. package/src/theme.js +1 -570
  55. package/src/title.js +1 -220
  56. package/src/todos.js +1 -115
  57. package/src/tokens.js +1 -263
  58. package/src/topup.js +1 -210
  59. package/src/update.js +1 -191
  60. package/vendor/client/aegis.js +1 -2441
  61. package/vendor/client/attest.js +1 -518
  62. package/vendor/client/authorship-key.js +1 -410
  63. package/vendor/client/auto-provision.js +1 -134
  64. package/vendor/client/brain-catalog.js +1 -268
  65. package/vendor/client/byok-catalog.js +1 -199
  66. package/vendor/client/catalog-client.js +1 -487
  67. package/vendor/client/conversation-export.js +1 -177
  68. package/vendor/client/credentials.js +1 -494
  69. package/vendor/client/device-fingerprint.js +1 -141
  70. package/vendor/client/drive-connect.js +1 -110
  71. package/vendor/client/drive-upload.js +1 -234
  72. package/vendor/client/env-file.js +1 -1273
  73. package/vendor/client/fingerprint.js +1 -1064
  74. package/vendor/client/foreign-memory.js +1 -669
  75. package/vendor/client/google-signin.js +1 -133
  76. package/vendor/client/hooks.js +1 -430
  77. package/vendor/client/model-discovery.js +1 -373
  78. package/vendor/client/naming.js +1 -283
  79. package/vendor/client/platform.js +1 -937
  80. package/vendor/client/prefs.js +1 -351
  81. package/vendor/client/presence-constants.js +1 -107
  82. package/vendor/client/presence.js +1 -438
  83. package/vendor/client/record-vault.js +3 -1055
  84. package/vendor/client/session-store.js +1 -575
  85. package/vendor/client/topup.js +1 -297
  86. package/vendor/client/touch.js +1 -458
  87. package/vendor/client/update.js +1 -763
  88. package/vendor/client/user-models.js +1 -381
  89. package/vendor/desktop/lib/local/agents.js +1 -105
  90. package/vendor/desktop/lib/local/attachments.js +1 -276
  91. package/vendor/desktop/lib/local/autonomous.js +1 -1045
  92. package/vendor/desktop/lib/local/claude-pro.js +1 -1028
  93. package/vendor/desktop/lib/local/context.js +1 -125
  94. package/vendor/desktop/lib/local/engine.js +1 -3666
  95. package/vendor/desktop/lib/local/entitlement.js +1 -660
  96. package/vendor/desktop/lib/local/exec-plan.js +1 -269
  97. package/vendor/desktop/lib/local/git-scope.js +1 -228
  98. package/vendor/desktop/lib/local/integrity.js +1 -163
  99. package/vendor/desktop/lib/local/local.js +1 -2145
  100. package/vendor/desktop/lib/local/prompt.js +1 -280
  101. package/vendor/desktop/lib/local/queue.js +1 -560
  102. package/vendor/desktop/lib/local/session-rounds.js +1 -238
  103. package/vendor/desktop/lib/local/shell.js +1 -712
  104. package/vendor/desktop/lib/local/spill.js +1 -75
  105. package/vendor/desktop/lib/local/tools.js +1 -1328
  106. package/vendor/desktop/lib/local/turn-guard.js +1 -300
  107. package/vendor/desktop/lib/local/worktree-lock.js +1 -235
  108. package/vendor/desktop/lib/settings.js +1 -890
  109. package/vendor/desktop/main.js +3 -4890
  110. package/vendor/desktop/renderer/usage.js +1 -1239
  111. package/vendor/hosts/install.js +1 -638
  112. package/vendor/hosts/openai-shim.js +1 -515
  113. package/vendor/hosts/spec.js +1 -164
  114. package/vendor/hosts/targets.js +1 -346
  115. package/vendor/mcp/server.js +1 -221
  116. package/vendor/mcp/tools.js +1 -408
  117. package/vendor/one/src/child.js +1 -285
  118. package/vendor/one/src/permissions.js +1 -383
@@ -1,164 +1 @@
1
- 'use strict';
2
-
3
- /**
4
- * The canonical AEGIS server spec — one description of "run the AEGIS MCP
5
- * server", which every host target then re-shapes into its own config dialect.
6
- *
7
- * There is exactly one server implementation (`mcp/server.js`, a dependency-free
8
- * stdio JSON-RPC host) and one tool registry (`mcp/tools.js`) shared with the
9
- * CLI. Editor integrations are therefore a CONFIGURATION problem, not a code
10
- * problem: every host that speaks MCP gets the same process, and nothing here
11
- * re-implements a tool.
12
- *
13
- * Two decisions are encoded deliberately:
14
- *
15
- * 1. The API key is NOT written into editor config by default. Each editor
16
- * keeps its MCP config in a plain, often world-readable file, and several
17
- * of them are inside project directories that get committed. The server
18
- * already resolves a credential from the environment, then the 0600 store
19
- * `aegiscode login` writes, then `~/.aegiscode/.env` (read at startup in
20
- * every host). So the correct default is to write NO secret and let the
21
- * existing resolution do its job. `--with-key` exists for the user who
22
- * insists, and `--prompt-key` emits VS Code's own `inputs` password prompt
23
- * for the one host that supports not storing the value at all.
24
- *
25
- * 2. `command` is `node` + an absolute path to `mcp/server.js`, because that
26
- * is true on every platform and needs no shebang, no chmod, and no PATH
27
- * entry. `npx aegiscode-mcp` style launchers are deliberately not used: a
28
- * cold `npx` resolution inside an editor's MCP host is a startup failure
29
- * the user cannot see.
30
- */
31
-
32
- const fs = require('node:fs');
33
- const path = require('node:path');
34
-
35
- const SERVER_NAME = 'aegis';
36
- const DEFAULT_API_BASE = 'https://aegiscloud.org';
37
-
38
- /**
39
- * Every place `mcp/server.js` legitimately lives, most-specific first.
40
- *
41
- * - inside this repo / this checkout: `<root>/mcp/server.js`
42
- * - installed as the `aegiscode` npm package: `<pkg>/vendor/mcp/server.js`
43
- * (the CLI vendors `mcp/` and `client/` at publish time — see
44
- * `cli/scripts/predist.mjs`)
45
- * - an explicit override, for a user who keeps the tree somewhere unusual.
46
- *
47
- * A missing target is a real, reportable condition: an editor config that
48
- * points at a path that does not exist fails silently inside the editor, which
49
- * is the worst possible failure mode. `resolveServer()` therefore returns the
50
- * first candidate that exists and `serverCandidates()` exposes all of them so
51
- * `aegiscode mcp status` can explain what it looked for.
52
- */
53
- function serverCandidates(env = process.env) {
54
- const out = [];
55
- const push = (p) => {
56
- if (!p) return;
57
- const abs = path.resolve(p);
58
- if (!out.includes(abs)) out.push(abs);
59
- };
60
-
61
- push(env.AEGIS_MCP_SERVER);
62
- push(path.resolve(__dirname, '..', 'mcp', 'server.js'));
63
- push(path.resolve(__dirname, '..', 'cli', 'vendor', 'mcp', 'server.js'));
64
- push(path.resolve(__dirname, '..', 'vendor', 'mcp', 'server.js'));
65
- push(path.resolve(__dirname, '..', '..', 'mcp', 'server.js'));
66
-
67
- // A globally installed CLI (`npm i -g aegiscode`) keeps its vendor tree in
68
- // the global root, which is not on any path relative to this file.
69
- for (const root of globalRoots(env)) {
70
- push(path.join(root, 'aegiscode', 'vendor', 'mcp', 'server.js'));
71
- }
72
- return out;
73
- }
74
-
75
- function globalRoots(env = process.env) {
76
- const roots = [];
77
- if (env.npm_config_prefix) roots.push(path.join(env.npm_config_prefix, 'lib', 'node_modules'));
78
- roots.push('/usr/local/lib/node_modules', '/usr/lib/node_modules');
79
- const node = process.execPath || '';
80
- if (node.includes(`${path.sep}bin${path.sep}`)) {
81
- roots.push(path.resolve(node, '..', '..', 'lib', 'node_modules'));
82
- }
83
- return roots;
84
- }
85
-
86
- /**
87
- * @returns {{path: string, exists: boolean, candidates: string[]}}
88
- */
89
- function resolveServer(env = process.env) {
90
- const candidates = serverCandidates(env);
91
- const found = candidates.find((p) => {
92
- try { return fs.statSync(p).isFile(); } catch { return false; }
93
- });
94
- return { path: found || candidates[0], exists: Boolean(found), candidates };
95
- }
96
-
97
- /**
98
- * The API base is part of the spec because a self-hosted `aegis1` is a
99
- * supported configuration (`AEGIS_API_BASE`), and an editor config that
100
- * silently points at the public cloud when the user meant their own box is a
101
- * leak, not a bug.
102
- */
103
- function resolveApiBase(env = process.env, override) {
104
- return override || env.AEGIS_API_BASE || DEFAULT_API_BASE;
105
- }
106
-
107
- /**
108
- * Build the server spec for one target.
109
- *
110
- * @param {object} [opts]
111
- * @param {string} [opts.apiKey] Only set when the user asked for it.
112
- * @param {string} [opts.apiBase]
113
- * @param {string} [opts.serverPath]
114
- * @param {boolean} [opts.promptKey] Reference a host-supplied secret instead of
115
- * embedding one (VS Code `inputs`).
116
- * @param {NodeJS.ProcessEnv} [opts.env]
117
- * @returns {{name: string, command: string, args: string[], env: object,
118
- * keyRef: string|null, server: object}}
119
- */
120
- function buildSpec(opts = {}) {
121
- const env = opts.env || process.env;
122
- const server = resolveServer(env);
123
- const path_ = opts.serverPath || server.path;
124
- const apiBase = resolveApiBase(env, opts.apiBase);
125
-
126
- const vars = {};
127
- if (opts.promptKey) {
128
- vars.AEGIS_API_KEY = '${input:aegis-api-key}';
129
- } else if (opts.apiKey) {
130
- vars.AEGIS_API_KEY = opts.apiKey;
131
- }
132
- // Always record the base: it is not a secret and a wrong base is the single
133
- // most confusing misconfiguration to debug from inside an editor.
134
- vars.AEGIS_API_BASE = apiBase;
135
-
136
- return {
137
- name: SERVER_NAME,
138
- command: 'node',
139
- args: [path_],
140
- env: vars,
141
- keyRef: opts.promptKey ? '${input:aegis-api-key}' : (opts.apiKey || null),
142
- server,
143
- };
144
- }
145
-
146
- /** The VS Code `inputs` block that makes `promptKey` above resolve. */
147
- function vscodeKeyInput() {
148
- return {
149
- type: 'promptString',
150
- id: 'aegis-api-key',
151
- description: 'AEGIS API key (aegiscloud.org → Account → API keys)',
152
- password: true,
153
- };
154
- }
155
-
156
- module.exports = {
157
- SERVER_NAME,
158
- DEFAULT_API_BASE,
159
- buildSpec,
160
- resolveServer,
161
- serverCandidates,
162
- resolveApiBase,
163
- vscodeKeyInput,
164
- };
1
+ "use strict";const fs=require("node:fs"),path=require("node:path"),SERVER_NAME="aegis",DEFAULT_API_BASE="https://aegiscloud.org";function serverCandidates(e=process.env){const s=[],r=e=>{if(!e)return;const r=path.resolve(e);s.includes(r)||s.push(r)};r(e.AEGIS_MCP_SERVER),r(path.resolve(__dirname,"..","mcp","server.js")),r(path.resolve(__dirname,"..","cli","vendor","mcp","server.js")),r(path.resolve(__dirname,"..","vendor","mcp","server.js")),r(path.resolve(__dirname,"..","..","mcp","server.js"));for(const s of globalRoots(e))r(path.join(s,"aegiscode","vendor","mcp","server.js"));return s}function globalRoots(e=process.env){const s=[];e.npm_config_prefix&&s.push(path.join(e.npm_config_prefix,"lib","node_modules")),s.push("/usr/local/lib/node_modules","/usr/lib/node_modules");const r=process.execPath||"";return r.includes(`${path.sep}bin${path.sep}`)&&s.push(path.resolve(r,"..","..","lib","node_modules")),s}function resolveServer(e=process.env){const s=serverCandidates(e),r=s.find((e=>{try{return fs.statSync(e).isFile()}catch{return!1}}));return{path:r||s[0],exists:Boolean(r),candidates:s}}function resolveApiBase(e=process.env,s){return s||e.AEGIS_API_BASE||DEFAULT_API_BASE}function buildSpec(e={}){const s=e.env||process.env,r=resolveServer(s),o=e.serverPath||r.path,n=resolveApiBase(s,e.apiBase),t={};return e.promptKey?t.AEGIS_API_KEY="${input:aegis-api-key}":e.apiKey&&(t.AEGIS_API_KEY=e.apiKey),t.AEGIS_API_BASE=n,{name:"aegis",command:"node",args:[o],env:t,keyRef:e.promptKey?"${input:aegis-api-key}":e.apiKey||null,server:r}}function vscodeKeyInput(){return{type:"promptString",id:"aegis-api-key",description:"AEGIS API key (aegiscloud.org → Account → API keys)",password:!0}}module.exports={SERVER_NAME:"aegis",DEFAULT_API_BASE:DEFAULT_API_BASE,buildSpec:buildSpec,resolveServer:resolveServer,serverCandidates:serverCandidates,resolveApiBase:resolveApiBase,vscodeKeyInput:vscodeKeyInput};
@@ -1,346 +1 @@
1
- 'use strict';
2
-
3
- /**
4
- * The host registry — every coding program AEGIS can appear in, and the exact
5
- * dialect each one wants.
6
- *
7
- * This file is DATA. It contains no I/O, no prompting and no CLI text: the
8
- * installer (`./install.js`) walks this table, and `aegiscode mcp print` renders
9
- * one entry without touching the disk. Adding a host is adding a row.
10
- *
11
- * Two things are worth knowing before editing a row:
12
- *
13
- * - `container` is the dotted key path inside the config file that holds the
14
- * server map. VS Code uses `servers`, most of the ecosystem uses
15
- * `mcpServers`, Zed uses `context_servers`, and OpenCode nests a single
16
- * `mcp` object. Getting this wrong does not error — the editor just never
17
- * starts the server — so each row carries `docs` and `verified` so a user
18
- * can check the claim against the host's own documentation.
19
- *
20
- * - `entry()` returns the host's own object shape, built from the canonical
21
- * spec in `./spec.js`. Nothing else in the codebase needs to know that
22
- * Windsurf and Cline disagree about `type: "stdio"`.
23
- *
24
- * `scopes`: `user` writes to the machine-wide config, `workspace` writes into
25
- * the current directory (committed to git in many projects — which is exactly
26
- * why no API key is written unless the user asks).
27
- */
28
-
29
- const os = require('node:os');
30
- const path = require('node:path');
31
-
32
- const { SERVER_NAME, vscodeKeyInput } = require('./spec.js');
33
-
34
- // ---------------------------------------------------------------------------
35
- // Path helpers — platform-aware, and injectable so tests never touch $HOME.
36
- // ---------------------------------------------------------------------------
37
-
38
- function home(ctx) {
39
- return ctx.home || ctx.env.HOME || ctx.env.USERPROFILE || os.homedir();
40
- }
41
-
42
- /** XDG on Linux, Application Support on macOS, APPDATA on Windows. */
43
- function appConfig(ctx) {
44
- const { env, platform } = ctx;
45
- if (env.XDG_CONFIG_HOME) return env.XDG_CONFIG_HOME;
46
- if (platform === 'win32') return env.APPDATA || path.join(home(ctx), 'AppData', 'Roaming');
47
- if (platform === 'darwin') return path.join(home(ctx), 'Library', 'Application Support');
48
- return path.join(home(ctx), '.config');
49
- }
50
-
51
- /** Zed keeps its settings in a plain dotfile even on macOS. */
52
- function zedConfig(ctx) {
53
- const { env, platform } = ctx;
54
- if (platform === 'win32') return path.join(env.APPDATA || path.join(home(ctx), 'AppData', 'Roaming'), 'Zed');
55
- return path.join(env.XDG_CONFIG_HOME || path.join(home(ctx), '.config'), 'zed');
56
- }
57
-
58
- function dot(ctx, ...parts) {
59
- return path.join(home(ctx), ...parts);
60
- }
61
-
62
- function vscodeUserFile(ctx, variant) {
63
- return path.join(appConfig(ctx), variant, 'User', 'mcp.json');
64
- }
65
-
66
- /** `env` is omitted entirely when empty: an empty object in these files is
67
- * noise, and Cline in particular treats a present-but-empty `env` as a change
68
- * worth re-asking the user about. */
69
- function orEnv(spec) {
70
- const env = spec.env && Object.keys(spec.env).length ? spec.env : null;
71
- return env;
72
- }
73
-
74
- function plainEntry(spec) {
75
- const env = orEnv(spec);
76
- const out = { command: spec.command, args: spec.args };
77
- if (env) out.env = env;
78
- return out;
79
- }
80
-
81
- // ---------------------------------------------------------------------------
82
- // The registry
83
- // ---------------------------------------------------------------------------
84
-
85
- const TARGETS = [
86
- {
87
- id: 'vscode',
88
- label: 'VS Code',
89
- kind: 'mcp-json',
90
- container: 'servers',
91
- scopes: ['user', 'workspace'],
92
- docs: 'https://code.visualstudio.com/docs/copilot/customization/mcp-servers',
93
- verified: true,
94
- supportsKeyPrompt: true,
95
- note: 'Copilot agent mode reads `.vscode/mcp.json` for the workspace, or the user file for every project.',
96
- path(scope, ctx) {
97
- return scope === 'workspace' ? path.join(ctx.cwd, '.vscode', 'mcp.json') : vscodeUserFile(ctx, 'Code');
98
- },
99
- // VS Code is the one host with a first-class stdio type tag and a secret
100
- // input mechanism, so it is the only row that gets either.
101
- entry(spec) {
102
- const out = { type: 'stdio', command: spec.command, args: spec.args };
103
- const env = orEnv(spec);
104
- if (env) out.env = env;
105
- return out;
106
- },
107
- extras(spec) {
108
- return spec.keyRef && spec.keyRef.startsWith('${input:')
109
- ? { inputs: [vscodeKeyInput()] }
110
- : null;
111
- },
112
- },
113
- {
114
- id: 'vscode-insiders',
115
- label: 'VS Code Insiders',
116
- kind: 'mcp-json',
117
- container: 'servers',
118
- scopes: ['user'],
119
- docs: 'https://code.visualstudio.com/docs/copilot/customization/mcp-servers',
120
- verified: true,
121
- supportsKeyPrompt: true,
122
- path(scope, ctx) { return vscodeUserFile(ctx, 'Code - Insiders'); },
123
- entry: (spec) => TARGETS[0].entry(spec),
124
- extras: (spec) => TARGETS[0].extras(spec),
125
- },
126
- {
127
- id: 'vscodium',
128
- label: 'VSCodium',
129
- kind: 'mcp-json',
130
- container: 'servers',
131
- scopes: ['user', 'workspace'],
132
- docs: 'https://code.visualstudio.com/docs/copilot/customization/mcp-servers',
133
- verified: true,
134
- supportsKeyPrompt: true,
135
- path(scope, ctx) {
136
- return scope === 'workspace' ? path.join(ctx.cwd, '.vscode', 'mcp.json') : vscodeUserFile(ctx, 'VSCodium');
137
- },
138
- entry: (spec) => TARGETS[0].entry(spec),
139
- extras: (spec) => TARGETS[0].extras(spec),
140
- },
141
- {
142
- id: 'cursor',
143
- label: 'Cursor',
144
- kind: 'mcp-json',
145
- container: 'mcpServers',
146
- scopes: ['user', 'workspace'],
147
- docs: 'https://cursor.com/docs/context/mcp',
148
- verified: true,
149
- path(scope, ctx) {
150
- return scope === 'workspace'
151
- ? path.join(ctx.cwd, '.cursor', 'mcp.json')
152
- : path.join(appConfig(ctx), 'Cursor', 'mcp.json');
153
- },
154
- entry: plainEntry,
155
- },
156
- {
157
- id: 'windsurf',
158
- label: 'Windsurf',
159
- kind: 'mcp-json',
160
- container: 'mcpServers',
161
- scopes: ['user'],
162
- docs: 'https://docs.windsurf.com/windsurf/cascade/mcp',
163
- verified: true,
164
- // Windsurf reads ~/.codeium/windsurf/mcp_config.json on every platform.
165
- path(scope, ctx) { return dot(ctx, '.codeium', 'windsurf', 'mcp_config.json'); },
166
- entry: plainEntry,
167
- },
168
- {
169
- id: 'cline',
170
- label: 'Cline (VS Code extension)',
171
- kind: 'mcp-json',
172
- container: 'mcpServers',
173
- scopes: ['user'],
174
- docs: 'https://docs.cline.bot/mcp/configuring-mcp-servers',
175
- verified: true,
176
- path(scope, ctx) {
177
- return path.join(
178
- appConfig(ctx), 'Code', 'User', 'globalStorage',
179
- 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'
180
- );
181
- },
182
- entry(spec) {
183
- return { ...plainEntry(spec), disabled: false, autoApprove: [], type: 'stdio' };
184
- },
185
- },
186
- {
187
- id: 'roo',
188
- label: 'Roo Code (VS Code extension)',
189
- kind: 'mcp-json',
190
- container: 'mcpServers',
191
- scopes: ['user'],
192
- docs: 'https://docs.roocode.com/features/mcp/using-mcp-in-roo',
193
- verified: true,
194
- path(scope, ctx) {
195
- return path.join(
196
- appConfig(ctx), 'Code', 'User', 'globalStorage',
197
- 'rooveterinaryinc.roo-cline', 'settings', 'mcp_settings.json'
198
- );
199
- },
200
- entry(spec) {
201
- return { ...plainEntry(spec), disabled: false, alwaysAllow: [], type: 'stdio' };
202
- },
203
- },
204
- {
205
- id: 'zed',
206
- label: 'Zed',
207
- kind: 'mcp-json',
208
- container: 'context_servers',
209
- scopes: ['user'],
210
- docs: 'https://zed.dev/docs/ai/mcp',
211
- verified: true,
212
- path(scope, ctx) { return path.join(zedConfig(ctx), 'settings.json'); },
213
- // Zed wraps the process in a `command` object and requires the custom
214
- // source tag; a bare `command` string here is silently ignored.
215
- entry(spec) {
216
- const command = { path: spec.command, args: spec.args };
217
- const env = orEnv(spec);
218
- if (env) command.env = env;
219
- return { source: 'custom', command };
220
- },
221
- },
222
- {
223
- id: 'continue',
224
- label: 'Continue (VS Code / JetBrains)',
225
- kind: 'mcp-json',
226
- container: 'mcpServers',
227
- scopes: ['user'],
228
- docs: 'https://docs.continue.dev/customize/deep-dives/mcp',
229
- verified: true,
230
- path(scope, ctx) { return dot(ctx, '.continue', 'config.json'); },
231
- entry: plainEntry,
232
- // Continue has moved to config.yaml; writing config.json into a directory
233
- // that already holds a yaml config produces a file Continue ignores.
234
- yamlWins: true,
235
- },
236
- {
237
- id: 'claude',
238
- label: 'Claude Code (project scope)',
239
- kind: 'mcp-json',
240
- container: 'mcpServers',
241
- scopes: ['workspace'],
242
- docs: 'https://docs.claude.com/en/docs/claude-code/mcp',
243
- verified: true,
244
- path(scope, ctx) { return path.join(ctx.cwd, '.mcp.json'); },
245
- entry: plainEntry,
246
- },
247
- {
248
- id: 'gemini',
249
- label: 'Gemini CLI',
250
- kind: 'mcp-json',
251
- container: 'mcpServers',
252
- scopes: ['user'],
253
- docs: 'https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md',
254
- verified: true,
255
- path(scope, ctx) { return dot(ctx, '.gemini', 'settings.json'); },
256
- entry: plainEntry,
257
- },
258
- {
259
- id: 'codex',
260
- label: 'Codex CLI',
261
- kind: 'mcp-toml',
262
- container: 'mcp_servers',
263
- scopes: ['user'],
264
- docs: 'https://github.com/openai/codex/blob/main/docs/config.md',
265
- verified: true,
266
- path(scope, ctx) { return dot(ctx, '.codex', 'config.toml'); },
267
- },
268
- {
269
- id: 'junie',
270
- label: 'JetBrains Junie / AI Assistant',
271
- kind: 'mcp-json',
272
- container: 'mcpServers',
273
- scopes: ['user', 'workspace'],
274
- docs: 'https://www.jetbrains.com/help/junie/mcp.html',
275
- verified: false,
276
- note: 'JetBrains reads this file but the IDE also caches MCP config in Settings — restart the IDE and confirm the server is listed there.',
277
- path(scope, ctx) {
278
- return scope === 'workspace'
279
- ? path.join(ctx.cwd, '.junie', 'mcp', 'mcp.json')
280
- : dot(ctx, '.junie', 'mcp', 'mcp.json');
281
- },
282
- entry: plainEntry,
283
- },
284
- {
285
- id: 'opencode',
286
- label: 'OpenCode',
287
- kind: 'mcp-json',
288
- container: 'mcp',
289
- scopes: ['user'],
290
- docs: 'https://opencode.ai/docs/mcp-servers/',
291
- verified: false,
292
- note: 'OpenCode takes a single command array instead of command + args.',
293
- path(scope, ctx) { return path.join(appConfig(ctx), 'opencode', 'opencode.json'); },
294
- entry(spec) {
295
- const env = orEnv(spec);
296
- const out = { type: 'local', command: [spec.command, ...spec.args], enabled: true };
297
- if (env) out.environment = env;
298
- return out;
299
- },
300
- },
301
- ];
302
-
303
- const BY_ID = new Map(TARGETS.map((t) => [t.id, t]));
304
-
305
- /** Aliases people actually type, and the VS Code variants' shared row. */
306
- const ALIASES = {
307
- code: 'vscode',
308
- 'vs-code': 'vscode',
309
- 'vscode-code': 'vscode',
310
- windsurfcodeium: 'windsurf',
311
- 'roo-code': 'roo',
312
- 'roocode': 'roo',
313
- jetbrains: 'junie',
314
- 'claude-code': 'claude',
315
- gemini_cli: 'gemini',
316
- 'codex-cli': 'codex',
317
- vsc: 'vscodium',
318
- };
319
-
320
- function getTarget(id) {
321
- if (!id) return null;
322
- const key = String(id).toLowerCase().trim();
323
- return BY_ID.get(key) || BY_ID.get(ALIASES[key]) || null;
324
- }
325
-
326
- function targetIds() {
327
- return TARGETS.map((t) => t.id);
328
- }
329
-
330
- /**
331
- * Hosts whose MCP config lives inside a VS Code-family `User` directory, keyed
332
- * by the directory name — used by `status` to explain a missing file.
333
- */
334
- const VSCODE_VARIANTS = ['Code', 'Code - Insiders', 'VSCodium'];
335
-
336
- module.exports = {
337
- TARGETS,
338
- ALIASES,
339
- VSCODE_VARIANTS,
340
- getTarget,
341
- targetIds,
342
- SERVER_NAME,
343
- appConfig,
344
- zedConfig,
345
- home,
346
- };
1
+ "use strict";const os=require("node:os"),path=require("node:path"),{SERVER_NAME:SERVER_NAME,vscodeKeyInput:vscodeKeyInput}=require("./spec.js");function home(e){return e.home||e.env.HOME||e.env.USERPROFILE||os.homedir()}function appConfig(e){const{env:o,platform:n}=e;return o.XDG_CONFIG_HOME?o.XDG_CONFIG_HOME:"win32"===n?o.APPDATA||path.join(home(e),"AppData","Roaming"):"darwin"===n?path.join(home(e),"Library","Application Support"):path.join(home(e),".config")}function zedConfig(e){const{env:o,platform:n}=e;return"win32"===n?path.join(o.APPDATA||path.join(home(e),"AppData","Roaming"),"Zed"):path.join(o.XDG_CONFIG_HOME||path.join(home(e),".config"),"zed")}function dot(e,...o){return path.join(home(e),...o)}function vscodeUserFile(e,o){return path.join(appConfig(e),o,"User","mcp.json")}function orEnv(e){return e.env&&Object.keys(e.env).length?e.env:null}function plainEntry(e){const o=orEnv(e),n={command:e.command,args:e.args};return o&&(n.env=o),n}const TARGETS=[{id:"vscode",label:"VS Code",kind:"mcp-json",container:"servers",scopes:["user","workspace"],docs:"https://code.visualstudio.com/docs/copilot/customization/mcp-servers",verified:!0,supportsKeyPrompt:!0,note:"Copilot agent mode reads `.vscode/mcp.json` for the workspace, or the user file for every project.",path:(e,o)=>"workspace"===e?path.join(o.cwd,".vscode","mcp.json"):vscodeUserFile(o,"Code"),entry(e){const o={type:"stdio",command:e.command,args:e.args},n=orEnv(e);return n&&(o.env=n),o},extras:e=>e.keyRef&&e.keyRef.startsWith("${input:")?{inputs:[vscodeKeyInput()]}:null},{id:"vscode-insiders",label:"VS Code Insiders",kind:"mcp-json",container:"servers",scopes:["user"],docs:"https://code.visualstudio.com/docs/copilot/customization/mcp-servers",verified:!0,supportsKeyPrompt:!0,path:(e,o)=>vscodeUserFile(o,"Code - Insiders"),entry:e=>TARGETS[0].entry(e),extras:e=>TARGETS[0].extras(e)},{id:"vscodium",label:"VSCodium",kind:"mcp-json",container:"servers",scopes:["user","workspace"],docs:"https://code.visualstudio.com/docs/copilot/customization/mcp-servers",verified:!0,supportsKeyPrompt:!0,path:(e,o)=>"workspace"===e?path.join(o.cwd,".vscode","mcp.json"):vscodeUserFile(o,"VSCodium"),entry:e=>TARGETS[0].entry(e),extras:e=>TARGETS[0].extras(e)},{id:"cursor",label:"Cursor",kind:"mcp-json",container:"mcpServers",scopes:["user","workspace"],docs:"https://cursor.com/docs/context/mcp",verified:!0,path:(e,o)=>"workspace"===e?path.join(o.cwd,".cursor","mcp.json"):path.join(appConfig(o),"Cursor","mcp.json"),entry:plainEntry},{id:"windsurf",label:"Windsurf",kind:"mcp-json",container:"mcpServers",scopes:["user"],docs:"https://docs.windsurf.com/windsurf/cascade/mcp",verified:!0,path:(e,o)=>dot(o,".codeium","windsurf","mcp_config.json"),entry:plainEntry},{id:"cline",label:"Cline (VS Code extension)",kind:"mcp-json",container:"mcpServers",scopes:["user"],docs:"https://docs.cline.bot/mcp/configuring-mcp-servers",verified:!0,path:(e,o)=>path.join(appConfig(o),"Code","User","globalStorage","saoudrizwan.claude-dev","settings","cline_mcp_settings.json"),entry:e=>({...plainEntry(e),disabled:!1,autoApprove:[],type:"stdio"})},{id:"roo",label:"Roo Code (VS Code extension)",kind:"mcp-json",container:"mcpServers",scopes:["user"],docs:"https://docs.roocode.com/features/mcp/using-mcp-in-roo",verified:!0,path:(e,o)=>path.join(appConfig(o),"Code","User","globalStorage","rooveterinaryinc.roo-cline","settings","mcp_settings.json"),entry:e=>({...plainEntry(e),disabled:!1,alwaysAllow:[],type:"stdio"})},{id:"zed",label:"Zed",kind:"mcp-json",container:"context_servers",scopes:["user"],docs:"https://zed.dev/docs/ai/mcp",verified:!0,path:(e,o)=>path.join(zedConfig(o),"settings.json"),entry(e){const o={path:e.command,args:e.args},n=orEnv(e);return n&&(o.env=n),{source:"custom",command:o}}},{id:"continue",label:"Continue (VS Code / JetBrains)",kind:"mcp-json",container:"mcpServers",scopes:["user"],docs:"https://docs.continue.dev/customize/deep-dives/mcp",verified:!0,path:(e,o)=>dot(o,".continue","config.json"),entry:plainEntry,yamlWins:!0},{id:"claude",label:"Claude Code (project scope)",kind:"mcp-json",container:"mcpServers",scopes:["workspace"],docs:"https://docs.claude.com/en/docs/claude-code/mcp",verified:!0,path:(e,o)=>path.join(o.cwd,".mcp.json"),entry:plainEntry},{id:"gemini",label:"Gemini CLI",kind:"mcp-json",container:"mcpServers",scopes:["user"],docs:"https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md",verified:!0,path:(e,o)=>dot(o,".gemini","settings.json"),entry:plainEntry},{id:"codex",label:"Codex CLI",kind:"mcp-toml",container:"mcp_servers",scopes:["user"],docs:"https://github.com/openai/codex/blob/main/docs/config.md",verified:!0,path:(e,o)=>dot(o,".codex","config.toml")},{id:"junie",label:"JetBrains Junie / AI Assistant",kind:"mcp-json",container:"mcpServers",scopes:["user","workspace"],docs:"https://www.jetbrains.com/help/junie/mcp.html",verified:!1,note:"JetBrains reads this file but the IDE also caches MCP config in Settings — restart the IDE and confirm the server is listed there.",path:(e,o)=>"workspace"===e?path.join(o.cwd,".junie","mcp","mcp.json"):dot(o,".junie","mcp","mcp.json"),entry:plainEntry},{id:"opencode",label:"OpenCode",kind:"mcp-json",container:"mcp",scopes:["user"],docs:"https://opencode.ai/docs/mcp-servers/",verified:!1,note:"OpenCode takes a single command array instead of command + args.",path:(e,o)=>path.join(appConfig(o),"opencode","opencode.json"),entry(e){const o=orEnv(e),n={type:"local",command:[e.command,...e.args],enabled:!0};return o&&(n.environment=o),n}}],BY_ID=new Map(TARGETS.map((e=>[e.id,e]))),ALIASES={code:"vscode","vs-code":"vscode","vscode-code":"vscode",windsurfcodeium:"windsurf","roo-code":"roo",roocode:"roo",jetbrains:"junie","claude-code":"claude",gemini_cli:"gemini","codex-cli":"codex",vsc:"vscodium"};function getTarget(e){if(!e)return null;const o=String(e).toLowerCase().trim();return BY_ID.get(o)||BY_ID.get(ALIASES[o])||null}function targetIds(){return TARGETS.map((e=>e.id))}const VSCODE_VARIANTS=["Code","Code - Insiders","VSCodium"];module.exports={TARGETS:TARGETS,ALIASES:ALIASES,VSCODE_VARIANTS:VSCODE_VARIANTS,getTarget:getTarget,targetIds:targetIds,SERVER_NAME:SERVER_NAME,appConfig:appConfig,zedConfig:zedConfig,home:home};