aegisone 1.0.22 → 1.0.23

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 (226) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +1 -1
  3. package/SOURCE-OFFER.txt +9 -0
  4. package/bin/aegis.js +1 -322
  5. package/package.json +4 -2
  6. package/scripts/bump.mjs +1 -211
  7. package/scripts/bundle.js +1 -129
  8. package/scripts/predist.mjs +1 -939
  9. package/src/child.js +1 -285
  10. package/src/dispatch.js +1 -269
  11. package/src/doctor.js +1 -639
  12. package/src/host.js +1 -111
  13. package/src/permissions.js +1 -369
  14. package/src/probes.js +1 -159
  15. package/src/release.js +1 -409
  16. package/vendor/cli/bin/aegiscode.js +2 -914
  17. package/vendor/cli/package.json +3 -2
  18. package/vendor/cli/scripts/check.mjs +1 -52
  19. package/vendor/cli/scripts/demo.mjs +1 -94
  20. package/vendor/cli/scripts/predist.mjs +1 -75
  21. package/vendor/cli/scripts/runtests.mjs +1 -56
  22. package/vendor/cli/scripts/seal-gate.mjs +1 -74
  23. package/vendor/cli/src/agents.js +1 -139
  24. package/vendor/cli/src/app.js +1 -2932
  25. package/vendor/cli/src/art.js +1 -289
  26. package/vendor/cli/src/autonomous.js +1 -515
  27. package/vendor/cli/src/caps.js +1 -879
  28. package/vendor/cli/src/chatflow.js +1 -3020
  29. package/vendor/cli/src/checkpoint.js +1 -90
  30. package/vendor/cli/src/clipboard.js +1 -424
  31. package/vendor/cli/src/cloudsync.js +1 -528
  32. package/vendor/cli/src/commands.js +1 -4003
  33. package/vendor/cli/src/config.js +1 -581
  34. package/vendor/cli/src/connect.js +1 -349
  35. package/vendor/cli/src/credentials.js +1 -33
  36. package/vendor/cli/src/deps.js +1 -232
  37. package/vendor/cli/src/devrun.js +1 -187
  38. package/vendor/cli/src/diff.js +1 -333
  39. package/vendor/cli/src/diffview.js +1 -296
  40. package/vendor/cli/src/engine.js +1 -297
  41. package/vendor/cli/src/entitlement.js +1 -355
  42. package/vendor/cli/src/events.js +1 -707
  43. package/vendor/cli/src/export.js +1 -67
  44. package/vendor/cli/src/fingerprint.js +1 -592
  45. package/vendor/cli/src/format.js +1 -259
  46. package/vendor/cli/src/fuzzy.js +1 -119
  47. package/vendor/cli/src/gate.js +1 -55
  48. package/vendor/cli/src/history.js +1 -401
  49. package/vendor/cli/src/init.js +1 -175
  50. package/vendor/cli/src/input.js +1 -139
  51. package/vendor/cli/src/keys.js +1 -183
  52. package/vendor/cli/src/limits.js +1 -190
  53. package/vendor/cli/src/markdown.js +1 -306
  54. package/vendor/cli/src/mcp.js +1 -694
  55. package/vendor/cli/src/models.js +1 -487
  56. package/vendor/cli/src/naming.js +1 -229
  57. package/vendor/cli/src/overlays.js +1 -461
  58. package/vendor/cli/src/panels.js +1 -1418
  59. package/vendor/cli/src/permissions.js +1 -290
  60. package/vendor/cli/src/ping.js +1 -226
  61. package/vendor/cli/src/presence.js +1 -238
  62. package/vendor/cli/src/provenance.js +2 -182
  63. package/vendor/cli/src/render.js +1 -515
  64. package/vendor/cli/src/screen.js +1 -518
  65. package/vendor/cli/src/screens.js +1 -896
  66. package/vendor/cli/src/secret.js +1 -59
  67. package/vendor/cli/src/securefs.js +1 -359
  68. package/vendor/cli/src/settings.js +1 -155
  69. package/vendor/cli/src/shared.js +1 -52
  70. package/vendor/cli/src/sharedpaths.js +1 -53
  71. package/vendor/cli/src/signup.js +1 -156
  72. package/vendor/cli/src/summarize.js +1 -95
  73. package/vendor/cli/src/sysdiag.js +1 -585
  74. package/vendor/cli/src/system.js +1 -40
  75. package/vendor/cli/src/theme.js +1 -570
  76. package/vendor/cli/src/title.js +1 -220
  77. package/vendor/cli/src/todos.js +1 -115
  78. package/vendor/cli/src/tokens.js +1 -263
  79. package/vendor/cli/src/topup.js +1 -210
  80. package/vendor/cli/src/update.js +1 -181
  81. package/vendor/cli/vendor/client/aegis.js +1 -2179
  82. package/vendor/cli/vendor/client/attest.js +1 -442
  83. package/vendor/cli/vendor/client/authorship-key.js +1 -410
  84. package/vendor/cli/vendor/client/auto-provision.js +1 -134
  85. package/vendor/cli/vendor/client/brain-catalog.js +1 -268
  86. package/vendor/cli/vendor/client/byok-catalog.js +1 -230
  87. package/vendor/cli/vendor/client/credentials.js +1 -494
  88. package/vendor/cli/vendor/client/device-fingerprint.js +1 -141
  89. package/vendor/cli/vendor/client/drive-connect.js +1 -110
  90. package/vendor/cli/vendor/client/drive-upload.js +1 -174
  91. package/vendor/cli/vendor/client/env-file.js +1 -1273
  92. package/vendor/cli/vendor/client/fingerprint.js +1 -1064
  93. package/vendor/cli/vendor/client/foreign-memory.js +1 -669
  94. package/vendor/cli/vendor/client/google-signin.js +1 -133
  95. package/vendor/cli/vendor/client/hooks.js +1 -430
  96. package/vendor/cli/vendor/client/model-discovery.js +1 -373
  97. package/vendor/cli/vendor/client/platform.js +1 -937
  98. package/vendor/cli/vendor/client/prefs.js +1 -351
  99. package/vendor/cli/vendor/client/presence-constants.js +1 -107
  100. package/vendor/cli/vendor/client/presence.js +1 -438
  101. package/vendor/cli/vendor/client/record-vault.js +3 -1055
  102. package/vendor/cli/vendor/client/session-store.js +1 -548
  103. package/vendor/cli/vendor/client/topup.js +1 -297
  104. package/vendor/cli/vendor/client/touch.js +1 -458
  105. package/vendor/cli/vendor/client/update.js +1 -704
  106. package/vendor/cli/vendor/client/user-models.js +1 -381
  107. package/vendor/cli/vendor/desktop/lib/local/agents.js +1 -105
  108. package/vendor/cli/vendor/desktop/lib/local/autonomous.js +1 -1045
  109. package/vendor/cli/vendor/desktop/lib/local/claude-pro.js +1 -993
  110. package/vendor/cli/vendor/desktop/lib/local/context.js +1 -95
  111. package/vendor/cli/vendor/desktop/lib/local/engine.js +1 -3301
  112. package/vendor/cli/vendor/desktop/lib/local/entitlement.js +1 -660
  113. package/vendor/cli/vendor/desktop/lib/local/git-scope.js +1 -228
  114. package/vendor/cli/vendor/desktop/lib/local/local.js +1 -2135
  115. package/vendor/cli/vendor/desktop/lib/local/prompt.js +1 -275
  116. package/vendor/cli/vendor/desktop/lib/local/queue.js +1 -560
  117. package/vendor/cli/vendor/desktop/lib/local/session-rounds.js +1 -208
  118. package/vendor/cli/vendor/desktop/lib/local/shell.js +1 -680
  119. package/vendor/cli/vendor/desktop/lib/local/tools.js +1 -1238
  120. package/vendor/cli/vendor/desktop/lib/local/turn-guard.js +1 -300
  121. package/vendor/cli/vendor/desktop/lib/local/worktree-lock.js +1 -235
  122. package/vendor/cli/vendor/desktop/lib/settings.js +1 -890
  123. package/vendor/cli/vendor/desktop/renderer/usage.js +1 -1239
  124. package/vendor/cli/vendor/hosts/install.js +1 -638
  125. package/vendor/cli/vendor/hosts/openai-shim.js +1 -515
  126. package/vendor/cli/vendor/hosts/spec.js +1 -164
  127. package/vendor/cli/vendor/hosts/targets.js +1 -346
  128. package/vendor/cli/vendor/mcp/server.js +1 -221
  129. package/vendor/cli/vendor/mcp/tools.js +1 -408
  130. package/vendor/cli/vendor/one/src/child.js +1 -285
  131. package/vendor/cli/vendor/one/src/permissions.js +1 -369
  132. package/vendor/desktop/bin/aegis.js +1 -32
  133. package/vendor/desktop/lib/account-key.js +1 -56
  134. package/vendor/desktop/lib/auto.js +1 -430
  135. package/vendor/desktop/lib/avatar/companion.js +1 -698
  136. package/vendor/desktop/lib/avatar/cosmetics.js +1 -532
  137. package/vendor/desktop/lib/avatar/events.js +1 -344
  138. package/vendor/desktop/lib/avatar/holder-turn.js +1 -350
  139. package/vendor/desktop/lib/avatar/holders.js +1 -612
  140. package/vendor/desktop/lib/avatar/identity.js +1 -641
  141. package/vendor/desktop/lib/avatar/level.js +1 -368
  142. package/vendor/desktop/lib/avatar/mirror.js +1 -524
  143. package/vendor/desktop/lib/avatar/persona.js +1 -388
  144. package/vendor/desktop/lib/avatar/profile.js +1 -977
  145. package/vendor/desktop/lib/avatar/register.js +1 -307
  146. package/vendor/desktop/lib/avatar/store.js +1 -472
  147. package/vendor/desktop/lib/avatar/tiers.js +1 -38
  148. package/vendor/desktop/lib/avatar/transfer.js +1 -415
  149. package/vendor/desktop/lib/avatar/turn.js +1 -216
  150. package/vendor/desktop/lib/avatar/voice.js +1 -328
  151. package/vendor/desktop/lib/avatar/xp.js +1 -404
  152. package/vendor/desktop/lib/deep-link.js +1 -120
  153. package/vendor/desktop/lib/fingerprint.js +2 -347
  154. package/vendor/desktop/lib/google-connect.js +1 -227
  155. package/vendor/desktop/lib/local/agents.js +1 -105
  156. package/vendor/desktop/lib/local/autonomous.js +1 -1045
  157. package/vendor/desktop/lib/local/claude-pro.js +1 -993
  158. package/vendor/desktop/lib/local/context.js +1 -95
  159. package/vendor/desktop/lib/local/engine.js +1 -3301
  160. package/vendor/desktop/lib/local/entitlement.js +1 -660
  161. package/vendor/desktop/lib/local/git-scope.js +1 -228
  162. package/vendor/desktop/lib/local/local.js +1 -2135
  163. package/vendor/desktop/lib/local/prompt.js +1 -275
  164. package/vendor/desktop/lib/local/queue.js +1 -560
  165. package/vendor/desktop/lib/local/session-rounds.js +1 -208
  166. package/vendor/desktop/lib/local/shell.js +1 -680
  167. package/vendor/desktop/lib/local/telemetry.js +1 -470
  168. package/vendor/desktop/lib/local/tools.js +1 -1238
  169. package/vendor/desktop/lib/local/turn-guard.js +1 -300
  170. package/vendor/desktop/lib/local/worktree-lock.js +1 -235
  171. package/vendor/desktop/lib/provider-key-mirror.js +1 -252
  172. package/vendor/desktop/lib/quick-launcher.js +1 -84
  173. package/vendor/desktop/lib/settings.js +1 -890
  174. package/vendor/desktop/lib/sync/memory-queue.js +1 -60
  175. package/vendor/desktop/lib/sync/persist-gate.js +1 -148
  176. package/vendor/desktop/lib/sync/sessions.js +1 -106
  177. package/vendor/desktop/lib/window-state.js +1 -66
  178. package/vendor/desktop/main.js +1 -4529
  179. package/vendor/desktop/package.json +3 -2
  180. package/vendor/desktop/preload.js +1 -636
  181. package/vendor/desktop/renderer/app.js +1 -6660
  182. package/vendor/desktop/renderer/avatar/assemble.js +1 -335
  183. package/vendor/desktop/renderer/avatar/avatar.js +1 -380
  184. package/vendor/desktop/renderer/avatar/cards.js +1 -141
  185. package/vendor/desktop/renderer/avatar/hud.js +1 -206
  186. package/vendor/desktop/renderer/avatar/machine.js +1 -213
  187. package/vendor/desktop/renderer/avatar/pane.js +1 -439
  188. package/vendor/desktop/renderer/avatar/parts.js +1 -437
  189. package/vendor/desktop/renderer/budget.js +1 -168
  190. package/vendor/desktop/renderer/companion.js +1 -223
  191. package/vendor/desktop/renderer/diff.js +1 -359
  192. package/vendor/desktop/renderer/diffview.js +1 -336
  193. package/vendor/desktop/renderer/fingerprint.js +3 -736
  194. package/vendor/desktop/renderer/markdown.js +1 -168
  195. package/vendor/desktop/renderer/provider-toolbar.js +1 -134
  196. package/vendor/desktop/renderer/providers.js +1 -259
  197. package/vendor/desktop/renderer/quick.js +1 -191
  198. package/vendor/desktop/renderer/stream-policy.js +1 -306
  199. package/vendor/desktop/renderer/transcript-view.js +1 -323
  200. package/vendor/desktop/renderer/usage.js +1 -1239
  201. package/vendor/desktop/vendor/aegis.js +1 -2179
  202. package/vendor/desktop/vendor/attest.js +1 -442
  203. package/vendor/desktop/vendor/authorship-key.js +1 -410
  204. package/vendor/desktop/vendor/auto-provision.js +1 -134
  205. package/vendor/desktop/vendor/brain-catalog.js +1 -268
  206. package/vendor/desktop/vendor/byok-catalog.js +1 -230
  207. package/vendor/desktop/vendor/credentials.js +1 -494
  208. package/vendor/desktop/vendor/device-fingerprint.js +1 -141
  209. package/vendor/desktop/vendor/drive-connect.js +1 -110
  210. package/vendor/desktop/vendor/drive-upload.js +1 -174
  211. package/vendor/desktop/vendor/env-file.js +1 -1273
  212. package/vendor/desktop/vendor/fingerprint.js +1 -1064
  213. package/vendor/desktop/vendor/foreign-memory.js +1 -669
  214. package/vendor/desktop/vendor/google-signin.js +1 -133
  215. package/vendor/desktop/vendor/hooks.js +1 -430
  216. package/vendor/desktop/vendor/model-discovery.js +1 -373
  217. package/vendor/desktop/vendor/platform.js +1 -937
  218. package/vendor/desktop/vendor/prefs.js +1 -351
  219. package/vendor/desktop/vendor/presence-constants.js +1 -107
  220. package/vendor/desktop/vendor/presence.js +1 -438
  221. package/vendor/desktop/vendor/record-vault.js +3 -1055
  222. package/vendor/desktop/vendor/session-store.js +1 -548
  223. package/vendor/desktop/vendor/topup.js +1 -297
  224. package/vendor/desktop/vendor/touch.js +1 -458
  225. package/vendor/desktop/vendor/update.js +1 -704
  226. package/vendor/desktop/vendor/user-models.js +1 -381
@@ -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};