/** * Pure classification of an agent turn's failure into a caller-facing status * (issue #390). Input is what the runner/exec engine produced — the §3.4 * `error.code` (auth, quota, missing-binary, runner-error, …) and its * message, plus any assistant text the turn printed — so `agent test` and, * later, `agent exec` error events can share one mapping. * * The main addition over §3.4 is `model_unavailable`: every runtime reports * "unknown model / not on your plan" differently, and they all land in * `runner-error` (or `auth`, when the provider answers 403) today. */ export type AgentFailureStatus = 'auth' | 'quota' | 'rate_limited' | 'model_unavailable' | 'timeout' | 'missing_binary' | 'error'; export interface AgentErrorInput { /** The §3.4 code the engine emitted (`runner-error`, `auth`, …), if any. */ code?: string; /** Error message plus any assistant text from the failed turn. */ message?: string; } export interface ClassifiedAgentError { status: AgentFailureStatus; /** Error code for the caller: the §3.4 code, or `model-unavailable`. */ code: string; } /** True when `message` is one of the runtimes' "model not available" errors. */ export declare function isModelUnavailable(message: string): boolean; /** Map an engine error (code + message) to a caller-facing status. */ export declare function classifyAgentError(input: AgentErrorInput): ClassifiedAgentError; //# sourceMappingURL=agent-error-classify.d.ts.map