delimit-cli 3.14.39 → 3.14.41

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.
@@ -74,18 +74,19 @@ function findSpecFiles(dir, depth = 0) {
74
74
  }
75
75
 
76
76
  async function main() {
77
- // Self-update check: ensure we're running the latest version
77
+ // Self-update check: ensure we're running the latest version (skip if already re-execed)
78
78
  const _pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf-8'));
79
- try {
80
- const latest = execSync('npm view delimit-cli version 2>/dev/null', { encoding: 'utf-8', timeout: 5000 }).trim();
81
- if (latest && latest !== _pkg.version && latest > _pkg.version) {
82
- log(dim(` Updating delimit-cli ${_pkg.version} -> ${latest}...`));
83
- execSync('npm install -g delimit-cli@latest 2>/dev/null', { stdio: 'pipe', timeout: 30000 });
84
- // Re-exec with the updated version from the NEW install location
85
- execSync('delimit-cli setup', { stdio: 'inherit' });
86
- process.exit(0);
87
- }
88
- } catch { /* offline or timeout — continue with current version */ }
79
+ if (!process.env.DELIMIT_SETUP_UPDATED) {
80
+ try {
81
+ const latest = execSync('npm view delimit-cli version 2>/dev/null', { encoding: 'utf-8', timeout: 5000 }).trim();
82
+ if (latest && latest !== _pkg.version && latest > _pkg.version) {
83
+ log(dim(` Updating delimit-cli ${_pkg.version} -> ${latest}...`));
84
+ execSync('npm install -g delimit-cli@latest 2>/dev/null', { stdio: 'pipe', timeout: 30000 });
85
+ execSync('delimit-cli setup', { stdio: 'inherit', env: { ...process.env, DELIMIT_SETUP_UPDATED: '1' } });
86
+ process.exit(0);
87
+ }
88
+ } catch { /* offline or timeout — continue with current version */ }
89
+ }
89
90
 
90
91
  log('');
91
92
  log(purple(' ____ ________ ______ _____________'));
@@ -321,19 +322,32 @@ async function main() {
321
322
  const serverDir = path.join(DELIMIT_HOME, 'server');
322
323
  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
324
 
324
- if (toml.includes('[mcp_servers.delimit]')) {
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`);
330
- configuredTools.push('Codex');
331
- } else {
332
- toml += correctEntry;
333
- fs.writeFileSync(CODEX_CONFIG, toml, { mode: 0o644 });
334
- await logp(` ${green('')} Added delimit to Codex (${CODEX_CONFIG})`);
335
- configuredTools.push('Codex');
325
+ // Remove ALL existing delimit MCP entries (prevents duplicates)
326
+ const existed = toml.includes('mcp_servers.delimit');
327
+ const lines = toml.split('\n');
328
+ const cleaned = [];
329
+ let skipBlock = false;
330
+ for (const line of lines) {
331
+ if (line.match(/^\[mcp_servers\.delimit/)) {
332
+ skipBlock = true;
333
+ continue;
334
+ }
335
+ if (skipBlock && (line.startsWith('[') || line.trim() === '')) {
336
+ if (line.startsWith('[') && !line.match(/^\[mcp_servers\.delimit/)) {
337
+ skipBlock = false;
338
+ cleaned.push(line);
339
+ }
340
+ continue;
341
+ }
342
+ if (!skipBlock) {
343
+ cleaned.push(line);
344
+ }
336
345
  }
346
+ toml = cleaned.join('\n').replace(/\n{3,}/g, '\n\n').trim();
347
+ toml += correctEntry;
348
+ fs.writeFileSync(CODEX_CONFIG, toml, { mode: 0o644 });
349
+ await logp(` ${green('✓')} ${existed ? 'Updated' : 'Added'} Delimit in Codex config`);
350
+ configuredTools.push('Codex');
337
351
  } catch (e) {
338
352
  log(` ${yellow('!')} Could not configure Codex: ${e.message}`);
339
353
  }
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.39",
4
+ "version": "3.14.41",
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": [