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

Function stepPickNodeTarget

src/possible-wizard.ts:278–300  ·  view source on GitHub ↗
(
  prompter: Prompter,
  depth: 'quick' | 'standard' | 'deep',
)

Source from the content-addressed store, hash-verified

276// ── Step 5: pick node count ───────────────────────────────────────────────
277
278export async function stepPickNodeTarget(
279 prompter: Prompter,
280 depth: 'quick' | 'standard' | 'deep',
281): Promise<
282 | { kind: 'picked'; nodeTarget: number | undefined }
283 | { kind: 'cancelled'; reason: string }
284> {
285 const depthDefault = DEPTH_BUDGETS[depth].candidateTarget;
286 prompter.write('');
287 prompter.write(`Node count per repo controls how many debates get generated. ${depth} defaults to ${depthDefault}.`);
288 const answer = await prompter.ask(`Node count [${MIN_NODE_TARGET}-${MAX_NODE_TARGET}] (or press enter for ${depthDefault}, \`q\` to quit): `);
289 if (answer === 'q' || answer === 'Q') {
290 return { kind: 'cancelled', reason: 'quit-at-node-count' };
291 }
292 if (answer === '') {
293 return { kind: 'picked', nodeTarget: undefined };
294 }
295 try {
296 return { kind: 'picked', nodeTarget: validateNodeTarget(answer) };
297 } catch {
298 return { kind: 'cancelled', reason: 'invalid-node-count' };
299 }
300}
301
302// ── Step 6: pick model profile ─────────────────────────────────────────────
303

Callers 2

runPossibleWizardFunction · 0.85

Calls 3

validateNodeTargetFunction · 0.85
writeMethod · 0.80
askMethod · 0.80

Tested by

no test coverage detected