@crustdev/armordesk 1.0.5 → 1.0.6
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/dist/agents.d.ts +5 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/{chunk-N7CZHRKB.mjs → chunk-HWPT3W34.mjs} +257 -99
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +261 -103
- package/dist/cli.mjs +6 -5
- package/dist/index.js +258 -99
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
package/dist/agents.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
export type AgentId = "antigravity" | "opencode" | "codex" | "hermes" | "openclaw" | "claude" | "cursor" | "windsurf" | "cline" | "roocode" | "continue" | "zed";
|
|
1
2
|
export interface DetectedAgent {
|
|
2
|
-
id:
|
|
3
|
+
id: AgentId;
|
|
3
4
|
name: string;
|
|
4
5
|
configPath: string;
|
|
5
6
|
isInstalled: boolean;
|
|
6
7
|
isConfigured: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function
|
|
9
|
+
export declare function resolveAgentAlias(input: string): AgentId | null;
|
|
10
|
+
export declare function getAgentPaths(): Record<AgentId, string>;
|
|
9
11
|
export declare function detectInstalledAgents(): DetectedAgent[];
|
|
10
|
-
export declare function injectAgentMCP(
|
|
12
|
+
export declare function injectAgentMCP(agentNameOrAlias: string, options: {
|
|
11
13
|
tenantId: string;
|
|
12
14
|
token?: string;
|
|
13
15
|
baseUrl?: string;
|
package/dist/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAKA,MAAM,
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,OAAO,GACf,aAAa,GACb,UAAU,GACV,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,OAAO,GACP,SAAS,GACT,UAAU,GACV,KAAK,CAAC;AAEV,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAe/D;AAED,wBAAgB,aAAa,IAAI,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAwCvD;AAED,wBAAgB,qBAAqB,IAAI,aAAa,EAAE,CAmKvD;AAED,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CA2O3D;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CA8BT"}
|
|
@@ -415,156 +415,186 @@ import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync
|
|
|
415
415
|
import { homedir as homedir2, platform } from "os";
|
|
416
416
|
import { join as join2 } from "path";
|
|
417
417
|
import { execSync } from "child_process";
|
|
418
|
+
function resolveAgentAlias(input) {
|
|
419
|
+
const norm = input.toLowerCase().trim();
|
|
420
|
+
if (norm === "antigravity" || norm === "agy") return "antigravity";
|
|
421
|
+
if (norm === "opencode" || norm === "openvode") return "opencode";
|
|
422
|
+
if (norm === "codex" || norm === "vodek" || norm === "openai-codex") return "codex";
|
|
423
|
+
if (norm === "hermes" || norm === "hermes-agent") return "hermes";
|
|
424
|
+
if (norm === "openclaw" || norm === "claw") return "openclaw";
|
|
425
|
+
if (norm === "claude" || norm === "claude-desktop") return "claude";
|
|
426
|
+
if (norm === "cursor") return "cursor";
|
|
427
|
+
if (norm === "windsurf" || norm === "codeium") return "windsurf";
|
|
428
|
+
if (norm === "cline") return "cline";
|
|
429
|
+
if (norm === "roocode" || norm === "roo-code" || norm === "roo") return "roocode";
|
|
430
|
+
if (norm === "continue" || norm === "continue.dev") return "continue";
|
|
431
|
+
if (norm === "zed") return "zed";
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
418
434
|
function getAgentPaths() {
|
|
419
435
|
const home = homedir2();
|
|
420
436
|
const os = platform();
|
|
437
|
+
let vscodeGlobal = join2(home, ".config", "Code", "User", "globalStorage");
|
|
438
|
+
let zedPath = join2(home, ".config", "zed", "settings.json");
|
|
421
439
|
let claudePath = join2(home, ".config", "Claude", "claude_desktop_config.json");
|
|
422
440
|
if (os === "darwin") {
|
|
423
441
|
claudePath = join2(home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
442
|
+
vscodeGlobal = join2(home, "Library", "Application Support", "Code", "User", "globalStorage");
|
|
443
|
+
zedPath = join2(home, "Library", "Application Support", "Zed", "settings.json");
|
|
424
444
|
} else if (os === "win32") {
|
|
425
|
-
|
|
445
|
+
const appData = process.env.APPDATA || join2(home, "AppData", "Roaming");
|
|
446
|
+
claudePath = join2(appData, "Claude", "claude_desktop_config.json");
|
|
447
|
+
vscodeGlobal = join2(appData, "Code", "User", "globalStorage");
|
|
448
|
+
zedPath = join2(appData, "Zed", "settings.json");
|
|
449
|
+
}
|
|
450
|
+
let antigravityPath = join2(home, ".gemini", "config", "mcp_config.json");
|
|
451
|
+
if (!existsSync2(join2(home, ".gemini", "config")) && existsSync2(join2(home, ".antigravity"))) {
|
|
452
|
+
antigravityPath = join2(home, ".antigravity", "mcp_config.json");
|
|
426
453
|
}
|
|
427
454
|
return {
|
|
455
|
+
antigravity: antigravityPath,
|
|
428
456
|
opencode: join2(home, ".config", "opencode", "opencode.json"),
|
|
457
|
+
codex: join2(home, ".codex", "config.toml"),
|
|
429
458
|
hermes: join2(home, ".hermes", "config.yaml"),
|
|
430
459
|
openclaw: join2(home, ".openclaw", "config.yaml"),
|
|
431
460
|
claude: claudePath,
|
|
432
461
|
cursor: join2(home, ".cursor", "mcp.json"),
|
|
433
|
-
windsurf: join2(home, ".codeium", "windsurf", "mcp_config.json")
|
|
462
|
+
windsurf: join2(home, ".codeium", "windsurf", "mcp_config.json"),
|
|
463
|
+
cline: join2(vscodeGlobal, "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json"),
|
|
464
|
+
roocode: join2(vscodeGlobal, "rooveterinaryinc.roo-cline", "settings", "cline_mcp_settings.json"),
|
|
465
|
+
continue: join2(home, ".continue", "config.json"),
|
|
466
|
+
zed: zedPath
|
|
434
467
|
};
|
|
435
468
|
}
|
|
436
469
|
function detectInstalledAgents() {
|
|
437
470
|
const paths = getAgentPaths();
|
|
438
471
|
const results = [];
|
|
439
|
-
|
|
440
|
-
if (!opencodeInstalled) {
|
|
472
|
+
const hasBinary = (cmd) => {
|
|
441
473
|
try {
|
|
442
|
-
execSync(
|
|
443
|
-
|
|
474
|
+
execSync(`which ${cmd} || where ${cmd}`, { stdio: "ignore" });
|
|
475
|
+
return true;
|
|
444
476
|
} catch {
|
|
477
|
+
return false;
|
|
445
478
|
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
479
|
+
};
|
|
480
|
+
const fileHasArmor = (p) => {
|
|
481
|
+
if (!existsSync2(p)) return false;
|
|
449
482
|
try {
|
|
450
|
-
const content = readFileSync2(
|
|
451
|
-
|
|
483
|
+
const content = readFileSync2(p, "utf8");
|
|
484
|
+
return content.includes("armordesk");
|
|
452
485
|
} catch {
|
|
486
|
+
return false;
|
|
453
487
|
}
|
|
454
|
-
}
|
|
488
|
+
};
|
|
489
|
+
const antigravityInstalled = existsSync2(paths.antigravity) || existsSync2(join2(homedir2(), ".gemini", "antigravity-cli")) || existsSync2(join2(homedir2(), ".local", "bin", "agy")) || hasBinary("agy") || hasBinary("antigravity");
|
|
490
|
+
results.push({
|
|
491
|
+
id: "antigravity",
|
|
492
|
+
name: "Antigravity CLI (agy)",
|
|
493
|
+
configPath: paths.antigravity,
|
|
494
|
+
isInstalled: antigravityInstalled,
|
|
495
|
+
isConfigured: fileHasArmor(paths.antigravity)
|
|
496
|
+
});
|
|
497
|
+
const opencodeInstalled = existsSync2(paths.opencode) || existsSync2(join2(homedir2(), ".opencode")) || hasBinary("opencode");
|
|
455
498
|
results.push({
|
|
456
499
|
id: "opencode",
|
|
457
500
|
name: "OpenCode CLI",
|
|
458
501
|
configPath: paths.opencode,
|
|
459
502
|
isInstalled: opencodeInstalled,
|
|
460
|
-
isConfigured:
|
|
503
|
+
isConfigured: fileHasArmor(paths.opencode)
|
|
461
504
|
});
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
if (existsSync2(paths.hermes)) {
|
|
472
|
-
try {
|
|
473
|
-
const content = readFileSync2(paths.hermes, "utf8");
|
|
474
|
-
hermesConfigured = content.includes("armordesk");
|
|
475
|
-
} catch {
|
|
476
|
-
}
|
|
477
|
-
}
|
|
505
|
+
const codexInstalled = existsSync2(paths.codex) || existsSync2(join2(homedir2(), ".codex")) || hasBinary("codex");
|
|
506
|
+
results.push({
|
|
507
|
+
id: "codex",
|
|
508
|
+
name: "OpenAI Codex CLI",
|
|
509
|
+
configPath: paths.codex,
|
|
510
|
+
isInstalled: codexInstalled,
|
|
511
|
+
isConfigured: fileHasArmor(paths.codex)
|
|
512
|
+
});
|
|
513
|
+
const hermesInstalled = existsSync2(paths.hermes) || existsSync2(join2(homedir2(), ".hermes")) || hasBinary("hermes");
|
|
478
514
|
results.push({
|
|
479
515
|
id: "hermes",
|
|
480
516
|
name: "Hermes Agent",
|
|
481
517
|
configPath: paths.hermes,
|
|
482
518
|
isInstalled: hermesInstalled,
|
|
483
|
-
isConfigured:
|
|
519
|
+
isConfigured: fileHasArmor(paths.hermes)
|
|
484
520
|
});
|
|
485
|
-
|
|
486
|
-
if (!openclawInstalled) {
|
|
487
|
-
try {
|
|
488
|
-
execSync("which openclaw || where openclaw", { stdio: "ignore" });
|
|
489
|
-
openclawInstalled = true;
|
|
490
|
-
} catch {
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
let openclawConfigured = false;
|
|
494
|
-
if (existsSync2(paths.openclaw)) {
|
|
495
|
-
try {
|
|
496
|
-
const content = readFileSync2(paths.openclaw, "utf8");
|
|
497
|
-
openclawConfigured = content.includes("armordesk");
|
|
498
|
-
} catch {
|
|
499
|
-
}
|
|
500
|
-
}
|
|
521
|
+
const openclawInstalled = existsSync2(paths.openclaw) || existsSync2(join2(homedir2(), ".openclaw")) || hasBinary("openclaw");
|
|
501
522
|
results.push({
|
|
502
523
|
id: "openclaw",
|
|
503
524
|
name: "OpenClaw Agent",
|
|
504
525
|
configPath: paths.openclaw,
|
|
505
526
|
isInstalled: openclawInstalled,
|
|
506
|
-
isConfigured:
|
|
527
|
+
isConfigured: fileHasArmor(paths.openclaw)
|
|
507
528
|
});
|
|
508
529
|
const claudeInstalled = existsSync2(paths.claude) || existsSync2(join2(paths.claude, ".."));
|
|
509
|
-
let claudeConfigured = false;
|
|
510
|
-
if (existsSync2(paths.claude)) {
|
|
511
|
-
try {
|
|
512
|
-
const content = readFileSync2(paths.claude, "utf8");
|
|
513
|
-
claudeConfigured = content.includes("armordesk");
|
|
514
|
-
} catch {
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
530
|
results.push({
|
|
518
531
|
id: "claude",
|
|
519
532
|
name: "Claude Desktop",
|
|
520
533
|
configPath: paths.claude,
|
|
521
534
|
isInstalled: claudeInstalled,
|
|
522
|
-
isConfigured:
|
|
535
|
+
isConfigured: fileHasArmor(paths.claude)
|
|
523
536
|
});
|
|
524
537
|
const cursorInstalled = existsSync2(paths.cursor) || existsSync2(join2(paths.cursor, ".."));
|
|
525
|
-
let cursorConfigured = false;
|
|
526
|
-
if (existsSync2(paths.cursor)) {
|
|
527
|
-
try {
|
|
528
|
-
const content = readFileSync2(paths.cursor, "utf8");
|
|
529
|
-
cursorConfigured = content.includes("armordesk");
|
|
530
|
-
} catch {
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
538
|
results.push({
|
|
534
539
|
id: "cursor",
|
|
535
540
|
name: "Cursor IDE",
|
|
536
541
|
configPath: paths.cursor,
|
|
537
542
|
isInstalled: cursorInstalled,
|
|
538
|
-
isConfigured:
|
|
543
|
+
isConfigured: fileHasArmor(paths.cursor)
|
|
539
544
|
});
|
|
540
545
|
const windsurfInstalled = existsSync2(paths.windsurf) || existsSync2(join2(paths.windsurf, ".."));
|
|
541
|
-
let windsurfConfigured = false;
|
|
542
|
-
if (existsSync2(paths.windsurf)) {
|
|
543
|
-
try {
|
|
544
|
-
const content = readFileSync2(paths.windsurf, "utf8");
|
|
545
|
-
windsurfConfigured = content.includes("armordesk");
|
|
546
|
-
} catch {
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
546
|
results.push({
|
|
550
547
|
id: "windsurf",
|
|
551
548
|
name: "Windsurf IDE",
|
|
552
549
|
configPath: paths.windsurf,
|
|
553
550
|
isInstalled: windsurfInstalled,
|
|
554
|
-
isConfigured:
|
|
551
|
+
isConfigured: fileHasArmor(paths.windsurf)
|
|
552
|
+
});
|
|
553
|
+
const clineInstalled = existsSync2(join2(paths.cline, ".."));
|
|
554
|
+
results.push({
|
|
555
|
+
id: "cline",
|
|
556
|
+
name: "Cline (VS Code)",
|
|
557
|
+
configPath: paths.cline,
|
|
558
|
+
isInstalled: clineInstalled,
|
|
559
|
+
isConfigured: fileHasArmor(paths.cline)
|
|
560
|
+
});
|
|
561
|
+
const rooInstalled = existsSync2(join2(paths.roocode, ".."));
|
|
562
|
+
results.push({
|
|
563
|
+
id: "roocode",
|
|
564
|
+
name: "Roo Code (VS Code)",
|
|
565
|
+
configPath: paths.roocode,
|
|
566
|
+
isInstalled: rooInstalled,
|
|
567
|
+
isConfigured: fileHasArmor(paths.roocode)
|
|
568
|
+
});
|
|
569
|
+
const continueInstalled = existsSync2(paths.continue) || existsSync2(join2(paths.continue, ".."));
|
|
570
|
+
results.push({
|
|
571
|
+
id: "continue",
|
|
572
|
+
name: "Continue.dev",
|
|
573
|
+
configPath: paths.continue,
|
|
574
|
+
isInstalled: continueInstalled,
|
|
575
|
+
isConfigured: fileHasArmor(paths.continue)
|
|
576
|
+
});
|
|
577
|
+
const zedInstalled = existsSync2(paths.zed) || existsSync2(join2(paths.zed, "..")) || hasBinary("zed");
|
|
578
|
+
results.push({
|
|
579
|
+
id: "zed",
|
|
580
|
+
name: "Zed IDE",
|
|
581
|
+
configPath: paths.zed,
|
|
582
|
+
isInstalled: zedInstalled,
|
|
583
|
+
isConfigured: fileHasArmor(paths.zed)
|
|
555
584
|
});
|
|
556
585
|
return results;
|
|
557
586
|
}
|
|
558
|
-
function injectAgentMCP(
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
if (!targetPath) {
|
|
587
|
+
function injectAgentMCP(agentNameOrAlias, options) {
|
|
588
|
+
const agentId = resolveAgentAlias(agentNameOrAlias);
|
|
589
|
+
if (!agentId) {
|
|
562
590
|
return {
|
|
563
591
|
success: false,
|
|
564
592
|
configPath: "",
|
|
565
|
-
message: `Unknown agent
|
|
593
|
+
message: `Unknown agent identifier '${agentNameOrAlias}'. Supported: antigravity (agy), opencode (openvode), codex (vodek), hermes, openclaw, claude, cursor, windsurf, cline, roocode, continue, zed`
|
|
566
594
|
};
|
|
567
595
|
}
|
|
596
|
+
const paths = getAgentPaths();
|
|
597
|
+
const targetPath = paths[agentId];
|
|
568
598
|
const url = `${(options.baseUrl || "https://armordesk.crusts.dev").replace(/\/$/, "")}/api/mcp/gateway`;
|
|
569
599
|
const tenant = options.tenantId || "acme-corp";
|
|
570
600
|
const token = options.token || `ak_live_${tenant}_key`;
|
|
@@ -573,6 +603,26 @@ function injectAgentMCP(agentId, options) {
|
|
|
573
603
|
mkdirSync2(dir, { recursive: true });
|
|
574
604
|
}
|
|
575
605
|
try {
|
|
606
|
+
if (agentId === "antigravity") {
|
|
607
|
+
let cfg = {};
|
|
608
|
+
if (existsSync2(targetPath)) {
|
|
609
|
+
try {
|
|
610
|
+
cfg = JSON.parse(readFileSync2(targetPath, "utf8"));
|
|
611
|
+
} catch {
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
615
|
+
cfg.mcpServers.armordesk = {
|
|
616
|
+
serverUrl: url,
|
|
617
|
+
disabled: false,
|
|
618
|
+
headers: {
|
|
619
|
+
"X-ArmorIQ-Tenant": tenant,
|
|
620
|
+
Authorization: `Bearer ${token}`
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
writeFileSync2(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
624
|
+
return { success: true, configPath: targetPath, message: "Antigravity CLI MCP configuration updated." };
|
|
625
|
+
}
|
|
576
626
|
if (agentId === "opencode") {
|
|
577
627
|
let cfg = {};
|
|
578
628
|
if (existsSync2(targetPath)) {
|
|
@@ -594,13 +644,38 @@ function injectAgentMCP(agentId, options) {
|
|
|
594
644
|
writeFileSync2(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
595
645
|
return { success: true, configPath: targetPath, message: "OpenCode config updated successfully." };
|
|
596
646
|
}
|
|
647
|
+
if (agentId === "codex") {
|
|
648
|
+
let content = "";
|
|
649
|
+
if (existsSync2(targetPath)) {
|
|
650
|
+
content = readFileSync2(targetPath, "utf8");
|
|
651
|
+
}
|
|
652
|
+
if (content.includes("armordesk")) {
|
|
653
|
+
return { success: true, configPath: targetPath, message: "Codex config already contains armordesk MCP server." };
|
|
654
|
+
}
|
|
655
|
+
const codexSnippet = `
|
|
656
|
+
# ArmorDesk Governed MCP Gateway
|
|
657
|
+
[mcp_servers.armordesk]
|
|
658
|
+
command = "npx"
|
|
659
|
+
args = ["-y", "@modelcontextprotocol/server-fetch", "${url}"]
|
|
660
|
+
|
|
661
|
+
[mcp_servers.armordesk.env]
|
|
662
|
+
ARMORIQ_TENANT = "${tenant}"
|
|
663
|
+
ARMORIQ_API_KEY = "${token}"
|
|
664
|
+
`;
|
|
665
|
+
writeFileSync2(targetPath, content + codexSnippet, "utf8");
|
|
666
|
+
return { success: true, configPath: targetPath, message: "OpenAI Codex config.toml updated successfully." };
|
|
667
|
+
}
|
|
597
668
|
if (agentId === "hermes" || agentId === "openclaw") {
|
|
598
669
|
let content = "";
|
|
599
670
|
if (existsSync2(targetPath)) {
|
|
600
671
|
content = readFileSync2(targetPath, "utf8");
|
|
601
672
|
}
|
|
602
673
|
if (content.includes("armordesk:")) {
|
|
603
|
-
return {
|
|
674
|
+
return {
|
|
675
|
+
success: true,
|
|
676
|
+
configPath: targetPath,
|
|
677
|
+
message: `${agentId === "hermes" ? "Hermes" : "OpenClaw"} config already has armordesk configured.`
|
|
678
|
+
};
|
|
604
679
|
}
|
|
605
680
|
const snippet = `
|
|
606
681
|
# ArmorDesk Governed MCP Gateway
|
|
@@ -612,9 +687,13 @@ mcp_servers:
|
|
|
612
687
|
Authorization: "Bearer ${token}"
|
|
613
688
|
`;
|
|
614
689
|
writeFileSync2(targetPath, content + snippet, "utf8");
|
|
615
|
-
return {
|
|
690
|
+
return {
|
|
691
|
+
success: true,
|
|
692
|
+
configPath: targetPath,
|
|
693
|
+
message: `${agentId === "hermes" ? "Hermes Agent" : "OpenClaw Agent"} config updated successfully.`
|
|
694
|
+
};
|
|
616
695
|
}
|
|
617
|
-
if (agentId === "claude"
|
|
696
|
+
if (agentId === "claude") {
|
|
618
697
|
let cfg = {};
|
|
619
698
|
if (existsSync2(targetPath)) {
|
|
620
699
|
try {
|
|
@@ -623,27 +702,105 @@ mcp_servers:
|
|
|
623
702
|
}
|
|
624
703
|
}
|
|
625
704
|
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
}
|
|
705
|
+
cfg.mcpServers.armordesk_gateway = {
|
|
706
|
+
command: "npx",
|
|
707
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
708
|
+
env: {
|
|
709
|
+
ARMORIQ_TENANT: tenant,
|
|
710
|
+
ARMORIQ_API_KEY: token
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
writeFileSync2(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
714
|
+
return { success: true, configPath: targetPath, message: "Claude Desktop MCP configuration updated." };
|
|
715
|
+
}
|
|
716
|
+
if (agentId === "cursor" || agentId === "windsurf") {
|
|
717
|
+
let cfg = {};
|
|
718
|
+
if (existsSync2(targetPath)) {
|
|
719
|
+
try {
|
|
720
|
+
cfg = JSON.parse(readFileSync2(targetPath, "utf8"));
|
|
721
|
+
} catch {
|
|
722
|
+
}
|
|
643
723
|
}
|
|
724
|
+
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
725
|
+
cfg.mcpServers.armordesk = {
|
|
726
|
+
url,
|
|
727
|
+
headers: {
|
|
728
|
+
"X-ArmorIQ-Tenant": tenant,
|
|
729
|
+
Authorization: `Bearer ${token}`
|
|
730
|
+
}
|
|
731
|
+
};
|
|
644
732
|
writeFileSync2(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
645
733
|
return { success: true, configPath: targetPath, message: `${agentId.toUpperCase()} MCP configuration updated.` };
|
|
646
734
|
}
|
|
735
|
+
if (agentId === "cline" || agentId === "roocode") {
|
|
736
|
+
let cfg = {};
|
|
737
|
+
if (existsSync2(targetPath)) {
|
|
738
|
+
try {
|
|
739
|
+
cfg = JSON.parse(readFileSync2(targetPath, "utf8"));
|
|
740
|
+
} catch {
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
744
|
+
cfg.mcpServers.armordesk = {
|
|
745
|
+
command: "npx",
|
|
746
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
747
|
+
env: {
|
|
748
|
+
ARMORIQ_TENANT: tenant,
|
|
749
|
+
ARMORIQ_API_KEY: token
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
writeFileSync2(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
753
|
+
return {
|
|
754
|
+
success: true,
|
|
755
|
+
configPath: targetPath,
|
|
756
|
+
message: `${agentId === "cline" ? "Cline" : "Roo Code"} MCP settings updated.`
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
if (agentId === "continue") {
|
|
760
|
+
let cfg = {};
|
|
761
|
+
if (existsSync2(targetPath)) {
|
|
762
|
+
try {
|
|
763
|
+
cfg = JSON.parse(readFileSync2(targetPath, "utf8"));
|
|
764
|
+
} catch {
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
if (!Array.isArray(cfg.mcpServers)) cfg.mcpServers = [];
|
|
768
|
+
const filtered = cfg.mcpServers.filter((s) => s.name !== "armordesk");
|
|
769
|
+
filtered.push({
|
|
770
|
+
name: "armordesk",
|
|
771
|
+
command: "npx",
|
|
772
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
773
|
+
env: {
|
|
774
|
+
ARMORIQ_TENANT: tenant,
|
|
775
|
+
ARMORIQ_API_KEY: token
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
cfg.mcpServers = filtered;
|
|
779
|
+
writeFileSync2(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
780
|
+
return { success: true, configPath: targetPath, message: "Continue.dev configuration updated." };
|
|
781
|
+
}
|
|
782
|
+
if (agentId === "zed") {
|
|
783
|
+
let cfg = {};
|
|
784
|
+
if (existsSync2(targetPath)) {
|
|
785
|
+
try {
|
|
786
|
+
cfg = JSON.parse(readFileSync2(targetPath, "utf8"));
|
|
787
|
+
} catch {
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if (!cfg.experimental) cfg.experimental = {};
|
|
791
|
+
if (!cfg.experimental.model_context_protocol) cfg.experimental.model_context_protocol = {};
|
|
792
|
+
if (!cfg.experimental.model_context_protocol.servers) cfg.experimental.model_context_protocol.servers = {};
|
|
793
|
+
cfg.experimental.model_context_protocol.servers.armordesk = {
|
|
794
|
+
command: "npx",
|
|
795
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
796
|
+
env: {
|
|
797
|
+
ARMORIQ_TENANT: tenant,
|
|
798
|
+
ARMORIQ_API_KEY: token
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
writeFileSync2(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
802
|
+
return { success: true, configPath: targetPath, message: "Zed IDE settings updated." };
|
|
803
|
+
}
|
|
647
804
|
} catch (err) {
|
|
648
805
|
return { success: false, configPath: targetPath, message: err.message };
|
|
649
806
|
}
|
|
@@ -695,6 +852,7 @@ export {
|
|
|
695
852
|
ArmorDeskClient,
|
|
696
853
|
generateClaudeDesktopConfig,
|
|
697
854
|
generateCursorConfig,
|
|
855
|
+
resolveAgentAlias,
|
|
698
856
|
getAgentPaths,
|
|
699
857
|
detectInstalledAgents,
|
|
700
858
|
injectAgentMCP,
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAgEA,wBAAsB,MAAM,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAsflF"}
|