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;
    /**
     * The agent defaults `options` were resolved from. Function-based defaults can build new
     * scorers on every call, so recording whether the completion policy came from the defaults
     * must compare against this resolution rather than a fresh one.
     */
    resolvedDefaultOptions?: AgentExecutionOptions<OUTPUT>;
    /**
     * Whether agent scopes were already applied to `options` (DurableAgent does this itself).
     * When false, preparation resolves scopes so wrappers that call it directly honor them.
     */
    scopesResolved?: boolean;
    /**
     * The AGENT_RUN and MODEL_GENERATION spans a suspended run persisted when it started. A cold
     * resume passes them so the run keeps its own trace instead of opening a new one.
     */
    resumedSpanData?: {
        agentSpanData?: unknown;
        modelSpanData?: unknown;
    };
    /**
     * Scopes the caller passed. When the property is absent, `options.scopes`; set it (even to
     * undefined) when `options` already include the agent defaults, so the Agent's own
     * `defaultOptions.scopes` are not treated as caller input.
     */
    callScopes?: string[];
    /** 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