@ai-gui/plugin-ui 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,303 @@
1
+ import MarkdownIt from "markdown-it";
2
+
3
+ //#region ../core/dist/index.d.ts
4
+
5
+ //#endregion
6
+ //#region src/types.d.ts
7
+ /** Framework-agnostic render node. */
8
+ interface ASTNode {
9
+ key: string;
10
+ type: string;
11
+ tag?: string;
12
+ content?: string;
13
+ html?: string;
14
+ attrs?: Record<string, string>;
15
+ children?: ASTNode[];
16
+ /** Whether a streaming block has enough source to invoke its renderer. */
17
+ complete?: boolean;
18
+ /** card-specific payload */
19
+ card?: {
20
+ id?: string;
21
+ type: string;
22
+ data: unknown;
23
+ complete: boolean;
24
+ valid: boolean;
25
+ };
26
+ }
27
+ /** Patch event produced by diffing. */
28
+
29
+ /** Framework-neutral render descriptor returned by plugin node renderers. */
30
+ type RenderOutput = {
31
+ kind: "html";
32
+ html: string;
33
+ } | {
34
+ kind: "element";
35
+ tag: string;
36
+ props?: Record<string, unknown>;
37
+ children?: RenderOutput[];
38
+ } | {
39
+ kind: "card";
40
+ type: string;
41
+ data: unknown;
42
+ } | {
43
+ kind: "mount";
44
+ mount: (el: HTMLElement, context: RenderMountContext) => void | (() => void);
45
+ };
46
+ interface MountCardSlotRequest {
47
+ type: string;
48
+ data: unknown;
49
+ }
50
+ interface MountedCardSlot {
51
+ update(data: unknown): void;
52
+ destroy(): void;
53
+ }
54
+ interface RenderMountContext {
55
+ mountCard?: (host: HTMLElement, request: MountCardSlotRequest) => MountedCardSlot | undefined;
56
+ }
57
+ type NodeRenderer = (node: ASTNode) => RenderOutput | Promise<RenderOutput>;
58
+ interface PluginCommitContext {
59
+ readonly generation: number;
60
+ emitDebug(type: string, data?: Record<string, unknown>): void;
61
+ }
62
+ type KnownJSONSchemaType = "object" | "array" | "string" | "number" | "integer" | "boolean" | "null";
63
+ interface JSONSchema {
64
+ type?: KnownJSONSchemaType | (string & {});
65
+ properties?: Record<string, JSONSchema>;
66
+ items?: JSONSchema;
67
+ required?: readonly string[];
68
+ additionalProperties?: boolean | JSONSchema;
69
+ enum?: readonly unknown[];
70
+ const?: unknown;
71
+ minLength?: number;
72
+ maxLength?: number;
73
+ pattern?: string;
74
+ minimum?: number;
75
+ maximum?: number;
76
+ minItems?: number;
77
+ maxItems?: number;
78
+ [k: string]: unknown;
79
+ }
80
+ interface CardDef<TData = unknown, TComponent = unknown> {
81
+ type: string;
82
+ description: string;
83
+ schema?: JSONSchema;
84
+ example?: TData;
85
+ render?: TComponent;
86
+ validate?: (data: TData) => boolean;
87
+ }
88
+ interface AIGuiPlugin {
89
+ name: string;
90
+ extendParser?: (md: MarkdownIt) => void;
91
+ cards?: CardDef[];
92
+ nodeRenderers?: Record<string, NodeRenderer>;
93
+ isBlockComplete?: (nodeType: string, raw: string) => boolean;
94
+ /** Runs synchronously after the AST is finalized and before patches are dispatched. */
95
+ onASTCommit?: (nodes: readonly ASTNode[], context: PluginCommitContext) => void;
96
+ css?: string;
97
+ /** LLM-facing guidance describing this plugin's fence syntax. */
98
+ promptSpec?: string | (() => string);
99
+ }
100
+ interface ActionRequest<TParams = unknown> {
101
+ type: string;
102
+ params: TParams;
103
+ cardType?: string;
104
+ cardId?: string;
105
+ }
106
+ interface ActionDispatchOptions {
107
+ signal?: AbortSignal;
108
+ timeoutMs?: number;
109
+ owner?: object;
110
+ } //#endregion
111
+ //#region src/types.d.ts
112
+ type UIScalar = string | number | boolean | null;
113
+ interface UIStateBinding {
114
+ $state: string;
115
+ }
116
+ type UIScalarExpression = UIScalar | UIStateBinding;
117
+ type UIBoundJSON = UIScalarExpression | UIBoundJSON[] | {
118
+ [key: string]: UIBoundJSON;
119
+ };
120
+ type UIGap = "none" | "sm" | "md" | "lg";
121
+ type UIAlign = "start" | "center" | "end" | "stretch";
122
+ type UITextTone = "default" | "muted" | "positive" | "warning" | "critical";
123
+ type UIFieldType = "text" | "textarea" | "number" | "date" | "select" | "checkbox" | "radio";
124
+ interface UIAction {
125
+ type: string;
126
+ params?: UIBoundJSON;
127
+ }
128
+ interface UIOption {
129
+ label: string;
130
+ value: string;
131
+ }
132
+ interface UIKeyValueItem {
133
+ label: string;
134
+ value: UIScalarExpression;
135
+ }
136
+ interface UIStackNode {
137
+ kind: "stack";
138
+ id: string;
139
+ direction?: "row" | "column";
140
+ gap?: UIGap;
141
+ align?: UIAlign;
142
+ children: UINode[];
143
+ }
144
+ interface UIGridNode {
145
+ kind: "grid";
146
+ id: string;
147
+ columns: 1 | 2 | 3 | 4;
148
+ gap?: UIGap;
149
+ children: UINode[];
150
+ }
151
+ interface UITextNode {
152
+ kind: "text";
153
+ id: string;
154
+ text: UIScalarExpression;
155
+ tone?: UITextTone;
156
+ }
157
+ interface UIHeadingNode {
158
+ kind: "heading";
159
+ id: string;
160
+ level: 2 | 3 | 4;
161
+ text: UIScalarExpression;
162
+ }
163
+ interface UIDividerNode {
164
+ kind: "divider";
165
+ id: string;
166
+ }
167
+ interface UIListNode {
168
+ kind: "list";
169
+ id: string;
170
+ ordered?: boolean;
171
+ items: UIScalar[];
172
+ }
173
+ interface UITableNode {
174
+ kind: "table";
175
+ id: string;
176
+ caption: string;
177
+ headers: string[];
178
+ rows: UIScalar[][];
179
+ }
180
+ interface UIKeyValueNode {
181
+ kind: "keyValue";
182
+ id: string;
183
+ items: UIKeyValueItem[];
184
+ }
185
+ interface UIFormNode {
186
+ kind: "form";
187
+ id: string;
188
+ children: UINode[];
189
+ submit: {
190
+ type: string;
191
+ };
192
+ submitLabel?: string;
193
+ }
194
+ interface UIFieldNode {
195
+ kind: "field";
196
+ id: string;
197
+ bind: string;
198
+ fieldType: UIFieldType;
199
+ label: string;
200
+ required?: boolean;
201
+ placeholder?: string;
202
+ minLength?: number;
203
+ maxLength?: number;
204
+ pattern?: string;
205
+ min?: number;
206
+ max?: number;
207
+ options?: UIOption[];
208
+ }
209
+ interface UIButtonNode {
210
+ kind: "button";
211
+ id: string;
212
+ label: string;
213
+ variant?: "primary" | "secondary" | "danger";
214
+ action: UIAction;
215
+ }
216
+ interface UICardNode {
217
+ kind: "card";
218
+ id: string;
219
+ type: string;
220
+ data: UIBoundJSON;
221
+ }
222
+ type UINode = UIStackNode | UIGridNode | UITextNode | UIHeadingNode | UIDividerNode | UIListNode | UITableNode | UIKeyValueNode | UIFormNode | UIFieldNode | UIButtonNode | UICardNode;
223
+ interface UIDocument {
224
+ version: 1;
225
+ id: string;
226
+ state?: Record<string, UIScalar>;
227
+ root: UINode;
228
+ }
229
+ interface UILimits {
230
+ sourceBytes: number;
231
+ nodes: number;
232
+ depth: number;
233
+ children: number;
234
+ state: number;
235
+ string: number;
236
+ totalStrings: number;
237
+ tableRows: number;
238
+ tableColumns: number;
239
+ options: number;
240
+ boundJSONDepth: number;
241
+ boundJSONNodes: number;
242
+ }
243
+ type UILimitOverrides = Partial<UILimits>;
244
+ interface UIValidationOptions {
245
+ registry: UICardRegistry;
246
+ actionRuntime: UIActionRuntime;
247
+ limits?: UILimitOverrides;
248
+ }
249
+ interface UIMountOptions {
250
+ actionRuntime: UIActionRuntime;
251
+ mountContext?: RenderMountContext;
252
+ }
253
+ interface UIPluginOptions extends UIValidationOptions {}
254
+ interface UICardRegistry {
255
+ get(type: string): Readonly<CardDef> | undefined;
256
+ list(): Readonly<CardDef>[];
257
+ validate(type: string, data: unknown): boolean;
258
+ }
259
+ interface UIActionRuntime {
260
+ hasAction(type: string): boolean;
261
+ listActionTypes(): readonly string[];
262
+ dispatch<TResult = unknown>(request: ActionRequest, options?: ActionDispatchOptions): Promise<TResult>;
263
+ }
264
+
265
+ //#endregion
266
+ //#region src/css.d.ts
267
+ declare const uiCss = "\n[data-aigui-ui] { display: block; color: inherit; font: inherit; }\n[data-aigui-ui-stack=\"row\"] { display: flex; flex-direction: row; flex-wrap: wrap; }\n[data-aigui-ui-stack=\"column\"] { display: flex; flex-direction: column; }\n[data-aigui-ui-grid] { display: grid; grid-template-columns: repeat(var(--aigui-ui-columns, 1), minmax(0, 1fr)); }\n[data-aigui-ui-grid=\"2\"] { --aigui-ui-columns: 2; }\n[data-aigui-ui-grid=\"3\"] { --aigui-ui-columns: 3; }\n[data-aigui-ui-grid=\"4\"] { --aigui-ui-columns: 4; }\n[data-gap=\"sm\"] { gap: .5rem; } [data-gap=\"md\"] { gap: 1rem; } [data-gap=\"lg\"] { gap: 1.5rem; }\n[data-align=\"start\"] { align-items: flex-start; } [data-align=\"center\"] { align-items: center; } [data-align=\"end\"] { align-items: flex-end; } [data-align=\"stretch\"] { align-items: stretch; }\n[data-tone=\"muted\"] { color: color-mix(in srgb, currentColor 60%, transparent); }\n[data-tone=\"positive\"] { color: #18794e; } [data-tone=\"warning\"] { color: #9a6700; } [data-tone=\"critical\"] { color: #b42318; }\n[data-aigui-ui] table { border-collapse: collapse; width: 100%; }\n[data-aigui-ui] th, [data-aigui-ui] td { border: 1px solid currentColor; padding: .4rem .6rem; text-align: left; }\n[data-aigui-ui-field] { display: grid; gap: .25rem; }\n[data-aigui-ui-field-error], [data-aigui-ui-action-error] { color: #b42318; }\n";
268
+
269
+ //#endregion
270
+ //#region src/errors.d.ts
271
+ declare class UIDocumentError extends Error {
272
+ readonly issues: readonly string[];
273
+ constructor(issues: readonly string[]);
274
+ }
275
+ declare class UILimitError extends UIDocumentError {
276
+ constructor(message: string);
277
+ }
278
+
279
+ //#endregion
280
+ //#region src/limits.d.ts
281
+ declare const DEFAULT_UI_LIMITS: Readonly<UILimits>;
282
+ declare function resolveUILimits(overrides?: UILimitOverrides): UILimits;
283
+
284
+ //#endregion
285
+ //#region src/mount.d.ts
286
+ declare function mountUIDocument(host: HTMLElement, document: UIDocument, options: UIMountOptions): () => void;
287
+
288
+ //#endregion
289
+ //#region src/prompt.d.ts
290
+ declare function uiPromptSpec(registry: UICardRegistry, actionRuntime: UIActionRuntime, limits?: UILimitOverrides): string;
291
+
292
+ //#endregion
293
+ //#region src/validate.d.ts
294
+ declare function parseUIDocument(source: string, options: UIValidationOptions): UIDocument;
295
+ declare function validateUIDocument(value: unknown, options: UIValidationOptions): UIDocument;
296
+ declare function resolveBoundJSON(value: UIBoundJSON, state: Record<string, UIScalar>): unknown;
297
+
298
+ //#endregion
299
+ //#region src/index.d.ts
300
+ declare function ui(options: UIPluginOptions): AIGuiPlugin;
301
+
302
+ //#endregion
303
+ export { DEFAULT_UI_LIMITS, UIAction, UIActionRuntime, UIAlign, UIBoundJSON, UIButtonNode, UICardNode, UICardRegistry, UIDividerNode, UIDocument, UIDocumentError, UIFieldNode, UIFieldType, UIFormNode, UIGap, UIGridNode, UIHeadingNode, UIKeyValueItem, UIKeyValueNode, UILimitError, UILimitOverrides, UILimits, UIListNode, UIMountOptions, UINode, UIOption, UIPluginOptions, UIScalar, UIScalarExpression, UIStackNode, UIStateBinding, UITableNode, UITextNode, UITextTone, UIValidationOptions, mountUIDocument, parseUIDocument, resolveBoundJSON, resolveUILimits, ui, uiCss, uiPromptSpec, validateUIDocument };
@@ -0,0 +1,303 @@
1
+ import MarkdownIt from "markdown-it";
2
+
3
+ //#region ../core/dist/index.d.ts
4
+
5
+ //#endregion
6
+ //#region src/types.d.ts
7
+ /** Framework-agnostic render node. */
8
+ interface ASTNode {
9
+ key: string;
10
+ type: string;
11
+ tag?: string;
12
+ content?: string;
13
+ html?: string;
14
+ attrs?: Record<string, string>;
15
+ children?: ASTNode[];
16
+ /** Whether a streaming block has enough source to invoke its renderer. */
17
+ complete?: boolean;
18
+ /** card-specific payload */
19
+ card?: {
20
+ id?: string;
21
+ type: string;
22
+ data: unknown;
23
+ complete: boolean;
24
+ valid: boolean;
25
+ };
26
+ }
27
+ /** Patch event produced by diffing. */
28
+
29
+ /** Framework-neutral render descriptor returned by plugin node renderers. */
30
+ type RenderOutput = {
31
+ kind: "html";
32
+ html: string;
33
+ } | {
34
+ kind: "element";
35
+ tag: string;
36
+ props?: Record<string, unknown>;
37
+ children?: RenderOutput[];
38
+ } | {
39
+ kind: "card";
40
+ type: string;
41
+ data: unknown;
42
+ } | {
43
+ kind: "mount";
44
+ mount: (el: HTMLElement, context: RenderMountContext) => void | (() => void);
45
+ };
46
+ interface MountCardSlotRequest {
47
+ type: string;
48
+ data: unknown;
49
+ }
50
+ interface MountedCardSlot {
51
+ update(data: unknown): void;
52
+ destroy(): void;
53
+ }
54
+ interface RenderMountContext {
55
+ mountCard?: (host: HTMLElement, request: MountCardSlotRequest) => MountedCardSlot | undefined;
56
+ }
57
+ type NodeRenderer = (node: ASTNode) => RenderOutput | Promise<RenderOutput>;
58
+ interface PluginCommitContext {
59
+ readonly generation: number;
60
+ emitDebug(type: string, data?: Record<string, unknown>): void;
61
+ }
62
+ type KnownJSONSchemaType = "object" | "array" | "string" | "number" | "integer" | "boolean" | "null";
63
+ interface JSONSchema {
64
+ type?: KnownJSONSchemaType | (string & {});
65
+ properties?: Record<string, JSONSchema>;
66
+ items?: JSONSchema;
67
+ required?: readonly string[];
68
+ additionalProperties?: boolean | JSONSchema;
69
+ enum?: readonly unknown[];
70
+ const?: unknown;
71
+ minLength?: number;
72
+ maxLength?: number;
73
+ pattern?: string;
74
+ minimum?: number;
75
+ maximum?: number;
76
+ minItems?: number;
77
+ maxItems?: number;
78
+ [k: string]: unknown;
79
+ }
80
+ interface CardDef<TData = unknown, TComponent = unknown> {
81
+ type: string;
82
+ description: string;
83
+ schema?: JSONSchema;
84
+ example?: TData;
85
+ render?: TComponent;
86
+ validate?: (data: TData) => boolean;
87
+ }
88
+ interface AIGuiPlugin {
89
+ name: string;
90
+ extendParser?: (md: MarkdownIt) => void;
91
+ cards?: CardDef[];
92
+ nodeRenderers?: Record<string, NodeRenderer>;
93
+ isBlockComplete?: (nodeType: string, raw: string) => boolean;
94
+ /** Runs synchronously after the AST is finalized and before patches are dispatched. */
95
+ onASTCommit?: (nodes: readonly ASTNode[], context: PluginCommitContext) => void;
96
+ css?: string;
97
+ /** LLM-facing guidance describing this plugin's fence syntax. */
98
+ promptSpec?: string | (() => string);
99
+ }
100
+ interface ActionRequest<TParams = unknown> {
101
+ type: string;
102
+ params: TParams;
103
+ cardType?: string;
104
+ cardId?: string;
105
+ }
106
+ interface ActionDispatchOptions {
107
+ signal?: AbortSignal;
108
+ timeoutMs?: number;
109
+ owner?: object;
110
+ } //#endregion
111
+ //#region src/types.d.ts
112
+ type UIScalar = string | number | boolean | null;
113
+ interface UIStateBinding {
114
+ $state: string;
115
+ }
116
+ type UIScalarExpression = UIScalar | UIStateBinding;
117
+ type UIBoundJSON = UIScalarExpression | UIBoundJSON[] | {
118
+ [key: string]: UIBoundJSON;
119
+ };
120
+ type UIGap = "none" | "sm" | "md" | "lg";
121
+ type UIAlign = "start" | "center" | "end" | "stretch";
122
+ type UITextTone = "default" | "muted" | "positive" | "warning" | "critical";
123
+ type UIFieldType = "text" | "textarea" | "number" | "date" | "select" | "checkbox" | "radio";
124
+ interface UIAction {
125
+ type: string;
126
+ params?: UIBoundJSON;
127
+ }
128
+ interface UIOption {
129
+ label: string;
130
+ value: string;
131
+ }
132
+ interface UIKeyValueItem {
133
+ label: string;
134
+ value: UIScalarExpression;
135
+ }
136
+ interface UIStackNode {
137
+ kind: "stack";
138
+ id: string;
139
+ direction?: "row" | "column";
140
+ gap?: UIGap;
141
+ align?: UIAlign;
142
+ children: UINode[];
143
+ }
144
+ interface UIGridNode {
145
+ kind: "grid";
146
+ id: string;
147
+ columns: 1 | 2 | 3 | 4;
148
+ gap?: UIGap;
149
+ children: UINode[];
150
+ }
151
+ interface UITextNode {
152
+ kind: "text";
153
+ id: string;
154
+ text: UIScalarExpression;
155
+ tone?: UITextTone;
156
+ }
157
+ interface UIHeadingNode {
158
+ kind: "heading";
159
+ id: string;
160
+ level: 2 | 3 | 4;
161
+ text: UIScalarExpression;
162
+ }
163
+ interface UIDividerNode {
164
+ kind: "divider";
165
+ id: string;
166
+ }
167
+ interface UIListNode {
168
+ kind: "list";
169
+ id: string;
170
+ ordered?: boolean;
171
+ items: UIScalar[];
172
+ }
173
+ interface UITableNode {
174
+ kind: "table";
175
+ id: string;
176
+ caption: string;
177
+ headers: string[];
178
+ rows: UIScalar[][];
179
+ }
180
+ interface UIKeyValueNode {
181
+ kind: "keyValue";
182
+ id: string;
183
+ items: UIKeyValueItem[];
184
+ }
185
+ interface UIFormNode {
186
+ kind: "form";
187
+ id: string;
188
+ children: UINode[];
189
+ submit: {
190
+ type: string;
191
+ };
192
+ submitLabel?: string;
193
+ }
194
+ interface UIFieldNode {
195
+ kind: "field";
196
+ id: string;
197
+ bind: string;
198
+ fieldType: UIFieldType;
199
+ label: string;
200
+ required?: boolean;
201
+ placeholder?: string;
202
+ minLength?: number;
203
+ maxLength?: number;
204
+ pattern?: string;
205
+ min?: number;
206
+ max?: number;
207
+ options?: UIOption[];
208
+ }
209
+ interface UIButtonNode {
210
+ kind: "button";
211
+ id: string;
212
+ label: string;
213
+ variant?: "primary" | "secondary" | "danger";
214
+ action: UIAction;
215
+ }
216
+ interface UICardNode {
217
+ kind: "card";
218
+ id: string;
219
+ type: string;
220
+ data: UIBoundJSON;
221
+ }
222
+ type UINode = UIStackNode | UIGridNode | UITextNode | UIHeadingNode | UIDividerNode | UIListNode | UITableNode | UIKeyValueNode | UIFormNode | UIFieldNode | UIButtonNode | UICardNode;
223
+ interface UIDocument {
224
+ version: 1;
225
+ id: string;
226
+ state?: Record<string, UIScalar>;
227
+ root: UINode;
228
+ }
229
+ interface UILimits {
230
+ sourceBytes: number;
231
+ nodes: number;
232
+ depth: number;
233
+ children: number;
234
+ state: number;
235
+ string: number;
236
+ totalStrings: number;
237
+ tableRows: number;
238
+ tableColumns: number;
239
+ options: number;
240
+ boundJSONDepth: number;
241
+ boundJSONNodes: number;
242
+ }
243
+ type UILimitOverrides = Partial<UILimits>;
244
+ interface UIValidationOptions {
245
+ registry: UICardRegistry;
246
+ actionRuntime: UIActionRuntime;
247
+ limits?: UILimitOverrides;
248
+ }
249
+ interface UIMountOptions {
250
+ actionRuntime: UIActionRuntime;
251
+ mountContext?: RenderMountContext;
252
+ }
253
+ interface UIPluginOptions extends UIValidationOptions {}
254
+ interface UICardRegistry {
255
+ get(type: string): Readonly<CardDef> | undefined;
256
+ list(): Readonly<CardDef>[];
257
+ validate(type: string, data: unknown): boolean;
258
+ }
259
+ interface UIActionRuntime {
260
+ hasAction(type: string): boolean;
261
+ listActionTypes(): readonly string[];
262
+ dispatch<TResult = unknown>(request: ActionRequest, options?: ActionDispatchOptions): Promise<TResult>;
263
+ }
264
+
265
+ //#endregion
266
+ //#region src/css.d.ts
267
+ declare const uiCss = "\n[data-aigui-ui] { display: block; color: inherit; font: inherit; }\n[data-aigui-ui-stack=\"row\"] { display: flex; flex-direction: row; flex-wrap: wrap; }\n[data-aigui-ui-stack=\"column\"] { display: flex; flex-direction: column; }\n[data-aigui-ui-grid] { display: grid; grid-template-columns: repeat(var(--aigui-ui-columns, 1), minmax(0, 1fr)); }\n[data-aigui-ui-grid=\"2\"] { --aigui-ui-columns: 2; }\n[data-aigui-ui-grid=\"3\"] { --aigui-ui-columns: 3; }\n[data-aigui-ui-grid=\"4\"] { --aigui-ui-columns: 4; }\n[data-gap=\"sm\"] { gap: .5rem; } [data-gap=\"md\"] { gap: 1rem; } [data-gap=\"lg\"] { gap: 1.5rem; }\n[data-align=\"start\"] { align-items: flex-start; } [data-align=\"center\"] { align-items: center; } [data-align=\"end\"] { align-items: flex-end; } [data-align=\"stretch\"] { align-items: stretch; }\n[data-tone=\"muted\"] { color: color-mix(in srgb, currentColor 60%, transparent); }\n[data-tone=\"positive\"] { color: #18794e; } [data-tone=\"warning\"] { color: #9a6700; } [data-tone=\"critical\"] { color: #b42318; }\n[data-aigui-ui] table { border-collapse: collapse; width: 100%; }\n[data-aigui-ui] th, [data-aigui-ui] td { border: 1px solid currentColor; padding: .4rem .6rem; text-align: left; }\n[data-aigui-ui-field] { display: grid; gap: .25rem; }\n[data-aigui-ui-field-error], [data-aigui-ui-action-error] { color: #b42318; }\n";
268
+
269
+ //#endregion
270
+ //#region src/errors.d.ts
271
+ declare class UIDocumentError extends Error {
272
+ readonly issues: readonly string[];
273
+ constructor(issues: readonly string[]);
274
+ }
275
+ declare class UILimitError extends UIDocumentError {
276
+ constructor(message: string);
277
+ }
278
+
279
+ //#endregion
280
+ //#region src/limits.d.ts
281
+ declare const DEFAULT_UI_LIMITS: Readonly<UILimits>;
282
+ declare function resolveUILimits(overrides?: UILimitOverrides): UILimits;
283
+
284
+ //#endregion
285
+ //#region src/mount.d.ts
286
+ declare function mountUIDocument(host: HTMLElement, document: UIDocument, options: UIMountOptions): () => void;
287
+
288
+ //#endregion
289
+ //#region src/prompt.d.ts
290
+ declare function uiPromptSpec(registry: UICardRegistry, actionRuntime: UIActionRuntime, limits?: UILimitOverrides): string;
291
+
292
+ //#endregion
293
+ //#region src/validate.d.ts
294
+ declare function parseUIDocument(source: string, options: UIValidationOptions): UIDocument;
295
+ declare function validateUIDocument(value: unknown, options: UIValidationOptions): UIDocument;
296
+ declare function resolveBoundJSON(value: UIBoundJSON, state: Record<string, UIScalar>): unknown;
297
+
298
+ //#endregion
299
+ //#region src/index.d.ts
300
+ declare function ui(options: UIPluginOptions): AIGuiPlugin;
301
+
302
+ //#endregion
303
+ export { DEFAULT_UI_LIMITS, UIAction, UIActionRuntime, UIAlign, UIBoundJSON, UIButtonNode, UICardNode, UICardRegistry, UIDividerNode, UIDocument, UIDocumentError, UIFieldNode, UIFieldType, UIFormNode, UIGap, UIGridNode, UIHeadingNode, UIKeyValueItem, UIKeyValueNode, UILimitError, UILimitOverrides, UILimits, UIListNode, UIMountOptions, UINode, UIOption, UIPluginOptions, UIScalar, UIScalarExpression, UIStackNode, UIStateBinding, UITableNode, UITextNode, UITextTone, UIValidationOptions, mountUIDocument, parseUIDocument, resolveBoundJSON, resolveUILimits, ui, uiCss, uiPromptSpec, validateUIDocument };