multi-agents-cli 1.1.70 → 1.1.71
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/lib/ui.js +6 -6
- package/package.json +1 -1
package/lib/ui.js
CHANGED
|
@@ -128,10 +128,10 @@ const NONE_LABEL = '→ None of these - I\'ll specify my own';
|
|
|
128
128
|
|
|
129
129
|
// ── Free-text handler (shared by selectRequired + selectOptional) ────────────
|
|
130
130
|
|
|
131
|
-
const handleFreeText = async (prompt, items, stepMachine, stepIndex, context, isOptional) => {
|
|
131
|
+
const handleFreeText = async (prompt, items, stepMachine, stepIndex, context, isOptional, block = null) => {
|
|
132
132
|
const _res = await prompts({ type: 'text', name: 'value', message: 'Type your own value:' }, { onCancel: () => process.exit(0) });
|
|
133
133
|
const typed = (_res.value || '').trim();
|
|
134
|
-
if (!typed) return isOptional ? null : handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional);
|
|
134
|
+
if (!typed) return isOptional ? null : handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional, block);
|
|
135
135
|
|
|
136
136
|
// Fuzzy match first - before registry check
|
|
137
137
|
const matches = fuzzyMatchFramework(typed, block);
|
|
@@ -142,7 +142,7 @@ const handleFreeText = async (prompt, items, stepMachine, stepIndex, context, is
|
|
|
142
142
|
];
|
|
143
143
|
const choice = await arrowSelect(`"${typed}" couldn't be verified. Did you mean:`, didYouMeanOpts.map(o => ({ label: o })));
|
|
144
144
|
if (choice < matches.length) return matches[choice]; // returns full framework object
|
|
145
|
-
return handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional);
|
|
145
|
+
return handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional, block);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
// Live registry check - only when no fuzzy match
|
|
@@ -156,7 +156,7 @@ const handleFreeText = async (prompt, items, stepMachine, stepIndex, context, is
|
|
|
156
156
|
`→ Type a different value`,
|
|
157
157
|
];
|
|
158
158
|
const choice = await arrowSelect(`"${typed}" couldn't be verified.`, riskOpts.map(o => ({ label: o })));
|
|
159
|
-
if (choice === 1) return handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional);
|
|
159
|
+
if (choice === 1) return handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional, block);
|
|
160
160
|
// Show risk consequence block
|
|
161
161
|
console.log('');
|
|
162
162
|
console.log(` ${yellow('⚠ Proceeding with an unverified framework may result in:')}`);
|
|
@@ -169,7 +169,7 @@ const handleFreeText = async (prompt, items, stepMachine, stepIndex, context, is
|
|
|
169
169
|
{ label: `→ Yes - proceed with "${typed}"` },
|
|
170
170
|
{ label: `→ No - let me pick something else` },
|
|
171
171
|
]);
|
|
172
|
-
if (confirm === 1) return handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional);
|
|
172
|
+
if (confirm === 1) return handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional, block);
|
|
173
173
|
return typed;
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -186,7 +186,7 @@ const handleFreeText = async (prompt, items, stepMachine, stepIndex, context, is
|
|
|
186
186
|
];
|
|
187
187
|
const choice = await arrowSelect('How would you like to proceed?', opts.map(o => ({ label: o })));
|
|
188
188
|
if (choice === 0) return typed;
|
|
189
|
-
if (choice === opts.length - 1) return handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional);
|
|
189
|
+
if (choice === opts.length - 1) return handleFreeText(prompt, items, stepMachine, stepIndex, context, isOptional, block);
|
|
190
190
|
return check.alternatives[choice - 1];
|
|
191
191
|
}
|
|
192
192
|
|
package/package.json
CHANGED