export type ToolErrorCode = 'PARAMETER_INVALID' | 'USER_INPUT_INCOMPLETE' | 'ASSET_NOT_FOUND' | 'WORKFLOW_VALIDATION_FAILED' | 'MODEL_UNAVAILABLE' | 'PROVIDER_TIMEOUT' | 'GPU_WORKER_FAILED' | 'COST_LIMIT_EXCEEDED' | 'SAFETY_REJECTED' | 'PERMISSION_REQUIRED' | 'USER_CANCELLED' | 'UNKNOWN_ERROR'; export type LegacyToolErrorCategory = 'schema_validation' | 'business_rule' | 'precondition_failed' | 'transient_failure' | 'permanent_failure' | 'insufficient_credits' | 'timeout' | 'cancelled' | 'content_refused'; export declare function mapLegacyToolErrorCategory(category: LegacyToolErrorCategory): ToolErrorCode; export interface ToolResultAsset { asset_id: string; type: 'image' | 'video' | 'audio' | 'model'; url?: string; width?: number; height?: number; duration_seconds?: number; fps?: number; metadata?: Record; } export interface ToolResultCost { spark?: number; usd?: number; internal_cost_usd?: number; notes?: string; } export interface ToolResultOk> { ok: true; tool: string; job_id?: string; model_id?: string; workflow_id?: string; status: 'completed' | 'in_progress' | 'queued'; output_assets: ToolResultAsset[]; params?: TParams; estimated_cost?: ToolResultCost; warnings?: string[]; metadata?: Record; } export interface ToolResultErr { ok: false; tool: string; error_type: ToolErrorCode; message: string; retryable: boolean; suggested_next_action?: string; metadata?: Record; } export type ToolResult> = ToolResultOk | ToolResultErr; export declare function toolOk>(fields: Omit, 'ok' | 'status' | 'output_assets'> & Partial, 'status' | 'output_assets'>>): ToolResultOk; export declare function toolErr(fields: Omit): ToolResultErr; export declare function isToolResultOk>(result: ToolResult): result is ToolResultOk; export declare function isToolResultErr(result: ToolResult): result is ToolResultErr; //# sourceMappingURL=result.d.ts.map