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

Function runPossibleWizard

src/possible-wizard.ts:384–450  ·  view source on GitHub ↗
(
  prompter: Prompter,
  deps: WizardDeps,
)

Source from the content-addressed store, hash-verified

382// ── Orchestration ──────────────────────────────────────────────────────────
383
384export async function runPossibleWizard(
385 prompter: Prompter,
386 deps: WizardDeps,
387): Promise<WizardResult> {
388 prompter.write('');
389 prompter.write('ft possible — walk a bookmark seed through to a scored 2x2 grid');
390 prompter.write('(press `q` at any prompt to quit without launching)');
391
392 const seedResult = await stepPickSeed(prompter, deps);
393 if (seedResult.kind === 'cancelled') {
394 return { kind: 'cancelled', reason: seedResult.reason };
395 }
396 if (seedResult.kind === 'empty') {
397 prompter.write('');
398 prompter.write('Run this to gather your first seed:');
399 prompter.write(` ${seedResult.command}`);
400 prompter.write('');
401 prompter.write('Then run `ft possible` again to continue from here.');
402 return { kind: 'no-seeds', strategy: seedResult.strategy, command: seedResult.command };
403 }
404 const seed = seedResult.seed;
405
406 const reposResult = await stepPickRepos(prompter, deps);
407 if (reposResult.kind === 'cancelled') {
408 return { kind: 'cancelled', reason: reposResult.reason };
409 }
410
411 const frameResult = await stepPickFrame(prompter, deps, seed.frameId);
412 if (frameResult.kind === 'cancelled') {
413 return { kind: 'cancelled', reason: frameResult.reason };
414 }
415
416 const depthResult = await stepPickDepth(prompter);
417 if (depthResult.kind === 'cancelled') {
418 return { kind: 'cancelled', reason: depthResult.reason };
419 }
420
421 const nodeResult = await stepPickNodeTarget(prompter, depthResult.depth);
422 if (nodeResult.kind === 'cancelled') {
423 return { kind: 'cancelled', reason: nodeResult.reason };
424 }
425
426 const modelResult = await stepPickModelProfile(prompter);
427 if (modelResult.kind === 'cancelled') {
428 return { kind: 'cancelled', reason: modelResult.reason };
429 }
430
431 const plan: WizardPlan = {
432 seedId: seed.id,
433 repos: reposResult.repos,
434 frameId: frameResult.frameId,
435 depth: depthResult.depth,
436 engine: modelResult.profile.engine,
437 model: modelResult.profile.model,
438 effort: modelResult.profile.effort,
439 nodeTarget: nodeResult.nodeTarget,
440 };
441

Callers 2

buildCliFunction · 0.85

Calls 9

stepPickSeedFunction · 0.85
stepPickReposFunction · 0.85
stepPickFrameFunction · 0.85
stepPickDepthFunction · 0.85
stepPickNodeTargetFunction · 0.85
stepPickModelProfileFunction · 0.85
stepConfirmFunction · 0.85
writeMethod · 0.80
listFramesMethod · 0.80

Tested by

no test coverage detected