multi-agents-cli 1.0.77 → 1.0.79
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 +14 -1
- package/core/workflow/complete.js +37 -2
- package/package.json +1 -1
package/core/workflow/agent.js
CHANGED
|
@@ -1393,8 +1393,21 @@ ${excludedUrls}
|
|
|
1393
1393
|
separator();
|
|
1394
1394
|
console.log(`\n${bold(' Workspace is set up and ready.')}\n`);
|
|
1395
1395
|
|
|
1396
|
+
// Spinner — flushes terminal buffer and signals readiness before prompt renders
|
|
1397
|
+
await new Promise(resolve => {
|
|
1398
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
1399
|
+
let i = 0;
|
|
1400
|
+
const spin = setInterval(() => {
|
|
1401
|
+
process.stdout.write(`\r ${frames[i++ % frames.length]} Preparing session...`);
|
|
1402
|
+
}, 60);
|
|
1403
|
+
setTimeout(() => {
|
|
1404
|
+
clearInterval(spin);
|
|
1405
|
+
process.stdout.write('\r' + ' '.repeat(30) + '\r');
|
|
1406
|
+
resolve();
|
|
1407
|
+
}, 600);
|
|
1408
|
+
});
|
|
1409
|
+
|
|
1396
1410
|
sessionLoop: while (true) {
|
|
1397
|
-
process.stdout.write("\n");
|
|
1398
1411
|
const sessionIdx = await arrowSelect('How would you like to start the session?', [
|
|
1399
1412
|
{ label: `${green('→')} IDE + new terminal ${dim('(Claude Code CLI)')} ${dim('← recommended')}` },
|
|
1400
1413
|
{ label: `${green('→')} IDE only` },
|
|
@@ -268,13 +268,48 @@ const main = async () => {
|
|
|
268
268
|
separator();
|
|
269
269
|
console.log(`\n${bold('Completing task...')}\n`);
|
|
270
270
|
|
|
271
|
-
// ── Auto-commit uncommitted changes in worktree
|
|
271
|
+
// ── Auto-commit uncommitted changes in worktree (scope-aware staging) ─────────
|
|
272
272
|
|
|
273
273
|
try {
|
|
274
274
|
const status = execSync('git status --porcelain', { cwd: worktreePath, stdio: 'pipe' }).toString().trim();
|
|
275
275
|
if (status) {
|
|
276
276
|
console.log(` ${yellow('!')} Uncommitted changes detected - committing before merge...`);
|
|
277
|
-
|
|
277
|
+
|
|
278
|
+
// Stage only files matching the allowed scope patterns — never root-level framework files
|
|
279
|
+
const scopeJsonPath = path.join(worktreePath, 'scope.json');
|
|
280
|
+
const scopePolicyPath = path.join(ROOT, '.scaffold', 'scope-policy.json');
|
|
281
|
+
let stagedWithScope = false;
|
|
282
|
+
|
|
283
|
+
if (fs.existsSync(scopeJsonPath) && fs.existsSync(scopePolicyPath)) {
|
|
284
|
+
const scopeMeta = JSON.parse(fs.readFileSync(scopeJsonPath, 'utf8'));
|
|
285
|
+
const scopePolicy = JSON.parse(fs.readFileSync(scopePolicyPath, 'utf8'));
|
|
286
|
+
const policyScope = scopePolicy[scopeMeta.policy];
|
|
287
|
+
const agentKey = scopeMeta.agent && scopeMeta.agent.toUpperCase();
|
|
288
|
+
const override = policyScope && policyScope.agentOverrides && policyScope.agentOverrides[agentKey];
|
|
289
|
+
const cfg = JSON.parse(fs.readFileSync(path.join(ROOT, '.scaffold', '.config.json'), 'utf8'));
|
|
290
|
+
const scaffolded = (cfg.scaffolded || {})[scopeMeta.scope];
|
|
291
|
+
const overrideActive = override && (!override.onlyBeforeScaffolded || !scaffolded);
|
|
292
|
+
const allowed = (overrideActive && override.allowed) || (policyScope && policyScope.allowed) || [];
|
|
293
|
+
|
|
294
|
+
if (allowed.length > 0) {
|
|
295
|
+
// Stage each allowed pattern individually
|
|
296
|
+
for (const pat of allowed) {
|
|
297
|
+
const target = pat.endsWith('/**') ? pat.slice(0, -3) : pat;
|
|
298
|
+
try {
|
|
299
|
+
execSync(`git add ${target}`, { cwd: worktreePath, stdio: 'pipe' });
|
|
300
|
+
} catch { /* pattern may not exist in this worktree */ }
|
|
301
|
+
}
|
|
302
|
+
stagedWithScope = true;
|
|
303
|
+
console.log(` ${green('✓')} Staged scope-allowed files only (${allowed.join(', ')})`);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (!stagedWithScope) {
|
|
308
|
+
// Fallback — no scope info, stage everything
|
|
309
|
+
execSync('git add .', { cwd: worktreePath, stdio: 'pipe' });
|
|
310
|
+
console.log(` ${yellow('!')} No scope info found - staged all files`);
|
|
311
|
+
}
|
|
312
|
+
|
|
278
313
|
execSync(`git commit -m "feat: task completion commit [${branchName}]"`, { cwd: worktreePath, stdio: 'pipe' });
|
|
279
314
|
console.log(` ${green('✓')} Changes committed`);
|
|
280
315
|
} else {
|
package/package.json
CHANGED