@dudousxd/nestjs-agent-core 0.24.0 → 0.26.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,47 @@
1
+ import { C as ComponentDefinition } from '../catalog-CrzetM3_.js';
2
+ import '@standard-schema/spec';
3
+
4
+ /**
5
+ * Optional builtin component DEFINITIONS — names, props schemas, model descriptions and plain-text
6
+ * fallbacks for the components most chat apps want. No visuals: an app renders each with its own
7
+ * look, keyed by name. Use them as-is, pick some, or extend them:
8
+ *
9
+ * ```ts
10
+ * const catalog = defineCatalog([...BUILTIN_COMPONENTS, ...LAYOUT_COMPONENTS, myDealCard]);
11
+ * ```
12
+ */
13
+
14
+ type Props = Record<string, any>;
15
+ /** A fixed-width text table in a code block, at most `max` rows. */
16
+ declare function textTable(columns: readonly {
17
+ key: string;
18
+ label: string;
19
+ }[], rows: readonly Props[], max?: number): string;
20
+ interface DiffLine {
21
+ op: 'same' | 'add' | 'del';
22
+ text: string;
23
+ }
24
+ /** Line diff (LCS) — good enough for snippets up to a few hundred lines. */
25
+ declare function lineDiff(before: string, after: string): DiffLine[];
26
+ declare const DataTable: ComponentDefinition<Props>;
27
+ declare const Chart: ComponentDefinition<Props>;
28
+ declare const KpiCards: ComponentDefinition<Props>;
29
+ declare const SourceCards: ComponentDefinition<Props>;
30
+ declare const Checklist: ComponentDefinition<Props>;
31
+ declare const Timeline: ComponentDefinition<Props>;
32
+ declare const CodeBlock: ComponentDefinition<Props>;
33
+ declare const Diff: ComponentDefinition<Props>;
34
+ declare const Callout: ComponentDefinition<Props>;
35
+ declare const Stack: ComponentDefinition<Props>;
36
+ declare const Card: ComponentDefinition<Props>;
37
+ declare const Heading: ComponentDefinition<Props>;
38
+ declare const Text: ComponentDefinition<Props>;
39
+ declare const Badge: ComponentDefinition<Props>;
40
+ declare const Link: ComponentDefinition<Props>;
41
+ declare const Image: ComponentDefinition<Props>;
42
+ /** Content components: data a model shows. */
43
+ declare const BUILTIN_COMPONENTS: readonly ComponentDefinition<Props>[];
44
+ /** Layout and text primitives, mostly for composing trees (`Stack`, `Card` take children). */
45
+ declare const LAYOUT_COMPONENTS: readonly ComponentDefinition<Props>[];
46
+
47
+ export { BUILTIN_COMPONENTS, Badge, Callout, Card, Chart, Checklist, CodeBlock, DataTable, Diff, type DiffLine, Heading, Image, KpiCards, LAYOUT_COMPONENTS, Link, SourceCards, Stack, Text, Timeline, lineDiff, textTable };
@@ -0,0 +1,511 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/genui/catalog.ts
5
+ var COMPONENT_NAME = /^[A-Za-z][A-Za-z0-9]{0,63}$/;
6
+ function defineComponent(definition) {
7
+ if (!COMPONENT_NAME.test(definition.name)) {
8
+ throw new Error(`genui: component name "${definition.name}" must be letters and digits, starting with a letter (e.g. DataTable)`);
9
+ }
10
+ return definition;
11
+ }
12
+ __name(defineComponent, "defineComponent");
13
+
14
+ // src/genui/builtins.ts
15
+ var str = /* @__PURE__ */ __name((description, extra = {}) => ({
16
+ type: "string",
17
+ ...description !== void 0 ? {
18
+ description
19
+ } : {},
20
+ ...extra
21
+ }), "str");
22
+ var obj = /* @__PURE__ */ __name((properties, required = []) => ({
23
+ type: "object",
24
+ properties,
25
+ required,
26
+ additionalProperties: false
27
+ }), "obj");
28
+ var arr = /* @__PURE__ */ __name((items, extra = {}) => ({
29
+ type: "array",
30
+ items,
31
+ ...extra
32
+ }), "arr");
33
+ var cell = {
34
+ type: [
35
+ "string",
36
+ "number",
37
+ "boolean",
38
+ "null"
39
+ ]
40
+ };
41
+ var row = {
42
+ type: "object",
43
+ additionalProperties: cell
44
+ };
45
+ var s = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? "" : String(value), "s");
46
+ var heading = /* @__PURE__ */ __name((props) => props.title ? `*${s(props.title)}*
47
+ ` : "", "heading");
48
+ function textTable(columns, rows, max = 15) {
49
+ const shown = rows.slice(0, max);
50
+ const widths = columns.map((column) => Math.min(28, Math.max(column.label.length, ...shown.map((r) => s(r[column.key]).length))));
51
+ const format = /* @__PURE__ */ __name((values) => values.map((value, index) => value.slice(0, widths[index]).padEnd(widths[index] ?? 0)).join(" "), "format");
52
+ const lines = [
53
+ format(columns.map((column) => column.label)),
54
+ widths.map((width) => "-".repeat(width)).join(" "),
55
+ ...shown.map((r) => format(columns.map((column) => s(r[column.key]))))
56
+ ];
57
+ if (rows.length > max) lines.push(`\u2026 ${rows.length - max} more rows`);
58
+ return `\`\`\`
59
+ ${lines.join("\n")}
60
+ \`\`\``;
61
+ }
62
+ __name(textTable, "textTable");
63
+ function lineDiff(before, after) {
64
+ const a = before.split("\n");
65
+ const b = after.split("\n");
66
+ if (a.length * b.length > 25e4) {
67
+ return [
68
+ ...a.map((text) => ({
69
+ op: "del",
70
+ text
71
+ })),
72
+ ...b.map((text) => ({
73
+ op: "add",
74
+ text
75
+ }))
76
+ ];
77
+ }
78
+ const dp = Array.from({
79
+ length: a.length + 1
80
+ }, () => new Array(b.length + 1).fill(0));
81
+ const at = /* @__PURE__ */ __name((i2, j2) => dp[i2]?.[j2] ?? 0, "at");
82
+ for (let i2 = a.length - 1; i2 >= 0; i2--) {
83
+ for (let j2 = b.length - 1; j2 >= 0; j2--) {
84
+ dp[i2][j2] = a[i2] === b[j2] ? at(i2 + 1, j2 + 1) + 1 : Math.max(at(i2 + 1, j2), at(i2, j2 + 1));
85
+ }
86
+ }
87
+ const out = [];
88
+ let i = 0;
89
+ let j = 0;
90
+ while (i < a.length && j < b.length) {
91
+ if (a[i] === b[j]) {
92
+ out.push({
93
+ op: "same",
94
+ text: a[i]
95
+ });
96
+ i++;
97
+ j++;
98
+ } else if (at(i + 1, j) >= at(i, j + 1)) {
99
+ out.push({
100
+ op: "del",
101
+ text: a[i++]
102
+ });
103
+ } else {
104
+ out.push({
105
+ op: "add",
106
+ text: b[j++]
107
+ });
108
+ }
109
+ }
110
+ while (i < a.length) out.push({
111
+ op: "del",
112
+ text: a[i++]
113
+ });
114
+ while (j < b.length) out.push({
115
+ op: "add",
116
+ text: b[j++]
117
+ });
118
+ return out;
119
+ }
120
+ __name(lineDiff, "lineDiff");
121
+ function bar(value, max, width = 20) {
122
+ const n = max > 0 ? Math.round(Math.abs(value) / max * width) : 0;
123
+ return "\u2588".repeat(n) || "\u258F";
124
+ }
125
+ __name(bar, "bar");
126
+ var DataTable = defineComponent({
127
+ name: "DataTable",
128
+ title: "Data table",
129
+ description: "Tabular data (records with the same fields) as a sortable table. Prefer it over markdown tables for more than 3 rows.",
130
+ props: obj({
131
+ title: str("Short caption"),
132
+ columns: arr(obj({
133
+ key: str("Field name in each row"),
134
+ label: str("Column header"),
135
+ align: str(void 0, {
136
+ enum: [
137
+ "left",
138
+ "right",
139
+ "center"
140
+ ]
141
+ }),
142
+ format: str("How to format values", {
143
+ enum: [
144
+ "text",
145
+ "number",
146
+ "currency",
147
+ "percent",
148
+ "date",
149
+ "link"
150
+ ]
151
+ })
152
+ }, [
153
+ "key",
154
+ "label"
155
+ ]), {
156
+ minItems: 1,
157
+ maxItems: 12
158
+ }),
159
+ rows: arr(row, {
160
+ maxItems: 500
161
+ })
162
+ }, [
163
+ "columns",
164
+ "rows"
165
+ ]),
166
+ fallbackText: /* @__PURE__ */ __name((props) => `${heading(props)}${textTable(props.columns ?? [], props.rows ?? [])}`, "fallbackText")
167
+ });
168
+ var Chart = defineComponent({
169
+ name: "Chart",
170
+ title: "Chart",
171
+ description: "`bar` to compare categories, `line` for a trend over time. `data` is a list of points; `xKey` names the category/time field and each series names a numeric field.",
172
+ props: obj({
173
+ type: str("Chart type", {
174
+ enum: [
175
+ "bar",
176
+ "line"
177
+ ]
178
+ }),
179
+ title: str(),
180
+ xKey: str("Field of each point used for the x axis"),
181
+ series: arr(obj({
182
+ key: str("Numeric field"),
183
+ label: str()
184
+ }, [
185
+ "key"
186
+ ]), {
187
+ minItems: 1,
188
+ maxItems: 6
189
+ }),
190
+ data: arr(row, {
191
+ minItems: 1,
192
+ maxItems: 200
193
+ }),
194
+ unit: str("Unit shown after values, e.g. `KB` or `%`")
195
+ }, [
196
+ "type",
197
+ "xKey",
198
+ "series",
199
+ "data"
200
+ ]),
201
+ fallbackText: /* @__PURE__ */ __name((props) => {
202
+ const series = props.series ?? [];
203
+ const data = props.data ?? [];
204
+ const first = series[0]?.key ?? "";
205
+ const max = Math.max(0, ...data.map((point) => Math.abs(Number(point[first]) || 0)));
206
+ const unit = props.unit ? ` ${s(props.unit)}` : "";
207
+ const lines = data.slice(0, 20).map((point) => `${s(point[props.xKey]).slice(0, 18).padEnd(18)} ${bar(Number(point[first]) || 0, max)} ${s(point[first])}${unit}`);
208
+ return `${heading(props)}\`\`\`
209
+ ${lines.join("\n")}
210
+ \`\`\``;
211
+ }, "fallbackText")
212
+ });
213
+ var KpiCards = defineComponent({
214
+ name: "KpiCards",
215
+ title: "KPI cards",
216
+ description: "A few key numbers (metrics, totals, counts) as cards.",
217
+ props: obj({
218
+ title: str(),
219
+ items: arr(obj({
220
+ label: str(),
221
+ value: {
222
+ type: [
223
+ "string",
224
+ "number"
225
+ ]
226
+ },
227
+ delta: str("Change, e.g. `+12%`"),
228
+ trend: str(void 0, {
229
+ enum: [
230
+ "up",
231
+ "down",
232
+ "flat"
233
+ ]
234
+ }),
235
+ hint: str()
236
+ }, [
237
+ "label",
238
+ "value"
239
+ ]), {
240
+ minItems: 1,
241
+ maxItems: 8
242
+ })
243
+ }, [
244
+ "items"
245
+ ]),
246
+ fallbackText: /* @__PURE__ */ __name((props) => `${heading(props)}${(props.items ?? []).map((item) => `\u2022 *${s(item.label)}:* ${s(item.value)}${item.delta ? ` (${s(item.delta)})` : ""}`).join("\n")}`, "fallbackText")
247
+ });
248
+ var SourceCards = defineComponent({
249
+ name: "SourceCards",
250
+ title: "Sources",
251
+ description: "The documents, pages or links an answer is based on, as cards.",
252
+ props: obj({
253
+ title: str(),
254
+ items: arr(obj({
255
+ title: str(),
256
+ url: str(),
257
+ snippet: str(),
258
+ source: str("e.g. Wiki, GitHub")
259
+ }, [
260
+ "title"
261
+ ]), {
262
+ minItems: 1,
263
+ maxItems: 12
264
+ })
265
+ }, [
266
+ "items"
267
+ ]),
268
+ fallbackText: /* @__PURE__ */ __name((props) => `${heading(props)}${(props.items ?? []).map((item) => `\u2022 ${item.url ? `<${s(item.url)}|${s(item.title)}>` : s(item.title)}${item.source ? ` \u2014 ${s(item.source)}` : ""}`).join("\n")}`, "fallbackText")
269
+ });
270
+ var Checklist = defineComponent({
271
+ name: "Checklist",
272
+ title: "Checklist",
273
+ description: "Steps or a to-do list with done/not-done state.",
274
+ props: obj({
275
+ title: str(),
276
+ items: arr(obj({
277
+ label: str(),
278
+ done: {
279
+ type: "boolean"
280
+ },
281
+ note: str()
282
+ }, [
283
+ "label"
284
+ ]), {
285
+ minItems: 1,
286
+ maxItems: 50
287
+ })
288
+ }, [
289
+ "items"
290
+ ]),
291
+ fallbackText: /* @__PURE__ */ __name((props) => `${heading(props)}${(props.items ?? []).map((item) => `${item.done ? "\u2611" : "\u2610"} ${s(item.label)}${item.note ? ` \u2014 _${s(item.note)}_` : ""}`).join("\n")}`, "fallbackText")
292
+ });
293
+ var Timeline = defineComponent({
294
+ name: "Timeline",
295
+ title: "Timeline",
296
+ description: "Events in chronological order (the history of a project, an incident, a deal).",
297
+ props: obj({
298
+ title: str(),
299
+ events: arr(obj({
300
+ date: str(),
301
+ title: str(),
302
+ description: str()
303
+ }, [
304
+ "title"
305
+ ]), {
306
+ minItems: 1,
307
+ maxItems: 50
308
+ })
309
+ }, [
310
+ "events"
311
+ ]),
312
+ fallbackText: /* @__PURE__ */ __name((props) => `${heading(props)}${(props.events ?? []).map((event) => `\u2022 ${event.date ? `*${s(event.date)}* ` : ""}${s(event.title)}${event.description ? ` \u2014 ${s(event.description)}` : ""}`).join("\n")}`, "fallbackText")
313
+ });
314
+ var CodeBlock = defineComponent({
315
+ name: "CodeBlock",
316
+ title: "Code",
317
+ description: "A code snippet or file excerpt with syntax highlighting.",
318
+ props: obj({
319
+ title: str(),
320
+ language: str(),
321
+ code: str()
322
+ }, [
323
+ "code"
324
+ ]),
325
+ fallbackText: /* @__PURE__ */ __name((props) => `${heading(props)}\`\`\`
326
+ ${s(props.code)}
327
+ \`\`\``, "fallbackText")
328
+ });
329
+ var Diff = defineComponent({
330
+ name: "Diff",
331
+ title: "Diff",
332
+ description: "A before/after change to a text or code file, as a line diff.",
333
+ props: obj({
334
+ title: str(),
335
+ language: str(),
336
+ before: str(),
337
+ after: str()
338
+ }, [
339
+ "before",
340
+ "after"
341
+ ]),
342
+ fallbackText: /* @__PURE__ */ __name((props) => `${heading(props)}\`\`\`
343
+ ${lineDiff(s(props.before), s(props.after)).map((line) => `${line.op === "add" ? "+" : line.op === "del" ? "-" : " "} ${line.text}`).join("\n")}
344
+ \`\`\``, "fallbackText")
345
+ });
346
+ var Callout = defineComponent({
347
+ name: "Callout",
348
+ title: "Callout",
349
+ description: "A short note, warning or success message, emphasized.",
350
+ props: obj({
351
+ tone: str(void 0, {
352
+ enum: [
353
+ "info",
354
+ "success",
355
+ "warning",
356
+ "danger"
357
+ ]
358
+ }),
359
+ title: str(),
360
+ text: str()
361
+ }, [
362
+ "text"
363
+ ]),
364
+ fallbackText: /* @__PURE__ */ __name((props) => `${props.tone === "warning" || props.tone === "danger" ? ":warning: " : ":information_source: "}${heading(props)}${s(props.text)}`, "fallbackText")
365
+ });
366
+ var Stack = defineComponent({
367
+ name: "Stack",
368
+ title: "Stack",
369
+ description: "Lays its children out vertically (or horizontally with direction=row).",
370
+ props: obj({
371
+ direction: str(void 0, {
372
+ enum: [
373
+ "column",
374
+ "row"
375
+ ]
376
+ }),
377
+ gap: {
378
+ type: "number"
379
+ }
380
+ }),
381
+ children: true,
382
+ fallbackText: /* @__PURE__ */ __name(() => "", "fallbackText")
383
+ });
384
+ var Card = defineComponent({
385
+ name: "Card",
386
+ title: "Card",
387
+ description: "A box with an optional title around its children.",
388
+ props: obj({
389
+ title: str(),
390
+ subtitle: str()
391
+ }),
392
+ children: true,
393
+ fallbackText: /* @__PURE__ */ __name((props) => props.title ? `*${s(props.title)}*${props.subtitle ? ` \u2014 ${s(props.subtitle)}` : ""}` : "", "fallbackText")
394
+ });
395
+ var Heading = defineComponent({
396
+ name: "Heading",
397
+ title: "Heading",
398
+ description: "A heading.",
399
+ props: obj({
400
+ text: str()
401
+ }, [
402
+ "text"
403
+ ]),
404
+ fallbackText: /* @__PURE__ */ __name((props) => `*${s(props.text)}*`, "fallbackText")
405
+ });
406
+ var Text = defineComponent({
407
+ name: "Text",
408
+ title: "Text",
409
+ description: "A paragraph of plain text (no markdown).",
410
+ props: obj({
411
+ text: str(),
412
+ muted: {
413
+ type: "boolean"
414
+ }
415
+ }, [
416
+ "text"
417
+ ]),
418
+ fallbackText: /* @__PURE__ */ __name((props) => s(props.text), "fallbackText")
419
+ });
420
+ var Badge = defineComponent({
421
+ name: "Badge",
422
+ title: "Badge",
423
+ description: "A small label.",
424
+ props: obj({
425
+ text: str(),
426
+ tone: str(void 0, {
427
+ enum: [
428
+ "neutral",
429
+ "brand",
430
+ "success",
431
+ "warning",
432
+ "danger"
433
+ ]
434
+ })
435
+ }, [
436
+ "text"
437
+ ]),
438
+ fallbackText: /* @__PURE__ */ __name((props) => `[${s(props.text)}]`, "fallbackText")
439
+ });
440
+ var Link = defineComponent({
441
+ name: "Link",
442
+ title: "Link",
443
+ description: "A link to an http(s) URL.",
444
+ props: obj({
445
+ text: str(),
446
+ url: str(void 0, {
447
+ pattern: "^https?://"
448
+ })
449
+ }, [
450
+ "text",
451
+ "url"
452
+ ]),
453
+ fallbackText: /* @__PURE__ */ __name((props) => `<${s(props.url)}|${s(props.text || props.url)}>`, "fallbackText")
454
+ });
455
+ var Image = defineComponent({
456
+ name: "Image",
457
+ title: "Image",
458
+ description: "An image from an https URL.",
459
+ props: obj({
460
+ url: str(void 0, {
461
+ pattern: "^https://"
462
+ }),
463
+ alt: str()
464
+ }, [
465
+ "url"
466
+ ]),
467
+ fallbackText: /* @__PURE__ */ __name((props) => s(props.url), "fallbackText")
468
+ });
469
+ var BUILTIN_COMPONENTS = [
470
+ DataTable,
471
+ Chart,
472
+ KpiCards,
473
+ SourceCards,
474
+ Checklist,
475
+ Timeline,
476
+ CodeBlock,
477
+ Diff,
478
+ Callout
479
+ ];
480
+ var LAYOUT_COMPONENTS = [
481
+ Stack,
482
+ Card,
483
+ Heading,
484
+ Text,
485
+ Badge,
486
+ Link,
487
+ Image
488
+ ];
489
+ export {
490
+ BUILTIN_COMPONENTS,
491
+ Badge,
492
+ Callout,
493
+ Card,
494
+ Chart,
495
+ Checklist,
496
+ CodeBlock,
497
+ DataTable,
498
+ Diff,
499
+ Heading,
500
+ Image,
501
+ KpiCards,
502
+ LAYOUT_COMPONENTS,
503
+ Link,
504
+ SourceCards,
505
+ Stack,
506
+ Text,
507
+ Timeline,
508
+ lineDiff,
509
+ textTable
510
+ };
511
+ //# sourceMappingURL=builtins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/genui/catalog.ts","../../src/genui/builtins.ts"],"sourcesContent":["import {\n type GenuiValidation,\n type JsonSchema,\n type JsonSchemaValidator,\n type PropsSchema,\n builtinJsonSchemaValidator,\n toJsonSchema,\n validateProps,\n validatePropsSync,\n} from './schema.js';\n\n/**\n * One component a server may push into a conversation. Data only — how it LOOKS is each app's own\n * renderer, looked up by {@link name}. The same definition serves the model (description + props\n * schema), the server (validation), text-only channels ({@link fallbackText}) and the client\n * (validation before rendering).\n */\nexport interface ComponentDefinition<P = Record<string, unknown>> {\n /** Registry key, e.g. `DataTable`. What a `ui` frame's `component` names. */\n name: string;\n /** Human label: \"Data table\". */\n title: string;\n /** Shown to the model: what the component is for and when to use it. */\n description: string;\n /** The props schema: a Standard Schema (Zod, Valibot, ArkType) or a JSON Schema object. */\n props: PropsSchema;\n /**\n * The component takes nested elements (a layout: `Stack`, `Card`). Only meaningful in tree mode,\n * where a node's `children` are validated against the catalog too.\n */\n children?: boolean;\n /**\n * Plain text / Slack mrkdwn rendering of these props, for a channel that cannot draw the\n * component. Absent → {@link componentToText} prints the props as JSON.\n */\n fallbackText?: (props: P) => string;\n /**\n * Pushed by the server (e.g. an approval card), never offered to the model. Excluded from\n * {@link catalogToModelText} and from the tool factories.\n */\n internal?: boolean;\n /**\n * Schema version of {@link props}. Stamped on every `ui` frame the component is pushed with, so a\n * client can keep rendering messages persisted under an older shape.\n */\n version?: number;\n}\n\n/** Component names: an identifier a registry key, a tool name and a snake_case slug can all be derived from. */\nexport const COMPONENT_NAME = /^[A-Za-z][A-Za-z0-9]{0,63}$/;\n\n/** Declare a component. Validates the name and returns the definition unchanged (typed). */\nexport function defineComponent<P = Record<string, unknown>>(\n definition: ComponentDefinition<P>,\n): ComponentDefinition<P> {\n if (!COMPONENT_NAME.test(definition.name)) {\n throw new Error(\n `genui: component name \"${definition.name}\" must be letters and digits, starting with a letter (e.g. DataTable)`,\n );\n }\n return definition;\n}\n\nexport interface CatalogOptions {\n /** How JSON Schema props are checked. Default: {@link builtinJsonSchemaValidator}; pass `ajvValidator(new Ajv())` for full JSON Schema. */\n jsonSchemaValidator?: JsonSchemaValidator;\n}\n\n/** An immutable set of component definitions, looked up by name. */\nexport interface Catalog {\n readonly components: readonly ComponentDefinition<any>[];\n readonly validator: JsonSchemaValidator;\n get(name: string): ComponentDefinition<any> | undefined;\n has(name: string): boolean;\n /** The components a model may be offered (every non-`internal` one). */\n modelComponents(): ComponentDefinition<any>[];\n /** Validate `props` for `component`. An unknown component is a validation failure, not a throw. */\n validate(component: string, props: unknown): Promise<GenuiValidation<Record<string, unknown>>>;\n /**\n * {@link validate} without waiting — `undefined` only when the component's Standard Schema\n * validates asynchronously. An unknown component is a failure, as in `validate`.\n */\n validateSync(\n component: string,\n props: unknown,\n ): GenuiValidation<Record<string, unknown>> | undefined;\n /** The component's props as JSON Schema, when it can be derived (see {@link toJsonSchema}). */\n jsonSchemaFor(component: string): JsonSchema | undefined;\n /** A new catalog with these components added (a later definition replaces an earlier one of the same name). */\n extend(components: readonly ComponentDefinition<any>[]): Catalog;\n}\n\n/**\n * Collect component definitions into a {@link Catalog}. Names must be unique; to override a\n * definition (e.g. a builtin), use {@link Catalog.extend}.\n */\nexport function defineCatalog(\n components: readonly ComponentDefinition<any>[],\n options: CatalogOptions = {},\n): Catalog {\n const byName = new Map<string, ComponentDefinition<any>>();\n for (const component of components) {\n defineComponent(component);\n if (byName.has(component.name)) {\n throw new Error(`genui: component \"${component.name}\" is defined twice in one catalog`);\n }\n byName.set(component.name, component);\n }\n return buildCatalog(byName, options.jsonSchemaValidator ?? builtinJsonSchemaValidator);\n}\n\nfunction buildCatalog(\n byName: Map<string, ComponentDefinition<any>>,\n validator: JsonSchemaValidator,\n): Catalog {\n const list = Object.freeze([...byName.values()]);\n return {\n components: list,\n validator,\n get: (name) => byName.get(name),\n has: (name) => byName.has(name),\n modelComponents: () => list.filter((component) => component.internal !== true),\n async validate(component, props) {\n const definition = byName.get(component);\n if (definition === undefined) {\n return {\n ok: false,\n issues: [{ path: [], message: `unknown component \"${component}\"` }],\n };\n }\n const result = await validateProps(definition.props, props, validator);\n return result as GenuiValidation<Record<string, unknown>>;\n },\n validateSync(component, props) {\n const definition = byName.get(component);\n if (definition === undefined) {\n return {\n ok: false,\n issues: [{ path: [], message: `unknown component \"${component}\"` }],\n };\n }\n return validatePropsSync(definition.props, props, validator) as\n | GenuiValidation<Record<string, unknown>>\n | undefined;\n },\n jsonSchemaFor(component) {\n const definition = byName.get(component);\n return definition === undefined ? undefined : toJsonSchema(definition.props);\n },\n extend(more) {\n const next = new Map(byName);\n for (const component of more) {\n defineComponent(component);\n next.set(component.name, component);\n }\n return buildCatalog(next, validator);\n },\n };\n}\n\n/** `DataTable` → `data_table`, `KPICards` → `kpi_cards`. */\nexport function toSnakeCase(name: string): string {\n return name\n .replace(/([a-z0-9])([A-Z])/g, '$1_$2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/[^a-zA-Z0-9]+/g, '_')\n .toLowerCase();\n}\n\n/** The per-component tool name: `ui__show_data_table` with the default prefix. */\nexport function toolNameFor(component: string, prefix = 'ui__show_'): string {\n return `${prefix}${toSnakeCase(component)}`;\n}\n","/**\n * Optional builtin component DEFINITIONS — names, props schemas, model descriptions and plain-text\n * fallbacks for the components most chat apps want. No visuals: an app renders each with its own\n * look, keyed by name. Use them as-is, pick some, or extend them:\n *\n * ```ts\n * const catalog = defineCatalog([...BUILTIN_COMPONENTS, ...LAYOUT_COMPONENTS, myDealCard]);\n * ```\n */\nimport { type ComponentDefinition, defineComponent } from './catalog.js';\nimport type { JsonSchema } from './schema.js';\n\ntype Props = Record<string, any>;\n\nconst str = (description?: string, extra: JsonSchema = {}): JsonSchema => ({\n type: 'string',\n ...(description !== undefined ? { description } : {}),\n ...extra,\n});\nconst obj = (properties: Record<string, JsonSchema>, required: string[] = []): JsonSchema => ({\n type: 'object',\n properties,\n required,\n additionalProperties: false,\n});\nconst arr = (items: JsonSchema, extra: JsonSchema = {}): JsonSchema => ({\n type: 'array',\n items,\n ...extra,\n});\nconst cell: JsonSchema = { type: ['string', 'number', 'boolean', 'null'] };\nconst row: JsonSchema = { type: 'object', additionalProperties: cell };\n\nconst s = (value: unknown): string => (value === null || value === undefined ? '' : String(value));\nconst heading = (props: Props): string => (props.title ? `*${s(props.title)}*\\n` : '');\n\n/** A fixed-width text table in a code block, at most `max` rows. */\nexport function textTable(\n columns: readonly { key: string; label: string }[],\n rows: readonly Props[],\n max = 15,\n): string {\n const shown = rows.slice(0, max);\n const widths = columns.map((column) =>\n Math.min(28, Math.max(column.label.length, ...shown.map((r) => s(r[column.key]).length))),\n );\n const format = (values: string[]) =>\n values\n .map((value, index) => value.slice(0, widths[index]).padEnd(widths[index] ?? 0))\n .join(' ');\n const lines = [\n format(columns.map((column) => column.label)),\n widths.map((width) => '-'.repeat(width)).join(' '),\n ...shown.map((r) => format(columns.map((column) => s(r[column.key])))),\n ];\n if (rows.length > max) lines.push(`… ${rows.length - max} more rows`);\n return `\\`\\`\\`\\n${lines.join('\\n')}\\n\\`\\`\\``;\n}\n\nexport interface DiffLine {\n op: 'same' | 'add' | 'del';\n text: string;\n}\n\n/** Line diff (LCS) — good enough for snippets up to a few hundred lines. */\nexport function lineDiff(before: string, after: string): DiffLine[] {\n const a = before.split('\\n');\n const b = after.split('\\n');\n if (a.length * b.length > 250_000) {\n return [\n ...a.map((text) => ({ op: 'del' as const, text })),\n ...b.map((text) => ({ op: 'add' as const, text })),\n ];\n }\n const dp: number[][] = Array.from({ length: a.length + 1 }, () =>\n new Array<number>(b.length + 1).fill(0),\n );\n const at = (i: number, j: number): number => dp[i]?.[j] ?? 0;\n for (let i = a.length - 1; i >= 0; i--) {\n for (let j = b.length - 1; j >= 0; j--) {\n (dp[i] as number[])[j] =\n a[i] === b[j] ? at(i + 1, j + 1) + 1 : Math.max(at(i + 1, j), at(i, j + 1));\n }\n }\n const out: DiffLine[] = [];\n let i = 0;\n let j = 0;\n while (i < a.length && j < b.length) {\n if (a[i] === b[j]) {\n out.push({ op: 'same', text: a[i] as string });\n i++;\n j++;\n } else if (at(i + 1, j) >= at(i, j + 1)) {\n out.push({ op: 'del', text: a[i++] as string });\n } else {\n out.push({ op: 'add', text: b[j++] as string });\n }\n }\n while (i < a.length) out.push({ op: 'del', text: a[i++] as string });\n while (j < b.length) out.push({ op: 'add', text: b[j++] as string });\n return out;\n}\n\nfunction bar(value: number, max: number, width = 20): string {\n const n = max > 0 ? Math.round((Math.abs(value) / max) * width) : 0;\n return '█'.repeat(n) || '▏';\n}\n\nexport const DataTable = defineComponent<Props>({\n name: 'DataTable',\n title: 'Data table',\n description:\n 'Tabular data (records with the same fields) as a sortable table. Prefer it over markdown tables for more than 3 rows.',\n props: obj(\n {\n title: str('Short caption'),\n columns: arr(\n obj(\n {\n key: str('Field name in each row'),\n label: str('Column header'),\n align: str(undefined, { enum: ['left', 'right', 'center'] }),\n format: str('How to format values', {\n enum: ['text', 'number', 'currency', 'percent', 'date', 'link'],\n }),\n },\n ['key', 'label'],\n ),\n { minItems: 1, maxItems: 12 },\n ),\n rows: arr(row, { maxItems: 500 }),\n },\n ['columns', 'rows'],\n ),\n fallbackText: (props) => `${heading(props)}${textTable(props.columns ?? [], props.rows ?? [])}`,\n});\n\nexport const Chart = defineComponent<Props>({\n name: 'Chart',\n title: 'Chart',\n description:\n '`bar` to compare categories, `line` for a trend over time. `data` is a list of points; `xKey` names the category/time field and each series names a numeric field.',\n props: obj(\n {\n type: str('Chart type', { enum: ['bar', 'line'] }),\n title: str(),\n xKey: str('Field of each point used for the x axis'),\n series: arr(obj({ key: str('Numeric field'), label: str() }, ['key']), {\n minItems: 1,\n maxItems: 6,\n }),\n data: arr(row, { minItems: 1, maxItems: 200 }),\n unit: str('Unit shown after values, e.g. `KB` or `%`'),\n },\n ['type', 'xKey', 'series', 'data'],\n ),\n fallbackText: (props) => {\n const series: { key: string }[] = props.series ?? [];\n const data: Props[] = props.data ?? [];\n const first = series[0]?.key ?? '';\n const max = Math.max(0, ...data.map((point) => Math.abs(Number(point[first]) || 0)));\n const unit = props.unit ? ` ${s(props.unit)}` : '';\n const lines = data\n .slice(0, 20)\n .map(\n (point) =>\n `${s(point[props.xKey]).slice(0, 18).padEnd(18)} ${bar(Number(point[first]) || 0, max)} ${s(point[first])}${unit}`,\n );\n return `${heading(props)}\\`\\`\\`\\n${lines.join('\\n')}\\n\\`\\`\\``;\n },\n});\n\nexport const KpiCards = defineComponent<Props>({\n name: 'KpiCards',\n title: 'KPI cards',\n description: 'A few key numbers (metrics, totals, counts) as cards.',\n props: obj(\n {\n title: str(),\n items: arr(\n obj(\n {\n label: str(),\n value: { type: ['string', 'number'] },\n delta: str('Change, e.g. `+12%`'),\n trend: str(undefined, { enum: ['up', 'down', 'flat'] }),\n hint: str(),\n },\n ['label', 'value'],\n ),\n { minItems: 1, maxItems: 8 },\n ),\n },\n ['items'],\n ),\n fallbackText: (props) =>\n `${heading(props)}${(props.items ?? [])\n .map(\n (item: Props) =>\n `• *${s(item.label)}:* ${s(item.value)}${item.delta ? ` (${s(item.delta)})` : ''}`,\n )\n .join('\\n')}`,\n});\n\nexport const SourceCards = defineComponent<Props>({\n name: 'SourceCards',\n title: 'Sources',\n description: 'The documents, pages or links an answer is based on, as cards.',\n props: obj(\n {\n title: str(),\n items: arr(\n obj({ title: str(), url: str(), snippet: str(), source: str('e.g. Wiki, GitHub') }, [\n 'title',\n ]),\n { minItems: 1, maxItems: 12 },\n ),\n },\n ['items'],\n ),\n fallbackText: (props) =>\n `${heading(props)}${(props.items ?? [])\n .map(\n (item: Props) =>\n `• ${item.url ? `<${s(item.url)}|${s(item.title)}>` : s(item.title)}${item.source ? ` — ${s(item.source)}` : ''}`,\n )\n .join('\\n')}`,\n});\n\nexport const Checklist = defineComponent<Props>({\n name: 'Checklist',\n title: 'Checklist',\n description: 'Steps or a to-do list with done/not-done state.',\n props: obj(\n {\n title: str(),\n items: arr(obj({ label: str(), done: { type: 'boolean' }, note: str() }, ['label']), {\n minItems: 1,\n maxItems: 50,\n }),\n },\n ['items'],\n ),\n fallbackText: (props) =>\n `${heading(props)}${(props.items ?? [])\n .map(\n (item: Props) =>\n `${item.done ? '☑' : '☐'} ${s(item.label)}${item.note ? ` — _${s(item.note)}_` : ''}`,\n )\n .join('\\n')}`,\n});\n\nexport const Timeline = defineComponent<Props>({\n name: 'Timeline',\n title: 'Timeline',\n description: 'Events in chronological order (the history of a project, an incident, a deal).',\n props: obj(\n {\n title: str(),\n events: arr(obj({ date: str(), title: str(), description: str() }, ['title']), {\n minItems: 1,\n maxItems: 50,\n }),\n },\n ['events'],\n ),\n fallbackText: (props) =>\n `${heading(props)}${(props.events ?? [])\n .map(\n (event: Props) =>\n `• ${event.date ? `*${s(event.date)}* ` : ''}${s(event.title)}${event.description ? ` — ${s(event.description)}` : ''}`,\n )\n .join('\\n')}`,\n});\n\nexport const CodeBlock = defineComponent<Props>({\n name: 'CodeBlock',\n title: 'Code',\n description: 'A code snippet or file excerpt with syntax highlighting.',\n props: obj({ title: str(), language: str(), code: str() }, ['code']),\n fallbackText: (props) => `${heading(props)}\\`\\`\\`\\n${s(props.code)}\\n\\`\\`\\``,\n});\n\nexport const Diff = defineComponent<Props>({\n name: 'Diff',\n title: 'Diff',\n description: 'A before/after change to a text or code file, as a line diff.',\n props: obj({ title: str(), language: str(), before: str(), after: str() }, ['before', 'after']),\n fallbackText: (props) =>\n `${heading(props)}\\`\\`\\`\\n${lineDiff(s(props.before), s(props.after))\n .map((line) => `${line.op === 'add' ? '+' : line.op === 'del' ? '-' : ' '} ${line.text}`)\n .join('\\n')}\\n\\`\\`\\``,\n});\n\nexport const Callout = defineComponent<Props>({\n name: 'Callout',\n title: 'Callout',\n description: 'A short note, warning or success message, emphasized.',\n props: obj(\n {\n tone: str(undefined, { enum: ['info', 'success', 'warning', 'danger'] }),\n title: str(),\n text: str(),\n },\n ['text'],\n ),\n fallbackText: (props) =>\n `${props.tone === 'warning' || props.tone === 'danger' ? ':warning: ' : ':information_source: '}${heading(props)}${s(props.text)}`,\n});\n\nexport const Stack = defineComponent<Props>({\n name: 'Stack',\n title: 'Stack',\n description: 'Lays its children out vertically (or horizontally with direction=row).',\n props: obj({ direction: str(undefined, { enum: ['column', 'row'] }), gap: { type: 'number' } }),\n children: true,\n fallbackText: () => '',\n});\n\nexport const Card = defineComponent<Props>({\n name: 'Card',\n title: 'Card',\n description: 'A box with an optional title around its children.',\n props: obj({ title: str(), subtitle: str() }),\n children: true,\n fallbackText: (props) =>\n props.title ? `*${s(props.title)}*${props.subtitle ? ` — ${s(props.subtitle)}` : ''}` : '',\n});\n\nexport const Heading = defineComponent<Props>({\n name: 'Heading',\n title: 'Heading',\n description: 'A heading.',\n props: obj({ text: str() }, ['text']),\n fallbackText: (props) => `*${s(props.text)}*`,\n});\n\nexport const Text = defineComponent<Props>({\n name: 'Text',\n title: 'Text',\n description: 'A paragraph of plain text (no markdown).',\n props: obj({ text: str(), muted: { type: 'boolean' } }, ['text']),\n fallbackText: (props) => s(props.text),\n});\n\nexport const Badge = defineComponent<Props>({\n name: 'Badge',\n title: 'Badge',\n description: 'A small label.',\n props: obj(\n {\n text: str(),\n tone: str(undefined, { enum: ['neutral', 'brand', 'success', 'warning', 'danger'] }),\n },\n ['text'],\n ),\n fallbackText: (props) => `[${s(props.text)}]`,\n});\n\nexport const Link = defineComponent<Props>({\n name: 'Link',\n title: 'Link',\n description: 'A link to an http(s) URL.',\n props: obj({ text: str(), url: str(undefined, { pattern: '^https?://' }) }, ['text', 'url']),\n fallbackText: (props) => `<${s(props.url)}|${s(props.text || props.url)}>`,\n});\n\nexport const Image = defineComponent<Props>({\n name: 'Image',\n title: 'Image',\n description: 'An image from an https URL.',\n props: obj({ url: str(undefined, { pattern: '^https://' }), alt: str() }, ['url']),\n fallbackText: (props) => s(props.url),\n});\n\n/** Content components: data a model shows. */\nexport const BUILTIN_COMPONENTS: readonly ComponentDefinition<Props>[] = [\n DataTable,\n Chart,\n KpiCards,\n SourceCards,\n Checklist,\n Timeline,\n CodeBlock,\n Diff,\n Callout,\n];\n\n/** Layout and text primitives, mostly for composing trees (`Stack`, `Card` take children). */\nexport const LAYOUT_COMPONENTS: readonly ComponentDefinition<Props>[] = [\n Stack,\n Card,\n Heading,\n Text,\n Badge,\n Link,\n Image,\n];\n"],"mappings":";;;;AAiDO,IAAMA,iBAAiB;AAGvB,SAASC,gBACdC,YAAkC;AAElC,MAAI,CAACF,eAAeG,KAAKD,WAAWE,IAAI,GAAG;AACzC,UAAM,IAAIC,MACR,0BAA0BH,WAAWE,IAAI,uEAAuE;EAEpH;AACA,SAAOF;AACT;AATgBD;;;ACtChB,IAAMK,MAAM,wBAACC,aAAsBC,QAAoB,CAAC,OAAmB;EACzEC,MAAM;EACN,GAAIF,gBAAgBG,SAAY;IAAEH;EAAY,IAAI,CAAC;EACnD,GAAGC;AACL,IAJY;AAKZ,IAAMG,MAAM,wBAACC,YAAwCC,WAAqB,CAAA,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,wBAACrD,UAAUJ,EAAEI,MAAMoE,GAAG,GAAtB;AAChB,CAAA;AAGO,IAAM+B,qBAA4D;EACvErD;EACAQ;EACAQ;EACAK;EACAI;EACAG;EACAI;EACAG;EACAE;;AAIK,IAAMiB,oBAA2D;EACtEf;EACAI;EACAE;EACAC;EACAE;EACAC;EACAE;;","names":["COMPONENT_NAME","defineComponent","definition","test","name","Error","str","description","extra","type","undefined","obj","properties","required","additionalProperties","arr","items","cell","row","s","value","String","heading","props","title","textTable","columns","rows","max","shown","slice","widths","map","column","Math","min","label","length","r","key","format","values","index","padEnd","join","lines","width","repeat","push","lineDiff","before","after","a","split","b","text","op","dp","Array","from","fill","at","i","j","out","bar","n","round","abs","DataTable","defineComponent","name","align","enum","minItems","maxItems","fallbackText","Chart","xKey","series","data","unit","first","point","Number","KpiCards","delta","trend","hint","item","SourceCards","url","snippet","source","Checklist","done","note","Timeline","events","date","event","CodeBlock","language","code","Diff","line","Callout","tone","Stack","direction","gap","children","Card","subtitle","Heading","Text","muted","Badge","Link","pattern","Image","alt","BUILTIN_COMPONENTS","LAYOUT_COMPONENTS"]}