import type { ModelMessage } from 'ai'; import { z } from 'zod'; import type { DecideNode } from '../types/flow.js'; import type { ChoiceOption } from '../types/selection.js'; import type { JSONValue, SystemModelMessage } from 'ai'; import type { RunContext } from '../types/run-context.js'; /** Reserved enum member: model declines to pick a listed choice (→ author stay/unmatched). */ export declare const CHOICE_NONE = "__none"; export declare function isConstrainedChoiceEnumSchema(schema: unknown): boolean; export declare function isChoiceFieldSchema(schema: unknown): schema is z.ZodObject<{ choice: z.ZodString; }>; export declare function buildChoiceEnumSchema(choices: ChoiceOption[]): z.ZodObject<{ choice: z.ZodEnum>; }>; export declare function latestUserMessageText(messages: ModelMessage[]): string | undefined; export declare function matchChoiceFromInput(input: string, choices: ChoiceOption[]): string | undefined; export declare function resolveStructuredDecide(node: DecideNode, ctx: RunContext, system: string | SystemModelMessage[], providerOptions?: Record>): Promise; export type PreparedStructuredDecision = { kind: 'immediate'; value: unknown; } | { kind: 'model'; schema: z.ZodType; }; /** Resolve deterministic choice matches and the exact schema used by model-backed decide nodes. */ export declare function prepareStructuredDecide(node: DecideNode, ctx: Pick): PreparedStructuredDecision;