@xmemo/client 0.4.142 → 0.4.144
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.
- package/README.md +62 -1
- package/package.json +1 -1
- package/src/cli.js +83 -55
package/README.md
CHANGED
|
@@ -41,6 +41,8 @@ xmemo setup gemini
|
|
|
41
41
|
xmemo setup gemini --dry-run
|
|
42
42
|
xmemo setup antigravity
|
|
43
43
|
xmemo setup antigravity --dry-run
|
|
44
|
+
xmemo mcp add antigravity2
|
|
45
|
+
xmemo mcp add antigravity2 --write
|
|
44
46
|
xmemo doctor
|
|
45
47
|
xmemo discovery show
|
|
46
48
|
xmemo setup
|
|
@@ -195,6 +197,25 @@ gemini ~/.gemini/GEMINI.md
|
|
|
195
197
|
antigravity ~/.gemini/antigravity/MEMORY.md
|
|
196
198
|
```
|
|
197
199
|
|
|
200
|
+
Antigravity 2.0 currently uses the lower-level MCP writer because its stable
|
|
201
|
+
user config path is separate from the original Antigravity profile. Preview the
|
|
202
|
+
generated OAuth-first config with:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
xmemo mcp add antigravity2 --url https://xmemo.dev
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Write it to the default Antigravity 2.0 config path with:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
xmemo mcp add antigravity2 --url https://xmemo.dev --write
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
The generated config uses `https://xmemo.dev/mcp`, contains no bearer token, and
|
|
215
|
+
expects Antigravity 2.0 to complete MCP OAuth in the browser on first use.
|
|
216
|
+
`XMEMO_AGENT_INSTANCE_ID` is generated and stored as a stable non-secret local
|
|
217
|
+
installation identifier when `--write` is used.
|
|
218
|
+
|
|
198
219
|
## MCP setup
|
|
199
220
|
|
|
200
221
|
List supported client generators:
|
|
@@ -211,6 +232,7 @@ cursor ~/.cursor/mcp.json
|
|
|
211
232
|
copilot ~/.copilot/mcp-config.json
|
|
212
233
|
gemini ~/.gemini/settings.json
|
|
213
234
|
antigravity ~/.gemini/antigravity/mcp_config.json
|
|
235
|
+
antigravity2 ~/.antigravity2/mcp.json
|
|
214
236
|
```
|
|
215
237
|
|
|
216
238
|
For clients without a verified user-scoped write path, generate a read-only
|
|
@@ -221,7 +243,8 @@ xmemo mcp config --client generic --base-url "https://your-private-service.examp
|
|
|
221
243
|
```
|
|
222
244
|
|
|
223
245
|
Codex, Cursor, Copilot CLI, Gemini CLI, and Antigravity have write-capable setup
|
|
224
|
-
helpers.
|
|
246
|
+
helpers. Antigravity 2.0 is write-capable through `xmemo mcp add antigravity2
|
|
247
|
+
--write`.
|
|
225
248
|
Other client writes should only be added after their official user-scoped config
|
|
226
249
|
format is verified.
|
|
227
250
|
|
|
@@ -394,6 +417,44 @@ directly, for example with `--url` or `--config` in advanced/multi-client setup.
|
|
|
394
417
|
The CLI refuses to overwrite an existing `XMemo`, `memory_os`, or `memory-os`
|
|
395
418
|
MCP server entry. Edit the config manually if you need to rotate the endpoint.
|
|
396
419
|
|
|
420
|
+
### Antigravity 2.0
|
|
421
|
+
|
|
422
|
+
Recommended Antigravity 2.0 setup:
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
xmemo mcp add antigravity2 --write
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
Use a dry preview first if you want to inspect the exact JSON before writing:
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
xmemo mcp add antigravity2
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
Antigravity 2.0 uses a separate config path from the original Antigravity
|
|
435
|
+
profile. The default write target is `~/.antigravity2/mcp.json`; on Windows the
|
|
436
|
+
server-side config contract also documents `%APPDATA%\\Antigravity 2.0\\mcp.json`
|
|
437
|
+
as the Antigravity 2.0 user config location. Pass `--config <path>` when you
|
|
438
|
+
want to write to a specific file.
|
|
439
|
+
|
|
440
|
+
The generated `XMemo` entry uses hosted HTTP MCP:
|
|
441
|
+
|
|
442
|
+
```json
|
|
443
|
+
{
|
|
444
|
+
"mcpServers": {
|
|
445
|
+
"XMemo": {
|
|
446
|
+
"type": "http",
|
|
447
|
+
"url": "https://xmemo.dev/mcp"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
No token value is written. Restart Antigravity 2.0 after setup and complete the
|
|
454
|
+
MCP OAuth browser flow on first use. If you use `--write`, the CLI also prepares
|
|
455
|
+
a stable non-secret `XMEMO_AGENT_INSTANCE_ID` for this local Antigravity 2.0
|
|
456
|
+
install so XMemo can attribute activity consistently without embedding secrets.
|
|
457
|
+
|
|
397
458
|
## Release model
|
|
398
459
|
|
|
399
460
|
This repository is the source for the `@xmemo/client` npm package. Releases
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ const PACKAGE_NAME = '@xmemo/client';
|
|
|
11
11
|
const FALLBACK_PACKAGE_NAME = '@yonro/xmemo-client';
|
|
12
12
|
const COMMAND_NAME = 'xmemo';
|
|
13
13
|
const LEGACY_COMMAND_NAME = 'memory-os';
|
|
14
|
-
const CLI_VERSION = '0.4.
|
|
14
|
+
const CLI_VERSION = '0.4.143';
|
|
15
15
|
const DEFAULT_SERVICE_URL = 'https://xmemo.dev';
|
|
16
16
|
const TOKEN_ENV_VAR = 'XMEMO_KEY';
|
|
17
17
|
const LEGACY_TOKEN_ENV_VAR = 'MEMORY_OS_MCP_TOKEN';
|
|
@@ -311,36 +311,53 @@ function defaultIo() {
|
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
function writeHelp(io) {
|
|
314
|
-
writeLine(io.stdout,
|
|
315
|
-
writeLine(io.stdout, `
|
|
314
|
+
writeLine(io.stdout, `======================================================================`);
|
|
315
|
+
writeLine(io.stdout, ` 🧠 ${PRODUCT_NAME} CLI (Version ${CLI_VERSION}) — Cloud Memory Orchestration Utility`);
|
|
316
|
+
writeLine(io.stdout, `======================================================================`);
|
|
317
|
+
writeLine(io.stdout, `Official package: ${PACKAGE_NAME} | Legacy command: ${LEGACY_COMMAND_NAME}`);
|
|
316
318
|
writeLine(io.stdout, '');
|
|
317
|
-
writeLine(io.stdout, '
|
|
318
|
-
writeLine(io.stdout, ` ${COMMAND_NAME}
|
|
319
|
-
writeLine(io.stdout, `
|
|
320
|
-
writeLine(io.stdout, `
|
|
321
|
-
writeLine(io.stdout, `
|
|
322
|
-
writeLine(io.stdout,
|
|
323
|
-
writeLine(io.stdout, ` ${COMMAND_NAME}
|
|
324
|
-
writeLine(io.stdout, `
|
|
325
|
-
writeLine(io.stdout, `
|
|
326
|
-
writeLine(io.stdout,
|
|
327
|
-
writeLine(io.stdout, ` ${COMMAND_NAME}
|
|
319
|
+
writeLine(io.stdout, '💡 CORE ONBOARDING & SETUP COMMANDS:');
|
|
320
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} setup --all [--write] [--profile]`);
|
|
321
|
+
writeLine(io.stdout, ` Auto-detects all local client installations (Cursor, VS Code, Continue, Trae, etc.).`);
|
|
322
|
+
writeLine(io.stdout, ` Merges XMemo MCP configs. Pass --profile to auto-inject workspace prompt rules.`);
|
|
323
|
+
writeLine(io.stdout, ` *Dry-run by default unless --write (or --yes/-y) is specified for safety.*`);
|
|
324
|
+
writeLine(io.stdout, '');
|
|
325
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} setup <client-id> [--url <url>] [--no-profile] [--json]`);
|
|
326
|
+
writeLine(io.stdout, ` Runs interactive setup wizard for a single client (e.g. cursor, gemini, antigravity).`);
|
|
327
|
+
writeLine(io.stdout, ` Detects active workspace to auto-inject project-scoped instruction rules.`);
|
|
328
|
+
writeLine(io.stdout, '');
|
|
329
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} login [--from-stdin] [--base-url <url>]`);
|
|
330
|
+
writeLine(io.stdout, ` Starts secure OAuth2 browser-based device login flow to register the CLI.`);
|
|
331
|
+
writeLine(io.stdout, '');
|
|
332
|
+
writeLine(io.stdout, '🛡️ DIAGNOSTICS & SYSTEM AUDIT:');
|
|
333
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} doctor [--base-url <url>] [--json]`);
|
|
334
|
+
writeLine(io.stdout, ` Performs structural diagnostics (Node version, Cloud connectivity, API compatibility, security).`);
|
|
335
|
+
writeLine(io.stdout, '');
|
|
336
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} status [--url <url>] [--json]`);
|
|
337
|
+
writeLine(io.stdout, ` Probes and audits XMemo core service endpoints, readiness states, and network health.`);
|
|
338
|
+
writeLine(io.stdout, '');
|
|
339
|
+
writeLine(io.stdout, '📋 MCP & CREDENTIAL MANAGEMENT:');
|
|
328
340
|
writeLine(io.stdout, ` ${COMMAND_NAME} mcp list`);
|
|
329
|
-
writeLine(io.stdout, `
|
|
330
|
-
writeLine(io.stdout,
|
|
331
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} mcp
|
|
332
|
-
writeLine(io.stdout, `
|
|
333
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} profile uninstall <codex|cursor|gemini|antigravity> [--target <path>] [--json]`);
|
|
334
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} mcp add <${supportedMcpClientIds().join('|')}> [--url <https://api.example.com>] [--write] [--config <path>]`);
|
|
335
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} smoke --client codex [--config <path>] [--json]`);
|
|
336
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} env example [--shell bash|powershell|cmd] [--json]`);
|
|
337
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} privacy`);
|
|
341
|
+
writeLine(io.stdout, ` Lists all natively supported client integrations and configurations.`);
|
|
342
|
+
writeLine(io.stdout, '');
|
|
343
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} mcp config --client <client-id> [--base-url <url>] [--json]`);
|
|
344
|
+
writeLine(io.stdout, ` Generates and outputs raw MCP config snippet templates without writing to files.`);
|
|
338
345
|
writeLine(io.stdout, '');
|
|
339
|
-
writeLine(io.stdout, `
|
|
340
|
-
writeLine(io.stdout,
|
|
346
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} mcp add <client-id> [--write] [--config <path>]`);
|
|
347
|
+
writeLine(io.stdout, ` Directly adds XMemo MCP server config snippet to the specified client settings file.`);
|
|
341
348
|
writeLine(io.stdout, '');
|
|
342
|
-
writeLine(io.stdout,
|
|
343
|
-
writeLine(io.stdout,
|
|
349
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} profile install <client-id> [--target <path>] [--dry-run]`);
|
|
350
|
+
writeLine(io.stdout, ` Injects/updates instruction rules prompt in target workspace rules files (Cursor/Gemini).`);
|
|
351
|
+
writeLine(io.stdout, '');
|
|
352
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} token status [--verify] | ${COMMAND_NAME} token add --from-stdin`);
|
|
353
|
+
writeLine(io.stdout, ` Checks local static credential states or manually saves XMEMO_KEY for key-auth fallbacks.`);
|
|
354
|
+
writeLine(io.stdout, '');
|
|
355
|
+
writeLine(io.stdout, '🔐 SECURITY & PRIVACY BY DESIGN:');
|
|
356
|
+
writeLine(io.stdout, ' - ZERO Telemetry: We never collect private workspace data or usage metrics.');
|
|
357
|
+
writeLine(io.stdout, ' - Git Protection: API tokens are kept securely in system environment variables (XMEMO_KEY)');
|
|
358
|
+
writeLine(io.stdout, ' or in user-scoped credentials.json file. They are never written to project configs.');
|
|
359
|
+
writeLine(io.stdout, ' - AST Merge Safety: Config writes only touch and append the XMemo keys, preserving all other servers.');
|
|
360
|
+
writeLine(io.stdout, '======================================================================');
|
|
344
361
|
}
|
|
345
362
|
|
|
346
363
|
async function updateCommand(args, io) {
|
|
@@ -2587,23 +2604,27 @@ async function mergeAntigravityMcpConfig(configPath, mcpUrl, identity) {
|
|
|
2587
2604
|
await bestEffortChmod(configPath, 0o600);
|
|
2588
2605
|
}
|
|
2589
2606
|
|
|
2590
|
-
function antigravityIdeJsonServerConfig(mcpUrl) {
|
|
2607
|
+
function antigravityIdeJsonServerConfig(mcpUrl, identity = envReferenceIdentity('antigravity')) {
|
|
2591
2608
|
return {
|
|
2592
2609
|
type: 'http',
|
|
2593
|
-
url: mcpUrl
|
|
2610
|
+
url: mcpUrl,
|
|
2611
|
+
headers: {
|
|
2612
|
+
[AGENT_ID_HEADER]: identity.agentId,
|
|
2613
|
+
[AGENT_INSTANCE_HEADER]: identity.agentInstanceId
|
|
2614
|
+
}
|
|
2594
2615
|
};
|
|
2595
2616
|
}
|
|
2596
2617
|
|
|
2597
|
-
function antigravityIdeJsonConfig(mcpUrl) {
|
|
2618
|
+
function antigravityIdeJsonConfig(mcpUrl, identity = envReferenceIdentity('antigravity')) {
|
|
2598
2619
|
return {
|
|
2599
2620
|
mcpServers: {
|
|
2600
|
-
[MCP_SERVER_NAME]: antigravityIdeJsonServerConfig(mcpUrl)
|
|
2621
|
+
[MCP_SERVER_NAME]: antigravityIdeJsonServerConfig(mcpUrl, identity)
|
|
2601
2622
|
}
|
|
2602
2623
|
};
|
|
2603
2624
|
}
|
|
2604
2625
|
|
|
2605
|
-
function antigravityIdeJsonSnippet(mcpUrl, identity = envReferenceIdentity('antigravity
|
|
2606
|
-
return `${JSON.stringify(antigravityIdeJsonConfig(mcpUrl), null, 2)}\n`;
|
|
2626
|
+
function antigravityIdeJsonSnippet(mcpUrl, identity = envReferenceIdentity('antigravity')) {
|
|
2627
|
+
return `${JSON.stringify(antigravityIdeJsonConfig(mcpUrl, identity), null, 2)}\n`;
|
|
2607
2628
|
}
|
|
2608
2629
|
|
|
2609
2630
|
async function mergeAntigravityIdeMcpConfig(configPath, mcpUrl, identity) {
|
|
@@ -2623,29 +2644,33 @@ async function mergeAntigravityIdeMcpConfig(configPath, mcpUrl, identity) {
|
|
|
2623
2644
|
throw new UsageError(`MCP config already contains mcpServers.${existingName}. Edit ${configPath} manually to avoid duplicate server definitions.`);
|
|
2624
2645
|
}
|
|
2625
2646
|
|
|
2626
|
-
parsed.mcpServers[MCP_SERVER_NAME] = antigravityIdeJsonServerConfig(mcpUrl);
|
|
2647
|
+
parsed.mcpServers[MCP_SERVER_NAME] = antigravityIdeJsonServerConfig(mcpUrl, identity);
|
|
2627
2648
|
await fs.mkdir(path.dirname(configPath), { recursive: true, mode: 0o700 });
|
|
2628
2649
|
await fs.writeFile(configPath, `${JSON.stringify(parsed, null, 2)}\n`, { mode: 0o600 });
|
|
2629
2650
|
await bestEffortChmod(configPath, 0o600);
|
|
2630
2651
|
}
|
|
2631
2652
|
|
|
2632
|
-
function antigravity2JsonServerConfig(mcpUrl) {
|
|
2653
|
+
function antigravity2JsonServerConfig(mcpUrl, identity = envReferenceIdentity('antigravity')) {
|
|
2633
2654
|
return {
|
|
2634
2655
|
type: 'http',
|
|
2635
|
-
url: mcpUrl
|
|
2656
|
+
url: mcpUrl,
|
|
2657
|
+
headers: {
|
|
2658
|
+
[AGENT_ID_HEADER]: identity.agentId,
|
|
2659
|
+
[AGENT_INSTANCE_HEADER]: identity.agentInstanceId
|
|
2660
|
+
}
|
|
2636
2661
|
};
|
|
2637
2662
|
}
|
|
2638
2663
|
|
|
2639
|
-
function antigravity2JsonConfig(mcpUrl) {
|
|
2664
|
+
function antigravity2JsonConfig(mcpUrl, identity = envReferenceIdentity('antigravity')) {
|
|
2640
2665
|
return {
|
|
2641
2666
|
mcpServers: {
|
|
2642
|
-
[MCP_SERVER_NAME]: antigravity2JsonServerConfig(mcpUrl)
|
|
2667
|
+
[MCP_SERVER_NAME]: antigravity2JsonServerConfig(mcpUrl, identity)
|
|
2643
2668
|
}
|
|
2644
2669
|
};
|
|
2645
2670
|
}
|
|
2646
2671
|
|
|
2647
|
-
function antigravity2JsonSnippet(mcpUrl, identity = envReferenceIdentity('
|
|
2648
|
-
return `${JSON.stringify(antigravity2JsonConfig(mcpUrl), null, 2)}\n`;
|
|
2672
|
+
function antigravity2JsonSnippet(mcpUrl, identity = envReferenceIdentity('antigravity')) {
|
|
2673
|
+
return `${JSON.stringify(antigravity2JsonConfig(mcpUrl, identity), null, 2)}\n`;
|
|
2649
2674
|
}
|
|
2650
2675
|
|
|
2651
2676
|
async function mergeAntigravity2McpConfig(configPath, mcpUrl, identity) {
|
|
@@ -2665,13 +2690,13 @@ async function mergeAntigravity2McpConfig(configPath, mcpUrl, identity) {
|
|
|
2665
2690
|
throw new UsageError(`MCP config already contains mcpServers.${existingName}. Edit ${configPath} manually to avoid duplicate server definitions.`);
|
|
2666
2691
|
}
|
|
2667
2692
|
|
|
2668
|
-
parsed.mcpServers[MCP_SERVER_NAME] = antigravity2JsonServerConfig(mcpUrl);
|
|
2693
|
+
parsed.mcpServers[MCP_SERVER_NAME] = antigravity2JsonServerConfig(mcpUrl, identity);
|
|
2669
2694
|
await fs.mkdir(path.dirname(configPath), { recursive: true, mode: 0o700 });
|
|
2670
2695
|
await fs.writeFile(configPath, `${JSON.stringify(parsed, null, 2)}\n`, { mode: 0o600 });
|
|
2671
2696
|
await bestEffortChmod(configPath, 0o600);
|
|
2672
2697
|
}
|
|
2673
2698
|
|
|
2674
|
-
function antigravityCliJsonServerConfig(mcpUrl, identity = envReferenceIdentity('antigravity
|
|
2699
|
+
function antigravityCliJsonServerConfig(mcpUrl, identity = envReferenceIdentity('antigravity')) {
|
|
2675
2700
|
return {
|
|
2676
2701
|
httpUrl: mcpUrl,
|
|
2677
2702
|
headers: {
|
|
@@ -2681,7 +2706,7 @@ function antigravityCliJsonServerConfig(mcpUrl, identity = envReferenceIdentity(
|
|
|
2681
2706
|
};
|
|
2682
2707
|
}
|
|
2683
2708
|
|
|
2684
|
-
function antigravityCliJsonConfig(mcpUrl, identity = envReferenceIdentity('antigravity
|
|
2709
|
+
function antigravityCliJsonConfig(mcpUrl, identity = envReferenceIdentity('antigravity')) {
|
|
2685
2710
|
return {
|
|
2686
2711
|
mcpServers: {
|
|
2687
2712
|
[MCP_SERVER_NAME]: antigravityCliJsonServerConfig(mcpUrl, identity)
|
|
@@ -2689,7 +2714,7 @@ function antigravityCliJsonConfig(mcpUrl, identity = envReferenceIdentity('antig
|
|
|
2689
2714
|
};
|
|
2690
2715
|
}
|
|
2691
2716
|
|
|
2692
|
-
function antigravityCliJsonSnippet(mcpUrl, identity = envReferenceIdentity('antigravity
|
|
2717
|
+
function antigravityCliJsonSnippet(mcpUrl, identity = envReferenceIdentity('antigravity')) {
|
|
2693
2718
|
return `${JSON.stringify(antigravityCliJsonConfig(mcpUrl, identity), null, 2)}\n`;
|
|
2694
2719
|
}
|
|
2695
2720
|
|
|
@@ -2812,27 +2837,28 @@ function geminiJsonSnippet(mcpUrl, identity = envReferenceIdentity('gemini-cli')
|
|
|
2812
2837
|
}
|
|
2813
2838
|
|
|
2814
2839
|
async function agentIdentity(clientId, env) {
|
|
2840
|
+
const targetClientId = (clientId === 'antigravity-ide' || clientId === 'antigravity2' || clientId === 'antigravity-cli') ? 'antigravity' : clientId;
|
|
2815
2841
|
const configuredInstanceId = env[AGENT_INSTANCE_ENV_VAR];
|
|
2816
2842
|
if (configuredInstanceId) {
|
|
2817
2843
|
return {
|
|
2818
|
-
agentId:
|
|
2844
|
+
agentId: targetClientId,
|
|
2819
2845
|
agentInstanceId: configuredInstanceId,
|
|
2820
2846
|
path: `${AGENT_INSTANCE_ENV_VAR} environment variable`
|
|
2821
2847
|
};
|
|
2822
2848
|
}
|
|
2823
2849
|
|
|
2824
|
-
const identityPath = agentInstanceIdentityPath(env,
|
|
2850
|
+
const identityPath = agentInstanceIdentityPath(env, targetClientId);
|
|
2825
2851
|
const existing = await readAgentInstanceIdentity(identityPath);
|
|
2826
2852
|
if (existing) {
|
|
2827
|
-
return { agentId:
|
|
2853
|
+
return { agentId: targetClientId, agentInstanceId: existing, path: identityPath };
|
|
2828
2854
|
}
|
|
2829
2855
|
|
|
2830
|
-
const generated = `xmemo-${
|
|
2856
|
+
const generated = `xmemo-${targetClientId}-${randomUUID()}`;
|
|
2831
2857
|
await fs.mkdir(path.dirname(identityPath), { recursive: true, mode: 0o700 });
|
|
2832
2858
|
await bestEffortChmod(path.dirname(identityPath), 0o700);
|
|
2833
|
-
await fs.writeFile(identityPath, `${JSON.stringify({ version: 1, agentId:
|
|
2859
|
+
await fs.writeFile(identityPath, `${JSON.stringify({ version: 1, agentId: targetClientId, agentInstanceId: generated }, null, 2)}\n`, { mode: 0o600 });
|
|
2834
2860
|
await bestEffortChmod(identityPath, 0o600);
|
|
2835
|
-
return { agentId:
|
|
2861
|
+
return { agentId: targetClientId, agentInstanceId: generated, path: identityPath };
|
|
2836
2862
|
}
|
|
2837
2863
|
|
|
2838
2864
|
async function readAgentInstanceIdentity(identityPath) {
|
|
@@ -2850,8 +2876,9 @@ function agentInstanceIdentityPath(env, clientId) {
|
|
|
2850
2876
|
}
|
|
2851
2877
|
|
|
2852
2878
|
function envReferenceIdentity(clientId) {
|
|
2879
|
+
const targetClientId = (clientId === 'antigravity-ide' || clientId === 'antigravity2' || clientId === 'antigravity-cli') ? 'antigravity' : clientId;
|
|
2853
2880
|
return {
|
|
2854
|
-
agentId:
|
|
2881
|
+
agentId: targetClientId,
|
|
2855
2882
|
agentInstanceId: `\${${AGENT_INSTANCE_ENV_VAR}}`,
|
|
2856
2883
|
path: `${AGENT_INSTANCE_ENV_VAR} environment variable`
|
|
2857
2884
|
};
|
|
@@ -2921,7 +2948,7 @@ function defaultGeminiConfigPath(env) {
|
|
|
2921
2948
|
|
|
2922
2949
|
function defaultAntigravityConfigPath(env) {
|
|
2923
2950
|
const home = env.USERPROFILE || env.HOME || os.homedir();
|
|
2924
|
-
return path.join(home, '.gemini', '
|
|
2951
|
+
return path.join(home, '.gemini', 'config', 'mcp_config.json');
|
|
2925
2952
|
}
|
|
2926
2953
|
|
|
2927
2954
|
function defaultAntigravityIdeConfigPath(env) {
|
|
@@ -2931,12 +2958,12 @@ function defaultAntigravityIdeConfigPath(env) {
|
|
|
2931
2958
|
|
|
2932
2959
|
function defaultAntigravity2ConfigPath(env) {
|
|
2933
2960
|
const home = env.USERPROFILE || env.HOME || os.homedir();
|
|
2934
|
-
return path.join(home, '.
|
|
2961
|
+
return path.join(home, '.gemini', 'config', 'mcp_config.json');
|
|
2935
2962
|
}
|
|
2936
2963
|
|
|
2937
2964
|
function defaultAntigravityCliConfigPath(env) {
|
|
2938
2965
|
const home = env.USERPROFILE || env.HOME || os.homedir();
|
|
2939
|
-
return path.join(home, '.
|
|
2966
|
+
return path.join(home, '.gemini', 'config', 'mcp_config.json');
|
|
2940
2967
|
}
|
|
2941
2968
|
|
|
2942
2969
|
function defaultCopilotConfigPath(env) {
|
|
@@ -3122,7 +3149,8 @@ async function runProcess(command, args, io, { stream = true } = {}) {
|
|
|
3122
3149
|
const spawnFn = io.spawn ?? spawn;
|
|
3123
3150
|
return await new Promise((resolve, reject) => {
|
|
3124
3151
|
const child = spawnFn(command, args, {
|
|
3125
|
-
stdio: ['ignore', 'pipe', 'pipe']
|
|
3152
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
3153
|
+
shell: os.platform() === 'win32'
|
|
3126
3154
|
});
|
|
3127
3155
|
let stdout = '';
|
|
3128
3156
|
let stderr = '';
|