multi-agents-cli 1.1.45 → 1.1.47
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.
- package/core/workflow/agent.js +10 -9
- package/core/workflow/restart.js +43 -0
- package/init.js +30 -0
- package/package.json +1 -1
package/core/workflow/agent.js
CHANGED
|
@@ -182,6 +182,7 @@ const openTerminal = (worktreePath, skipPermissions = false) => {
|
|
|
182
182
|
try {
|
|
183
183
|
if (process.platform === 'darwin') {
|
|
184
184
|
execSync('osascript -e \'tell app "' + termCmd + '" to do script "cd \\"' + worktreePath + '\\" && ' + claudeCmd + '"\'', { stdio: 'pipe' });
|
|
185
|
+
try { execSync('osascript -e \'tell app "' + termCmd + '" to activate\'', { stdio: 'pipe' }); } catch {}
|
|
185
186
|
} else if (process.platform === 'win32') {
|
|
186
187
|
execSync('start ' + termCmd + ' /k "cd /d ' + worktreePath + ' && ' + claudeCmd + '"', { stdio: 'pipe' });
|
|
187
188
|
} else {
|
|
@@ -1741,9 +1742,9 @@ ${excludedUrls}
|
|
|
1741
1742
|
], rl);
|
|
1742
1743
|
|
|
1743
1744
|
if (sessionIdx === 0) {
|
|
1744
|
-
|
|
1745
|
-
console.log(
|
|
1746
|
-
|
|
1745
|
+
console.log('\n ' + '\x1b[36m' + '┌─────────────────────────────────────────┐' + '\x1b[0m');
|
|
1746
|
+
console.log(' ' + '\x1b[36m' + '│' + '\x1b[0m' + ' \x1b[1m\x1b[36m What happens next \x1b[0m' + '\x1b[36m│' + '\x1b[0m');
|
|
1747
|
+
console.log(' ' + '\x1b[36m' + '└─────────────────────────────────────────┘' + '\x1b[0m' + '\n');
|
|
1747
1748
|
console.log(` ${dim('→')} ${bold(config.ide.name || 'Your IDE')} will open at your agent workspace`);
|
|
1748
1749
|
console.log(` ${dim('→')} A new terminal window will open with Claude Code\n`);
|
|
1749
1750
|
console.log(` ${bold('Once open:')}
|
|
@@ -1764,9 +1765,9 @@ ${excludedUrls}
|
|
|
1764
1765
|
process.exit(0);
|
|
1765
1766
|
|
|
1766
1767
|
} else if (sessionIdx === 1) {
|
|
1767
|
-
|
|
1768
|
-
console.log(
|
|
1769
|
-
|
|
1768
|
+
console.log('\n ' + '\x1b[36m' + '┌─────────────────────────────────────────┐' + '\x1b[0m');
|
|
1769
|
+
console.log(' ' + '\x1b[36m' + '│' + '\x1b[0m' + ' \x1b[1m\x1b[36m What happens next \x1b[0m' + '\x1b[36m│' + '\x1b[0m');
|
|
1770
|
+
console.log(' ' + '\x1b[36m' + '└─────────────────────────────────────────┘' + '\x1b[0m' + '\n');
|
|
1770
1771
|
console.log(` ${dim('→')} ${bold(config.ide.name || 'Your IDE')} will open at your agent workspace\n`);
|
|
1771
1772
|
console.log(` ${bold('Once open:')}
|
|
1772
1773
|
`);
|
|
@@ -1783,9 +1784,9 @@ ${excludedUrls}
|
|
|
1783
1784
|
process.exit(0);
|
|
1784
1785
|
|
|
1785
1786
|
} else if (sessionIdx === 2) {
|
|
1786
|
-
|
|
1787
|
-
console.log(
|
|
1788
|
-
|
|
1787
|
+
console.log('\n ' + '\x1b[36m' + '┌─────────────────────────────────────────┐' + '\x1b[0m');
|
|
1788
|
+
console.log(' ' + '\x1b[36m' + '│' + '\x1b[0m' + ' \x1b[1m\x1b[36m What happens next \x1b[0m' + '\x1b[36m│' + '\x1b[0m');
|
|
1789
|
+
console.log(' ' + '\x1b[36m' + '└─────────────────────────────────────────┘' + '\x1b[0m' + '\n');
|
|
1789
1790
|
console.log(` ${dim('→')} A new terminal window will open with Claude Code\n`);
|
|
1790
1791
|
console.log(` ${bold('Once open:')}
|
|
1791
1792
|
`);
|
package/core/workflow/restart.js
CHANGED
|
@@ -167,6 +167,49 @@ const wipeAgent = ({ scope, agent, branch, worktreePath }) => {
|
|
|
167
167
|
if (fs.existsSync(tmplPath)) {
|
|
168
168
|
fs.mkdirSync(scopeDir, { recursive: true });
|
|
169
169
|
fs.copyFileSync(tmplPath, claudePath);
|
|
170
|
+
// Substitute @config values from .config.json (primary) or git history (secondary)
|
|
171
|
+
try {
|
|
172
|
+
let restored = fs.readFileSync(claudePath, 'utf8');
|
|
173
|
+
const scopeCfg = config[scope] || {};
|
|
174
|
+
const configMap = {
|
|
175
|
+
PROJECT_NAME: config.projectName,
|
|
176
|
+
FRAMEWORK: scopeCfg.framework,
|
|
177
|
+
FRAMEWORK_VERSION: scopeCfg.frameworkVersion,
|
|
178
|
+
LANGUAGE: scopeCfg.language,
|
|
179
|
+
UI_LIBRARY: scopeCfg.uiLibrary,
|
|
180
|
+
STATE: scopeCfg.state,
|
|
181
|
+
STYLING: scopeCfg.styling,
|
|
182
|
+
ORM: scopeCfg.orm,
|
|
183
|
+
AUTH: scopeCfg.auth,
|
|
184
|
+
};
|
|
185
|
+
for (const [key, val] of Object.entries(configMap)) {
|
|
186
|
+
if (val) restored = restored.replace(
|
|
187
|
+
new RegExp(`(# @config ${key}\\s*:).*$`, 'm'), `$1 ${val}`
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
// Secondary: git history fallback if config values still missing
|
|
191
|
+
try {
|
|
192
|
+
const firstCommit = require('child_process').execSync(
|
|
193
|
+
`git log --all --reverse --format=%H -- ${scope}/CLAUDE.md`,
|
|
194
|
+
{ cwd: ROOT, stdio: 'pipe', encoding: 'utf8' }
|
|
195
|
+
).trim().split('\n')[0];
|
|
196
|
+
if (firstCommit) {
|
|
197
|
+
const oldContent = require('child_process').execSync(
|
|
198
|
+
`git show ${firstCommit}:${scope}/CLAUDE.md`,
|
|
199
|
+
{ cwd: ROOT, stdio: 'pipe', encoding: 'utf8' }
|
|
200
|
+
);
|
|
201
|
+
for (const line of oldContent.split('\n').filter(l => /^# @config \w/.test(l))) {
|
|
202
|
+
const m = line.match(/^# @config (\w+)\s*:\s*(.+)$/);
|
|
203
|
+
if (m && !configMap[m[1].trim()]) {
|
|
204
|
+
restored = restored.replace(
|
|
205
|
+
new RegExp(`(# @config ${m[1].trim()}\\s*:).*$`, 'm'), `$1 ${m[2].trim()}`
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
} catch {}
|
|
211
|
+
fs.writeFileSync(claudePath, restored, 'utf8');
|
|
212
|
+
} catch {}
|
|
170
213
|
}
|
|
171
214
|
}
|
|
172
215
|
} catch {}
|
package/init.js
CHANGED
|
@@ -503,6 +503,36 @@ const main = async () => {
|
|
|
503
503
|
});
|
|
504
504
|
console.log(` ${green('✓')} client/CLAUDE.md configured`);
|
|
505
505
|
|
|
506
|
+
// Persist resolved config to .scaffold/.config.json for recovery by restart/sync
|
|
507
|
+
try {
|
|
508
|
+
const scaffoldConfig = {
|
|
509
|
+
projectName,
|
|
510
|
+
client: {
|
|
511
|
+
framework: clientFw.value,
|
|
512
|
+
frameworkVersion: clientFwVersion || '',
|
|
513
|
+
language: clientLang,
|
|
514
|
+
state: clientState,
|
|
515
|
+
uiLibrary: clientUi,
|
|
516
|
+
styling: clientStyle,
|
|
517
|
+
},
|
|
518
|
+
};
|
|
519
|
+
if (backendType === 'separate') {
|
|
520
|
+
scaffoldConfig.backend = {
|
|
521
|
+
framework: backendFw,
|
|
522
|
+
frameworkVersion: answers.backendFwVersion || '',
|
|
523
|
+
language: backendLang,
|
|
524
|
+
orm: backendOrm,
|
|
525
|
+
auth: backendAuth,
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
fs.writeFileSync(
|
|
529
|
+
path.join(ROOT, '.scaffold', '.config.json'),
|
|
530
|
+
JSON.stringify(scaffoldConfig, null, 2) + '\n',
|
|
531
|
+
'utf8'
|
|
532
|
+
);
|
|
533
|
+
console.log(` ${green('✓')} .scaffold/.config.json written`);
|
|
534
|
+
} catch {}
|
|
535
|
+
|
|
506
536
|
if (backendType === 'separate') {
|
|
507
537
|
writeConfig(path.join(ROOT, 'backend', 'CLAUDE.md'), {
|
|
508
538
|
PROJECT_NAME: projectName,
|
package/package.json
CHANGED