* Generate a thin delegate wrapper that forwards execution to the real script * in the Citadel install. This avoids copying scripts that import from * ../core/ and ../runtimes/ — paths that only exist inside the Citadel repo.
(scriptName)
| 101 | return Object.entries(PLANNING_DIRS_BY_BUNDLE) |
| 102 | .filter(([bundle]) => selected.has(bundle)) |
| 103 | .flatMap(([, directories]) => directories); |
| 104 | } |
| 105 | |
| 106 | function shouldSyncScripts() { |
| 107 | try { |
| 108 | const pkgPath = path.join(PLUGIN_ROOT, 'package.json'); |
| 109 | if (!fs.existsSync(pkgPath)) return true; // can't determine — sync to be safe |
| 110 | const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); |
| 111 | const pluginVersion = pkg.version || '0.0.0'; |
| 112 | |
| 113 | const versionFile = path.join(PROJECT_ROOT, '.citadel', 'version.txt'); |
| 114 | if (!fs.existsSync(versionFile)) return true; |
| 115 | |
| 116 | const installedVersion = fs.readFileSync(versionFile, 'utf8').trim(); |
| 117 | if (installedVersion !== pluginVersion) return true; |
| 118 |