import type { MastraServerCache } from '../../cache/base.js';
import type { PubSub } from '../../events/pubsub.js';
import type { ResolvedAgentStreamBus } from './resolve.js';
import type { AgentStreamsConfig } from './types.js';
/**
 * Hooks an {@link AgentStreamBus} reads its owner's runtime state through.
 * The bus keeps no process-specific state of its own.
 */
export interface AgentStreamBusHooks {
    /** The Mastra-level bus and cache, once the owner is registered. */
    getMastra: () => {
        pubsub: PubSub;
        serverCache?: MastraServerCache;
    } | undefined;
    /** The owner's default execution mode; wrappers select their own mode per run. */
    usesSharedRunLog: () => boolean;
    warn: (message: string) => void;
}
/** Runs `cleanup` after `timeoutMs`. A timeout of 0 keeps run state forever, so nothing is scheduled. */
export declare function scheduleStreamCleanup(timeoutMs: number, cleanup: () => void): ReturnType<typeof setTimeout> | undefined;
/**
 * The resumable stream layer of an agent: the bus its run frames are
 * published on and the replay cache that lets readers reconnect from an
 * offset. Resolution is lazy so a registered agent inherits Mastra's bus and
 * cache.
 */
export declare class AgentStreamBus {
    #private;
    constructor(config: AgentStreamsConfig, hooks: AgentStreamBusHooks, defaultPubsub?: PubSub);
    /** Isolate explicit wrapper settings without changing the native Agent's bus. */
    withConfig(config: AgentStreamsConfig): AgentStreamBus;
    /** The owner's default run transport, including replay when enabled. */
    get pubsub(): PubSub;
    /** The owner's default replay cache, or `null` when replay is disabled. */
    get cache(): MastraServerCache | null;
    /** Ownership records follow the same cache as the run's replay history. */
    get runRecordCache(): MastraServerCache;
    getRunRecordCache(usesSharedRunLog: boolean): MastraServerCache;
    /** Grace period before a finished run's state is cleaned up (0 = never). */
    get cleanupTimeoutMs(): number;
    /** Runs `cleanup` once the grace period passes. Returns no timer when cleanup is disabled. */
    scheduleCleanup(cleanup: () => void): ReturnType<typeof setTimeout> | undefined;
    /** Re-resolve transports initialized before Mastra registration. */
    registerMastra(mastraPubsub: PubSub): void;
    /** Select the run's log without changing the owner's default routing policy. */
    forRun(usesSharedRunLog: boolean): ResolvedAgentStreamBus;
}
//# sourceMappingURL=bus.d.ts.map