import { z } from "zod"; import type { Json } from "../ids.js"; export { TREE_MAX_NODES, TREE_MAX_QUERIES, TREE_MAX_GENERATED_COMPONENTS, TREE_MAX_COMPONENT_SOURCE_BYTES, TREE_MAX_TOTAL_COMPONENT_BYTES, TREE_MAX_COMPONENT_SOURCE_CHARS, TREE_MAX_TOTAL_COMPONENT_CHARS, } from "./tree-limits.js"; import type { ReshapeStep } from "../reshape.js"; /** 01-core §8; `$reshape` is v2 spec §3 — an optional bounded reshape chain * (additive: every existing consumer keeps working; the format gate validates * the chain, and the renderer applies it on resolution). */ export interface PathBinding { $path: string; $reshape?: ReshapeStep[]; } /** 01-core §8; `$reshape` as on {@link PathBinding} (v2 spec §3). */ export interface StateBinding { $state: string; $reshape?: ReshapeStep[]; } /** 01-core §8 */ export declare function isPathBinding(value: unknown): value is PathBinding; /** 01-core §8 */ export declare function isStateBinding(value: unknown): value is StateBinding; /** 01-core §8 */ export interface UIPayload { formatVersion: string; [key: string]: unknown; } /** 01-core §8 */ export declare const uiPayloadSchema: z.ZodObject<{ formatVersion: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ formatVersion: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ formatVersion: z.ZodString; }, z.ZodTypeAny, "passthrough">>; /** 01-core §8 */ export interface TreeNode { id: string; component: string; /** Where the painted component came from. `ported` is a component the splitter * ported from host source, as opposed to `generated`, which the model wrote * from scratch — the marker that lets the renderer honor `className` on * ported nodes only. */ source?: "prewired" | "host" | "generated" | "ported"; props?: Record; children?: string[]; } /** 01-core §8 */ export declare const treeNodeSchema: z.ZodObject<{ id: z.ZodString; component: z.ZodString; source: z.ZodOptional>; props: z.ZodOptional>; children: z.ZodOptional>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ id: z.ZodString; component: z.ZodString; source: z.ZodOptional>; props: z.ZodOptional>; children: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ id: z.ZodString; component: z.ZodString; source: z.ZodOptional>; props: z.ZodOptional>; children: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">>; /** The vocabulary itself, DERIVED from the schema above rather than written out * a second time — the two validators that walk a tree by hand instead of by zod * (apps genui/tree.ts, ui tree/renderer.tsx) read it from here. Three * hand-written copies is how `ported` came to be legal in one and refused by the * other two. */ export declare const TREE_NODE_SOURCES: readonly string[]; /** The one canonical non-null, non-array object guard (kill-list B6) — every * package already depends on core, so a per-file redefinition is duplication, * not a layering workaround. */ export declare const isPlainObject: (value: unknown) => value is Record; /** The one canonical own-property define (the isPlainObject precedent): a * wire/sample key named __proto__ must become data, never the record's * prototype. */ export declare const defineOwn: (record: Record, key: string, value: T) => void;