UNPKG

@mastra/core

Version:
27 lines 1.51 kB
import type { JsonSchema } from './json-schema-to-zod.js'; import type { WorkflowValidationIssue } from './validate/types.js'; /** Parses a stored mapConfig JSON string; throws with the step id on malformed JSON. */ export declare function parseMapConfig(raw: string, stepId: string): Record<string, any>; export interface MapConfigAnalysisOptions { /** Issue path prefix of the mapping entry, e.g. `graph.2`. */ path: string; /** Outputs of preceding workflow-local steps (schema may be undefined when unknown). */ availableOutputs: ReadonlyMap<string, JsonSchema | undefined>; /** The workflow's input schema (for `{ initData: true }` sources). */ inputSchema: JsonSchema | undefined; /** The workflow's request-context schema (for `{ requestContextPath }` sources). */ requestContextSchema: JsonSchema | undefined; } export interface MapConfigAnalysis { issues: WorkflowValidationIssue[]; /** Inferred output schema of the mapping step; undefined when the config is unusable. */ outputSchema: JsonSchema | undefined; } /** * Validates a mapping entry's raw `mapConfig` string and infers the step's * output schema. Every key must define exactly one source * (`value` | `template` | `requestContextPath` | `initData`/`step` + `path`); * step references must point at preceding workflow-local steps. */ export declare function analyzeMapConfig(rawConfig: string, opts: MapConfigAnalysisOptions): MapConfigAnalysis; //# sourceMappingURL=mapping-config.d.ts.map