create-merlin-brain 5.3.1 → 5.3.2

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/bin/install.cjs +75 -0
  2. package/package.json +1 -1
package/bin/install.cjs CHANGED
@@ -1609,6 +1609,78 @@ async function install() {
1609
1609
  quiet: true, // step 2 already printed the detection summary
1610
1610
  });
1611
1611
 
1612
+ // Step 13.4: Allowlist codex Bash patterns (when Codex is installed)
1613
+ if (!process.env.MERLIN_SKIP_PERMISSIONS_PATCH) {
1614
+ try {
1615
+ const { execSync } = require('child_process');
1616
+ const codexInstalledScript = path.join(SCRIPTS_DIR, 'codex-installed.sh');
1617
+
1618
+ // Check if Codex is installed
1619
+ let isCodexInstalled = false;
1620
+ try {
1621
+ if (fs.existsSync(codexInstalledScript)) {
1622
+ execSync(`bash ${codexInstalledScript}`, { stdio: 'pipe' });
1623
+ isCodexInstalled = true;
1624
+ }
1625
+ } catch (err) {
1626
+ // Codex not installed, skip this step
1627
+ }
1628
+
1629
+ if (isCodexInstalled) {
1630
+ const settingsPath = path.join(CLAUDE_DIR, 'settings.json');
1631
+
1632
+ if (fs.existsSync(settingsPath)) {
1633
+ try {
1634
+ const settingsContent = fs.readFileSync(settingsPath, 'utf8');
1635
+ const settings = JSON.parse(settingsContent);
1636
+
1637
+ if (settings.permissions && Array.isArray(settings.permissions.allow)) {
1638
+ const codexRules = [
1639
+ 'Bash(which *)',
1640
+ 'Bash(codex *)',
1641
+ 'Bash(codex exec *)',
1642
+ 'Bash(merlin-codex *)',
1643
+ 'Bash(~/.claude/scripts/codex-as.sh *)',
1644
+ 'Bash(bash ~/.claude/scripts/codex-as.sh *)',
1645
+ 'Bash(~/.claude/scripts/duo-codex-call.sh *)',
1646
+ 'Bash(bash ~/.claude/scripts/duo-codex-call.sh *)',
1647
+ 'Bash(~/.claude/scripts/codex-installed.sh)',
1648
+ 'Bash(~/.claude/scripts/duo-*)',
1649
+ 'Bash(bash ~/.claude/scripts/duo-*)',
1650
+ 'mcp__merlin__*'
1651
+ ];
1652
+
1653
+ let addedCount = 0;
1654
+ for (const rule of codexRules) {
1655
+ if (!settings.permissions.allow.includes(rule)) {
1656
+ settings.permissions.allow.push(rule);
1657
+ addedCount++;
1658
+ }
1659
+ }
1660
+
1661
+ if (addedCount > 0) {
1662
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2), 'utf8');
1663
+ logSuccess(`Allowlisted codex/duo commands in ~/.claude/settings.json (${addedCount} new rules)`);
1664
+ } else if (process.env.MERLIN_INSTALL_VERBOSE) {
1665
+ log(` codex/duo Bash rules already allowlisted`);
1666
+ }
1667
+ } else {
1668
+ logWarn('permissions.allow not found in ~/.claude/settings.json — skipping codex allowlist');
1669
+ }
1670
+ } catch (parseErr) {
1671
+ logWarn(`Could not parse ~/.claude/settings.json — skipping codex allowlist: ${parseErr.message}`);
1672
+ }
1673
+ }
1674
+ // If settings.json doesn't exist, skip silently (don't create it from scratch)
1675
+ }
1676
+ } catch (err) {
1677
+ // Non-fatal: permissions patch failure does not block the installer
1678
+ if (process.env.MERLIN_INSTALL_VERBOSE) {
1679
+ logWarn(`Codex permissions patch skipped: ${err.message}`);
1680
+ }
1681
+ }
1682
+ }
1683
+
1612
1684
  // Step 13.5: Install priority design skills (async, non-blocking)
1613
1685
  if (!process.env.MERLIN_SKIP_DESIGN_SKILLS) {
1614
1686
  try {
@@ -1661,6 +1733,9 @@ ${colors.cyan}Universal Task Optimization (NEW in 5.3.0):${colors.reset}
1661
1733
  • ${colors.bright}/merlin:polish${colors.reset} - Animation polish via animation-expert
1662
1734
  • ${colors.bright}/merlin:redesign${colors.reset} - Full redesign via ui-builder
1663
1735
 
1736
+ ${colors.cyan}Duo permissions (NEW in 5.3.2):${colors.reset}
1737
+ • Auto-allowlist codex/duo Bash commands when Codex is installed
1738
+
1664
1739
  ${colors.cyan}Merlin works with or without Sights:${colors.reset}
1665
1740
  • ${colors.green}With Sights${colors.reset}: Instant context, cross-session memory
1666
1741
  • ${colors.green}Without${colors.reset}: Full workflows, uses file exploration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-merlin-brain",
3
- "version": "5.3.1",
3
+ "version": "5.3.2",
4
4
  "description": "Merlin - The Ultimate AI Brain for Claude Code, Codex, and other AI CLIs. One install: workflows, agents, loop, and Sights MCP server.",
5
5
  "type": "module",
6
6
  "main": "./dist/server/index.js",