/** * What a zod schema IS, in ONE vocabulary across zod 3 and zod 4. * * Two walkers read the Kit's schemas — the checks floor's TypeScript printer * (`server/checking/screen-typings.ts`) and the catalog prompt's compact type * text (`kit/catalog-prompt.ts`) — and both used to switch on `_def.typeName` * against `z.ZodFirstPartyTypeKind`. zod 4 has neither: the def carries `type` * instead, and the enum is gone, so every `case` compared `undefined` against * `undefined` and the FIRST one matched. Live on 0.27.1, where the peer range * admits zod 4: every prop in the Kit typed as `string`, 37 "takes string" * refusals, every real screen rejected, nothing painted — and the `default:` * net that exists so imprecise typing never becomes a false positive could not * be reached to catch it. * * So the version knowledge lives here, once, and both walkers read the same * normalized answer. The two layouts are NOT merged field by field: zod 3 keeps * an array's element in `_def.type`, which is the very field zod 4 uses for the * tag, so the tag decides how the rest of the def is read. A def wearing * neither tag — a construct outside this vocabulary, a stub from a shim, or * nothing at all — is `"unsupported"`, which is the honest answer and the one * both walkers already degrade on. */ import type { ZodTypeAny } from "zod"; export type ZodKind = "string" | "number" | "boolean" | "null" | "any" | "unknown" | "enum" | "literal" | "array" | "union" | "record" | "object" | "optional" | "nullable" | "effects" | "unsupported"; export interface ZodShape { kind: ZodKind; /** The def's own tag, for the sentence a walker writes when it degrades. */ tag?: string; /** An `enum`'s members, or a `literal`'s value — zod 4 literals hold a list. */ values?: readonly unknown[]; /** An `array`'s element, an `optional`/`nullable`'s inner schema, or the * schema an `effects` started from. */ inner?: ZodTypeAny; /** A `union`'s members. */ options?: readonly ZodTypeAny[]; /** A `record`'s value. */ valueType?: ZodTypeAny; /** An `object`'s fields. */ shape?: Readonly>; /** An `object` that KEEPS what it does not declare. */ passthrough?: boolean; } export declare function zodShape(schema: ZodTypeAny | undefined): ZodShape; //# sourceMappingURL=zod-shape.d.ts.map