import type { ScoringFilter } from '../../../evals/predicate.js';
import type { MastraLanguageModel } from '../../../llm/model/shared.types.js';
import type { ToolCallConcurrency } from '../../../loop/types.js';
import type { MemoryConfig } from '../../../memory/types.js';
import type { SpanErrorOrigin } from '../../../observability/error-count.js';
import type { CoreTool } from '../../../tools/types.js';
import type { MessageList } from '../../message-list/index.js';
import type { AgentModelManagerConfig } from '../../types.js';
import type { SerializableClientTool, SerializableToolMetadata, SerializableModelConfig, SerializableModelListEntry, SerializableDurableState, SerializableDurableOptions, SerializableModelSettings, SerializableScorersConfig, DurableAgenticWorkflowInput } from '../types.js';
/**
 * Extract serializable metadata from a CoreTool
 * This strips out the execute function and converts the schema to JSON Schema
 */
export declare function serializeToolMetadata(name: string, tool: CoreTool): SerializableToolMetadata;
/**
 * Extract serializable metadata from all tools
 */
export declare function serializeToolsMetadata(tools: Record<string, CoreTool>): SerializableToolMetadata[];
/**
 * Extract serializable model configuration
 */
export declare function serializeModelConfig(model: MastraLanguageModel): SerializableModelConfig;
/**
 * Extract serializable model list entry from AgentModelManagerConfig
 */
export declare function serializeModelListEntry(entry: AgentModelManagerConfig): SerializableModelListEntry;
/**
 * Serialize an array of model configs into a model list.
 * Filters out disabled models since they shouldn't be included in durable execution.
 */
export declare function serializeModelList(models: AgentModelManagerConfig[]): SerializableModelListEntry[];
/**
 * Serialize scorers configuration for durable execution.
 *
 * This extracts the scorer name (for resolution at runtime) and sampling config.
 * The actual scorer objects are resolved from Mastra at step execution time.
 *
 * @param scorers The agent's scorers configuration (from agent.scorers or options.scorers)
 * @returns Serializable scorer configuration
 */
export declare function serializeScorersConfig(scorers: Record<string, {
    scorer: {
        name: string;
    } | string;
    sampling?: {
        type: 'none';
    } | {
        type: 'ratio';
        rate: number;
    };
    filter?: ScoringFilter;
}>): SerializableScorersConfig;
/**
 * Extract serializable state from _internal-like objects
 */
export declare function serializeDurableState(params: {
    memoryConfig?: MemoryConfig;
    threadId?: string;
    resourceId?: string;
    threadExists?: boolean;
    savePerStep?: boolean;
    observationalMemory?: boolean;
    fixedMemory?: boolean;
}): SerializableDurableState;
/**
 * Pick the JSON-safe call settings out of an arbitrary `modelSettings` input.
 * Drops any field that is not a primitive value of the expected type so that
 * non-serializable fields (functions, AbortSignal, etc.) never reach the
 * workflow input.
 */
export declare function serializeModelSettings(settings: SerializableModelSettings | Record<string, unknown> | undefined): SerializableModelSettings | undefined;
/**
 * Snapshot call-time client tools from their converted CoreTools so a worker in
 * another process can rebuild them. Provider tools (no JSON input schema to
 * carry) are skipped.
 */
export declare function serializeClientTools(clientTools: Record<string, unknown> | undefined, tools: Record<string, CoreTool>): Record<string, SerializableClientTool> | undefined;
/**
 * Collect the tool names from call-time toolsets so a cross-process worker can
 * detect that they are unavailable.
 */
export declare function serializeToolsetToolNames(toolsets: Record<string, Record<string, unknown> | undefined> | undefined): string[] | undefined;
/**
 * Extract serializable options from agent execution options
 */
export declare function serializeDurableOptions(options: {
    clientTools?: SerializableDurableOptions['clientTools'];
    toolsetToolNames?: string[];
    maxSteps?: number;
    toolChoice?: any;
    activeTools?: string[];
    modelSettings?: SerializableModelSettings | Record<string, unknown>;
    agentMaxRetries?: number;
    agentMaxRetriesConfigured?: boolean;
    requireToolApproval?: boolean;
    toolCallConcurrency?: ToolCallConcurrency;
    autoResumeSuspendedTools?: boolean;
    maxProcessorRetries?: number;
    includeRawChunks?: boolean;
    returnScorerData?: boolean;
    hasErrorProcessors?: boolean;
    emptyErrorProcessorOverride?: boolean;
    providerOptions?: SerializableDurableOptions['providerOptions'];
    structuredOutput?: SerializableDurableOptions['structuredOutput'];
    skipBgTaskWait?: boolean;
    disableBackgroundTasks?: boolean;
    backgroundTaskPolicy?: SerializableDurableOptions['backgroundTaskPolicy'];
    tracingOptions?: SerializableDurableOptions['tracingOptions'];
    actor?: SerializableDurableOptions['actor'];
    instructionsOverride?: SerializableDurableOptions['instructionsOverride'];
    systemMessage?: SerializableDurableOptions['systemMessage'];
    transform?: SerializableDurableOptions['transform'];
    isTaskComplete?: SerializableDurableOptions['isTaskComplete'];
}): SerializableDurableOptions;
/**
 * Create the full workflow input from all components
 */
export declare function createWorkflowInput(params: {
    runId: string;
    agentId: string;
    agentName?: string;
    agentVersionId?: string;
    messageList: MessageList;
    tools: Record<string, CoreTool>;
    model: MastraLanguageModel;
    modelList?: AgentModelManagerConfig[];
    scorers?: Parameters<typeof serializeScorersConfig>[0];
    options: Parameters<typeof serializeDurableOptions>[0];
    state: Parameters<typeof serializeDurableState>[0];
    messageId: string;
    agentSpanData?: unknown;
    modelSpanData?: unknown;
    requestContextEntries?: Record<string, unknown>;
    inputTripwire?: DurableAgenticWorkflowInput['inputTripwire'];
}): DurableAgenticWorkflowInput;
/**
 * Serialize an error for workflow state
 */
export declare function serializeError(error: unknown): {
    name: string;
    message: string;
    stack?: string;
    __mastraSpanErrorOrigin?: SpanErrorOrigin;
};
/**
 * Serialize a Date to ISO string for workflow state
 */
export declare function serializeDate(date: Date | undefined): string | undefined;
/**
 * Deserialize an ISO string back to Date
 */
export declare function deserializeDate(isoString: string | undefined): Date | undefined;
//# sourceMappingURL=serialize-state.d.ts.map