import type { AgJSONSchema } from '../ai/agJSONSchema'; import type { AgErrorMessageKey } from '../error'; import type { FailureResult, Issue, SuccessResult } from './standardSchema'; export interface AgStandardShapeIssue extends Issue { key: AgErrorMessageKey; variableValues?: Record; } export interface AgStandardShapeError extends FailureResult { success: false; issues: AgStandardShapeIssue[]; } export interface AgStandardShapeSuccess extends SuccessResult { value: T; success: true; } export type AgStandardShapeResult = AgStandardShapeSuccess | AgStandardShapeError; export interface AgStandardShape { parse(input: unknown): AgStandardShapeResult; toJSONSchema(): AgJSONSchema; '~standard': { version: 1; vendor: 'ag'; validate: (input: unknown) => AgStandardShapeResult; types: { input: TIn; output: TOut; }; }; }