import type { CliProviderAdapter } from './cli/adapter.types.js'; export declare function parseStreamJsonOutput(raw: string): string; export declare function parseResultEventUsage(raw: string): ProviderUsage | null; export { ProviderError, IdleTimeoutError, TotalTimeoutError, type ProviderErrorCode, type ProviderErrorKind, type ProviderErrorOptions, } from './errors.js'; export declare function shouldFallbackToGhCopilot(providerId: string, err: unknown, platform?: NodeJS.Platform): boolean; export interface RunCliProcessOptions { timeoutMs?: number; env?: Record; cwd?: string; onOutput?: (line: string, level: 'stdout' | 'stderr') => void; onPid?: (pid: number) => void; onExitCode?: (code: number) => void; onUsage?: (usage: ProviderUsage) => void; onModel?: (model: string) => void; } export declare function runCliProcess(command: string, args: string[], providerStr: string, _providerId: string, options?: RunCliProcessOptions, stdinMessage?: string, adapter?: CliProviderAdapter): Promise<{ stdout: string; parsed: string; }>; export interface ClientToolCall { toolCallId: string; toolName: string; args: Record; } export interface ContinuationState { userMessage: string; responseMessages: unknown[]; toolDefinitions: import('../facade/Crewx').ToolDefinition[]; maxSteps: number; systemPrompt?: string; modelOverride?: string; } export declare class ClientToolCallRequiredError extends Error { readonly toolCall: ClientToolCall; readonly continuationState: ContinuationState; readonly name = "ClientToolCallRequiredError"; constructor(toolCall: ClientToolCall, continuationState: ContinuationState); } export type ProviderFactory = (id: string, providerStr: string) => ProviderRuntime; export declare function registerProviderFactory(namespace: string, factory: ProviderFactory): void; export interface ProviderUsage { inputTokens: number; outputTokens: number; cachedInputTokens: number; costUsd: number; } export interface ProviderQueryOptions { model?: string; effort?: string; mode?: string; context?: string; systemPrompt?: string; additionalArgs?: string[]; onOutput?: (line: string, level: 'stdout' | 'stderr') => void; onPid?: (pid: number) => void; onCommand?: (command: string) => void; onUsage?: (usage: ProviderUsage) => void; onExitCode?: (code: number) => void; onModel?: (model: string) => void; onTaskLog?: (entries: import('../types/task-log.types').TaskLogEntry[]) => void; env?: Record; cwd?: string; timeoutMs?: number; configOptions?: Record; tools?: import('../facade/Crewx').ToolDefinition[]; maxSteps?: number; } export interface ProviderRuntime { query(message: string, options?: ProviderQueryOptions): Promise; execute(message: string, options?: ProviderQueryOptions): Promise; continueWithToolResults?(continuationState: ContinuationState, toolResults: Array<{ toolCallId: string; toolName: string; result: unknown; }>, options?: ProviderQueryOptions): Promise; dispose?(): Promise; } export declare function createProvider(providerStr: string): ProviderRuntime;