/** * The eval app's commander program: `run ` executes a * benchmark and writes its JSON report; `report ` renders one as * markdown. Parsing follows the cmdline contract: the action publishes an * ordinary service, and help or a rejection publishes nothing. * * @module dsh-eval/command */ import { Command } from 'commander'; import type { Context } from '@deepseek-ai/cordis'; import type { ImportFormat } from './import.ts'; /** What the eval app resolved from its command line. */ export type EvalStartupValues = { kind: 'run'; benchmarkPath: string; outPath: string; trials?: number; concurrency?: number; dshCommand?: readonly string[]; profile?: string; } | { kind: 'report'; runPath: string; } | { kind: 'compare'; runPathA: string; runPathB: string; } | { kind: 'import'; format: ImportFormat; path: string; outPath: string; caseId: string; }; /** * Build a fresh eval commander program. The root action rejects a bare * invocation; the `run` and `report` actions hand the resolved values to the * publish callback. The callback, not a Cordis service, carries the values * because the plugin's own fiber is not yet active when the parse action runs * and a strict `ctx.get` would miss a just-provided service. * @param publish - receives the resolved invocation once a subcommand runs. * @returns the configured program. */ export declare function evalCommand(publish: (values: EvalStartupValues) => void): Command; /** * Parse the launcher's inner arguments with the eval program and return what * the invoked command published. * @param ctx - plugin context carrying `cmdlineArgs` and `appExit`. * @returns the resolved invocation, or undefined when help or an error exited. */ export declare function applyEval(ctx: Context): EvalStartupValues | undefined;