@agentvalet/register 1.0.2 → 1.1.0
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");
|
|
@@ -1176,6 +1194,22 @@ function buildMcpEntry(params) {
|
|
|
1176
1194
|
}
|
|
1177
1195
|
};
|
|
1178
1196
|
}
|
|
1197
|
+
function claudeDesktopConfigPath() {
|
|
1198
|
+
const home = os2.homedir();
|
|
1199
|
+
if (process.platform === "darwin") {
|
|
1200
|
+
return path5.join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
1201
|
+
}
|
|
1202
|
+
if (process.platform === "win32") {
|
|
1203
|
+
const appData = process.env.APPDATA ?? path5.join(home, "AppData", "Roaming");
|
|
1204
|
+
return path5.join(appData, "Claude", "claude_desktop_config.json");
|
|
1205
|
+
}
|
|
1206
|
+
return path5.join(home, ".config", "Claude", "claude_desktop_config.json");
|
|
1207
|
+
}
|
|
1208
|
+
function claudeDesktopFriendly() {
|
|
1209
|
+
if (process.platform === "darwin") return "~/Library/Application Support/Claude/claude_desktop_config.json";
|
|
1210
|
+
if (process.platform === "win32") return "%APPDATA%\\Claude\\claude_desktop_config.json";
|
|
1211
|
+
return "~/.config/Claude/claude_desktop_config.json";
|
|
1212
|
+
}
|
|
1179
1213
|
async function mergeJsonFile(filePath, key, value) {
|
|
1180
1214
|
let existing = {};
|
|
1181
1215
|
if (existsSync6(filePath)) {
|
|
@@ -1321,6 +1355,16 @@ async function writeIdeConfigs(params) {
|
|
|
1321
1355
|
const home = os2.homedir();
|
|
1322
1356
|
const written = [];
|
|
1323
1357
|
const entry = buildMcpEntry(mcpParams);
|
|
1358
|
+
if (detected.claudeDesktop) {
|
|
1359
|
+
const desktopConfig = claudeDesktopConfigPath();
|
|
1360
|
+
try {
|
|
1361
|
+
await mkdir3(path5.dirname(desktopConfig), { recursive: true });
|
|
1362
|
+
await mergeJsonFile(desktopConfig, "agentvalet", entry);
|
|
1363
|
+
written.push(claudeDesktopFriendly());
|
|
1364
|
+
} catch (err) {
|
|
1365
|
+
console.warn(` Warning: could not write Claude Desktop config: ${err.message}`);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1324
1368
|
if (scope === "user") {
|
|
1325
1369
|
if (detected.claudeCode) {
|
|
1326
1370
|
const claudeUserConfig = path5.join(home, ".claude.json");
|
|
@@ -1922,6 +1966,8 @@ function cleanLocally() {
|
|
|
1922
1966
|
if (stripMcpJson(resolve3(".factory/mcp.json"), { wrapped: false })) stripped.push(".factory/mcp.json");
|
|
1923
1967
|
const home = homedir();
|
|
1924
1968
|
if (stripMcpJson(join(home, ".claude.json"))) stripped.push("~/.claude.json");
|
|
1969
|
+
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");
|
|
1970
|
+
if (stripMcpJson(claudeDesktopConfig)) stripped.push("claude_desktop_config.json");
|
|
1925
1971
|
if (stripMcpJson(join(home, ".cursor", "mcp.json"))) stripped.push("~/.cursor/mcp.json");
|
|
1926
1972
|
if (stripMcpJson(join(home, ".factory", "mcp.json"), { wrapped: false })) stripped.push("~/.factory/mcp.json");
|
|
1927
1973
|
if (stripCodexTomlAt(join(home, ".codex", "config.toml"))) stripped.push("~/.codex/config.toml");
|
|
@@ -2791,7 +2837,7 @@ program.command("refresh").description("Refresh approved permissions and update
|
|
|
2791
2837
|
}
|
|
2792
2838
|
});
|
|
2793
2839
|
program.command("mcp-server").description("Start the AgentValet MCP server (stdio transport)").action(async () => {
|
|
2794
|
-
const { mcpServerCommand } = await import("./mcp-server-
|
|
2840
|
+
const { mcpServerCommand } = await import("./mcp-server-77VYWZUZ.js");
|
|
2795
2841
|
await mcpServerCommand();
|
|
2796
2842
|
});
|
|
2797
2843
|
program.addCommand(listCommand());
|
|
@@ -2,35 +2,25 @@
|
|
|
2
2
|
import { spawn } from "child_process";
|
|
3
3
|
import { createRequire } from "module";
|
|
4
4
|
function resolveMcpServerBin() {
|
|
5
|
+
const require2 = createRequire(import.meta.url);
|
|
5
6
|
try {
|
|
6
|
-
const require2 = createRequire(import.meta.url);
|
|
7
7
|
return require2.resolve("@agentvalet/mcp-server/dist/index.js");
|
|
8
8
|
} catch {
|
|
9
9
|
try {
|
|
10
|
-
const require2 = createRequire(import.meta.url);
|
|
11
10
|
const pkgRoot = require2.resolve("@agentvalet/mcp-server/package.json");
|
|
12
11
|
return pkgRoot.replace("package.json", "dist/index.js");
|
|
13
12
|
} catch {
|
|
14
|
-
|
|
15
|
-
"@agentvalet/mcp-server is not installed. Run: npx @agentvalet/register"
|
|
16
|
-
);
|
|
13
|
+
return null;
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
17
|
async function mcpServerCommand() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} catch (err) {
|
|
25
|
-
process.stderr.write(
|
|
26
|
-
`[agentvalet] ${err instanceof Error ? err.message : String(err)}
|
|
27
|
-
`
|
|
28
|
-
);
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
const child = spawn(process.execPath, [binPath], {
|
|
18
|
+
const binPath = resolveMcpServerBin();
|
|
19
|
+
const [cmd, args] = binPath ? [process.execPath, [binPath]] : ["npx", ["--yes", "@agentvalet/mcp-server"]];
|
|
20
|
+
const child = spawn(cmd, args, {
|
|
32
21
|
stdio: "inherit",
|
|
33
|
-
env: process.env
|
|
22
|
+
env: process.env,
|
|
23
|
+
shell: process.platform === "win32"
|
|
34
24
|
});
|
|
35
25
|
child.on("error", (err) => {
|
|
36
26
|
process.stderr.write(`[agentvalet] Failed to start MCP server: ${err.message}
|
package/package.json
CHANGED
|
@@ -1,65 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@agentvalet/register",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Self-register AI agents with AgentValet",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"agentvalet-register": "dist/index.js"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"dist",
|
|
11
|
-
"README.md"
|
|
12
|
-
],
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
},
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"license": "MIT"
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentvalet/register",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Self-register AI agents with AgentValet",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agentvalet-register": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
15
|
+
"@octokit/auth-oauth-device": "^7.0.0",
|
|
16
|
+
"chalk": "^5.3.0",
|
|
17
|
+
"commander": "^12.0.0",
|
|
18
|
+
"conf": "^13.0.0",
|
|
19
|
+
"open": "^10.0.0",
|
|
20
|
+
"ora": "^8.0.1",
|
|
21
|
+
"prompts": "^2.4.2",
|
|
22
|
+
"undici": "^6.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^20.0.0",
|
|
26
|
+
"@types/prompts": "^2.4.0",
|
|
27
|
+
"tsup": "^8.0.0",
|
|
28
|
+
"tsx": "^4.0.0",
|
|
29
|
+
"typescript": "^5.0.0",
|
|
30
|
+
"vitest": "^1.5.0",
|
|
31
|
+
"@agentvalet/mcp-server": "^1.4.1"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18"
|
|
35
|
+
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/agentvalet/agentvalet.git"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://agentvalet.ai",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/agentvalet/agentvalet/issues"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [
|
|
48
|
+
"ai",
|
|
49
|
+
"agents",
|
|
50
|
+
"auth",
|
|
51
|
+
"credentials",
|
|
52
|
+
"mcp",
|
|
53
|
+
"valet",
|
|
54
|
+
"agentvalet"
|
|
55
|
+
],
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsup src/index.ts --format esm --dts --clean --shims",
|
|
59
|
+
"dev": "tsx src/index.ts",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"typecheck": "tsc --noEmit"
|
|
62
|
+
}
|
|
63
|
+
}
|