export declare const SCHEMA_VERSION: "v2"; export type ErrorClass = 'validation' | 'not_found' | 'auth' | 'rate_limit' | 'internal' | 'partial'; export interface V2Error { class: ErrorClass; /** Stable identifier, e.g. SESSION_NOT_FOUND. */ code: string; message: string; detail?: Record; suggestion?: string; /** Renamed from legacy `retry` for clarity. */ retryable: boolean; } export interface V2Action { command: string; description: string; } export interface V2Meta { cwd_scope?: 'auto' | 'fellback_to_global' | 'all' | 'explicit'; cwd?: string; etag?: string; timing_ms?: number; [key: string]: unknown; } export interface V2Envelope { ok: boolean; schema_version: typeof SCHEMA_VERSION; result?: T; error?: V2Error; meta?: V2Meta; actions?: V2Action[]; } /** * Build a successful envelope. Always sets ok:true, schema_version:'v2', * and `result`. Never sets `error`. */ export declare function success(result: T, opts?: { meta?: V2Meta; actions?: V2Action[]; }): V2Envelope; /** * Build a failure envelope. Always sets ok:false, schema_version:'v2', * and `error`. Never sets `result`. */ export declare function failure(error: V2Error, opts?: { meta?: V2Meta; actions?: V2Action[]; }): V2Envelope; //# sourceMappingURL=envelope.d.ts.map