@adrive/cli 1.1.2 → 1.1.3

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.
@@ -6,11 +6,13 @@ export function getAgentTargets(opts = {}) {
6
6
  const env = opts.env ?? process.env;
7
7
  const home = opts.home ?? homedir();
8
8
  const os = opts.osPlatform ?? platform();
9
+ // Linux apps (Electron, Zed) resolve their config under XDG_CONFIG_HOME; Zed on macOS always uses ~/.config.
10
+ const xdgConfig = env.XDG_CONFIG_HOME || join(home, '.config');
9
11
  const claudeDesktop = os === 'darwin'
10
12
  ? join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json')
11
13
  : os === 'win32'
12
14
  ? join(env.APPDATA ?? join(home, 'AppData', 'Roaming'), 'Claude', 'claude_desktop_config.json')
13
- : join(home, '.config', 'Claude', 'claude_desktop_config.json');
15
+ : join(xdgConfig, 'Claude', 'claude_desktop_config.json');
14
16
  return [
15
17
  {
16
18
  name: 'claude-desktop',
@@ -26,7 +28,7 @@ export function getAgentTargets(opts = {}) {
26
28
  },
27
29
  {
28
30
  name: 'zed',
29
- configPath: join(home, '.config', 'zed', 'settings.json'),
31
+ configPath: join(os === 'linux' ? xdgConfig : join(home, '.config'), 'zed', 'settings.json'),
30
32
  format: 'zed-json',
31
33
  platform: 'zed',
32
34
  },
@@ -34,7 +36,7 @@ export function getAgentTargets(opts = {}) {
34
36
  name: 'cline',
35
37
  configPath: os === 'darwin'
36
38
  ? join(home, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json')
37
- : join(home, '.config', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'),
39
+ : join(xdgConfig, 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json'),
38
40
  format: 'mcp-json',
39
41
  platform: 'cline',
40
42
  },
@@ -100,6 +102,7 @@ const CODEX_BLOCK = '[mcp_servers.agentdrive]\ncommand = "npx"\nargs = ["-y", "@
100
102
  // codex exec runs with approval policy "never", which refuses MCP calls unless the tool is pre-approved; only the read-only ones are.
101
103
  '\n[mcp_servers.agentdrive.tools.drive_sessions]\napproval_mode = "approve"\n' +
102
104
  '\n[mcp_servers.agentdrive.tools.drive_resume]\napproval_mode = "approve"\n';
105
+ const CODEX_BLOCK_TABLES = new Set(CODEX_BLOCK.match(/^\[.+\]$/gm));
103
106
  // Line-based so every table we don't own keeps its exact text. Drops our
104
107
  // [mcp_servers.agentdrive*] tables plus the [[mcp_servers]] name="agentdrive"
105
108
  // array entry older CLIs wrote, which would make the file invalid TOML next
@@ -116,8 +119,10 @@ export function mergeCodexToml(existing) {
116
119
  const header = section.split('\n', 1)[0].trim();
117
120
  if (i === 0 && !header.startsWith('['))
118
121
  return true;
119
- if (/^\[mcp_servers\.agentdrive(\.[^\]]+)?\]$/.test(header))
120
- return false;
122
+ if (/^\[mcp_servers\.agentdrive(\.[^\]]+)?\]$/.test(header)) {
123
+ // Approvals the user added for other agentdrive tools are theirs to keep.
124
+ return header.startsWith('[mcp_servers.agentdrive.tools.') && !CODEX_BLOCK_TABLES.has(header);
125
+ }
121
126
  if (header === '[[mcp_servers]]' && /^\s*name\s*=\s*"agentdrive"\s*$/m.test(section))
122
127
  return false;
123
128
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adrive/cli",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "AgentDrive CLI — cross-agent artifact workspace with provenance and portable storage across Claude Code, Codex, Cursor, and LangGraph.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -38,7 +38,7 @@
38
38
  "kleur": "^4.1.5",
39
39
  "open": "^10.1.0",
40
40
  "prompts": "^2.4.2",
41
- "@adrive/mcp-server": "^1.1.1"
41
+ "@adrive/mcp-server": "^1.1.2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^22.0.0",