multi-agents-cli 1.1.43 → 1.1.45
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/restart.js +20 -6
- package/package.json +1 -1
package/core/workflow/restart.js
CHANGED
|
@@ -152,18 +152,32 @@ const wipeAgent = ({ scope, agent, branch, worktreePath }) => {
|
|
|
152
152
|
const scopeContents = fs.readdirSync(scopeDir).filter(f => f !== 'CLAUDE.md');
|
|
153
153
|
if (scopeContents.length > 0) {
|
|
154
154
|
try {
|
|
155
|
-
// Delete each entry individually - preserve CLAUDE.md
|
|
156
155
|
for (const entry of scopeContents) {
|
|
157
156
|
fs.rmSync(require('path').join(scopeDir, entry), { recursive: true, force: true });
|
|
158
157
|
}
|
|
159
|
-
require('child_process').execSync('git add -A', { cwd: ROOT, stdio: 'pipe' });
|
|
160
|
-
require('child_process').execSync(
|
|
161
|
-
`git commit --no-gpg-sign --no-verify -m "chore: remove ${scope} scope content for restart"`,
|
|
162
|
-
{ cwd: ROOT, stdio: 'pipe' }
|
|
163
|
-
);
|
|
164
158
|
} catch {}
|
|
165
159
|
}
|
|
166
160
|
}
|
|
161
|
+
// Always ensure scope CLAUDE.md exists - restore from CLI templates if missing or folder gone
|
|
162
|
+
try {
|
|
163
|
+
const claudePath = require('path').join(scopeDir, 'CLAUDE.md');
|
|
164
|
+
if (!fs.existsSync(claudePath)) {
|
|
165
|
+
const globalPkg = require('child_process').execSync('npm root -g', { stdio: 'pipe', encoding: 'utf8' }).trim();
|
|
166
|
+
const tmplPath = require('path').join(globalPkg, 'multi-agents-cli', 'core', 'templates', scope, 'CLAUDE.md');
|
|
167
|
+
if (fs.existsSync(tmplPath)) {
|
|
168
|
+
fs.mkdirSync(scopeDir, { recursive: true });
|
|
169
|
+
fs.copyFileSync(tmplPath, claudePath);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
} catch {}
|
|
173
|
+
// Commit any scope changes to main
|
|
174
|
+
try {
|
|
175
|
+
require('child_process').execSync('git add -A', { cwd: ROOT, stdio: 'pipe' });
|
|
176
|
+
require('child_process').execSync(
|
|
177
|
+
`git commit --no-gpg-sign --no-verify -m "chore: remove ${scope} scope content for restart"`,
|
|
178
|
+
{ cwd: ROOT, stdio: 'pipe' }
|
|
179
|
+
);
|
|
180
|
+
} catch {}
|
|
167
181
|
|
|
168
182
|
if (tracking[scope]?.[agent]) {
|
|
169
183
|
tracking[scope][agent] = { branch: null, timestamp: null, launchedAt: null, status: null, missingCount: 0, worktreePath: null };
|
package/package.json
CHANGED