MCPcopy
hub / github.com/afar1/fieldtheory-cli / stepPickDepth

Function stepPickDepth

src/possible-wizard.ts:249–274  ·  view source on GitHub ↗
(
  prompter: Prompter,
)

Source from the content-addressed store, hash-verified

247];
248
249export async function stepPickDepth(
250 prompter: Prompter,
251): Promise<
252 | { kind: 'picked'; depth: 'quick' | 'standard' | 'deep' }
253 | { kind: 'cancelled'; reason: string }
254> {
255 prompter.write('');
256 prompter.write('Pick a depth:');
257 prompter.write('');
258 for (const [idx, opt] of DEPTH_OPTIONS.entries()) {
259 prompter.write(` ${idx + 1}) ${opt.label.padEnd(9)} ${opt.estimate}`);
260 }
261 prompter.write('');
262 const answer = await prompter.ask('Pick a depth [1-3] (or press enter for quick): ');
263 if (answer === 'q' || answer === 'Q') {
264 return { kind: 'cancelled', reason: 'quit-at-depth' };
265 }
266 if (answer === '') {
267 return { kind: 'picked', depth: 'quick' };
268 }
269 const pick = parseIndex(answer, DEPTH_OPTIONS.length);
270 if (pick === null) {
271 return { kind: 'cancelled', reason: 'invalid-depth-pick' };
272 }
273 return { kind: 'picked', depth: DEPTH_OPTIONS[pick]!.key };
274}
275
276// ── Step 5: pick node count ───────────────────────────────────────────────
277

Callers 2

runPossibleWizardFunction · 0.85

Calls 3

parseIndexFunction · 0.85
writeMethod · 0.80
askMethod · 0.80

Tested by

no test coverage detected