delimit-cli 3.14.37 → 3.14.39

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.
@@ -277,21 +277,24 @@ async function main() {
277
277
  const serverPathAlt = path.join(DELIMIT_HOME, 'server', 'mcp-server.py');
278
278
  const actualServer = fs.existsSync(serverPath) ? serverPath : serverPathAlt;
279
279
 
280
- if (mcpConfig.mcpServers.delimit) {
281
- await logp(` ${green('✓')} Delimit MCP already configured`);
280
+ // Always update paths to match this machine's directory structure
281
+ const delimitMcp = {
282
+ type: 'stdio',
283
+ command: python,
284
+ args: [actualServer],
285
+ cwd: path.join(DELIMIT_HOME, 'server'),
286
+ env: {
287
+ PYTHONPATH: path.join(DELIMIT_HOME, 'server')
288
+ },
289
+ description: 'Delimit — AI agent guardrails'
290
+ };
291
+ const existed = !!mcpConfig.mcpServers.delimit;
292
+ mcpConfig.mcpServers.delimit = delimitMcp;
293
+ fs.writeFileSync(MCP_CONFIG, JSON.stringify(mcpConfig, null, 2));
294
+ if (existed) {
295
+ await logp(` ${green('✓')} Delimit MCP paths updated`);
282
296
  configuredTools.push('Claude Code');
283
297
  } else {
284
- mcpConfig.mcpServers.delimit = {
285
- type: 'stdio',
286
- command: python,
287
- args: [actualServer],
288
- cwd: path.join(DELIMIT_HOME, 'server'),
289
- env: {
290
- PYTHONPATH: path.join(DELIMIT_HOME, 'server')
291
- },
292
- description: 'Delimit — AI agent guardrails'
293
- };
294
- fs.writeFileSync(MCP_CONFIG, JSON.stringify(mcpConfig, null, 2));
295
298
  await logp(` ${green('✓')} Added delimit to ${MCP_CONFIG}`);
296
299
  configuredTools.push('Claude Code');
297
300
  }
@@ -315,13 +318,18 @@ async function main() {
315
318
  // Fix permissions on existing config
316
319
  fs.chmodSync(CODEX_CONFIG, 0o644);
317
320
  let toml = fs.readFileSync(CODEX_CONFIG, 'utf-8');
321
+ const serverDir = path.join(DELIMIT_HOME, 'server');
322
+ const correctEntry = `\n[mcp_servers.delimit]\ncommand = "${python}"\nargs = ["${actualServer}"]\ncwd = "${serverDir}"\n\n[mcp_servers.delimit.env]\nPYTHONPATH = "${serverDir}:${path.join(serverDir, 'ai')}"\n`;
323
+
318
324
  if (toml.includes('[mcp_servers.delimit]')) {
319
- await logp(` ${green('✓')} Delimit already in Codex config`);
325
+ // Remove old entry and replace with correct paths for this machine
326
+ toml = toml.replace(/\[mcp_servers\.delimit\][\s\S]*?(?=\n\[|\n*$)/, '').trim();
327
+ toml += correctEntry;
328
+ fs.writeFileSync(CODEX_CONFIG, toml, { mode: 0o644 });
329
+ await logp(` ${green('✓')} Updated Delimit paths in Codex config`);
320
330
  configuredTools.push('Codex');
321
331
  } else {
322
- const serverDir = path.join(DELIMIT_HOME, 'server');
323
- const codexEntry = `\n[mcp_servers.delimit]\ncommand = "${python}"\nargs = ["${actualServer}"]\ncwd = "${serverDir}"\n\n[mcp_servers.delimit.env]\nPYTHONPATH = "${serverDir}:${path.join(serverDir, 'ai')}"\n`;
324
- toml += codexEntry;
332
+ toml += correctEntry;
325
333
  fs.writeFileSync(CODEX_CONFIG, toml, { mode: 0o644 });
326
334
  await logp(` ${green('✓')} Added delimit to Codex (${CODEX_CONFIG})`);
327
335
  configuredTools.push('Codex');
@@ -340,17 +348,18 @@ async function main() {
340
348
  cursorConfig = JSON.parse(fs.readFileSync(CURSOR_CONFIG, 'utf-8'));
341
349
  }
342
350
  if (!cursorConfig.mcpServers) cursorConfig.mcpServers = {};
343
- if (cursorConfig.mcpServers.delimit) {
344
- await logp(` ${green('✓')} Delimit already in Cursor config`);
351
+ const cursorExisted = !!cursorConfig.mcpServers.delimit;
352
+ cursorConfig.mcpServers.delimit = {
353
+ command: python,
354
+ args: [actualServer],
355
+ cwd: path.join(DELIMIT_HOME, 'server'),
356
+ env: { PYTHONPATH: path.join(DELIMIT_HOME, 'server') }
357
+ };
358
+ fs.writeFileSync(CURSOR_CONFIG, JSON.stringify(cursorConfig, null, 2));
359
+ if (cursorExisted) {
360
+ await logp(` ${green('✓')} Updated Delimit paths in Cursor config`);
345
361
  configuredTools.push('Cursor');
346
362
  } else {
347
- cursorConfig.mcpServers.delimit = {
348
- command: python,
349
- args: [actualServer],
350
- cwd: path.join(DELIMIT_HOME, 'server'),
351
- env: { PYTHONPATH: path.join(DELIMIT_HOME, 'server') }
352
- };
353
- fs.writeFileSync(CURSOR_CONFIG, JSON.stringify(cursorConfig, null, 2));
354
363
  await logp(` ${green('✓')} Added delimit to Cursor (${CURSOR_CONFIG})`);
355
364
  configuredTools.push('Cursor');
356
365
  }
@@ -369,17 +378,18 @@ async function main() {
369
378
  geminiConfig = JSON.parse(fs.readFileSync(GEMINI_CONFIG, 'utf-8'));
370
379
  }
371
380
  if (!geminiConfig.mcpServers) geminiConfig.mcpServers = {};
372
- if (geminiConfig.mcpServers.delimit) {
373
- await logp(` ${green('✓')} Delimit already in Gemini CLI config`);
381
+ const geminiExisted = !!geminiConfig.mcpServers.delimit;
382
+ geminiConfig.mcpServers.delimit = {
383
+ command: python,
384
+ args: [actualServer],
385
+ cwd: path.join(DELIMIT_HOME, 'server'),
386
+ env: { PYTHONPATH: path.join(DELIMIT_HOME, 'server') }
387
+ };
388
+ fs.writeFileSync(GEMINI_CONFIG, JSON.stringify(geminiConfig, null, 2));
389
+ if (geminiExisted) {
390
+ await logp(` ${green('✓')} Updated Delimit paths in Gemini CLI config`);
374
391
  configuredTools.push('Gemini CLI');
375
392
  } else {
376
- geminiConfig.mcpServers.delimit = {
377
- command: python,
378
- args: [actualServer],
379
- cwd: path.join(DELIMIT_HOME, 'server'),
380
- env: { PYTHONPATH: path.join(DELIMIT_HOME, 'server') }
381
- };
382
- fs.writeFileSync(GEMINI_CONFIG, JSON.stringify(geminiConfig, null, 2));
383
393
  await logp(` ${green('✓')} Added delimit to Gemini CLI (${GEMINI_CONFIG})`);
384
394
  configuredTools.push('Gemini CLI');
385
395
  }
@@ -653,6 +663,8 @@ Run full governance compliance checks. Verify security, policy compliance, evide
653
663
  # Delimit Governance Shim for ${displayName}
654
664
  PURPLE='\\033[35m'; MAGENTA='\\033[91m'; ORANGE='\\033[33m'; GREEN='\\033[32m'
655
665
  WHITE='\\033[97m'; BOLD='\\033[1m'; DIM='\\033[2m'; RESET='\\033[0m'
666
+ # Fix config permissions before anything else
667
+ [ -f "$HOME/.codex/config.toml" ] && chmod 644 "$HOME/.codex/config.toml" 2>/dev/null
656
668
  if [ "$DELIMIT_WRAPPED" = "true" ] || [ ! -t 1 ]; then
657
669
  for c in /usr/bin/${toolName} /usr/local/bin/${toolName} $HOME/.local/bin/${toolName}; do
658
670
  [ -x "$c" ] && exec "$c" "$@"
@@ -664,8 +676,6 @@ fi
664
676
  npm install -g "delimit-cli@\$LATE" >/dev/null 2>&1 && delimit-cli setup >/dev/null 2>&1; \\
665
677
  fi ) &
666
678
  DELIMIT_HOME="\${DELIMIT_HOME:-$HOME/.delimit}"
667
- # Fix Codex config permissions if needed
668
- [ -f "$HOME/.codex/config.toml" ] && chmod 644 "$HOME/.codex/config.toml" 2>/dev/null
669
679
  TOOL_COUNT="0"
670
680
  if [ -f "$DELIMIT_HOME/server/ai/server.py" ]; then
671
681
  DECORATED=$(grep -c '@mcp.tool' "$DELIMIT_HOME/server/ai/server.py" 2>/dev/null || echo "0")
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "delimit-cli",
3
3
  "mcpName": "io.github.delimit-ai/delimit-mcp-server",
4
- "version": "3.14.37",
4
+ "version": "3.14.39",
5
5
  "description": "Unify Claude Code, Codex, Cursor, and Gemini CLI with persistent context, governance, and multi-model debate.",
6
6
  "main": "index.js",
7
7
  "files": [