UNPKG

@mastra/core

Version:

The core foundation of the Mastra framework, providing essential components and interfaces for building AI-powered applications.

88 lines (85 loc) 4.94 kB
import { aw as VariableReference, aD as StepResult, H as Step, I as Workflow, B as Agent, aG as WorkflowContext, a$ as ToolsInput, a as Mastra, ar as StepAction, aF as WorkflowRunResult } from '../base-BS0LLAna.js'; export { ay as ActionContext, ax as BaseCondition, aM as DependencyCheckOutput, aT as ExtractSchemaFromStep, aW as ExtractSchemaType, aU as ExtractStepResult, aX as PathsToStringProps, aJ as ResolverFunctionInput, aK as ResolverFunctionOutput, av as RetryConfig, aB as StepCondition, aC as StepConfig, aA as StepDef, aq as StepExecutionContext, au as StepGraph, aS as StepId, aV as StepInputType, at as StepNode, aN as StepResolverOutput, as as StepVariableType, aE as StepsRecord, aL as SubscriberFunctionOutput, az as WhenConditionReturnValue, aP as WorkflowActionParams, aQ as WorkflowActions, aO as WorkflowActors, aI as WorkflowEvent, aH as WorkflowLogMessage, J as WorkflowOptions, aZ as WorkflowResumeResult, aY as WorkflowRunState, aR as WorkflowState } from '../base-BS0LLAna.js'; import { z } from 'zod'; import { a as Metric } from '../types-BtMyV38I.js'; import { L as Logger } from '../index-CquI0inB.js'; import '../base-DT2poiVK.js'; import 'ai'; import 'sift'; import 'json-schema'; import '../runtime-context/index.js'; import '@opentelemetry/api'; import 'xstate'; import 'node:events'; import '../vector/index.js'; import '../vector/filter/index.js'; import 'stream'; import 'pino'; import '@opentelemetry/sdk-trace-base'; import '../tts/index.js'; import 'events'; import '../deployer/index.js'; import '../bundler/index.js'; import 'hono'; import 'hono/cors'; import 'hono-openapi'; import 'ai/test'; declare function isErrorEvent(stateEvent: any): stateEvent is { type: `xstate.error.actor.${string}`; error: Error; }; declare function isTransitionEvent(stateEvent: any): stateEvent is { type: `xstate.done.actor.${string}`; output?: unknown; }; declare function isVariableReference(value: any): value is VariableReference<any, any>; declare function getStepResult(result?: StepResult<any>): any; declare function getSuspendedPaths({ value, path, suspendedPaths, }: { value: string | Record<string, string>; path: string; suspendedPaths: Set<string>; }): void; declare function isFinalState(status: string): boolean; declare function isLimboState(status: string): boolean; declare function recursivelyCheckForFinalState({ value, suspendedPaths, path, }: { value: string | Record<string, string>; suspendedPaths: Set<string>; path: string; }): boolean; declare function getActivePathsAndStatus(value: Record<string, any>): Array<{ stepPath: string[]; stepId: string; status: string; }>; declare function mergeChildValue(startStepId: string, parent: Record<string, any>, child: Record<string, any>): Record<string, any>; declare const updateStepInHierarchy: (value: Record<string, any>, targetStepId: string) => Record<string, any>; declare function getResultActivePaths(state: { value: Record<string, string>; context: { steps: Record<string, any>; }; }): Map<string, { status: string; suspendPayload?: any; stepPath: string[]; }>; declare function isWorkflow(step: Step<any, any, any, any> | Workflow<any, any, any, any> | Agent<any, any, any>): step is Workflow<any, any, any, any>; declare function isAgent(step: Step<any, any, any, any> | Agent<any, any, any> | Workflow<any, any, any, any>): step is Agent<any, any, any>; declare function resolveVariables({ runId, logger, variables, context, }: { runId: string; logger: Logger; variables: Record<string, VariableReference<any, any>>; context: WorkflowContext; }): Record<string, any>; declare function agentToStep<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TMetrics extends Record<string, Metric> = Record<string, Metric>>(agent: Agent<TAgentId, TTools, TMetrics>, { mastra }?: { mastra?: Mastra; }): StepAction<TAgentId, z.ZodObject<{ prompt: z.ZodString; }>, z.ZodObject<{ text: z.ZodString; }>, any>; declare function workflowToStep<TSteps extends Step<any, any, any, any>[], TStepId extends string = any, TTriggerSchema extends z.ZodObject<any> = any, TResultSchema extends z.ZodObject<any> = any>(workflow: Workflow<TSteps, TStepId, TTriggerSchema, TResultSchema>, { mastra }: { mastra?: Mastra; }): StepAction<TStepId, TTriggerSchema, z.ZodType<WorkflowRunResult<TTriggerSchema, TSteps, TResultSchema>>, any>; declare function isConditionalKey(key: string): boolean; export { Step, StepAction, StepResult, VariableReference, Workflow, WorkflowContext, WorkflowRunResult, agentToStep, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isAgent, isConditionalKey, isErrorEvent, isFinalState, isLimboState, isTransitionEvent, isVariableReference, isWorkflow, mergeChildValue, recursivelyCheckForFinalState, resolveVariables, updateStepInHierarchy, workflowToStep };