multi-agents-cli 1.1.34 → 1.1.36
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 +2 -2
- package/init.js +26 -1
- package/package.json +1 -1
package/core/workflow/agent.js
CHANGED
|
@@ -1350,7 +1350,7 @@ Mark each step complete. Only proceed to the task below when all are checked.
|
|
|
1350
1350
|
};
|
|
1351
1351
|
fs.writeFileSync(path.join(beWorktreePath, 'package.json'), JSON.stringify(bePkg, null, 2), 'utf8');
|
|
1352
1352
|
|
|
1353
|
-
const beGitignore = ['# Framework files — never commit these to the agent branch', 'package.json', '.claude-scope', 'scope.json', 'TASK.md', '.vscode/', '.idea/', '.zed/', 'node_modules/'].join('\n') + '\n';
|
|
1353
|
+
const beGitignore = ['# Framework files — never commit these to the agent branch', '/package.json', '.claude-scope', 'scope.json', 'TASK.md', '.vscode/', '.idea/', '.zed/', 'node_modules/'].join('\n') + '\n';
|
|
1354
1354
|
fs.writeFileSync(path.join(beWorktreePath, '.gitignore'), beGitignore, 'utf8');
|
|
1355
1355
|
|
|
1356
1356
|
// IDE settings for backend/INIT worktree
|
|
@@ -1662,7 +1662,7 @@ ${excludedUrls}
|
|
|
1662
1662
|
// ── Write worktree .gitignore — block framework files from agent commits ────
|
|
1663
1663
|
const worktreeGitignore = [
|
|
1664
1664
|
'# Framework files — never commit these to the agent branch',
|
|
1665
|
-
'package.json',
|
|
1665
|
+
'/package.json',
|
|
1666
1666
|
'.claude-scope',
|
|
1667
1667
|
'scope.json',
|
|
1668
1668
|
'TASK.md',
|
package/init.js
CHANGED
|
@@ -107,15 +107,40 @@ if (isGlobalCLI) {
|
|
|
107
107
|
'utf8'
|
|
108
108
|
);
|
|
109
109
|
|
|
110
|
+
let gitOk = false;
|
|
110
111
|
try {
|
|
111
112
|
execSync('git init -b main', { cwd: targetDir, stdio: 'pipe' });
|
|
112
113
|
execSync('git commit --allow-empty -m "init: project created"', { cwd: targetDir, stdio: 'pipe' });
|
|
114
|
+
gitOk = true;
|
|
113
115
|
} catch {
|
|
114
116
|
try {
|
|
115
117
|
execSync('git init', { cwd: targetDir, stdio: 'pipe' });
|
|
116
118
|
execSync('git checkout -b main', { cwd: targetDir, stdio: 'pipe' });
|
|
117
119
|
execSync('git commit --allow-empty -m "init: project created"', { cwd: targetDir, stdio: 'pipe' });
|
|
118
|
-
|
|
120
|
+
gitOk = true;
|
|
121
|
+
} catch { /* both attempts failed */ }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Hard gate: verify a commit actually exists before proceeding
|
|
125
|
+
if (gitOk) {
|
|
126
|
+
try {
|
|
127
|
+
const commitCount = execSync('git rev-list --count HEAD', { cwd: targetDir, encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
128
|
+
gitOk = parseInt(commitCount, 10) > 0;
|
|
129
|
+
} catch { gitOk = false; }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (!gitOk) {
|
|
133
|
+
console.error(`
|
|
134
|
+
✖ Could not create the initial git commit.
|
|
135
|
+
|
|
136
|
+
This is usually caused by missing git identity configuration. Run:
|
|
137
|
+
|
|
138
|
+
git config --global user.name "Your Name"
|
|
139
|
+
git config --global user.email "you@example.com"
|
|
140
|
+
|
|
141
|
+
Then re-run: multi-agents init ${path.basename(targetDir)}
|
|
142
|
+
`);
|
|
143
|
+
process.exit(1);
|
|
119
144
|
}
|
|
120
145
|
}
|
|
121
146
|
}
|
package/package.json
CHANGED