/**
 * Mock provider helpers for testing the stream architecture.
 *
 * Provides declarative mock builders that make tests readable.
 */
import type { Tool } from "../../../../agent/tools2/types.js";
import type { StreamTextProvider, StreamTextResult, StreamTextOptions } from "../../../interaction/provider.js";
import type { TextStreamPart, AsyncIterableStream } from "ai";
/**
 * Default chunks to return from mock streams.
 */
export declare const defaultChunks: TextStreamPart<Record<string, Tool>>[];
/** Default usage stats for sentence-based providers. */
export declare const sentenceUsage: {
    inputTokens: number;
    outputTokens: number;
    totalTokens: number;
};
/**
 * Create full stream chunks from an array of text strings.
 */
export declare function chunksFromText<TOOLS extends Record<string, Tool>>(textChunks: string[], usage?: {
    inputTokens: number;
    outputTokens: number;
    totalTokens: number;
}): TextStreamPart<TOOLS>[];
/**
 * Split a sentence into word-based text chunks (space-separated).
 * Each word after the first is prefixed with a space.
 */
export declare function textToChunks(text: string): string[];
/**
 * Create a mock StreamTextResult from text chunks.
 */
export declare function createResultFromText<TOOLS extends Record<string, Tool>>(textChunks: string[], usage?: {
    inputTokens: number;
    outputTokens: number;
    totalTokens: number;
}): StreamTextResult<TOOLS>;
/**
 * Create a mock StreamTextResult from a sentence (splits by spaces).
 */
export declare function createResultFromSentence<TOOLS extends Record<string, Tool>>(text: string): StreamTextResult<TOOLS>;
/**
 * Create an AsyncIterableStream from an array of items.
 * Each call to [Symbol.asyncIterator]() creates a fresh iterator.
 */
export declare function asyncIterableFrom<T>(items: T[]): AsyncIterableStream<T>;
export declare const MockProvider: {
    /**
     * Provider that always succeeds with the given chunks.
     */
    success<TOOLS extends Record<string, Tool> = Record<string, Tool<any, any>>>(chunks?: TextStreamPart<TOOLS>[]): StreamTextProvider;
    /**
     * Provider that always succeeds with the given text (splits by spaces).
     */
    successWithText(text: string): StreamTextProvider;
    /**
     * Provider that fails on the first N attempts then succeeds.
     * Optionally tracks calls by pushing to the provided `calls` array.
     */
    failsThenSucceeds(failCount: number, options?: {
        error?: Error;
        text?: string;
        textChunks?: string[];
        calls?: Array<{
            messages: any[];
            timestamp: number;
        }>;
    }): StreamTextProvider;
    /**
     * Provider where the stream fails after N chunks (sends error chunk).
     */
    streamFailsAfter(chunkCount: number, error?: Error): StreamTextProvider;
    /**
     * Provider where the iterator throws after N chunks (simulates network disconnect).
     * Unlike streamFailsAfter which sends an error chunk, this throws from iterator.next().
     */
    iteratorThrowsAfter(chunkCount: number, error?: Error): StreamTextProvider;
    /**
     * Provider where iterator throws on first N attempts, then succeeds.
     * Simulates network issues that recover after retries.
     */
    iteratorThrowsThenSucceeds(failCount: number, options?: {
        error?: Error;
        chunksBeforeError?: number;
        text?: string;
    }): StreamTextProvider;
    /**
     * Provider that stalls after N chunks.
     */
    streamStalls(chunkCount: number): StreamTextProvider;
    /**
     * Provider that tracks calls for verification.
     */
    tracked(text?: string): {
        provider: StreamTextProvider;
        calls: Array<{
            options: StreamTextOptions<any>;
            timestamp: number;
        }>;
    };
    /**
     * Provider that always fails with the given error.
     */
    alwaysFails(error?: Error): StreamTextProvider;
    /**
     * Provider that waits for a delay then fails.
     */
    slowAlwaysFails(delayMs: number, error?: Error): StreamTextProvider;
    /**
     * Provider that stalls for a specified duration then continues producing chunks.
     * This simulates the scenario where stall detection fires but the underlying
     * stream continues to produce data (e.g., tool calls appear after the stall error).
     *
     * @param stallDurationMs - How long to stall before continuing
     * @param chunksBeforeStall - Number of chunks to emit before stalling
     * @param chunksAfterStall - Optional chunks to emit after stall (defaults to success chunks)
     */
    stallsThenContinues(stallDurationMs: number, chunksBeforeStall?: number, chunksAfterStall?: TextStreamPart<Record<string, Tool>>[]): StreamTextProvider;
    /**
     * Provider with slow steps on first N attempts, then succeeds.
     * Simulates slow LLM responses that trigger stall detection.
     */
    slowStepsThenSucceeds(slowCount: number, stepDelayMs: number, options?: {
        text?: string;
    }): StreamTextProvider;
};
//# sourceMappingURL=mock-provider.d.ts.map