multi-agents-cli 1.0.45 → 1.0.47
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/init.js +35 -23
- package/package.json +1 -1
package/init.js
CHANGED
|
@@ -768,37 +768,48 @@ const main = async () => {
|
|
|
768
768
|
return 'done';
|
|
769
769
|
};
|
|
770
770
|
|
|
771
|
+
separator();
|
|
772
|
+
console.log(`\n${yellow(' This project has already been initialized.')}`);
|
|
773
|
+
console.log(dim(` Initialized on: ${ts}\n`));
|
|
774
|
+
console.log(dim(` To start a task: `) + cyan('npm run agent'));
|
|
775
|
+
console.log(dim(` To restart an agent: `) + cyan('npm run restart'));
|
|
776
|
+
console.log(dim(` To wipe everything: `) + cyan('npm run reset') + '\n');
|
|
777
|
+
|
|
771
778
|
if (prompts && process.stdin.isTTY) {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
779
|
+
const res = await prompts({
|
|
780
|
+
type: 'select',
|
|
781
|
+
name: 'value',
|
|
782
|
+
message: 'What would you like to do?',
|
|
783
|
+
choices: [
|
|
784
|
+
{ title: 'Re-initialize project', description: 'Wipe everything and start fresh', value: '1' },
|
|
785
|
+
{ title: 'Cancel', value: '2' },
|
|
786
|
+
],
|
|
787
|
+
}, { onCancel: () => process.exit(0) });
|
|
777
788
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
789
|
+
if (res.value === '1') {
|
|
790
|
+
separator();
|
|
791
|
+
console.log(yellow(' ⚠ This will permanently delete the entire project.'));
|
|
792
|
+
console.log(dim(' All branches, worktrees, files and git history will be removed.\n'));
|
|
793
|
+
const confirm = await prompts({
|
|
794
|
+
type: 'select',
|
|
795
|
+
name: 'value',
|
|
796
|
+
message: 'Are you sure?',
|
|
782
797
|
choices: [
|
|
783
|
-
{ title: '
|
|
784
|
-
{ title: '
|
|
785
|
-
{ title: 'Cancel', value: '3' },
|
|
798
|
+
{ title: red('Yes - wipe everything and re-initialize'), value: 'yes' },
|
|
799
|
+
{ title: 'No - Cancel', value: 'no' },
|
|
786
800
|
],
|
|
787
801
|
}, { onCancel: () => process.exit(0) });
|
|
788
|
-
|
|
789
|
-
if (res.value === '1') {
|
|
790
|
-
const child = spawn('node', [path.join(ROOT, '.workflow', 'agent.js')], { stdio: 'inherit', cwd: ROOT });
|
|
791
|
-
child.on('exit', (code) => process.exit(code));
|
|
792
|
-
return;
|
|
793
|
-
} else if (res.value === '2') {
|
|
794
|
-
const restartResult = await showRestartProcess();
|
|
795
|
-
if (restartResult === 'back') continue; // Back — show menu again
|
|
796
|
-
lockLoop = false;
|
|
797
|
-
return;
|
|
798
|
-
} else {
|
|
802
|
+
if (confirm.value !== 'yes') {
|
|
799
803
|
console.log(dim('\n Cancelled.\n'));
|
|
800
804
|
process.exit(0);
|
|
801
805
|
}
|
|
806
|
+
const { spawn: sp } = require('child_process');
|
|
807
|
+
const resetChild = sp('node', [path.join(ROOT, '.workflow', 'reset.js')], { stdio: 'inherit', cwd: ROOT });
|
|
808
|
+
resetChild.on('exit', code => process.exit(code ?? 0));
|
|
809
|
+
return;
|
|
810
|
+
} else {
|
|
811
|
+
console.log(dim('\n Cancelled.\n'));
|
|
812
|
+
process.exit(0);
|
|
802
813
|
}
|
|
803
814
|
}
|
|
804
815
|
}
|
|
@@ -1269,6 +1280,7 @@ If a dependency is not met:
|
|
|
1269
1280
|
scripts: {
|
|
1270
1281
|
init: 'multi-agents init',
|
|
1271
1282
|
agent: 'node .workflow/agent.js',
|
|
1283
|
+
restart: 'node .workflow/restart.js',
|
|
1272
1284
|
reset: 'node .workflow/reset.js',
|
|
1273
1285
|
complete: 'node .workflow/complete.js',
|
|
1274
1286
|
},
|
package/package.json
CHANGED