multi-agents-cli 1.1.63 → 1.1.65
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 +12 -0
- package/core/workflow/complete.js +22 -7
- package/core/workflow/guards.js +35 -0
- package/init.js +8 -0
- package/package.json +1 -1
package/core/workflow/agent.js
CHANGED
|
@@ -1413,6 +1413,18 @@ Mark each step complete. Only proceed to the task below when all are checked.
|
|
|
1413
1413
|
backendLaunchTiming: 'now',
|
|
1414
1414
|
}, ROOT);
|
|
1415
1415
|
|
|
1416
|
+
// Relationship
|
|
1417
|
+
guards.updateRelationship(ROOT, {
|
|
1418
|
+
author: worktreeName,
|
|
1419
|
+
parent: `${project}/${agent}`,
|
|
1420
|
+
child: 'backend/INIT',
|
|
1421
|
+
type: 'spawn',
|
|
1422
|
+
at: timestamp,
|
|
1423
|
+
parentBranch: branchName,
|
|
1424
|
+
childBranch: beBranchName,
|
|
1425
|
+
status: 'active',
|
|
1426
|
+
});
|
|
1427
|
+
|
|
1416
1428
|
// TASKS_HISTORY
|
|
1417
1429
|
tasksHistory.ensureHistoryFile(ROOT);
|
|
1418
1430
|
tasksHistory.writeSessionEntry(ROOT, { scope: 'backend', agent: 'INIT', branch: beBranchName, task: beTask, launchedAt: new Date().toISOString() });
|
|
@@ -557,19 +557,34 @@ const main = async () => {
|
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
separator();
|
|
560
|
-
|
|
560
|
+
const boxWidth = 54;
|
|
561
|
+
const rev = (s) => `\x1b[7m${s}\x1b[27m`;
|
|
562
|
+
const pad = (s, w) => s + ' '.repeat(Math.max(0, w - s.length));
|
|
563
|
+
|
|
564
|
+
console.log('');
|
|
565
|
+
console.log(' ' + rev(' ' + pad(' What happens next', boxWidth) + ' '));
|
|
566
|
+
console.log(' ' + rev(' ' + pad('', boxWidth) + ' '));
|
|
561
567
|
|
|
562
568
|
if (nextAgent) {
|
|
563
|
-
console.log(
|
|
564
|
-
console.log(
|
|
565
|
-
console.log(` ${dim('Select: ' + nextScope + ' → ' + nextAgent)}`);
|
|
569
|
+
console.log(' ' + rev(' ' + pad(` -> Run: npm run agent`, boxWidth) + ' '));
|
|
570
|
+
console.log(' ' + rev(' ' + pad(` -> Select: ${nextScope} -> ${nextAgent}`, boxWidth) + ' '));
|
|
566
571
|
} else {
|
|
567
|
-
console.log(
|
|
572
|
+
console.log(' ' + rev(' ' + pad(` -> All agents complete - ready to deploy`, boxWidth) + ' '));
|
|
568
573
|
}
|
|
574
|
+
|
|
575
|
+
console.log(' ' + rev(' ' + pad('', boxWidth) + ' '));
|
|
576
|
+
console.log('');
|
|
569
577
|
} catch {
|
|
570
578
|
separator();
|
|
571
|
-
|
|
572
|
-
|
|
579
|
+
const boxWidth2 = 54;
|
|
580
|
+
const rev2 = (s) => `\x1b[7m${s}\x1b[27m`;
|
|
581
|
+
const pad2 = (s, w) => s + ' '.repeat(Math.max(0, w - s.length));
|
|
582
|
+
console.log('');
|
|
583
|
+
console.log(' ' + rev2(' ' + pad2(' What happens next', boxWidth2) + ' '));
|
|
584
|
+
console.log(' ' + rev2(' ' + pad2('', boxWidth2) + ' '));
|
|
585
|
+
console.log(' ' + rev2(' ' + pad2(` -> Run: npm run agent`, boxWidth2) + ' '));
|
|
586
|
+
console.log(' ' + rev2(' ' + pad2('', boxWidth2) + ' '));
|
|
587
|
+
console.log('');
|
|
573
588
|
}
|
|
574
589
|
|
|
575
590
|
console.log('\n');
|
package/core/workflow/guards.js
CHANGED
|
@@ -107,6 +107,39 @@ const loadTracking = (ROOT, config) => {
|
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
+
|
|
111
|
+
// ── Load relationships ────────────────────────────────────────────────────────
|
|
112
|
+
|
|
113
|
+
const loadRelationships = (ROOT) => {
|
|
114
|
+
const depPath = path.join(ROOT, '.scaffold', 'dependencies.json');
|
|
115
|
+
if (!fs.existsSync(depPath)) return { relationships: [] };
|
|
116
|
+
try {
|
|
117
|
+
return JSON.parse(fs.readFileSync(depPath, 'utf8'));
|
|
118
|
+
} catch {
|
|
119
|
+
console.log(yellow(' ⚠ dependencies.json is corrupt - resetting.'));
|
|
120
|
+
const fresh = { relationships: [] };
|
|
121
|
+
fs.writeFileSync(depPath, JSON.stringify(fresh, null, 2), 'utf8');
|
|
122
|
+
return fresh;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// ── Update relationship entry ─────────────────────────────────────────────────
|
|
127
|
+
|
|
128
|
+
const updateRelationship = (ROOT, entry) => {
|
|
129
|
+
const depPath = path.join(ROOT, '.scaffold', 'dependencies.json');
|
|
130
|
+
const deps = loadRelationships(ROOT);
|
|
131
|
+
const idx = deps.relationships.findIndex(
|
|
132
|
+
r => r.author === entry.author && r.type === entry.type && r.child === entry.child
|
|
133
|
+
);
|
|
134
|
+
if (idx !== -1) {
|
|
135
|
+
deps.relationships[idx] = { ...deps.relationships[idx], ...entry };
|
|
136
|
+
} else {
|
|
137
|
+
deps.relationships.push(entry);
|
|
138
|
+
}
|
|
139
|
+
fs.writeFileSync(depPath, JSON.stringify(deps, null, 2), 'utf8');
|
|
140
|
+
return deps;
|
|
141
|
+
};
|
|
142
|
+
|
|
110
143
|
// ── Write tracking slot ───────────────────────────────────────────────────────
|
|
111
144
|
|
|
112
145
|
const updateTrackingSlot = (tracking, scope, agent, data, ROOT) => {
|
|
@@ -673,6 +706,8 @@ module.exports = {
|
|
|
673
706
|
generateTrackingStructure,
|
|
674
707
|
loadTracking,
|
|
675
708
|
updateTrackingSlot,
|
|
709
|
+
loadRelationships,
|
|
710
|
+
updateRelationship,
|
|
676
711
|
clearTrackingSlot,
|
|
677
712
|
validateConfig,
|
|
678
713
|
checkAgentActive,
|
package/init.js
CHANGED
|
@@ -600,6 +600,14 @@ const main = async () => {
|
|
|
600
600
|
fs.writeFileSync(path.join(RUNTIME_DIR, '.config.json'), JSON.stringify(config, null, 2), 'utf8');
|
|
601
601
|
console.log(` ${green('✓')} .scaffold/.config.json written`);
|
|
602
602
|
|
|
603
|
+
// ── dependencies.json ─────────────────────────────────────────────────────────
|
|
604
|
+
|
|
605
|
+
const depsPath = path.join(RUNTIME_DIR, 'dependencies.json');
|
|
606
|
+
if (!fs.existsSync(depsPath)) {
|
|
607
|
+
fs.writeFileSync(depsPath, JSON.stringify({ relationships: [] }, null, 2), 'utf8');
|
|
608
|
+
console.log(` ${green('✓')} .scaffold/dependencies.json initialized`);
|
|
609
|
+
}
|
|
610
|
+
|
|
603
611
|
// ── scope-policy.json ─────────────────────────────────────────────────────────
|
|
604
612
|
|
|
605
613
|
const scopePolicy = {
|
package/package.json
CHANGED