@agentvalet/register 1.0.3 → 1.1.1
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/index.js
CHANGED
|
@@ -713,6 +713,19 @@ function codexDesktopInstalled() {
|
|
|
713
713
|
}
|
|
714
714
|
return existsSync3("/usr/share/applications/codex.desktop") || existsSync3(path2.join(home, ".local", "share", "applications", "codex.desktop"));
|
|
715
715
|
}
|
|
716
|
+
function claudeDesktopInstalled() {
|
|
717
|
+
const home = os.homedir();
|
|
718
|
+
const platform = process.platform;
|
|
719
|
+
if (platform === "darwin") {
|
|
720
|
+
return existsSync3("/Applications/Claude.app") || existsSync3(path2.join(home, "Library", "Application Support", "Claude"));
|
|
721
|
+
}
|
|
722
|
+
if (platform === "win32") {
|
|
723
|
+
const appData = process.env.APPDATA ?? path2.join(home, "AppData", "Roaming");
|
|
724
|
+
const localAppData = process.env.LOCALAPPDATA ?? path2.join(home, "AppData", "Local");
|
|
725
|
+
return existsSync3(path2.join(appData, "Claude")) || existsSync3(path2.join(localAppData, "AnthropicClaude")) || existsSync3(path2.join(localAppData, "Programs", "claude"));
|
|
726
|
+
}
|
|
727
|
+
return existsSync3(path2.join(home, ".config", "Claude"));
|
|
728
|
+
}
|
|
716
729
|
function cursorInstalled() {
|
|
717
730
|
const home = os.homedir();
|
|
718
731
|
const platform = process.platform;
|
|
@@ -732,6 +745,7 @@ function detectFrameworks() {
|
|
|
732
745
|
codex: existsSync3(path2.join(home, ".codex")) || tryBinary("codex"),
|
|
733
746
|
codexDesktop: codexDesktopInstalled(),
|
|
734
747
|
claudeCode: existsSync3(path2.join(home, ".claude")) || tryBinary("claude"),
|
|
748
|
+
claudeDesktop: claudeDesktopInstalled(),
|
|
735
749
|
cursor: existsSync3(path2.join(process.cwd(), ".cursor")) || cursorInstalled(),
|
|
736
750
|
cursorCli: tryBinary("cursor-agent"),
|
|
737
751
|
openclaw: existsSync3(path2.join(home, ".openclaw")),
|
|
@@ -740,6 +754,7 @@ function detectFrameworks() {
|
|
|
740
754
|
}
|
|
741
755
|
function resolveAgentType(detected) {
|
|
742
756
|
if (detected.claudeCode) return "claude-code";
|
|
757
|
+
if (detected.claudeDesktop) return "claude-desktop";
|
|
743
758
|
if (detected.codexDesktop) return "codex-desktop";
|
|
744
759
|
if (detected.codex) return "codex-cli";
|
|
745
760
|
if (detected.cursor) return "cursor-ide";
|
|
@@ -754,6 +769,9 @@ async function frameworkSetupConsent(detected) {
|
|
|
754
769
|
items.push("Claude Code \u2192 .mcp.json (MCP server)");
|
|
755
770
|
items.push(" \u2192 CLAUDE.md (usage rules)");
|
|
756
771
|
}
|
|
772
|
+
if (detected.claudeDesktop) {
|
|
773
|
+
items.push("Claude Desktop \u2192 claude_desktop_config.json (MCP server)");
|
|
774
|
+
}
|
|
757
775
|
if (detected.cursor || detected.cursorCli) {
|
|
758
776
|
const surfaces = [];
|
|
759
777
|
if (detected.cursor) surfaces.push("IDE");
|
|
@@ -965,7 +983,9 @@ function ensureMcpJson() {
|
|
|
965
983
|
const { agentId, ownerId, apiUrl, keyPath } = creds;
|
|
966
984
|
servers["agentvalet"] = {
|
|
967
985
|
command: "npx",
|
|
968
|
-
|
|
986
|
+
// Pin @latest — unversioned lets npx reuse a stale global install that
|
|
987
|
+
// shadows the current build (see apps/cli/src/config/ide.ts).
|
|
988
|
+
args: ["-y", "@agentvalet/register@latest", "mcp-server"],
|
|
969
989
|
env: {
|
|
970
990
|
AGENT_ID: agentId,
|
|
971
991
|
OWNER_ID: ownerId,
|
|
@@ -1167,7 +1187,11 @@ import os2 from "os";
|
|
|
1167
1187
|
function buildMcpEntry(params) {
|
|
1168
1188
|
return {
|
|
1169
1189
|
command: "npx",
|
|
1170
|
-
|
|
1190
|
+
// Pin @latest so npx always resolves the published version from the registry.
|
|
1191
|
+
// Unversioned `@agentvalet/register` lets npx silently reuse a stale global
|
|
1192
|
+
// install (e.g. an old 0.5.0 bundling mcp-server@0.2.1), which shadows the
|
|
1193
|
+
// current build and drops newer tool params like use_platform's connection_id.
|
|
1194
|
+
args: ["-y", "@agentvalet/register@latest", "mcp-server"],
|
|
1171
1195
|
env: {
|
|
1172
1196
|
AGENT_ID: params.agentId,
|
|
1173
1197
|
OWNER_ID: params.ownerId,
|
|
@@ -1176,6 +1200,22 @@ function buildMcpEntry(params) {
|
|
|
1176
1200
|
}
|
|
1177
1201
|
};
|
|
1178
1202
|
}
|
|
1203
|
+
function claudeDesktopConfigPath() {
|
|
1204
|
+
const home = os2.homedir();
|
|
1205
|
+
if (process.platform === "darwin") {
|
|
1206
|
+
return path5.join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
1207
|
+
}
|
|
1208
|
+
if (process.platform === "win32") {
|
|
1209
|
+
const appData = process.env.APPDATA ?? path5.join(home, "AppData", "Roaming");
|
|
1210
|
+
return path5.join(appData, "Claude", "claude_desktop_config.json");
|
|
1211
|
+
}
|
|
1212
|
+
return path5.join(home, ".config", "Claude", "claude_desktop_config.json");
|
|
1213
|
+
}
|
|
1214
|
+
function claudeDesktopFriendly() {
|
|
1215
|
+
if (process.platform === "darwin") return "~/Library/Application Support/Claude/claude_desktop_config.json";
|
|
1216
|
+
if (process.platform === "win32") return "%APPDATA%\\Claude\\claude_desktop_config.json";
|
|
1217
|
+
return "~/.config/Claude/claude_desktop_config.json";
|
|
1218
|
+
}
|
|
1179
1219
|
async function mergeJsonFile(filePath, key, value) {
|
|
1180
1220
|
let existing = {};
|
|
1181
1221
|
if (existsSync6(filePath)) {
|
|
@@ -1236,7 +1276,7 @@ function buildCodexTomlBlock(params) {
|
|
|
1236
1276
|
return `
|
|
1237
1277
|
[mcp_servers.agentvalet]
|
|
1238
1278
|
command = "npx"
|
|
1239
|
-
args = ["-y", "@agentvalet/register", "mcp-server"]
|
|
1279
|
+
args = ["-y", "@agentvalet/register@latest", "mcp-server"]
|
|
1240
1280
|
env = { AGENT_ID = "${params.agentId}", OWNER_ID = "${params.ownerId}", PROXY_URL = "${params.proxyUrl}", AGENT_PRIVATE_KEY_PATH = "${params.keyPath.replace(/\\/g, "/")}" }
|
|
1241
1281
|
`;
|
|
1242
1282
|
}
|
|
@@ -1321,6 +1361,16 @@ async function writeIdeConfigs(params) {
|
|
|
1321
1361
|
const home = os2.homedir();
|
|
1322
1362
|
const written = [];
|
|
1323
1363
|
const entry = buildMcpEntry(mcpParams);
|
|
1364
|
+
if (detected.claudeDesktop) {
|
|
1365
|
+
const desktopConfig = claudeDesktopConfigPath();
|
|
1366
|
+
try {
|
|
1367
|
+
await mkdir3(path5.dirname(desktopConfig), { recursive: true });
|
|
1368
|
+
await mergeJsonFile(desktopConfig, "agentvalet", entry);
|
|
1369
|
+
written.push(claudeDesktopFriendly());
|
|
1370
|
+
} catch (err) {
|
|
1371
|
+
console.warn(` Warning: could not write Claude Desktop config: ${err.message}`);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1324
1374
|
if (scope === "user") {
|
|
1325
1375
|
if (detected.claudeCode) {
|
|
1326
1376
|
const claudeUserConfig = path5.join(home, ".claude.json");
|
|
@@ -1922,6 +1972,8 @@ function cleanLocally() {
|
|
|
1922
1972
|
if (stripMcpJson(resolve3(".factory/mcp.json"), { wrapped: false })) stripped.push(".factory/mcp.json");
|
|
1923
1973
|
const home = homedir();
|
|
1924
1974
|
if (stripMcpJson(join(home, ".claude.json"))) stripped.push("~/.claude.json");
|
|
1975
|
+
const claudeDesktopConfig = process.platform === "darwin" ? join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json") : process.platform === "win32" ? join(process.env.APPDATA ?? join(home, "AppData", "Roaming"), "Claude", "claude_desktop_config.json") : join(home, ".config", "Claude", "claude_desktop_config.json");
|
|
1976
|
+
if (stripMcpJson(claudeDesktopConfig)) stripped.push("claude_desktop_config.json");
|
|
1925
1977
|
if (stripMcpJson(join(home, ".cursor", "mcp.json"))) stripped.push("~/.cursor/mcp.json");
|
|
1926
1978
|
if (stripMcpJson(join(home, ".factory", "mcp.json"), { wrapped: false })) stripped.push("~/.factory/mcp.json");
|
|
1927
1979
|
if (stripCodexTomlAt(join(home, ".codex", "config.toml"))) stripped.push("~/.codex/config.toml");
|
|
@@ -2791,7 +2843,7 @@ program.command("refresh").description("Refresh approved permissions and update
|
|
|
2791
2843
|
}
|
|
2792
2844
|
});
|
|
2793
2845
|
program.command("mcp-server").description("Start the AgentValet MCP server (stdio transport)").action(async () => {
|
|
2794
|
-
const { mcpServerCommand } = await import("./mcp-server-
|
|
2846
|
+
const { mcpServerCommand } = await import("./mcp-server-MFHDR2TL.js");
|
|
2795
2847
|
await mcpServerCommand();
|
|
2796
2848
|
});
|
|
2797
2849
|
program.addCommand(listCommand());
|
|
@@ -16,7 +16,7 @@ function resolveMcpServerBin() {
|
|
|
16
16
|
}
|
|
17
17
|
async function mcpServerCommand() {
|
|
18
18
|
const binPath = resolveMcpServerBin();
|
|
19
|
-
const [cmd, args] = binPath ? [process.execPath, [binPath]] : ["npx", ["--yes", "@agentvalet/mcp-server"]];
|
|
19
|
+
const [cmd, args] = binPath ? [process.execPath, [binPath]] : ["npx", ["--yes", "@agentvalet/mcp-server@latest"]];
|
|
20
20
|
const child = spawn(cmd, args, {
|
|
21
21
|
stdio: "inherit",
|
|
22
22
|
env: process.env,
|