@agentvalet/register 1.0.3 → 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.
Files changed (2) hide show
  1. package/dist/index.js +46 -0
  2. package/package.json +1 -1
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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvalet/register",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Self-register AI agents with AgentValet",
5
5
  "type": "module",
6
6
  "bin": {