import type { IMastraLogger } from '../../logger/index.js';
import type { Mastra } from '../../mastra/index.js';
import { RequestContext } from '../../request-context/index.js';
import type { Agent } from '../agent.js';
import type { AgentExecutionOptions } from '../agent.types.js';
import { MessageList } from '../message-list/index.js';
import type { MessageListInput } from '../message-list/index.js';
import type { AgentMethodType } from '../types.js';
import type { DurableAgenticWorkflowInput, RunRegistryEntry } from './types.js';
/**
 * Result from the preparation phase
 */
export interface PreparationResult<_OUTPUT = undefined> {
    /** Unique run identifier */
    runId: string;
    /** Message ID for this generation */
    messageId: string;
    /** Serialized workflow input */
    workflowInput: DurableAgenticWorkflowInput;
    /** Non-serializable state for the run registry */
    registryEntry: RunRegistryEntry;
    /** MessageList for callback access */
    messageList: MessageList;
    /** Thread ID if using memory */
    threadId?: string;
    /** Resource ID if using memory */
    resourceId?: string;
}
/**
 * Options for preparation phase
 */
export interface PreparationOptions<OUTPUT = undefined> {
    /** The agent instance (wrapped agent — used for config resolution: tools, model, instructions, memory) */
    agent: Agent<string, any, OUTPUT>;
    /** User messages to process */
    messages: MessageListInput;
    /** Execution options */
    options?: AgentExecutionOptions<OUTPUT>;
    /** Whether execution options already include the agent defaults. */
    optionsAreResolved?: boolean;
    /** Run ID (will be generated if not provided) */
    runId?: string;
    /** Request context */
    requestContext?: RequestContext;
    /** Logger */
    logger?: IMastraLogger;
    /** Mastra instance (for version overrides, background tasks, etc.) */
    mastra?: Mastra;
    /** Method type */
    methodType?: AgentMethodType;
    /**
     * The public-facing agent ID (the DurableAgent wrapper's ID).
     * Used for spans, background tasks, scorers, and all identification visible to Studio.
     * Falls back to `agent.id` if not provided.
     */
    durableAgentId?: string;
    /**
     * The public-facing agent name (the DurableAgent wrapper's name).
     * Used for spans, background tasks, scorers, and all identification visible to Studio.
     * Falls back to `agent.name` if not provided.
     */
    durableAgentName?: string;
}
/**
 * Prepare for durable agent execution.
 *
 * This function performs the non-durable preparation phase:
 * 1. Generates run ID and message ID
 * 2. Resolves thread/memory context
 * 3. Creates MessageList with instructions and messages
 * 4. Converts tools to CoreTool format
 * 5. Gets the model configuration
 * 6. Creates serialized workflow input
 * 7. Creates run registry entry for non-serializable state
 *
 * The result includes both the serialized workflow input (for the durable
 * workflow) and the run registry entry (for non-serializable state).
 */
export declare function prepareForDurableExecution<OUTPUT = undefined>(options: PreparationOptions<OUTPUT>): Promise<PreparationResult<OUTPUT>>;
//# sourceMappingURL=preparation.d.ts.map