delimit-cli 4.1.13 → 4.1.15

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.
@@ -767,23 +767,44 @@ exit 127
767
767
  fs.chmodSync(shimPath, '755');
768
768
  }
769
769
 
770
- // Add to PATH in shell rc files
770
+ // Add to PATH in shell rc files (create if missing)
771
771
  const pathLine = `export PATH="${shimsDir}:$PATH" # Delimit governance wrapping`;
772
- for (const rc of ['.bashrc', '.zshrc']) {
772
+ let pathWritten = false;
773
+ for (const rc of ['.bashrc', '.zshrc', '.profile']) {
773
774
  const rcPath = path.join(os.homedir(), rc);
774
- if (fs.existsSync(rcPath)) {
775
- const content = fs.readFileSync(rcPath, 'utf-8');
776
- if (!content.includes('.delimit/shims')) {
777
- fs.appendFileSync(rcPath, `\n# Delimit governance wrapping\n${pathLine}\n`);
775
+ try {
776
+ if (fs.existsSync(rcPath)) {
777
+ const content = fs.readFileSync(rcPath, 'utf-8');
778
+ if (!content.includes('.delimit/shims')) {
779
+ fs.appendFileSync(rcPath, `\n# Delimit governance wrapping\n${pathLine}\n`);
780
+ }
781
+ pathWritten = true;
778
782
  }
779
- }
783
+ } catch { /* skip unreadable files */ }
780
784
  }
785
+ // If no rc files exist, create .bashrc with the PATH export
786
+ if (!pathWritten) {
787
+ const bashrc = path.join(os.homedir(), '.bashrc');
788
+ fs.writeFileSync(bashrc, `# Delimit governance wrapping\n${pathLine}\n`);
789
+ pathWritten = true;
790
+ }
791
+ // Also write to /etc/profile.d/ if writable (login shells)
792
+ try {
793
+ const profileD = '/etc/profile.d/delimit-shims.sh';
794
+ if (!fs.existsSync(profileD)) {
795
+ fs.writeFileSync(profileD, `# Delimit governance wrapping\n${pathLine}\n`);
796
+ }
797
+ } catch { /* not writable, skip */ }
781
798
 
782
799
  if (shimsInstalled) {
783
800
  await logp(` ${green('✓')} Governance shims updated`);
784
801
  } else {
785
802
  log(` ${green('✓')} Governance wrapping enabled`);
786
- log(` ${dim(' Restart your terminal or run: source ~/.bashrc')}`);
803
+ log('');
804
+ log(` ${bold('To activate now, run:')}`);
805
+ log(` ${green('source ~/.bashrc')}`);
806
+ log('');
807
+ log(` ${dim('Or restart your terminal. The banner appears before each AI session.')}`);
787
808
  }
788
809
  } else {
789
810
  log(` ${dim(' Skipped. Enable later: delimit shims enable')}`);
@@ -338,7 +338,8 @@ function installClaudeHooks(tool, hookConfig) {
338
338
  fs.mkdirSync(hooksDir, { recursive: true });
339
339
  const hookScript = path.join(hooksDir, 'delimit');
340
340
  const delimitHome = path.join(home, '.delimit');
341
- fs.writeFileSync(hookScript, `#!/bin/bash
341
+ // Write hook script — use explicit newline prefix to avoid terminal escape contamination
342
+ const scriptContent = '#!/bin/bash\n' + `
342
343
  # Delimit SessionStart — generated by delimit-cli setup
343
344
  DELIMIT_HOME="\${DELIMIT_HOME:-${delimitHome}}"
344
345
  echo "=== Delimit Status ==="
@@ -378,7 +379,8 @@ if [ -d "$SESSIONS" ]; then
378
379
  [ -n "$LATEST" ] && python3 -c "import json; d=json.load(open('$LATEST')); s=d.get('summary','')[:150]; print(f'Last session: {s}')" 2>/dev/null
379
380
  fi
380
381
  echo "=== Delimit Ready ==="
381
- `);
382
+ `;
383
+ fs.writeFileSync(hookScript, scriptContent);
382
384
  fs.chmodSync(hookScript, '755');
383
385
 
384
386
  if (!config.hooks.SessionStart) {
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": "4.1.13",
4
+ "version": "4.1.15",
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": [