@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/cli.js
CHANGED
|
@@ -442,156 +442,186 @@ var import_node_fs2 = require("fs");
|
|
|
442
442
|
var import_node_os2 = require("os");
|
|
443
443
|
var import_node_path2 = require("path");
|
|
444
444
|
var import_node_child_process = require("child_process");
|
|
445
|
+
function resolveAgentAlias(input) {
|
|
446
|
+
const norm = input.toLowerCase().trim();
|
|
447
|
+
if (norm === "antigravity" || norm === "agy") return "antigravity";
|
|
448
|
+
if (norm === "opencode" || norm === "openvode") return "opencode";
|
|
449
|
+
if (norm === "codex" || norm === "vodek" || norm === "openai-codex") return "codex";
|
|
450
|
+
if (norm === "hermes" || norm === "hermes-agent") return "hermes";
|
|
451
|
+
if (norm === "openclaw" || norm === "claw") return "openclaw";
|
|
452
|
+
if (norm === "claude" || norm === "claude-desktop") return "claude";
|
|
453
|
+
if (norm === "cursor") return "cursor";
|
|
454
|
+
if (norm === "windsurf" || norm === "codeium") return "windsurf";
|
|
455
|
+
if (norm === "cline") return "cline";
|
|
456
|
+
if (norm === "roocode" || norm === "roo-code" || norm === "roo") return "roocode";
|
|
457
|
+
if (norm === "continue" || norm === "continue.dev") return "continue";
|
|
458
|
+
if (norm === "zed") return "zed";
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
445
461
|
function getAgentPaths() {
|
|
446
462
|
const home = (0, import_node_os2.homedir)();
|
|
447
463
|
const os = (0, import_node_os2.platform)();
|
|
464
|
+
let vscodeGlobal = (0, import_node_path2.join)(home, ".config", "Code", "User", "globalStorage");
|
|
465
|
+
let zedPath = (0, import_node_path2.join)(home, ".config", "zed", "settings.json");
|
|
448
466
|
let claudePath = (0, import_node_path2.join)(home, ".config", "Claude", "claude_desktop_config.json");
|
|
449
467
|
if (os === "darwin") {
|
|
450
468
|
claudePath = (0, import_node_path2.join)(home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
469
|
+
vscodeGlobal = (0, import_node_path2.join)(home, "Library", "Application Support", "Code", "User", "globalStorage");
|
|
470
|
+
zedPath = (0, import_node_path2.join)(home, "Library", "Application Support", "Zed", "settings.json");
|
|
451
471
|
} else if (os === "win32") {
|
|
452
|
-
|
|
472
|
+
const appData = process.env.APPDATA || (0, import_node_path2.join)(home, "AppData", "Roaming");
|
|
473
|
+
claudePath = (0, import_node_path2.join)(appData, "Claude", "claude_desktop_config.json");
|
|
474
|
+
vscodeGlobal = (0, import_node_path2.join)(appData, "Code", "User", "globalStorage");
|
|
475
|
+
zedPath = (0, import_node_path2.join)(appData, "Zed", "settings.json");
|
|
476
|
+
}
|
|
477
|
+
let antigravityPath = (0, import_node_path2.join)(home, ".gemini", "config", "mcp_config.json");
|
|
478
|
+
if (!(0, import_node_fs2.existsSync)((0, import_node_path2.join)(home, ".gemini", "config")) && (0, import_node_fs2.existsSync)((0, import_node_path2.join)(home, ".antigravity"))) {
|
|
479
|
+
antigravityPath = (0, import_node_path2.join)(home, ".antigravity", "mcp_config.json");
|
|
453
480
|
}
|
|
454
481
|
return {
|
|
482
|
+
antigravity: antigravityPath,
|
|
455
483
|
opencode: (0, import_node_path2.join)(home, ".config", "opencode", "opencode.json"),
|
|
484
|
+
codex: (0, import_node_path2.join)(home, ".codex", "config.toml"),
|
|
456
485
|
hermes: (0, import_node_path2.join)(home, ".hermes", "config.yaml"),
|
|
457
486
|
openclaw: (0, import_node_path2.join)(home, ".openclaw", "config.yaml"),
|
|
458
487
|
claude: claudePath,
|
|
459
488
|
cursor: (0, import_node_path2.join)(home, ".cursor", "mcp.json"),
|
|
460
|
-
windsurf: (0, import_node_path2.join)(home, ".codeium", "windsurf", "mcp_config.json")
|
|
489
|
+
windsurf: (0, import_node_path2.join)(home, ".codeium", "windsurf", "mcp_config.json"),
|
|
490
|
+
cline: (0, import_node_path2.join)(vscodeGlobal, "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json"),
|
|
491
|
+
roocode: (0, import_node_path2.join)(vscodeGlobal, "rooveterinaryinc.roo-cline", "settings", "cline_mcp_settings.json"),
|
|
492
|
+
continue: (0, import_node_path2.join)(home, ".continue", "config.json"),
|
|
493
|
+
zed: zedPath
|
|
461
494
|
};
|
|
462
495
|
}
|
|
463
496
|
function detectInstalledAgents() {
|
|
464
497
|
const paths = getAgentPaths();
|
|
465
498
|
const results = [];
|
|
466
|
-
|
|
467
|
-
if (!opencodeInstalled) {
|
|
499
|
+
const hasBinary = (cmd) => {
|
|
468
500
|
try {
|
|
469
|
-
(0, import_node_child_process.execSync)(
|
|
470
|
-
|
|
501
|
+
(0, import_node_child_process.execSync)(`which ${cmd} || where ${cmd}`, { stdio: "ignore" });
|
|
502
|
+
return true;
|
|
471
503
|
} catch {
|
|
504
|
+
return false;
|
|
472
505
|
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
|
|
506
|
+
};
|
|
507
|
+
const fileHasArmor = (p) => {
|
|
508
|
+
if (!(0, import_node_fs2.existsSync)(p)) return false;
|
|
476
509
|
try {
|
|
477
|
-
const content = (0, import_node_fs2.readFileSync)(
|
|
478
|
-
|
|
510
|
+
const content = (0, import_node_fs2.readFileSync)(p, "utf8");
|
|
511
|
+
return content.includes("armordesk");
|
|
479
512
|
} catch {
|
|
513
|
+
return false;
|
|
480
514
|
}
|
|
481
|
-
}
|
|
515
|
+
};
|
|
516
|
+
const antigravityInstalled = (0, import_node_fs2.existsSync)(paths.antigravity) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)((0, import_node_os2.homedir)(), ".gemini", "antigravity-cli")) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)((0, import_node_os2.homedir)(), ".local", "bin", "agy")) || hasBinary("agy") || hasBinary("antigravity");
|
|
517
|
+
results.push({
|
|
518
|
+
id: "antigravity",
|
|
519
|
+
name: "Antigravity CLI (agy)",
|
|
520
|
+
configPath: paths.antigravity,
|
|
521
|
+
isInstalled: antigravityInstalled,
|
|
522
|
+
isConfigured: fileHasArmor(paths.antigravity)
|
|
523
|
+
});
|
|
524
|
+
const opencodeInstalled = (0, import_node_fs2.existsSync)(paths.opencode) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)((0, import_node_os2.homedir)(), ".opencode")) || hasBinary("opencode");
|
|
482
525
|
results.push({
|
|
483
526
|
id: "opencode",
|
|
484
527
|
name: "OpenCode CLI",
|
|
485
528
|
configPath: paths.opencode,
|
|
486
529
|
isInstalled: opencodeInstalled,
|
|
487
|
-
isConfigured:
|
|
530
|
+
isConfigured: fileHasArmor(paths.opencode)
|
|
488
531
|
});
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
if ((0, import_node_fs2.existsSync)(paths.hermes)) {
|
|
499
|
-
try {
|
|
500
|
-
const content = (0, import_node_fs2.readFileSync)(paths.hermes, "utf8");
|
|
501
|
-
hermesConfigured = content.includes("armordesk");
|
|
502
|
-
} catch {
|
|
503
|
-
}
|
|
504
|
-
}
|
|
532
|
+
const codexInstalled = (0, import_node_fs2.existsSync)(paths.codex) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)((0, import_node_os2.homedir)(), ".codex")) || hasBinary("codex");
|
|
533
|
+
results.push({
|
|
534
|
+
id: "codex",
|
|
535
|
+
name: "OpenAI Codex CLI",
|
|
536
|
+
configPath: paths.codex,
|
|
537
|
+
isInstalled: codexInstalled,
|
|
538
|
+
isConfigured: fileHasArmor(paths.codex)
|
|
539
|
+
});
|
|
540
|
+
const hermesInstalled = (0, import_node_fs2.existsSync)(paths.hermes) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)((0, import_node_os2.homedir)(), ".hermes")) || hasBinary("hermes");
|
|
505
541
|
results.push({
|
|
506
542
|
id: "hermes",
|
|
507
543
|
name: "Hermes Agent",
|
|
508
544
|
configPath: paths.hermes,
|
|
509
545
|
isInstalled: hermesInstalled,
|
|
510
|
-
isConfigured:
|
|
546
|
+
isConfigured: fileHasArmor(paths.hermes)
|
|
511
547
|
});
|
|
512
|
-
|
|
513
|
-
if (!openclawInstalled) {
|
|
514
|
-
try {
|
|
515
|
-
(0, import_node_child_process.execSync)("which openclaw || where openclaw", { stdio: "ignore" });
|
|
516
|
-
openclawInstalled = true;
|
|
517
|
-
} catch {
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
let openclawConfigured = false;
|
|
521
|
-
if ((0, import_node_fs2.existsSync)(paths.openclaw)) {
|
|
522
|
-
try {
|
|
523
|
-
const content = (0, import_node_fs2.readFileSync)(paths.openclaw, "utf8");
|
|
524
|
-
openclawConfigured = content.includes("armordesk");
|
|
525
|
-
} catch {
|
|
526
|
-
}
|
|
527
|
-
}
|
|
548
|
+
const openclawInstalled = (0, import_node_fs2.existsSync)(paths.openclaw) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)((0, import_node_os2.homedir)(), ".openclaw")) || hasBinary("openclaw");
|
|
528
549
|
results.push({
|
|
529
550
|
id: "openclaw",
|
|
530
551
|
name: "OpenClaw Agent",
|
|
531
552
|
configPath: paths.openclaw,
|
|
532
553
|
isInstalled: openclawInstalled,
|
|
533
|
-
isConfigured:
|
|
554
|
+
isConfigured: fileHasArmor(paths.openclaw)
|
|
534
555
|
});
|
|
535
556
|
const claudeInstalled = (0, import_node_fs2.existsSync)(paths.claude) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.claude, ".."));
|
|
536
|
-
let claudeConfigured = false;
|
|
537
|
-
if ((0, import_node_fs2.existsSync)(paths.claude)) {
|
|
538
|
-
try {
|
|
539
|
-
const content = (0, import_node_fs2.readFileSync)(paths.claude, "utf8");
|
|
540
|
-
claudeConfigured = content.includes("armordesk");
|
|
541
|
-
} catch {
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
557
|
results.push({
|
|
545
558
|
id: "claude",
|
|
546
559
|
name: "Claude Desktop",
|
|
547
560
|
configPath: paths.claude,
|
|
548
561
|
isInstalled: claudeInstalled,
|
|
549
|
-
isConfigured:
|
|
562
|
+
isConfigured: fileHasArmor(paths.claude)
|
|
550
563
|
});
|
|
551
564
|
const cursorInstalled = (0, import_node_fs2.existsSync)(paths.cursor) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.cursor, ".."));
|
|
552
|
-
let cursorConfigured = false;
|
|
553
|
-
if ((0, import_node_fs2.existsSync)(paths.cursor)) {
|
|
554
|
-
try {
|
|
555
|
-
const content = (0, import_node_fs2.readFileSync)(paths.cursor, "utf8");
|
|
556
|
-
cursorConfigured = content.includes("armordesk");
|
|
557
|
-
} catch {
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
565
|
results.push({
|
|
561
566
|
id: "cursor",
|
|
562
567
|
name: "Cursor IDE",
|
|
563
568
|
configPath: paths.cursor,
|
|
564
569
|
isInstalled: cursorInstalled,
|
|
565
|
-
isConfigured:
|
|
570
|
+
isConfigured: fileHasArmor(paths.cursor)
|
|
566
571
|
});
|
|
567
572
|
const windsurfInstalled = (0, import_node_fs2.existsSync)(paths.windsurf) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.windsurf, ".."));
|
|
568
|
-
let windsurfConfigured = false;
|
|
569
|
-
if ((0, import_node_fs2.existsSync)(paths.windsurf)) {
|
|
570
|
-
try {
|
|
571
|
-
const content = (0, import_node_fs2.readFileSync)(paths.windsurf, "utf8");
|
|
572
|
-
windsurfConfigured = content.includes("armordesk");
|
|
573
|
-
} catch {
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
573
|
results.push({
|
|
577
574
|
id: "windsurf",
|
|
578
575
|
name: "Windsurf IDE",
|
|
579
576
|
configPath: paths.windsurf,
|
|
580
577
|
isInstalled: windsurfInstalled,
|
|
581
|
-
isConfigured:
|
|
578
|
+
isConfigured: fileHasArmor(paths.windsurf)
|
|
579
|
+
});
|
|
580
|
+
const clineInstalled = (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.cline, ".."));
|
|
581
|
+
results.push({
|
|
582
|
+
id: "cline",
|
|
583
|
+
name: "Cline (VS Code)",
|
|
584
|
+
configPath: paths.cline,
|
|
585
|
+
isInstalled: clineInstalled,
|
|
586
|
+
isConfigured: fileHasArmor(paths.cline)
|
|
587
|
+
});
|
|
588
|
+
const rooInstalled = (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.roocode, ".."));
|
|
589
|
+
results.push({
|
|
590
|
+
id: "roocode",
|
|
591
|
+
name: "Roo Code (VS Code)",
|
|
592
|
+
configPath: paths.roocode,
|
|
593
|
+
isInstalled: rooInstalled,
|
|
594
|
+
isConfigured: fileHasArmor(paths.roocode)
|
|
595
|
+
});
|
|
596
|
+
const continueInstalled = (0, import_node_fs2.existsSync)(paths.continue) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.continue, ".."));
|
|
597
|
+
results.push({
|
|
598
|
+
id: "continue",
|
|
599
|
+
name: "Continue.dev",
|
|
600
|
+
configPath: paths.continue,
|
|
601
|
+
isInstalled: continueInstalled,
|
|
602
|
+
isConfigured: fileHasArmor(paths.continue)
|
|
603
|
+
});
|
|
604
|
+
const zedInstalled = (0, import_node_fs2.existsSync)(paths.zed) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.zed, "..")) || hasBinary("zed");
|
|
605
|
+
results.push({
|
|
606
|
+
id: "zed",
|
|
607
|
+
name: "Zed IDE",
|
|
608
|
+
configPath: paths.zed,
|
|
609
|
+
isInstalled: zedInstalled,
|
|
610
|
+
isConfigured: fileHasArmor(paths.zed)
|
|
582
611
|
});
|
|
583
612
|
return results;
|
|
584
613
|
}
|
|
585
|
-
function injectAgentMCP(
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
if (!targetPath) {
|
|
614
|
+
function injectAgentMCP(agentNameOrAlias, options) {
|
|
615
|
+
const agentId = resolveAgentAlias(agentNameOrAlias);
|
|
616
|
+
if (!agentId) {
|
|
589
617
|
return {
|
|
590
618
|
success: false,
|
|
591
619
|
configPath: "",
|
|
592
|
-
message: `Unknown agent
|
|
620
|
+
message: `Unknown agent identifier '${agentNameOrAlias}'. Supported: antigravity (agy), opencode (openvode), codex (vodek), hermes, openclaw, claude, cursor, windsurf, cline, roocode, continue, zed`
|
|
593
621
|
};
|
|
594
622
|
}
|
|
623
|
+
const paths = getAgentPaths();
|
|
624
|
+
const targetPath = paths[agentId];
|
|
595
625
|
const url = `${(options.baseUrl || "https://armordesk.crusts.dev").replace(/\/$/, "")}/api/mcp/gateway`;
|
|
596
626
|
const tenant = options.tenantId || "acme-corp";
|
|
597
627
|
const token = options.token || `ak_live_${tenant}_key`;
|
|
@@ -600,6 +630,26 @@ function injectAgentMCP(agentId, options) {
|
|
|
600
630
|
(0, import_node_fs2.mkdirSync)(dir, { recursive: true });
|
|
601
631
|
}
|
|
602
632
|
try {
|
|
633
|
+
if (agentId === "antigravity") {
|
|
634
|
+
let cfg = {};
|
|
635
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
636
|
+
try {
|
|
637
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
638
|
+
} catch {
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
642
|
+
cfg.mcpServers.armordesk = {
|
|
643
|
+
serverUrl: url,
|
|
644
|
+
disabled: false,
|
|
645
|
+
headers: {
|
|
646
|
+
"X-ArmorIQ-Tenant": tenant,
|
|
647
|
+
Authorization: `Bearer ${token}`
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
651
|
+
return { success: true, configPath: targetPath, message: "Antigravity CLI MCP configuration updated." };
|
|
652
|
+
}
|
|
603
653
|
if (agentId === "opencode") {
|
|
604
654
|
let cfg = {};
|
|
605
655
|
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
@@ -621,13 +671,38 @@ function injectAgentMCP(agentId, options) {
|
|
|
621
671
|
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
622
672
|
return { success: true, configPath: targetPath, message: "OpenCode config updated successfully." };
|
|
623
673
|
}
|
|
674
|
+
if (agentId === "codex") {
|
|
675
|
+
let content = "";
|
|
676
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
677
|
+
content = (0, import_node_fs2.readFileSync)(targetPath, "utf8");
|
|
678
|
+
}
|
|
679
|
+
if (content.includes("armordesk")) {
|
|
680
|
+
return { success: true, configPath: targetPath, message: "Codex config already contains armordesk MCP server." };
|
|
681
|
+
}
|
|
682
|
+
const codexSnippet = `
|
|
683
|
+
# ArmorDesk Governed MCP Gateway
|
|
684
|
+
[mcp_servers.armordesk]
|
|
685
|
+
command = "npx"
|
|
686
|
+
args = ["-y", "@modelcontextprotocol/server-fetch", "${url}"]
|
|
687
|
+
|
|
688
|
+
[mcp_servers.armordesk.env]
|
|
689
|
+
ARMORIQ_TENANT = "${tenant}"
|
|
690
|
+
ARMORIQ_API_KEY = "${token}"
|
|
691
|
+
`;
|
|
692
|
+
(0, import_node_fs2.writeFileSync)(targetPath, content + codexSnippet, "utf8");
|
|
693
|
+
return { success: true, configPath: targetPath, message: "OpenAI Codex config.toml updated successfully." };
|
|
694
|
+
}
|
|
624
695
|
if (agentId === "hermes" || agentId === "openclaw") {
|
|
625
696
|
let content = "";
|
|
626
697
|
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
627
698
|
content = (0, import_node_fs2.readFileSync)(targetPath, "utf8");
|
|
628
699
|
}
|
|
629
700
|
if (content.includes("armordesk:")) {
|
|
630
|
-
return {
|
|
701
|
+
return {
|
|
702
|
+
success: true,
|
|
703
|
+
configPath: targetPath,
|
|
704
|
+
message: `${agentId === "hermes" ? "Hermes" : "OpenClaw"} config already has armordesk configured.`
|
|
705
|
+
};
|
|
631
706
|
}
|
|
632
707
|
const snippet = `
|
|
633
708
|
# ArmorDesk Governed MCP Gateway
|
|
@@ -639,9 +714,13 @@ mcp_servers:
|
|
|
639
714
|
Authorization: "Bearer ${token}"
|
|
640
715
|
`;
|
|
641
716
|
(0, import_node_fs2.writeFileSync)(targetPath, content + snippet, "utf8");
|
|
642
|
-
return {
|
|
717
|
+
return {
|
|
718
|
+
success: true,
|
|
719
|
+
configPath: targetPath,
|
|
720
|
+
message: `${agentId === "hermes" ? "Hermes Agent" : "OpenClaw Agent"} config updated successfully.`
|
|
721
|
+
};
|
|
643
722
|
}
|
|
644
|
-
if (agentId === "claude"
|
|
723
|
+
if (agentId === "claude") {
|
|
645
724
|
let cfg = {};
|
|
646
725
|
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
647
726
|
try {
|
|
@@ -650,27 +729,105 @@ mcp_servers:
|
|
|
650
729
|
}
|
|
651
730
|
}
|
|
652
731
|
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
}
|
|
732
|
+
cfg.mcpServers.armordesk_gateway = {
|
|
733
|
+
command: "npx",
|
|
734
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
735
|
+
env: {
|
|
736
|
+
ARMORIQ_TENANT: tenant,
|
|
737
|
+
ARMORIQ_API_KEY: token
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
741
|
+
return { success: true, configPath: targetPath, message: "Claude Desktop MCP configuration updated." };
|
|
742
|
+
}
|
|
743
|
+
if (agentId === "cursor" || agentId === "windsurf") {
|
|
744
|
+
let cfg = {};
|
|
745
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
746
|
+
try {
|
|
747
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
748
|
+
} catch {
|
|
749
|
+
}
|
|
670
750
|
}
|
|
751
|
+
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
752
|
+
cfg.mcpServers.armordesk = {
|
|
753
|
+
url,
|
|
754
|
+
headers: {
|
|
755
|
+
"X-ArmorIQ-Tenant": tenant,
|
|
756
|
+
Authorization: `Bearer ${token}`
|
|
757
|
+
}
|
|
758
|
+
};
|
|
671
759
|
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
672
760
|
return { success: true, configPath: targetPath, message: `${agentId.toUpperCase()} MCP configuration updated.` };
|
|
673
761
|
}
|
|
762
|
+
if (agentId === "cline" || agentId === "roocode") {
|
|
763
|
+
let cfg = {};
|
|
764
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
765
|
+
try {
|
|
766
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
767
|
+
} catch {
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
771
|
+
cfg.mcpServers.armordesk = {
|
|
772
|
+
command: "npx",
|
|
773
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
774
|
+
env: {
|
|
775
|
+
ARMORIQ_TENANT: tenant,
|
|
776
|
+
ARMORIQ_API_KEY: token
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
780
|
+
return {
|
|
781
|
+
success: true,
|
|
782
|
+
configPath: targetPath,
|
|
783
|
+
message: `${agentId === "cline" ? "Cline" : "Roo Code"} MCP settings updated.`
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
if (agentId === "continue") {
|
|
787
|
+
let cfg = {};
|
|
788
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
789
|
+
try {
|
|
790
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
791
|
+
} catch {
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
if (!Array.isArray(cfg.mcpServers)) cfg.mcpServers = [];
|
|
795
|
+
const filtered = cfg.mcpServers.filter((s) => s.name !== "armordesk");
|
|
796
|
+
filtered.push({
|
|
797
|
+
name: "armordesk",
|
|
798
|
+
command: "npx",
|
|
799
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
800
|
+
env: {
|
|
801
|
+
ARMORIQ_TENANT: tenant,
|
|
802
|
+
ARMORIQ_API_KEY: token
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
cfg.mcpServers = filtered;
|
|
806
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
807
|
+
return { success: true, configPath: targetPath, message: "Continue.dev configuration updated." };
|
|
808
|
+
}
|
|
809
|
+
if (agentId === "zed") {
|
|
810
|
+
let cfg = {};
|
|
811
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
812
|
+
try {
|
|
813
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
814
|
+
} catch {
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
if (!cfg.experimental) cfg.experimental = {};
|
|
818
|
+
if (!cfg.experimental.model_context_protocol) cfg.experimental.model_context_protocol = {};
|
|
819
|
+
if (!cfg.experimental.model_context_protocol.servers) cfg.experimental.model_context_protocol.servers = {};
|
|
820
|
+
cfg.experimental.model_context_protocol.servers.armordesk = {
|
|
821
|
+
command: "npx",
|
|
822
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
823
|
+
env: {
|
|
824
|
+
ARMORIQ_TENANT: tenant,
|
|
825
|
+
ARMORIQ_API_KEY: token
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
829
|
+
return { success: true, configPath: targetPath, message: "Zed IDE settings updated." };
|
|
830
|
+
}
|
|
674
831
|
} catch (err) {
|
|
675
832
|
return { success: false, configPath: targetPath, message: err.message };
|
|
676
833
|
}
|
|
@@ -729,8 +886,9 @@ var HELP_TEXT = `
|
|
|
729
886
|
|
|
730
887
|
MCP Gateway & AI Agent Auto-Connect:
|
|
731
888
|
mcp [check|status] Verify if MCP Gateway is connected & reachable
|
|
732
|
-
mcp detect Scan system for installed AI coding agents (OpenCode, Hermes, Claude,
|
|
889
|
+
mcp detect Scan system for installed AI coding agents (Antigravity, OpenCode, Codex, Hermes, Claude, etc.)
|
|
733
890
|
mcp inject [agent|all] Auto-configure ArmorDesk MCP into detected or specified agent
|
|
891
|
+
(Supported: antigravity/agy, opencode/openvode, codex/vodek, hermes, openclaw, claude, cursor, windsurf, cline, roocode, continue, zed)
|
|
734
892
|
mcp prompt Display ready-to-copy AI System Prompt for any agent or LLM
|
|
735
893
|
mcp claude Output Claude Desktop MCP configuration JSON
|
|
736
894
|
mcp cursor Output Cursor IDE MCP configuration JSON
|
|
@@ -866,7 +1024,7 @@ async function runCLI(args = process.argv.slice(2)) {
|
|
|
866
1024
|
console.log(`
|
|
867
1025
|
\u{1F4C1} Session saved to: ${getConfigPath()}`);
|
|
868
1026
|
console.log("All armordesk commands will now execute under this identity.");
|
|
869
|
-
console.log("\n\u{1F916} Scanning for Installed AI Agents (OpenCode, Hermes, Claude,
|
|
1027
|
+
console.log("\n\u{1F916} Scanning for Installed AI Agents (Antigravity, OpenCode, Codex, Hermes, Claude, etc.)...");
|
|
870
1028
|
const detected = detectInstalledAgents();
|
|
871
1029
|
const installed = detected.filter((d) => d.isInstalled);
|
|
872
1030
|
if (installed.length > 0) {
|
|
@@ -883,7 +1041,7 @@ async function runCLI(args = process.argv.slice(2)) {
|
|
|
883
1041
|
}
|
|
884
1042
|
} else {
|
|
885
1043
|
console.log(" No local agents detected yet. You can auto-connect anytime with:");
|
|
886
|
-
console.log(" npx @crustdev/armordesk mcp inject <opencode|hermes|claude|cursor
|
|
1044
|
+
console.log(" npx @crustdev/armordesk mcp inject <antigravity|opencode|codex|hermes|claude|cursor>");
|
|
887
1045
|
}
|
|
888
1046
|
console.log("\n\u{1F4CB} Governed AI Agent System Directive (Prompt for your LLMs):");
|
|
889
1047
|
console.log("------------------------------------------------------------");
|
|
@@ -1128,7 +1286,7 @@ async function runCLI(args = process.argv.slice(2)) {
|
|
|
1128
1286
|
const targetsToInject = target === "all" ? agents.filter((a) => a.isInstalled).map((a) => a.id) : [target];
|
|
1129
1287
|
if (targetsToInject.length === 0) {
|
|
1130
1288
|
console.log("\u26A0\uFE0F No installed agents detected to inject automatically.");
|
|
1131
|
-
console.log("You can force injection by specifying: armordesk mcp inject <opencode|hermes|claude|cursor|windsurf>");
|
|
1289
|
+
console.log("You can force injection by specifying: armordesk mcp inject <antigravity|opencode|codex|hermes|claude|cursor|windsurf|cline|roocode|continue|zed>");
|
|
1132
1290
|
} else {
|
|
1133
1291
|
for (const t of targetsToInject) {
|
|
1134
1292
|
const res = injectAgentMCP(t, {
|
package/dist/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
injectAgentMCP,
|
|
10
10
|
loadStoredConfig,
|
|
11
11
|
saveStoredConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HWPT3W34.mjs";
|
|
13
13
|
|
|
14
14
|
// src/cli.ts
|
|
15
15
|
import { exec } from "child_process";
|
|
@@ -34,8 +34,9 @@ var HELP_TEXT = `
|
|
|
34
34
|
|
|
35
35
|
MCP Gateway & AI Agent Auto-Connect:
|
|
36
36
|
mcp [check|status] Verify if MCP Gateway is connected & reachable
|
|
37
|
-
mcp detect Scan system for installed AI coding agents (OpenCode, Hermes, Claude,
|
|
37
|
+
mcp detect Scan system for installed AI coding agents (Antigravity, OpenCode, Codex, Hermes, Claude, etc.)
|
|
38
38
|
mcp inject [agent|all] Auto-configure ArmorDesk MCP into detected or specified agent
|
|
39
|
+
(Supported: antigravity/agy, opencode/openvode, codex/vodek, hermes, openclaw, claude, cursor, windsurf, cline, roocode, continue, zed)
|
|
39
40
|
mcp prompt Display ready-to-copy AI System Prompt for any agent or LLM
|
|
40
41
|
mcp claude Output Claude Desktop MCP configuration JSON
|
|
41
42
|
mcp cursor Output Cursor IDE MCP configuration JSON
|
|
@@ -171,7 +172,7 @@ async function runCLI(args = process.argv.slice(2)) {
|
|
|
171
172
|
console.log(`
|
|
172
173
|
\u{1F4C1} Session saved to: ${getConfigPath()}`);
|
|
173
174
|
console.log("All armordesk commands will now execute under this identity.");
|
|
174
|
-
console.log("\n\u{1F916} Scanning for Installed AI Agents (OpenCode, Hermes, Claude,
|
|
175
|
+
console.log("\n\u{1F916} Scanning for Installed AI Agents (Antigravity, OpenCode, Codex, Hermes, Claude, etc.)...");
|
|
175
176
|
const detected = detectInstalledAgents();
|
|
176
177
|
const installed = detected.filter((d) => d.isInstalled);
|
|
177
178
|
if (installed.length > 0) {
|
|
@@ -188,7 +189,7 @@ async function runCLI(args = process.argv.slice(2)) {
|
|
|
188
189
|
}
|
|
189
190
|
} else {
|
|
190
191
|
console.log(" No local agents detected yet. You can auto-connect anytime with:");
|
|
191
|
-
console.log(" npx @crustdev/armordesk mcp inject <opencode|hermes|claude|cursor
|
|
192
|
+
console.log(" npx @crustdev/armordesk mcp inject <antigravity|opencode|codex|hermes|claude|cursor>");
|
|
192
193
|
}
|
|
193
194
|
console.log("\n\u{1F4CB} Governed AI Agent System Directive (Prompt for your LLMs):");
|
|
194
195
|
console.log("------------------------------------------------------------");
|
|
@@ -433,7 +434,7 @@ async function runCLI(args = process.argv.slice(2)) {
|
|
|
433
434
|
const targetsToInject = target === "all" ? agents.filter((a) => a.isInstalled).map((a) => a.id) : [target];
|
|
434
435
|
if (targetsToInject.length === 0) {
|
|
435
436
|
console.log("\u26A0\uFE0F No installed agents detected to inject automatically.");
|
|
436
|
-
console.log("You can force injection by specifying: armordesk mcp inject <opencode|hermes|claude|cursor|windsurf>");
|
|
437
|
+
console.log("You can force injection by specifying: armordesk mcp inject <antigravity|opencode|codex|hermes|claude|cursor|windsurf|cline|roocode|continue|zed>");
|
|
437
438
|
} else {
|
|
438
439
|
for (const t of targetsToInject) {
|
|
439
440
|
const res = injectAgentMCP(t, {
|