/** * GenUI Planner * * Takes structured UIIntent objects and produces validated UIPlan objects. * Bridge between "what the AI wants to create" and the deterministic kernel execution. * * Intent → UINode tree → UIPlan → schema validation → accessibility audit → PlanResult */ import type { UIPlan, CommandSource, ComponentRegistration, ValidationResult } from './types.ts'; import type { A11yResult } from './accessibility.ts'; export interface UIIntent { readonly type: 'form' | 'display' | 'action' | 'layout' | 'composite'; readonly elements: readonly ElementIntent[]; readonly id?: string; readonly title?: string; } export interface ElementIntent { readonly component: string; readonly label?: string; readonly attributes?: Readonly>; readonly properties?: Readonly>; readonly events?: Readonly>; readonly children?: readonly ElementIntent[]; readonly slot?: string; } export interface PlanResult { readonly plan: UIPlan; readonly validation: ValidationResult; readonly accessibility: A11yResult; readonly warnings: readonly string[]; } export interface FormFieldIntent { readonly name: string; readonly type?: 'text' | 'email' | 'password' | 'number' | 'textarea' | 'select'; readonly placeholder?: string; readonly required?: boolean; readonly options?: readonly { value: string; label: string; }[]; } export interface ButtonIntent { readonly label: string; readonly command: string; readonly variant?: string; readonly intent?: string; } export interface CardIntent { readonly heading?: string; readonly body: string; readonly footer?: readonly ButtonIntent[]; readonly media?: { src: string; alt: string; height?: string; }; readonly interactive?: boolean; readonly href?: string; } export interface DialogIntent { readonly title: string; readonly body: string; readonly confirmLabel?: string; readonly cancelLabel?: string; readonly confirmCommand: string; readonly cancelCommand?: string; readonly intent?: string; } export interface SettingIntent { readonly label: string; readonly description?: string; readonly name: string; readonly checked?: boolean; readonly command?: string; } export interface TabIntent { readonly label: string; readonly value: string; readonly content: string; readonly disabled?: boolean; } export interface NavItemIntent { readonly label: string; readonly value: string; readonly icon?: string; readonly group?: string; } export declare class Planner { #private; constructor(registry?: Map); generate(intent: UIIntent, source?: CommandSource): PlanResult; /** * Build a form plan from field descriptors. * Produces a `
` with `n-field` + `n-input`/`n-select`/`n-textarea` per field, * plus a submit `n-button` at the end. */ static form(fields: readonly FormFieldIntent[], options?: { title?: string; submitLabel?: string; submitCommand?: string; registry?: Map; }): PlanResult; /** * Build a simple action bar from button descriptors. * Produces a horizontal `
` with `n-button` children. */ static actions(buttons: readonly ButtonIntent[], options?: { registry?: Map; }): PlanResult; /** * Build a content card with optional heading, body, media, and footer actions. * Produces a `` with slotted children. */ static card(card: CardIntent, options?: { registry?: Map; }): PlanResult; /** * Build a confirmation/alert dialog. * Produces a `` with a styled panel containing title, body, and action buttons. */ static dialog(dialog: DialogIntent, options?: { registry?: Map; }): PlanResult; /** * Build a settings toggle list. * Produces a vertical list of `n-switch` elements with labels and optional descriptions. */ static settings(settings: readonly SettingIntent[], options?: { title?: string; registry?: Map; }): PlanResult; /** * Build a tabbed interface. * Produces a `` with `` triggers + `` container. */ static tabs(tabs: readonly TabIntent[], options?: { defaultValue?: string; orientation?: 'horizontal' | 'vertical'; registry?: Map; }): PlanResult; /** * Build a navigation list. * Produces a `` with `` items, optionally grouped with ``. */ static nav(items: readonly NavItemIntent[], options?: { title?: string; registry?: Map; }): PlanResult; } export declare function createPlanner(registry?: Map): Planner; //# sourceMappingURL=planner.d.ts.map