multi-agents-cli 1.1.63 → 1.1.64

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.
@@ -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() });
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-agents-cli",
3
- "version": "1.1.63",
3
+ "version": "1.1.64",
4
4
  "description": "Multi-agent workflow orchestration for Claude Code — isolated git worktrees, structured state tracking, autonomous task chaining",
5
5
  "keywords": [
6
6
  "claude-code",