multi-agents-cli 1.1.11 → 1.1.13
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 +52 -14
- package/core/workflow/complete.js +10 -1
- package/lib/ui.js +9 -7
- package/package.json +1 -1
package/core/workflow/agent.js
CHANGED
|
@@ -41,19 +41,21 @@ const arrowSelect = async (message, choices, rl) => {
|
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const arrowConfirm = async (message, rl) => {
|
|
44
|
+
const arrowConfirm = async (message, rl, initial = true) => {
|
|
45
45
|
if (prompts && process.stdin.isTTY) {
|
|
46
46
|
const res = await prompts({
|
|
47
|
-
type: '
|
|
47
|
+
type: 'select',
|
|
48
48
|
name: 'value',
|
|
49
49
|
message,
|
|
50
|
-
|
|
50
|
+
choices: [
|
|
51
|
+
{ title: 'Yes', value: true },
|
|
52
|
+
{ title: 'No', value: false },
|
|
53
|
+
],
|
|
54
|
+
initial: initial ? 0 : 1,
|
|
51
55
|
}, { onCancel: () => process.exit(0) });
|
|
52
|
-
return res.value ??
|
|
56
|
+
return res.value ?? initial;
|
|
53
57
|
}
|
|
54
|
-
return
|
|
55
|
-
rl.question(`${message} (y/n): `, ans => resolve(ans.toLowerCase() !== 'n'));
|
|
56
|
-
});
|
|
58
|
+
return initial;
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
// ── Colors ────────────────────────────────────────────────────────────────────
|
|
@@ -1184,11 +1186,10 @@ const main = async () => {
|
|
|
1184
1186
|
type: 'text',
|
|
1185
1187
|
name: 'value',
|
|
1186
1188
|
message: '* What are you building?',
|
|
1187
|
-
|
|
1189
|
+
hint: '(e.g. A stock market prediction app with AI insights)',
|
|
1188
1190
|
}, { onCancel: () => process.exit(0) });
|
|
1189
1191
|
const rawCtx = (ctxRes.value || '').trim();
|
|
1190
|
-
|
|
1191
|
-
projectContext = isPlaceholderCtx ? '' : rawCtx;
|
|
1192
|
+
projectContext = rawCtx;
|
|
1192
1193
|
} else {
|
|
1193
1194
|
console.log(dim(' (optional — helps the agent make better decisions)'));
|
|
1194
1195
|
const input = await ask(`\n${bold('* What are you building?')}: `);
|
|
@@ -1207,12 +1208,13 @@ const main = async () => {
|
|
|
1207
1208
|
type: 'text',
|
|
1208
1209
|
name: 'value',
|
|
1209
1210
|
message: `* Task description (${agent} agent)`,
|
|
1210
|
-
initial: defaultTask
|
|
1211
|
+
initial: defaultTask || '',
|
|
1212
|
+
hint: defaultTask ? '(Enter to use default, or type your own)' : '(describe what this agent should build or fix)',
|
|
1211
1213
|
}, { onCancel: () => process.exit(0) });
|
|
1212
1214
|
|
|
1213
1215
|
if (res.value === undefined) continue flowLoop; // Esc = back
|
|
1214
1216
|
const rawValue = (res.value || '').trim();
|
|
1215
|
-
const isPlaceholder = rawValue
|
|
1217
|
+
const isPlaceholder = rawValue === defaultTask || rawValue === '';
|
|
1216
1218
|
task = isPlaceholder ? defaultTask : (rawValue || defaultTask);
|
|
1217
1219
|
if (!task) task = defaultTask;
|
|
1218
1220
|
} else {
|
|
@@ -1721,6 +1723,19 @@ ${excludedUrls}
|
|
|
1721
1723
|
], rl);
|
|
1722
1724
|
|
|
1723
1725
|
if (sessionIdx === 0) {
|
|
1726
|
+
separator();
|
|
1727
|
+
console.log(`\n ${bold('What happens next:')}
|
|
1728
|
+
`);
|
|
1729
|
+
console.log(` ${dim('→')} ${bold(config.ide.name || 'Your IDE')} will open at your agent workspace`);
|
|
1730
|
+
console.log(` ${dim('→')} A new terminal window will open with Claude Code\n`);
|
|
1731
|
+
console.log(` ${bold('Once open:')}
|
|
1732
|
+
`);
|
|
1733
|
+
console.log(` ${bold('1.')} Approve the workspace trust prompt in Claude Code`);
|
|
1734
|
+
console.log(` ${bold('2.')} Type anything to start ${dim("(e.g. 'go', 'start', 'begin')")}`);
|
|
1735
|
+
console.log(` ${bold('3.')} Let the agent run autonomously — don't interrupt mid-task`);
|
|
1736
|
+
console.log(` ${bold('4.')} When done, run: ${cyan('npm run complete')}\n`);
|
|
1737
|
+
const goIdx = await arrowSelect('Ready?', [{ label: `${green('✓')} Open workspace` }, { label: `${dim('←')} Back` }], rl);
|
|
1738
|
+
if (goIdx === 1) { continue sessionLoop; }
|
|
1724
1739
|
const openedIDE = openIDE(worktreePath);
|
|
1725
1740
|
if (openedIDE) console.log(` ${green('✓')} ${openedIDE} opened`);
|
|
1726
1741
|
else console.log(` ${yellow('!')} Could not open IDE - open manually at: ${dim(worktreePath)}`);
|
|
@@ -1732,15 +1747,38 @@ ${excludedUrls}
|
|
|
1732
1747
|
process.exit(0);
|
|
1733
1748
|
|
|
1734
1749
|
} else if (sessionIdx === 1) {
|
|
1750
|
+
separator();
|
|
1751
|
+
console.log(`\n ${bold('What happens next:')}
|
|
1752
|
+
`);
|
|
1753
|
+
console.log(` ${dim('→')} ${bold(config.ide.name || 'Your IDE')} will open at your agent workspace\n`);
|
|
1754
|
+
console.log(` ${bold('Once open:')}
|
|
1755
|
+
`);
|
|
1756
|
+
console.log(` ${bold('1.')} Open a new Claude Code session inside the IDE`);
|
|
1757
|
+
console.log(` ${bold('2.')} Approve the workspace trust prompt`);
|
|
1758
|
+
console.log(` ${bold('3.')} Type anything to start ${dim("(e.g. 'go', 'start', 'begin')")}`);
|
|
1759
|
+
console.log(` ${bold('4.')} Let the agent run autonomously — don't interrupt mid-task`);
|
|
1760
|
+
console.log(` ${bold('5.')} When done, run: ${cyan('npm run complete')}\n`);
|
|
1761
|
+
const goIdx = await arrowSelect('Ready?', [{ label: `${green('✓')} Open workspace` }, { label: `${dim('←')} Back` }], rl);
|
|
1762
|
+
if (goIdx === 1) { continue sessionLoop; }
|
|
1735
1763
|
const openedIDE = openIDE(worktreePath);
|
|
1736
1764
|
if (openedIDE) console.log(` ${green("✓")} ${openedIDE} opened`);
|
|
1737
1765
|
else console.log(` ${yellow("!")} Could not open IDE - open manually at: ${dim(worktreePath)}`);
|
|
1738
|
-
console.log(`\n ${dim('Open a NEW Claude Code session and type')} ${cyan('go')} ${dim('to start.')}\n`);
|
|
1739
|
-
console.log(` ${dim('When done, run:')} ${cyan('npm run complete')}\n`);
|
|
1740
1766
|
rl.close();
|
|
1741
1767
|
process.exit(0);
|
|
1742
1768
|
|
|
1743
1769
|
} else if (sessionIdx === 2) {
|
|
1770
|
+
separator();
|
|
1771
|
+
console.log(`\n ${bold('What happens next:')}
|
|
1772
|
+
`);
|
|
1773
|
+
console.log(` ${dim('→')} A new terminal window will open with Claude Code\n`);
|
|
1774
|
+
console.log(` ${bold('Once open:')}
|
|
1775
|
+
`);
|
|
1776
|
+
console.log(` ${bold('1.')} Approve the workspace trust prompt in Claude Code`);
|
|
1777
|
+
console.log(` ${bold('2.')} Type anything to start ${dim("(e.g. 'go', 'start', 'begin')")}`);
|
|
1778
|
+
console.log(` ${bold('3.')} Let the agent run autonomously — don't interrupt mid-task`);
|
|
1779
|
+
console.log(` ${bold('4.')} When done, run: ${cyan('npm run complete')}\n`);
|
|
1780
|
+
const goIdx = await arrowSelect('Ready?', [{ label: `${green('✓')} Open workspace` }, { label: `${dim('←')} Back` }], rl);
|
|
1781
|
+
if (goIdx === 1) { continue sessionLoop; }
|
|
1744
1782
|
const termOpened = openTerminal(worktreePath, skipPermissions);
|
|
1745
1783
|
if (termOpened) console.log(` ${green('✓')} New terminal opened with Claude Code CLI`);
|
|
1746
1784
|
console.log(`\n ${dim("This window can be closed.")}`);
|
|
@@ -55,7 +55,16 @@ const config = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8'));
|
|
|
55
55
|
|
|
56
56
|
const arrowConfirm = async (message, initial = true) => {
|
|
57
57
|
if (prompts && process.stdin.isTTY) {
|
|
58
|
-
const res = await prompts({
|
|
58
|
+
const res = await prompts({
|
|
59
|
+
type: 'select',
|
|
60
|
+
name: 'value',
|
|
61
|
+
message,
|
|
62
|
+
choices: [
|
|
63
|
+
{ title: 'Yes', value: true },
|
|
64
|
+
{ title: 'No', value: false },
|
|
65
|
+
],
|
|
66
|
+
initial: initial ? 0 : 1,
|
|
67
|
+
}, { onCancel: () => process.exit(0) });
|
|
59
68
|
return res.value ?? initial;
|
|
60
69
|
}
|
|
61
70
|
return initial;
|
package/lib/ui.js
CHANGED
|
@@ -62,19 +62,21 @@ const arrowSelect = async (message, choices, showBack = false, backLabel = '←
|
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
const arrowConfirm = async (message) => {
|
|
65
|
+
const arrowConfirm = async (message, initial = true) => {
|
|
66
66
|
if (prompts && process.stdin.isTTY) {
|
|
67
67
|
const res = await prompts({
|
|
68
|
-
type: '
|
|
68
|
+
type: 'select',
|
|
69
69
|
name: 'value',
|
|
70
70
|
message,
|
|
71
|
-
|
|
71
|
+
choices: [
|
|
72
|
+
{ title: 'Yes', value: true },
|
|
73
|
+
{ title: 'No', value: false },
|
|
74
|
+
],
|
|
75
|
+
initial: initial ? 0 : 1,
|
|
72
76
|
}, { onCancel: () => process.exit(0) });
|
|
73
|
-
return res.value ??
|
|
77
|
+
return res.value ?? initial;
|
|
74
78
|
}
|
|
75
|
-
return
|
|
76
|
-
rl.question(`${message} (y/n): `, ans => resolve(ans.toLowerCase() !== 'n'));
|
|
77
|
-
});
|
|
79
|
+
return initial;
|
|
78
80
|
};
|
|
79
81
|
|
|
80
82
|
// ── Layout helpers ────────────────────────────────────────────────────────────
|
package/package.json
CHANGED