MCPcopy Create free account
hub / github.com/chhoumann/quickadd / runChoiceHandler

Function runChoiceHandler

src/cli/registerQuickAddCliHandlers.ts:498–525  ·  view source on GitHub ↗
(
	plugin: QuickAdd,
	params: CliData,
	command: string,
)

Source from the content-addressed store, hash-verified

496}
497
498async function runChoiceHandler(
499 plugin: QuickAdd,
500 params: CliData,
501 command: string,
502): Promise<string> {
503 let choice: IChoice;
504 try {
505 choice = resolveChoiceFromParams(plugin, params);
506 } catch (error) {
507 return serialize({
508 ok: false,
509 command,
510 error: error instanceof Error ? error.message : String(error),
511 });
512 }
513
514 return runResolvedChoice(
515 plugin,
516 params,
517 command,
518 choice,
519 RESERVED_RUN_PARAMS,
520 // Opt-in (`verify`) so existing scripts keying off the legacy envelope
521 // keep their behavior; run-template made the outcome path the default
522 // from the start, quickadd:run could not.
523 /* useOutcome */ isTruthy(params.verify),
524 );
525}
526
527async function runTemplateHandler(
528 plugin: QuickAdd,

Callers 1

Calls 4

resolveChoiceFromParamsFunction · 0.85
serializeFunction · 0.85
runResolvedChoiceFunction · 0.85
isTruthyFunction · 0.85

Tested by

no test coverage detected