/** * TOON — Token-Optimized Object Notation. * * A compact, deterministic, line-oriented text format for Reticle snapshots and query results. * This is a ONE-WAY, encode-only projection of the internal JSON representation (there is no decoder * back to JSON — the agent reads TOON, it is never parsed back). Not a binary format — Claude must be * able to generate and read it reliably from its training data alone. * * Grammar (one element per line): * type ref "name" [states] key=value... * * Element types (abbreviated roles): * btn button inp textbox/input sel combobox/listbox chk checkbox * rad radio lnk link img img dlg dialog/alertdialog * nav navigation lst list/listbox tab tab/tabpanel hdr heading * frm form mn menu/menubar fld group/fieldset el (any other role) * * State flags (inside []): * vis visible hid hidden en enabled dis disabled * chk checked exp expanded focus focused * (`present` is on every element, so it is never encoded — see STATE_FLAG.) * * Attributes (key=value, space-separated): * val="..." current value of the element * count=N child count (for containers, replaces expanding children) * ph="..." placeholder text */ /** Encode an ElementDescriptor to a TOON line. */ export interface ToonElement { ref: string; role: string; name: string; value?: string; states?: string[]; visible?: boolean; text?: string; children?: ToonElement[]; childCount?: number; } /** Encode an array of ElementDescriptor-shaped objects to TOON text. */ export declare function toToon(elements: ToonElement[]): string; /** Encode a single reticle_snapshot or reticle_query result object to TOON. */ export declare function resultToToon(result: Record): string; /** Whether a tool result object should be encoded as TOON (has an elements array). */ export declare function isToonable(result: unknown): boolean;