multi-agents-cli 1.1.40 → 1.1.42
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/complete.js +20 -0
- package/core/workflow/restart.js +17 -0
- package/package.json +1 -1
|
@@ -128,6 +128,26 @@ const updateBuildState = (branch, status, notes = '') => {
|
|
|
128
128
|
`$1 ${status} $2`
|
|
129
129
|
);
|
|
130
130
|
|
|
131
|
+
// Flip checkbox in the relevant scope section
|
|
132
|
+
const branchParts = branch.split('/');
|
|
133
|
+
const scope = branchParts[1];
|
|
134
|
+
const agentName = branchParts[2] ? branchParts[2].toUpperCase() : null;
|
|
135
|
+
if (scope && agentName && status === 'COMPLETED') {
|
|
136
|
+
const sectionMap = { client: '## Client State', backend: '## Backend State', shared: '## Shared' };
|
|
137
|
+
const header = sectionMap[scope];
|
|
138
|
+
if (header) {
|
|
139
|
+
const start = content.indexOf(header);
|
|
140
|
+
if (start !== -1) {
|
|
141
|
+
const rest = content.slice(start + header.length);
|
|
142
|
+
const nextH = rest.indexOf('\n## ');
|
|
143
|
+
const blockEnd = nextH === -1 ? content.length : start + header.length + nextH;
|
|
144
|
+
const block = content.slice(start, blockEnd);
|
|
145
|
+
const patched = block.replace('- [ ] ' + agentName + ' ', '- [x] ' + agentName + ' ');
|
|
146
|
+
content = content.slice(0, start) + patched + content.slice(blockEnd);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
131
151
|
fs.writeFileSync(buildStatePath, content, 'utf8');
|
|
132
152
|
|
|
133
153
|
// Update TASKS_HISTORY.md
|
package/core/workflow/restart.js
CHANGED
|
@@ -145,6 +145,23 @@ const wipeAgent = ({ scope, agent, branch, worktreePath }) => {
|
|
|
145
145
|
try { execSync(`git branch -D ${branch}`, { cwd: ROOT, stdio: 'pipe' }); } catch {}
|
|
146
146
|
try { execSync(`git push origin --delete ${branch}`, { cwd: ROOT, stdio: 'pipe' }); } catch {}
|
|
147
147
|
|
|
148
|
+
// If scope folder has agent-built content on main, remove it so new branch starts clean
|
|
149
|
+
// Use filesystem truth, not tracking status (tracking may already be cleared by prior restart)
|
|
150
|
+
const scopeDir = require('path').join(ROOT, scope);
|
|
151
|
+
if (fs.existsSync(scopeDir)) {
|
|
152
|
+
const scopeContents = fs.readdirSync(scopeDir).filter(f => f !== 'CLAUDE.md');
|
|
153
|
+
if (scopeContents.length > 0) {
|
|
154
|
+
try {
|
|
155
|
+
fs.rmSync(scopeDir, { recursive: true, force: true });
|
|
156
|
+
require('child_process').execSync('git add -A', { cwd: ROOT, stdio: 'pipe' });
|
|
157
|
+
require('child_process').execSync(
|
|
158
|
+
`git commit --no-gpg-sign --no-verify -m "chore: remove ${scope} scope content for restart"`,
|
|
159
|
+
{ cwd: ROOT, stdio: 'pipe' }
|
|
160
|
+
);
|
|
161
|
+
} catch {}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
148
165
|
if (tracking[scope]?.[agent]) {
|
|
149
166
|
tracking[scope][agent] = { branch: null, timestamp: null, launchedAt: null, status: null, missingCount: 0, worktreePath: null };
|
|
150
167
|
fs.writeFileSync(TRACKING_PATH, JSON.stringify(tracking, null, 2), 'utf8');
|
package/package.json
CHANGED