@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/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
hashSha256: () => hashSha256,
|
|
36
36
|
injectAgentMCP: () => injectAgentMCP,
|
|
37
37
|
loadStoredConfig: () => loadStoredConfig,
|
|
38
|
+
resolveAgentAlias: () => resolveAgentAlias,
|
|
38
39
|
saveStoredConfig: () => saveStoredConfig,
|
|
39
40
|
verifyMerkleRoot: () => verifyMerkleRoot,
|
|
40
41
|
verifyProof: () => verifyProof
|
|
@@ -458,156 +459,186 @@ var import_node_fs2 = require("fs");
|
|
|
458
459
|
var import_node_os2 = require("os");
|
|
459
460
|
var import_node_path2 = require("path");
|
|
460
461
|
var import_node_child_process = require("child_process");
|
|
462
|
+
function resolveAgentAlias(input) {
|
|
463
|
+
const norm = input.toLowerCase().trim();
|
|
464
|
+
if (norm === "antigravity" || norm === "agy") return "antigravity";
|
|
465
|
+
if (norm === "opencode" || norm === "openvode") return "opencode";
|
|
466
|
+
if (norm === "codex" || norm === "vodek" || norm === "openai-codex") return "codex";
|
|
467
|
+
if (norm === "hermes" || norm === "hermes-agent") return "hermes";
|
|
468
|
+
if (norm === "openclaw" || norm === "claw") return "openclaw";
|
|
469
|
+
if (norm === "claude" || norm === "claude-desktop") return "claude";
|
|
470
|
+
if (norm === "cursor") return "cursor";
|
|
471
|
+
if (norm === "windsurf" || norm === "codeium") return "windsurf";
|
|
472
|
+
if (norm === "cline") return "cline";
|
|
473
|
+
if (norm === "roocode" || norm === "roo-code" || norm === "roo") return "roocode";
|
|
474
|
+
if (norm === "continue" || norm === "continue.dev") return "continue";
|
|
475
|
+
if (norm === "zed") return "zed";
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
461
478
|
function getAgentPaths() {
|
|
462
479
|
const home = (0, import_node_os2.homedir)();
|
|
463
480
|
const os = (0, import_node_os2.platform)();
|
|
481
|
+
let vscodeGlobal = (0, import_node_path2.join)(home, ".config", "Code", "User", "globalStorage");
|
|
482
|
+
let zedPath = (0, import_node_path2.join)(home, ".config", "zed", "settings.json");
|
|
464
483
|
let claudePath = (0, import_node_path2.join)(home, ".config", "Claude", "claude_desktop_config.json");
|
|
465
484
|
if (os === "darwin") {
|
|
466
485
|
claudePath = (0, import_node_path2.join)(home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
486
|
+
vscodeGlobal = (0, import_node_path2.join)(home, "Library", "Application Support", "Code", "User", "globalStorage");
|
|
487
|
+
zedPath = (0, import_node_path2.join)(home, "Library", "Application Support", "Zed", "settings.json");
|
|
467
488
|
} else if (os === "win32") {
|
|
468
|
-
|
|
489
|
+
const appData = process.env.APPDATA || (0, import_node_path2.join)(home, "AppData", "Roaming");
|
|
490
|
+
claudePath = (0, import_node_path2.join)(appData, "Claude", "claude_desktop_config.json");
|
|
491
|
+
vscodeGlobal = (0, import_node_path2.join)(appData, "Code", "User", "globalStorage");
|
|
492
|
+
zedPath = (0, import_node_path2.join)(appData, "Zed", "settings.json");
|
|
493
|
+
}
|
|
494
|
+
let antigravityPath = (0, import_node_path2.join)(home, ".gemini", "config", "mcp_config.json");
|
|
495
|
+
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"))) {
|
|
496
|
+
antigravityPath = (0, import_node_path2.join)(home, ".antigravity", "mcp_config.json");
|
|
469
497
|
}
|
|
470
498
|
return {
|
|
499
|
+
antigravity: antigravityPath,
|
|
471
500
|
opencode: (0, import_node_path2.join)(home, ".config", "opencode", "opencode.json"),
|
|
501
|
+
codex: (0, import_node_path2.join)(home, ".codex", "config.toml"),
|
|
472
502
|
hermes: (0, import_node_path2.join)(home, ".hermes", "config.yaml"),
|
|
473
503
|
openclaw: (0, import_node_path2.join)(home, ".openclaw", "config.yaml"),
|
|
474
504
|
claude: claudePath,
|
|
475
505
|
cursor: (0, import_node_path2.join)(home, ".cursor", "mcp.json"),
|
|
476
|
-
windsurf: (0, import_node_path2.join)(home, ".codeium", "windsurf", "mcp_config.json")
|
|
506
|
+
windsurf: (0, import_node_path2.join)(home, ".codeium", "windsurf", "mcp_config.json"),
|
|
507
|
+
cline: (0, import_node_path2.join)(vscodeGlobal, "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json"),
|
|
508
|
+
roocode: (0, import_node_path2.join)(vscodeGlobal, "rooveterinaryinc.roo-cline", "settings", "cline_mcp_settings.json"),
|
|
509
|
+
continue: (0, import_node_path2.join)(home, ".continue", "config.json"),
|
|
510
|
+
zed: zedPath
|
|
477
511
|
};
|
|
478
512
|
}
|
|
479
513
|
function detectInstalledAgents() {
|
|
480
514
|
const paths = getAgentPaths();
|
|
481
515
|
const results = [];
|
|
482
|
-
|
|
483
|
-
if (!opencodeInstalled) {
|
|
516
|
+
const hasBinary = (cmd) => {
|
|
484
517
|
try {
|
|
485
|
-
(0, import_node_child_process.execSync)(
|
|
486
|
-
|
|
518
|
+
(0, import_node_child_process.execSync)(`which ${cmd} || where ${cmd}`, { stdio: "ignore" });
|
|
519
|
+
return true;
|
|
487
520
|
} catch {
|
|
521
|
+
return false;
|
|
488
522
|
}
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
523
|
+
};
|
|
524
|
+
const fileHasArmor = (p) => {
|
|
525
|
+
if (!(0, import_node_fs2.existsSync)(p)) return false;
|
|
492
526
|
try {
|
|
493
|
-
const content = (0, import_node_fs2.readFileSync)(
|
|
494
|
-
|
|
527
|
+
const content = (0, import_node_fs2.readFileSync)(p, "utf8");
|
|
528
|
+
return content.includes("armordesk");
|
|
495
529
|
} catch {
|
|
530
|
+
return false;
|
|
496
531
|
}
|
|
497
|
-
}
|
|
532
|
+
};
|
|
533
|
+
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");
|
|
534
|
+
results.push({
|
|
535
|
+
id: "antigravity",
|
|
536
|
+
name: "Antigravity CLI (agy)",
|
|
537
|
+
configPath: paths.antigravity,
|
|
538
|
+
isInstalled: antigravityInstalled,
|
|
539
|
+
isConfigured: fileHasArmor(paths.antigravity)
|
|
540
|
+
});
|
|
541
|
+
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");
|
|
498
542
|
results.push({
|
|
499
543
|
id: "opencode",
|
|
500
544
|
name: "OpenCode CLI",
|
|
501
545
|
configPath: paths.opencode,
|
|
502
546
|
isInstalled: opencodeInstalled,
|
|
503
|
-
isConfigured:
|
|
547
|
+
isConfigured: fileHasArmor(paths.opencode)
|
|
504
548
|
});
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
if ((0, import_node_fs2.existsSync)(paths.hermes)) {
|
|
515
|
-
try {
|
|
516
|
-
const content = (0, import_node_fs2.readFileSync)(paths.hermes, "utf8");
|
|
517
|
-
hermesConfigured = content.includes("armordesk");
|
|
518
|
-
} catch {
|
|
519
|
-
}
|
|
520
|
-
}
|
|
549
|
+
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");
|
|
550
|
+
results.push({
|
|
551
|
+
id: "codex",
|
|
552
|
+
name: "OpenAI Codex CLI",
|
|
553
|
+
configPath: paths.codex,
|
|
554
|
+
isInstalled: codexInstalled,
|
|
555
|
+
isConfigured: fileHasArmor(paths.codex)
|
|
556
|
+
});
|
|
557
|
+
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");
|
|
521
558
|
results.push({
|
|
522
559
|
id: "hermes",
|
|
523
560
|
name: "Hermes Agent",
|
|
524
561
|
configPath: paths.hermes,
|
|
525
562
|
isInstalled: hermesInstalled,
|
|
526
|
-
isConfigured:
|
|
563
|
+
isConfigured: fileHasArmor(paths.hermes)
|
|
527
564
|
});
|
|
528
|
-
|
|
529
|
-
if (!openclawInstalled) {
|
|
530
|
-
try {
|
|
531
|
-
(0, import_node_child_process.execSync)("which openclaw || where openclaw", { stdio: "ignore" });
|
|
532
|
-
openclawInstalled = true;
|
|
533
|
-
} catch {
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
let openclawConfigured = false;
|
|
537
|
-
if ((0, import_node_fs2.existsSync)(paths.openclaw)) {
|
|
538
|
-
try {
|
|
539
|
-
const content = (0, import_node_fs2.readFileSync)(paths.openclaw, "utf8");
|
|
540
|
-
openclawConfigured = content.includes("armordesk");
|
|
541
|
-
} catch {
|
|
542
|
-
}
|
|
543
|
-
}
|
|
565
|
+
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");
|
|
544
566
|
results.push({
|
|
545
567
|
id: "openclaw",
|
|
546
568
|
name: "OpenClaw Agent",
|
|
547
569
|
configPath: paths.openclaw,
|
|
548
570
|
isInstalled: openclawInstalled,
|
|
549
|
-
isConfigured:
|
|
571
|
+
isConfigured: fileHasArmor(paths.openclaw)
|
|
550
572
|
});
|
|
551
573
|
const claudeInstalled = (0, import_node_fs2.existsSync)(paths.claude) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.claude, ".."));
|
|
552
|
-
let claudeConfigured = false;
|
|
553
|
-
if ((0, import_node_fs2.existsSync)(paths.claude)) {
|
|
554
|
-
try {
|
|
555
|
-
const content = (0, import_node_fs2.readFileSync)(paths.claude, "utf8");
|
|
556
|
-
claudeConfigured = content.includes("armordesk");
|
|
557
|
-
} catch {
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
574
|
results.push({
|
|
561
575
|
id: "claude",
|
|
562
576
|
name: "Claude Desktop",
|
|
563
577
|
configPath: paths.claude,
|
|
564
578
|
isInstalled: claudeInstalled,
|
|
565
|
-
isConfigured:
|
|
579
|
+
isConfigured: fileHasArmor(paths.claude)
|
|
566
580
|
});
|
|
567
581
|
const cursorInstalled = (0, import_node_fs2.existsSync)(paths.cursor) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.cursor, ".."));
|
|
568
|
-
let cursorConfigured = false;
|
|
569
|
-
if ((0, import_node_fs2.existsSync)(paths.cursor)) {
|
|
570
|
-
try {
|
|
571
|
-
const content = (0, import_node_fs2.readFileSync)(paths.cursor, "utf8");
|
|
572
|
-
cursorConfigured = content.includes("armordesk");
|
|
573
|
-
} catch {
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
582
|
results.push({
|
|
577
583
|
id: "cursor",
|
|
578
584
|
name: "Cursor IDE",
|
|
579
585
|
configPath: paths.cursor,
|
|
580
586
|
isInstalled: cursorInstalled,
|
|
581
|
-
isConfigured:
|
|
587
|
+
isConfigured: fileHasArmor(paths.cursor)
|
|
582
588
|
});
|
|
583
589
|
const windsurfInstalled = (0, import_node_fs2.existsSync)(paths.windsurf) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.windsurf, ".."));
|
|
584
|
-
let windsurfConfigured = false;
|
|
585
|
-
if ((0, import_node_fs2.existsSync)(paths.windsurf)) {
|
|
586
|
-
try {
|
|
587
|
-
const content = (0, import_node_fs2.readFileSync)(paths.windsurf, "utf8");
|
|
588
|
-
windsurfConfigured = content.includes("armordesk");
|
|
589
|
-
} catch {
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
590
|
results.push({
|
|
593
591
|
id: "windsurf",
|
|
594
592
|
name: "Windsurf IDE",
|
|
595
593
|
configPath: paths.windsurf,
|
|
596
594
|
isInstalled: windsurfInstalled,
|
|
597
|
-
isConfigured:
|
|
595
|
+
isConfigured: fileHasArmor(paths.windsurf)
|
|
596
|
+
});
|
|
597
|
+
const clineInstalled = (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.cline, ".."));
|
|
598
|
+
results.push({
|
|
599
|
+
id: "cline",
|
|
600
|
+
name: "Cline (VS Code)",
|
|
601
|
+
configPath: paths.cline,
|
|
602
|
+
isInstalled: clineInstalled,
|
|
603
|
+
isConfigured: fileHasArmor(paths.cline)
|
|
604
|
+
});
|
|
605
|
+
const rooInstalled = (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.roocode, ".."));
|
|
606
|
+
results.push({
|
|
607
|
+
id: "roocode",
|
|
608
|
+
name: "Roo Code (VS Code)",
|
|
609
|
+
configPath: paths.roocode,
|
|
610
|
+
isInstalled: rooInstalled,
|
|
611
|
+
isConfigured: fileHasArmor(paths.roocode)
|
|
612
|
+
});
|
|
613
|
+
const continueInstalled = (0, import_node_fs2.existsSync)(paths.continue) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.continue, ".."));
|
|
614
|
+
results.push({
|
|
615
|
+
id: "continue",
|
|
616
|
+
name: "Continue.dev",
|
|
617
|
+
configPath: paths.continue,
|
|
618
|
+
isInstalled: continueInstalled,
|
|
619
|
+
isConfigured: fileHasArmor(paths.continue)
|
|
620
|
+
});
|
|
621
|
+
const zedInstalled = (0, import_node_fs2.existsSync)(paths.zed) || (0, import_node_fs2.existsSync)((0, import_node_path2.join)(paths.zed, "..")) || hasBinary("zed");
|
|
622
|
+
results.push({
|
|
623
|
+
id: "zed",
|
|
624
|
+
name: "Zed IDE",
|
|
625
|
+
configPath: paths.zed,
|
|
626
|
+
isInstalled: zedInstalled,
|
|
627
|
+
isConfigured: fileHasArmor(paths.zed)
|
|
598
628
|
});
|
|
599
629
|
return results;
|
|
600
630
|
}
|
|
601
|
-
function injectAgentMCP(
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
if (!targetPath) {
|
|
631
|
+
function injectAgentMCP(agentNameOrAlias, options) {
|
|
632
|
+
const agentId = resolveAgentAlias(agentNameOrAlias);
|
|
633
|
+
if (!agentId) {
|
|
605
634
|
return {
|
|
606
635
|
success: false,
|
|
607
636
|
configPath: "",
|
|
608
|
-
message: `Unknown agent
|
|
637
|
+
message: `Unknown agent identifier '${agentNameOrAlias}'. Supported: antigravity (agy), opencode (openvode), codex (vodek), hermes, openclaw, claude, cursor, windsurf, cline, roocode, continue, zed`
|
|
609
638
|
};
|
|
610
639
|
}
|
|
640
|
+
const paths = getAgentPaths();
|
|
641
|
+
const targetPath = paths[agentId];
|
|
611
642
|
const url = `${(options.baseUrl || "https://armordesk.crusts.dev").replace(/\/$/, "")}/api/mcp/gateway`;
|
|
612
643
|
const tenant = options.tenantId || "acme-corp";
|
|
613
644
|
const token = options.token || `ak_live_${tenant}_key`;
|
|
@@ -616,6 +647,26 @@ function injectAgentMCP(agentId, options) {
|
|
|
616
647
|
(0, import_node_fs2.mkdirSync)(dir, { recursive: true });
|
|
617
648
|
}
|
|
618
649
|
try {
|
|
650
|
+
if (agentId === "antigravity") {
|
|
651
|
+
let cfg = {};
|
|
652
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
653
|
+
try {
|
|
654
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
655
|
+
} catch {
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
659
|
+
cfg.mcpServers.armordesk = {
|
|
660
|
+
serverUrl: url,
|
|
661
|
+
disabled: false,
|
|
662
|
+
headers: {
|
|
663
|
+
"X-ArmorIQ-Tenant": tenant,
|
|
664
|
+
Authorization: `Bearer ${token}`
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
668
|
+
return { success: true, configPath: targetPath, message: "Antigravity CLI MCP configuration updated." };
|
|
669
|
+
}
|
|
619
670
|
if (agentId === "opencode") {
|
|
620
671
|
let cfg = {};
|
|
621
672
|
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
@@ -637,13 +688,38 @@ function injectAgentMCP(agentId, options) {
|
|
|
637
688
|
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
638
689
|
return { success: true, configPath: targetPath, message: "OpenCode config updated successfully." };
|
|
639
690
|
}
|
|
691
|
+
if (agentId === "codex") {
|
|
692
|
+
let content = "";
|
|
693
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
694
|
+
content = (0, import_node_fs2.readFileSync)(targetPath, "utf8");
|
|
695
|
+
}
|
|
696
|
+
if (content.includes("armordesk")) {
|
|
697
|
+
return { success: true, configPath: targetPath, message: "Codex config already contains armordesk MCP server." };
|
|
698
|
+
}
|
|
699
|
+
const codexSnippet = `
|
|
700
|
+
# ArmorDesk Governed MCP Gateway
|
|
701
|
+
[mcp_servers.armordesk]
|
|
702
|
+
command = "npx"
|
|
703
|
+
args = ["-y", "@modelcontextprotocol/server-fetch", "${url}"]
|
|
704
|
+
|
|
705
|
+
[mcp_servers.armordesk.env]
|
|
706
|
+
ARMORIQ_TENANT = "${tenant}"
|
|
707
|
+
ARMORIQ_API_KEY = "${token}"
|
|
708
|
+
`;
|
|
709
|
+
(0, import_node_fs2.writeFileSync)(targetPath, content + codexSnippet, "utf8");
|
|
710
|
+
return { success: true, configPath: targetPath, message: "OpenAI Codex config.toml updated successfully." };
|
|
711
|
+
}
|
|
640
712
|
if (agentId === "hermes" || agentId === "openclaw") {
|
|
641
713
|
let content = "";
|
|
642
714
|
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
643
715
|
content = (0, import_node_fs2.readFileSync)(targetPath, "utf8");
|
|
644
716
|
}
|
|
645
717
|
if (content.includes("armordesk:")) {
|
|
646
|
-
return {
|
|
718
|
+
return {
|
|
719
|
+
success: true,
|
|
720
|
+
configPath: targetPath,
|
|
721
|
+
message: `${agentId === "hermes" ? "Hermes" : "OpenClaw"} config already has armordesk configured.`
|
|
722
|
+
};
|
|
647
723
|
}
|
|
648
724
|
const snippet = `
|
|
649
725
|
# ArmorDesk Governed MCP Gateway
|
|
@@ -655,9 +731,13 @@ mcp_servers:
|
|
|
655
731
|
Authorization: "Bearer ${token}"
|
|
656
732
|
`;
|
|
657
733
|
(0, import_node_fs2.writeFileSync)(targetPath, content + snippet, "utf8");
|
|
658
|
-
return {
|
|
734
|
+
return {
|
|
735
|
+
success: true,
|
|
736
|
+
configPath: targetPath,
|
|
737
|
+
message: `${agentId === "hermes" ? "Hermes Agent" : "OpenClaw Agent"} config updated successfully.`
|
|
738
|
+
};
|
|
659
739
|
}
|
|
660
|
-
if (agentId === "claude"
|
|
740
|
+
if (agentId === "claude") {
|
|
661
741
|
let cfg = {};
|
|
662
742
|
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
663
743
|
try {
|
|
@@ -666,27 +746,105 @@ mcp_servers:
|
|
|
666
746
|
}
|
|
667
747
|
}
|
|
668
748
|
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
}
|
|
749
|
+
cfg.mcpServers.armordesk_gateway = {
|
|
750
|
+
command: "npx",
|
|
751
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
752
|
+
env: {
|
|
753
|
+
ARMORIQ_TENANT: tenant,
|
|
754
|
+
ARMORIQ_API_KEY: token
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
758
|
+
return { success: true, configPath: targetPath, message: "Claude Desktop MCP configuration updated." };
|
|
759
|
+
}
|
|
760
|
+
if (agentId === "cursor" || agentId === "windsurf") {
|
|
761
|
+
let cfg = {};
|
|
762
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
763
|
+
try {
|
|
764
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
765
|
+
} catch {
|
|
766
|
+
}
|
|
686
767
|
}
|
|
768
|
+
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
769
|
+
cfg.mcpServers.armordesk = {
|
|
770
|
+
url,
|
|
771
|
+
headers: {
|
|
772
|
+
"X-ArmorIQ-Tenant": tenant,
|
|
773
|
+
Authorization: `Bearer ${token}`
|
|
774
|
+
}
|
|
775
|
+
};
|
|
687
776
|
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
688
777
|
return { success: true, configPath: targetPath, message: `${agentId.toUpperCase()} MCP configuration updated.` };
|
|
689
778
|
}
|
|
779
|
+
if (agentId === "cline" || agentId === "roocode") {
|
|
780
|
+
let cfg = {};
|
|
781
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
782
|
+
try {
|
|
783
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
784
|
+
} catch {
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
if (!cfg.mcpServers) cfg.mcpServers = {};
|
|
788
|
+
cfg.mcpServers.armordesk = {
|
|
789
|
+
command: "npx",
|
|
790
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
791
|
+
env: {
|
|
792
|
+
ARMORIQ_TENANT: tenant,
|
|
793
|
+
ARMORIQ_API_KEY: token
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
797
|
+
return {
|
|
798
|
+
success: true,
|
|
799
|
+
configPath: targetPath,
|
|
800
|
+
message: `${agentId === "cline" ? "Cline" : "Roo Code"} MCP settings updated.`
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
if (agentId === "continue") {
|
|
804
|
+
let cfg = {};
|
|
805
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
806
|
+
try {
|
|
807
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
808
|
+
} catch {
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
if (!Array.isArray(cfg.mcpServers)) cfg.mcpServers = [];
|
|
812
|
+
const filtered = cfg.mcpServers.filter((s) => s.name !== "armordesk");
|
|
813
|
+
filtered.push({
|
|
814
|
+
name: "armordesk",
|
|
815
|
+
command: "npx",
|
|
816
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
817
|
+
env: {
|
|
818
|
+
ARMORIQ_TENANT: tenant,
|
|
819
|
+
ARMORIQ_API_KEY: token
|
|
820
|
+
}
|
|
821
|
+
});
|
|
822
|
+
cfg.mcpServers = filtered;
|
|
823
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
824
|
+
return { success: true, configPath: targetPath, message: "Continue.dev configuration updated." };
|
|
825
|
+
}
|
|
826
|
+
if (agentId === "zed") {
|
|
827
|
+
let cfg = {};
|
|
828
|
+
if ((0, import_node_fs2.existsSync)(targetPath)) {
|
|
829
|
+
try {
|
|
830
|
+
cfg = JSON.parse((0, import_node_fs2.readFileSync)(targetPath, "utf8"));
|
|
831
|
+
} catch {
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
if (!cfg.experimental) cfg.experimental = {};
|
|
835
|
+
if (!cfg.experimental.model_context_protocol) cfg.experimental.model_context_protocol = {};
|
|
836
|
+
if (!cfg.experimental.model_context_protocol.servers) cfg.experimental.model_context_protocol.servers = {};
|
|
837
|
+
cfg.experimental.model_context_protocol.servers.armordesk = {
|
|
838
|
+
command: "npx",
|
|
839
|
+
args: ["-y", "@modelcontextprotocol/server-fetch", url],
|
|
840
|
+
env: {
|
|
841
|
+
ARMORIQ_TENANT: tenant,
|
|
842
|
+
ARMORIQ_API_KEY: token
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
(0, import_node_fs2.writeFileSync)(targetPath, JSON.stringify(cfg, null, 2), "utf8");
|
|
846
|
+
return { success: true, configPath: targetPath, message: "Zed IDE settings updated." };
|
|
847
|
+
}
|
|
690
848
|
} catch (err) {
|
|
691
849
|
return { success: false, configPath: targetPath, message: err.message };
|
|
692
850
|
}
|
|
@@ -739,6 +897,7 @@ You are operating under enterprise governance enforced by the ArmorDesk Control
|
|
|
739
897
|
hashSha256,
|
|
740
898
|
injectAgentMCP,
|
|
741
899
|
loadStoredConfig,
|
|
900
|
+
resolveAgentAlias,
|
|
742
901
|
saveStoredConfig,
|
|
743
902
|
verifyMerkleRoot,
|
|
744
903
|
verifyProof
|
package/dist/index.mjs
CHANGED
|
@@ -14,10 +14,11 @@ import {
|
|
|
14
14
|
hashSha256,
|
|
15
15
|
injectAgentMCP,
|
|
16
16
|
loadStoredConfig,
|
|
17
|
+
resolveAgentAlias,
|
|
17
18
|
saveStoredConfig,
|
|
18
19
|
verifyMerkleRoot,
|
|
19
20
|
verifyProof
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HWPT3W34.mjs";
|
|
21
22
|
export {
|
|
22
23
|
ArmorDeskClient,
|
|
23
24
|
buildMerkleTree,
|
|
@@ -34,6 +35,7 @@ export {
|
|
|
34
35
|
hashSha256,
|
|
35
36
|
injectAgentMCP,
|
|
36
37
|
loadStoredConfig,
|
|
38
|
+
resolveAgentAlias,
|
|
37
39
|
saveStoredConfig,
|
|
38
40
|
verifyMerkleRoot,
|
|
39
41
|
verifyProof
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crustdev/armordesk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Official TypeScript SDK and CLI for ArmorDesk: Enterprise AI Agent Control Plane, Governed MCP Gateway, and Cryptographic Trust Center.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|