UNPKG

@mastra/core

Version:

Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.

110 lines 3.6 kB
import { z } from 'zod'; /** * Shared Zod schemas for durable agentic workflows. * * These schemas are used by: * - Core DurableAgent workflow * - Inngest durable agent workflow * - Evented durable agent workflow (future) */ /** * Schema for model configuration */ export declare const modelConfigSchema: z.ZodObject<{ provider: z.ZodString; modelId: z.ZodString; specificationVersion: z.ZodOptional<z.ZodString>; settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; }, z.core.$strip>; /** * Schema for model list entry (fallback support) */ export declare const modelListEntrySchema: z.ZodObject<{ id: z.ZodString; config: z.ZodObject<{ provider: z.ZodString; modelId: z.ZodString; specificationVersion: z.ZodOptional<z.ZodString>; originalConfig: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; }, z.core.$strip>; maxRetries: z.ZodNumber; enabled: z.ZodBoolean; }, z.core.$strip>; /** * Schema for accumulated usage across iterations */ export declare const accumulatedUsageSchema: z.ZodObject<{ inputTokens: z.ZodNumber; outputTokens: z.ZodNumber; totalTokens: z.ZodNumber; }, z.core.$strip>; /** * Schema for output from the durable agentic workflow */ export declare const durableAgenticOutputSchema: z.ZodObject<{ messageListState: z.ZodAny; messageId: z.ZodString; stepResult: z.ZodAny; output: z.ZodObject<{ text: z.ZodOptional<z.ZodString>; usage: z.ZodAny; steps: z.ZodArray<z.ZodAny>; }, z.core.$strip>; state: z.ZodAny; }, z.core.$strip>; /** * Base schema for durable agentic workflow input. * Implementations can extend this with additional fields. */ export declare const baseDurableAgenticInputSchema: z.ZodObject<{ runId: z.ZodString; agentId: z.ZodString; agentName: z.ZodOptional<z.ZodString>; messageListState: z.ZodAny; toolsMetadata: z.ZodArray<z.ZodAny>; modelConfig: z.ZodObject<{ provider: z.ZodString; modelId: z.ZodString; specificationVersion: z.ZodOptional<z.ZodString>; settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; }, z.core.$strip>; options: z.ZodAny; state: z.ZodAny; messageId: z.ZodString; }, z.core.$strip>; /** * Base schema for iteration state. * Implementations can extend this with additional fields. */ export declare const baseIterationStateSchema: z.ZodObject<{ runId: z.ZodString; agentId: z.ZodString; agentName: z.ZodOptional<z.ZodString>; messageListState: z.ZodAny; toolsMetadata: z.ZodArray<z.ZodAny>; modelConfig: z.ZodAny; options: z.ZodAny; state: z.ZodAny; messageId: z.ZodString; iterationCount: z.ZodNumber; accumulatedSteps: z.ZodArray<z.ZodAny>; accumulatedUsage: z.ZodObject<{ inputTokens: z.ZodNumber; outputTokens: z.ZodNumber; totalTokens: z.ZodNumber; }, z.core.$strip>; lastStepResult: z.ZodOptional<z.ZodAny>; backgroundTaskPending: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>; /** * Type for the base iteration state */ export type BaseIterationState = z.infer<typeof baseIterationStateSchema>; /** * Type for accumulated usage */ export type AccumulatedUsage = z.infer<typeof accumulatedUsageSchema>; //# sourceMappingURL=schemas.d.ts.map