/** * The A2UI catalog subset this engine renders — the single source of truth for * BOTH validation (`a2ui-validate.ts`) and the agent-facing system prompt * (`a2ui-prompt.ts`). No Svelte imports: this module must be importable * standalone (a server building the system prompt has no DOM). * * The subset covers the v0.9.1 `basic` components except the deliberately * excluded ones (Modal, Video, AudioPlayer), which validate to a visible * error chip; see `UNSUPPORTED_A2UI_COMPONENTS`. * * Prop names, kinds, `required`, defaults and enum sets mirror * `catalogs/basic/catalog.json` **case-sensitively**. Every `description` here * is written to be read by an agent — it is emitted verbatim into the prompt. */ /** How a prop value is shaped and validated. */ export type A2uiPropKind = 'string' | 'number' | 'boolean' | 'stringList' | 'enum' | 'childId' | 'childList' | 'labeledChildren' | 'action' | 'options' | 'icon' | 'accessibility'; export interface A2uiPropSpec { kind: A2uiPropKind; /** Required on the component. @default false */ required?: boolean; /** Accepts the Dynamic union (literal | `{ path }` | function call). @default false */ dynamic?: boolean; /** Allowed values for `enum`/`icon` kinds. */ values?: readonly string[]; /** * `labeledChildren` only: the item key carrying the label. The A2UI catalogs * disagree on it — Basic `Tabs` items are `{ title, child }`, the Urbicon * `Accordion` uses `{ label, child }` — and the registries mirror their own * catalog verbatim, so the key is data rather than a hardcoded `label`. * The child key is always `child`. @default 'label' */ labelKey?: string; /** Documented default (rendered in the prompt). */ default?: string | number | boolean; /** Agent-facing description; emitted into the system prompt verbatim. */ description: string; /** * Accepted for spec-compatibility but omitted from the prompt and rendered * with a degraded fallback (e.g. ChoicePicker `displayStyle`/`filterable`). */ promptHidden?: boolean; } export interface A2uiComponentSpec { /** Agent-facing description; emitted into the system prompt verbatim. */ description: string; props: Record; } /** Opaque catalog identifier this subset advertises in `createSurface`. */ export declare const A2UI_CATALOG_ID = "urbicon-ui/a2ui-basic-subset/v0.9.1"; /** Envelope `version` strings this engine accepts. */ export declare const A2UI_SUPPORTED_VERSIONS: readonly string[]; /** * Real v0.9.1 `basic` components the engine deliberately does not render. * Distinguished from wholly-unknown component names so the error message can * say "not part of the rendered subset" rather than "unknown". */ export declare const UNSUPPORTED_A2UI_COMPONENTS: ReadonlySet; /** * Mapped `Icon.name` values. A name outside this set degrades to a fallback * glyph (a warning, not an error). Kept in sync with the direct icon imports in * `A2UINode.svelte` (WP-B). */ export declare const A2UI_ICON_NAMES: readonly string[]; /** * Grammar guard for inline `Icon.name.svgPath`. Only SVG path commands, digits, * whitespace and separators — no `<`, no attributes, no entities. WP-B MUST * re-apply this guard before inlining a `` (defense in depth). */ export declare const A2UI_SVG_PATH_RE: RegExp; /** * Build a lookup table that inherits nothing. * * Every table on the A2UI path is keyed by a string the PAYLOAD chooses — a * component name, a prop name, an icon name, a variant. On an ordinary object * literal `table['toString']` resolves an `Object.prototype` member instead of * missing, and the caller then reads `.props` off a function: one line of * payload killed the whole surface (#134). A null prototype makes that state * unrepresentable at the source, rather than asking every lookup site — the * validator, the renderer, the prompt builder, and every one added later — to * remember `Object.hasOwn`. * * `Object.assign` copies own enumerable keys only, so the result carries the * table's real entries and nothing else. */ export declare function lookupTable(entries: Record): Readonly>; /** * Read one entry out of a lookup table by a key the PAYLOAD chose. * * `lookupTable` above hardens the tables this package ships, but `A2uiCatalog` * is a documented extension point: a consumer registering their own catalog * writes plain object literals, as anyone would, and their registry inherits * from `Object.prototype` again. So the engine cannot rely on how a table was * built — every lookup driven by payload text goes through here, and the two * defences are deliberately redundant rather than alternatives. */ export declare function ownEntry(table: Readonly> | undefined, key: string): T | undefined; export declare const A2UI_REGISTRY: Readonly>; /** Props recognized anywhere but intentionally ignored (validation only, dropped before render). */ export declare const A2UI_IGNORED_PROPS: ReadonlySet;