/** * darwin run "task" * * Runs an agent, optionally evaluates with critic, triggers Darwin evolution. */ import type { ProviderConfig } from '../providers/types.js'; import type { AgentDefinition, PromptVersion } from '../types.js'; import type { ABTest, EvolutionConfigOverride } from '../types.js'; export interface RunFlags { agentName: string; task: string; taskType: string; noEvolve: boolean; noCritic: boolean; model?: string; path?: string; verbose: boolean; /** Provider override: anthropic-api, openai, ollama */ provider?: ProviderConfig['type']; /** Base URL for OpenAI-compatible / Ollama endpoints */ baseUrl?: string; /** Advanced evolution-config toggles for this run (--gepa/--coverage/…) */ evolutionOverride: EvolutionConfigOverride; } export declare function parseRunArgs(args: string[]): RunFlags; /** * Which prompt version should THIS run use? (v0.14.0 — exported for tests.) * * - Active A/B test AND evolution enabled → round-robin the arm with fewer * runs (the pre-v0.14 behaviour). * - Otherwise → the agent's ACTIVE version. Two real bugs lived here * (cross-model review, v0.14.0): * 1. Without a running test the CLI always ran the STATIC v1 prompt — * a promoted winner (v3 active in state) never actually ran, and its * runs were recorded against v1, corrupting the version stats. * 2. `darwin evolve --disable` did not stop the A/B routing, so a * disabled agent kept sending ~50% of its traffic through the * challenger — with the test counters frozen, forever. */ export declare function pickRunVersion(abTest: ABTest | null, evolutionEnabled: boolean, activeVersion: string): string; /** * Are both arms of an A/B test backed by a resolvable prompt? `v1` always * resolves (the agent definition is its floor); any other label needs a * stored prompt. (v0.14.0 — exported for tests.) * * Why this exists (R4 review, P0): when an open test references an arm whose * stored prompt has vanished (corrupted/foreign state), routing would fall * back to v1 and RELABEL the run as v1 — which `handleABTest` then counts * for whichever arm happens to be labeled v1, or for neither, so the test * either decides on wrong data or starves forever. An unresolvable test is * dead on arrival; the caller clears it and runs the active version. */ export declare function abTestArmsResolvable(abTest: ABTest, storedVersions: ReadonlyArray>): boolean; /** * Resolve the prompt TEXT + the version label the experiment must be recorded * under. (v0.14.0 — exported for tests; R3 review closed two gaps here.) * * Invariant: the returned `version` always names the prompt that actually * RUNS. When state requests a label with no stored prompt (corrupted/foreign * state), we fall back to the static v1 prompt AND relabel the run as v1 — * recording a static-v1 output under the missing label would corrupt that * label's stats and could decide an A/B test with wrong data. * * v1 itself prefers the STORED v1 prompt when one exists (the seeded copy), * falling back to the agent definition. `darwin eval` resolves versions the * same way, so a built-in prompt edited after seeding no longer makes live * runs and offline evals score different texts under the same label. */ export declare function resolveRunPrompt(agent: AgentDefinition, storedVersions: ReadonlyArray>, requestedVersion: string): { version: string; promptText: string; missingStored: boolean; }; export declare function runCommand(args: string[]): Promise; //# sourceMappingURL=run.d.ts.map