import { z } from "zod"; /** Sort directions accepted by the LLM. */ export type SortDirection = "asc" | "desc"; export interface Sort { field: string; direction: SortDirection; } /** * Carte-author-declared shape: which built-in sort fields a query may expose, * and (optionally) which directions are allowed for each. Typically supplied * via `defineParams({ sorts: ... })`. Used by `parsePlan` (to reject * LLM-emitted sorts that don't fit) and `generatePrompt` (to teach the LLM * what's available). */ export interface AllowedSort { /** * Permitted directions for this field. Default `["asc", "desc"]` (both). * Set to a single direction for fields where only one ordering makes * semantic sense (e.g. `createdAt: ["desc"]` for recent-first feeds). */ directions?: SortDirection[]; /** Optional human-readable description shown in the prompt. */ description?: string; } export type AllowedSorts = Record; export declare const sortSchema: z.ZodType; /** * Sugar for `z.array(sortSchema)`. `defineParams({ sorts: ... })` adds this * automatically for built-in sort support. You can still use it directly in a * plain params schema when you want to own sort semantics yourself. */ export declare const sortsParamSchema: z.ZodArray>>; export declare const allowedSortSchema: z.ZodType; /** * Returns a human-readable error message if `sort` is not allowed under * `allowed`, or `undefined` if it passes. Used by `validatePlan` and * `applyDrizzleSort`. */ export declare function checkSort(sort: Sort, allowed: AllowedSorts): string | undefined; //# sourceMappingURL=sorts.d.ts.map