import { loadAppCoreConfig } from "./app-config.js"; import type { WizardPlan } from "./wizard/answers.js"; import type { RuntimeModelReference, RuntimeResult, RuntimeRunOptions } from "@mono-agent/runtime-adapter"; type ReadinessRuntimeRunOptions = RuntimeRunOptions & { /** Exact provider environment supplied to the injected test seam. */ readonly providerEnv: Readonly>; }; export interface ReadinessProbeOptions { readonly plan: WizardPlan; /** Caller cancellation for an interactive readiness check. */ readonly abortSignal?: AbortSignal; /** The selected required module secrets, held only for this process. */ readonly secretValues?: Readonly>; /** * The already-resolved Pi auth path selected by CLI/config precedence. This * is the sole MONO_AGENT_* value intentionally restored after isolation. */ readonly resolvedPiAuthPath?: string; /** Test seam; production preserves its non-mono-agent host environment. */ readonly hostEnv?: Readonly>; /** Override the provider-class deadline; production uses 90s cloud / 240s local. */ readonly timeoutMs?: number; /** Test seam; production calls the selected primary runtime in an isolated worker. */ readonly run?: (input: { readonly config: Awaited>; readonly options: ReadinessRuntimeRunOptions; }) => Promise; /** Test seam for proving timeout/process cleanup. */ readonly dispose?: () => Promise | void; /** Test seam for exercising the isolated-worker transport without a real provider. */ readonly workerUrl?: URL; /** * Resume only routes that already completed successfully under the exact * immutable route plan. A mismatched fingerprint is ignored fail-closed. */ readonly resume?: Readonly<{ planFingerprint: string; successfulRouteKeys: readonly string[]; }>; /** Non-secret progress hooks for app-owned preflight rendering. */ readonly onRouteStart?: (route: ReadinessRouteStart) => void | Promise; readonly onRouteComplete?: (result: ReadinessRouteResult) => void | Promise; } export type ReadinessProbeFailureKind = "invalid_plan" | "unsupported_guided_probe" | "timeout" | "cancelled" | "tool_used" | "provider_failed" | "empty_response" | "probe_failed"; export interface ReadinessRouteResult { readonly key: string; readonly index: number; readonly model: string; /** Omitted means the provider's own default; legacy fallbacks inherit. */ readonly effort?: string; readonly status: "verified" | "failed" | "skipped_verified" | "interrupted"; readonly kind?: ReadinessProbeFailureKind; readonly message?: string; } export interface ReadinessRouteStart { readonly key: string; readonly index: number; readonly total: number; readonly model: string; readonly effort?: string; } export type ReadinessProbeResult = { readonly ok: true; readonly planFingerprint?: string; readonly routes?: readonly ReadinessRouteResult[]; } | { readonly ok: false; readonly kind: ReadinessProbeFailureKind; readonly message: string; readonly planFingerprint?: string; readonly routes?: readonly ReadinessRouteResult[]; readonly interrupted?: boolean; }; /** Provider-aware hard deadline for the one-turn primary-model probe. */ export declare function readinessProbeTimeoutMs(model: RuntimeModelReference): number; /** Source-derived operator wording for the per-route readiness deadlines. */ export declare function readinessProbeTimeoutDescription(): string; /** * The probe must not inherit a configured agent from the shell it happens to * run in. Provider auth/runtime variables remain available, while every * ambient MONO_AGENT_* override is excluded before layered config loading. * Selected wizard secrets are an in-memory overlay and are intentionally added * afterwards; they are never written to the disposable workspace. */ export declare function readinessProbeEnvironment(hostEnv: Readonly>, secretValues?: Readonly>, options?: { readonly resolvedPiAuthPath?: string; }): Record; /** * Make one real, sequential no-tool turn for every selected persistent runtime * route and return the ordered route ledger, including for a primary-only plan. * A route is never allowed to invoke its configured fallback chain. Ordinary * failures are collected so the operator gets one complete summary; caller * cancellation stops the current route and records interruption state. */ export declare function runAllRouteReadinessProbe(options: ReadinessProbeOptions): Promise; export {}; //# sourceMappingURL=readiness-probe.d.ts.map