@yourgpt/copilot-sdk 2.1.5-alpha.3 → 2.1.5-alpha.5
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.
- package/dist/{MessageTree-CoIt_4nB.d.cts → MessageTree-Clhiv_k2.d.ts} +5 -4
- package/dist/{MessageTree-CzaN9Eul.d.ts → MessageTree-Dt9qfJ55.d.cts} +5 -4
- package/dist/{ThreadManager-BEAECB7Y.d.ts → ThreadManager-D7KwT2FJ.d.ts} +3 -1
- package/dist/{ThreadManager-Cw5fwyCN.d.cts → ThreadManager-DK46fVl3.d.cts} +3 -1
- package/dist/{chunk-NUXLAZOE.cjs → chunk-3ZDRX7J2.cjs} +2 -2
- package/dist/{chunk-NUXLAZOE.cjs.map → chunk-3ZDRX7J2.cjs.map} +1 -1
- package/dist/{chunk-RKGRQRZU.js → chunk-533K2Z7C.js} +4 -4
- package/dist/{chunk-RKGRQRZU.js.map → chunk-533K2Z7C.js.map} +1 -1
- package/dist/chunk-5EGBIQYS.cjs +292 -0
- package/dist/chunk-5EGBIQYS.cjs.map +1 -0
- package/dist/chunk-5UGWLGFS.cjs +2039 -0
- package/dist/chunk-5UGWLGFS.cjs.map +1 -0
- package/dist/{chunk-3AONOZLY.js → chunk-AIVXGTWS.js} +2 -2
- package/dist/chunk-AIVXGTWS.js.map +1 -0
- package/dist/{chunk-LLM7AHMO.js → chunk-DDZLRCVX.js} +2 -2
- package/dist/{chunk-LLM7AHMO.js.map → chunk-DDZLRCVX.js.map} +1 -1
- package/dist/{chunk-PT2TOHG5.js → chunk-DH6EO6NW.js} +1337 -3049
- package/dist/chunk-DH6EO6NW.js.map +1 -0
- package/dist/{chunk-WIXFZUEZ.cjs → chunk-KGYDGK3U.cjs} +84 -30
- package/dist/chunk-KGYDGK3U.cjs.map +1 -0
- package/dist/{chunk-TCPAT3WG.cjs → chunk-LHLVTGIP.cjs} +1339 -3101
- package/dist/chunk-LHLVTGIP.cjs.map +1 -0
- package/dist/{chunk-TPB7XED6.cjs → chunk-TPDMBDQX.cjs} +2 -2
- package/dist/chunk-TPDMBDQX.cjs.map +1 -0
- package/dist/chunk-TXQ37MAO.js +287 -0
- package/dist/chunk-TXQ37MAO.js.map +1 -0
- package/dist/{chunk-MDS23G2S.cjs → chunk-Y2A6AMGO.cjs} +10 -10
- package/dist/{chunk-MDS23G2S.cjs.map → chunk-Y2A6AMGO.cjs.map} +1 -1
- package/dist/{chunk-WZ2TOZ7M.js → chunk-YLZCTR4O.js} +65 -11
- package/dist/chunk-YLZCTR4O.js.map +1 -0
- package/dist/chunk-ZAOTYA5L.js +1983 -0
- package/dist/chunk-ZAOTYA5L.js.map +1 -0
- package/dist/core/index.cjs +93 -93
- package/dist/core/index.d.cts +7 -7
- package/dist/core/index.d.ts +7 -7
- package/dist/core/index.js +5 -5
- package/dist/experimental/index.cjs +644 -0
- package/dist/experimental/index.cjs.map +1 -0
- package/dist/experimental/index.d.cts +924 -0
- package/dist/experimental/index.d.ts +924 -0
- package/dist/experimental/index.js +611 -0
- package/dist/experimental/index.js.map +1 -0
- package/dist/{index-D7169xuR.d.ts → index-D8zza1Q8.d.ts} +1 -1
- package/dist/{index-CzJB8Ddo.d.cts → index-DCVjTdIZ.d.cts} +1 -1
- package/dist/mcp/index.d.cts +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/react/index.cjs +136 -123
- package/dist/react/index.d.cts +178 -12
- package/dist/react/index.d.ts +178 -12
- package/dist/react/index.js +7 -6
- package/dist/styles.css +45 -0
- package/dist/tools/anthropic/index.cjs +3 -3
- package/dist/tools/anthropic/index.d.cts +1 -1
- package/dist/tools/anthropic/index.d.ts +1 -1
- package/dist/tools/anthropic/index.js +2 -2
- package/dist/tools/brave/index.cjs +6 -6
- package/dist/tools/brave/index.d.cts +1 -1
- package/dist/tools/brave/index.d.ts +1 -1
- package/dist/tools/brave/index.js +3 -3
- package/dist/tools/exa/index.cjs +6 -6
- package/dist/tools/exa/index.d.cts +1 -1
- package/dist/tools/exa/index.d.ts +1 -1
- package/dist/tools/exa/index.js +3 -3
- package/dist/tools/google/index.cjs +6 -6
- package/dist/tools/google/index.d.cts +1 -1
- package/dist/tools/google/index.d.ts +1 -1
- package/dist/tools/google/index.js +4 -4
- package/dist/tools/openai/index.cjs +6 -6
- package/dist/tools/openai/index.d.cts +1 -1
- package/dist/tools/openai/index.d.ts +1 -1
- package/dist/tools/openai/index.js +3 -3
- package/dist/tools/searxng/index.cjs +6 -6
- package/dist/tools/searxng/index.d.cts +1 -1
- package/dist/tools/searxng/index.d.ts +1 -1
- package/dist/tools/searxng/index.js +3 -3
- package/dist/tools/serper/index.cjs +6 -6
- package/dist/tools/serper/index.d.cts +1 -1
- package/dist/tools/serper/index.d.ts +1 -1
- package/dist/tools/serper/index.js +3 -3
- package/dist/tools/tavily/index.cjs +6 -6
- package/dist/tools/tavily/index.d.cts +1 -1
- package/dist/tools/tavily/index.d.ts +1 -1
- package/dist/tools/tavily/index.js +3 -3
- package/dist/tools/web-search/index.cjs +7 -7
- package/dist/tools/web-search/index.d.cts +2 -2
- package/dist/tools/web-search/index.d.ts +2 -2
- package/dist/tools/web-search/index.js +4 -4
- package/dist/{tools-tmksfhUo.d.cts → tools-DcS6Aeao.d.cts} +7 -3
- package/dist/{tools-tmksfhUo.d.ts → tools-DcS6Aeao.d.ts} +7 -3
- package/dist/{types-BqwW3Baj.d.ts → types-BUYni9B8.d.ts} +1 -1
- package/dist/{types-BLw7mxtW.d.cts → types-Cvg4DUoc.d.cts} +1 -1
- package/dist/{types-BeFBBZ5i.d.ts → types-waEqyE4K.d.cts} +5 -0
- package/dist/{types-BeFBBZ5i.d.cts → types-waEqyE4K.d.ts} +5 -0
- package/dist/ui/index.cjs +354 -524
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +22 -4
- package/dist/ui/index.d.ts +22 -4
- package/dist/ui/index.js +197 -372
- package/dist/ui/index.js.map +1 -1
- package/package.json +6 -1
- package/dist/chunk-3AONOZLY.js.map +0 -1
- package/dist/chunk-PT2TOHG5.js.map +0 -1
- package/dist/chunk-TCPAT3WG.cjs.map +0 -1
- package/dist/chunk-TPB7XED6.cjs.map +0 -1
- package/dist/chunk-WIXFZUEZ.cjs.map +0 -1
- package/dist/chunk-WZ2TOZ7M.js.map +0 -1
|
@@ -0,0 +1,924 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
interface GenerativeUIToolConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Override the default LLM description.
|
|
8
|
+
* The default instructs the model when to use each UI type.
|
|
9
|
+
*/
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns a tool definition compatible with `streamText` for use in your backend route.
|
|
14
|
+
*
|
|
15
|
+
* Pass the returned object as a value in the `tools` map of `streamText`.
|
|
16
|
+
* The key you use becomes the tool name — use the same name in `useGenerativeUI({ name })` on the frontend.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { streamText } from "@yourgpt/llm-sdk";
|
|
21
|
+
* import { generativeUITool } from "@yourgpt/copilot-sdk/experimental";
|
|
22
|
+
*
|
|
23
|
+
* const result = await streamText({
|
|
24
|
+
* model: openai("gpt-4o"),
|
|
25
|
+
* messages,
|
|
26
|
+
* tools: {
|
|
27
|
+
* render_ui: generativeUITool(),
|
|
28
|
+
* // ...your other tools
|
|
29
|
+
* },
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare function generativeUITool(config?: GenerativeUIToolConfig): {
|
|
34
|
+
description: string;
|
|
35
|
+
parameters: {
|
|
36
|
+
type: "object";
|
|
37
|
+
properties: {
|
|
38
|
+
type: {
|
|
39
|
+
type: "string";
|
|
40
|
+
enum: string[];
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
html: {
|
|
44
|
+
type: "string";
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
height: {
|
|
48
|
+
type: "string";
|
|
49
|
+
};
|
|
50
|
+
chartType: {
|
|
51
|
+
type: "string";
|
|
52
|
+
enum: string[];
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
labels: {
|
|
56
|
+
type: "array";
|
|
57
|
+
items: {
|
|
58
|
+
type: "string";
|
|
59
|
+
};
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
datasets: {
|
|
63
|
+
type: "array";
|
|
64
|
+
items: {
|
|
65
|
+
type: "object";
|
|
66
|
+
properties: {
|
|
67
|
+
label: {
|
|
68
|
+
type: "string";
|
|
69
|
+
};
|
|
70
|
+
data: {
|
|
71
|
+
type: "array";
|
|
72
|
+
items: {
|
|
73
|
+
type: "number";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
required: string[];
|
|
78
|
+
};
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
xLabel: {
|
|
82
|
+
type: "string";
|
|
83
|
+
};
|
|
84
|
+
yLabel: {
|
|
85
|
+
type: "string";
|
|
86
|
+
};
|
|
87
|
+
columns: {
|
|
88
|
+
type: "array";
|
|
89
|
+
items: {
|
|
90
|
+
type: "object";
|
|
91
|
+
properties: {
|
|
92
|
+
key: {
|
|
93
|
+
type: "string";
|
|
94
|
+
};
|
|
95
|
+
label: {
|
|
96
|
+
type: "string";
|
|
97
|
+
};
|
|
98
|
+
align: {
|
|
99
|
+
type: "string";
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
required: string[];
|
|
103
|
+
};
|
|
104
|
+
description: string;
|
|
105
|
+
};
|
|
106
|
+
rows: {
|
|
107
|
+
type: "array";
|
|
108
|
+
items: {
|
|
109
|
+
type: "object";
|
|
110
|
+
};
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
caption: {
|
|
114
|
+
type: "string";
|
|
115
|
+
};
|
|
116
|
+
stats: {
|
|
117
|
+
type: "array";
|
|
118
|
+
items: {
|
|
119
|
+
type: "object";
|
|
120
|
+
properties: {
|
|
121
|
+
label: {
|
|
122
|
+
type: "string";
|
|
123
|
+
};
|
|
124
|
+
value: {
|
|
125
|
+
type: "string";
|
|
126
|
+
};
|
|
127
|
+
change: {
|
|
128
|
+
type: "string";
|
|
129
|
+
};
|
|
130
|
+
changeDirection: {
|
|
131
|
+
type: "string";
|
|
132
|
+
enum: string[];
|
|
133
|
+
};
|
|
134
|
+
description: {
|
|
135
|
+
type: "string";
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
required: string[];
|
|
139
|
+
};
|
|
140
|
+
description: string;
|
|
141
|
+
};
|
|
142
|
+
title: {
|
|
143
|
+
type: "string";
|
|
144
|
+
description: string;
|
|
145
|
+
};
|
|
146
|
+
subtitle: {
|
|
147
|
+
type: "string";
|
|
148
|
+
};
|
|
149
|
+
body: {
|
|
150
|
+
type: "string";
|
|
151
|
+
};
|
|
152
|
+
fields: {
|
|
153
|
+
type: "array";
|
|
154
|
+
items: {
|
|
155
|
+
type: "object";
|
|
156
|
+
properties: {
|
|
157
|
+
label: {
|
|
158
|
+
type: "string";
|
|
159
|
+
};
|
|
160
|
+
value: {
|
|
161
|
+
type: "string";
|
|
162
|
+
};
|
|
163
|
+
badge: {
|
|
164
|
+
type: "boolean";
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
required: string[];
|
|
168
|
+
};
|
|
169
|
+
description: string;
|
|
170
|
+
};
|
|
171
|
+
cta: {
|
|
172
|
+
type: "object";
|
|
173
|
+
properties: {
|
|
174
|
+
label: {
|
|
175
|
+
type: "string";
|
|
176
|
+
};
|
|
177
|
+
url: {
|
|
178
|
+
type: "string";
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
required: string[];
|
|
182
|
+
description: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
required: string[];
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
declare const HtmlPayloadSchema: z.ZodObject<{
|
|
190
|
+
type: z.ZodLiteral<"html">;
|
|
191
|
+
html: z.ZodString;
|
|
192
|
+
title: z.ZodOptional<z.ZodString>;
|
|
193
|
+
height: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
195
|
+
type: z.ZodLiteral<"html">;
|
|
196
|
+
html: z.ZodString;
|
|
197
|
+
title: z.ZodOptional<z.ZodString>;
|
|
198
|
+
height: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
200
|
+
type: z.ZodLiteral<"html">;
|
|
201
|
+
html: z.ZodString;
|
|
202
|
+
title: z.ZodOptional<z.ZodString>;
|
|
203
|
+
height: z.ZodOptional<z.ZodString>;
|
|
204
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
205
|
+
declare const ChartPayloadSchema: z.ZodObject<{
|
|
206
|
+
type: z.ZodLiteral<"chart">;
|
|
207
|
+
chartType: z.ZodEnum<["bar", "line", "pie", "area", "scatter"]>;
|
|
208
|
+
title: z.ZodOptional<z.ZodString>;
|
|
209
|
+
labels: z.ZodArray<z.ZodString, "many">;
|
|
210
|
+
datasets: z.ZodArray<z.ZodObject<{
|
|
211
|
+
label: z.ZodString;
|
|
212
|
+
data: z.ZodArray<z.ZodNumber, "many">;
|
|
213
|
+
color: z.ZodOptional<z.ZodString>;
|
|
214
|
+
}, "strip", z.ZodTypeAny, {
|
|
215
|
+
label: string;
|
|
216
|
+
data: number[];
|
|
217
|
+
color?: string | undefined;
|
|
218
|
+
}, {
|
|
219
|
+
label: string;
|
|
220
|
+
data: number[];
|
|
221
|
+
color?: string | undefined;
|
|
222
|
+
}>, "many">;
|
|
223
|
+
xLabel: z.ZodOptional<z.ZodString>;
|
|
224
|
+
yLabel: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
226
|
+
type: z.ZodLiteral<"chart">;
|
|
227
|
+
chartType: z.ZodEnum<["bar", "line", "pie", "area", "scatter"]>;
|
|
228
|
+
title: z.ZodOptional<z.ZodString>;
|
|
229
|
+
labels: z.ZodArray<z.ZodString, "many">;
|
|
230
|
+
datasets: z.ZodArray<z.ZodObject<{
|
|
231
|
+
label: z.ZodString;
|
|
232
|
+
data: z.ZodArray<z.ZodNumber, "many">;
|
|
233
|
+
color: z.ZodOptional<z.ZodString>;
|
|
234
|
+
}, "strip", z.ZodTypeAny, {
|
|
235
|
+
label: string;
|
|
236
|
+
data: number[];
|
|
237
|
+
color?: string | undefined;
|
|
238
|
+
}, {
|
|
239
|
+
label: string;
|
|
240
|
+
data: number[];
|
|
241
|
+
color?: string | undefined;
|
|
242
|
+
}>, "many">;
|
|
243
|
+
xLabel: z.ZodOptional<z.ZodString>;
|
|
244
|
+
yLabel: z.ZodOptional<z.ZodString>;
|
|
245
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
246
|
+
type: z.ZodLiteral<"chart">;
|
|
247
|
+
chartType: z.ZodEnum<["bar", "line", "pie", "area", "scatter"]>;
|
|
248
|
+
title: z.ZodOptional<z.ZodString>;
|
|
249
|
+
labels: z.ZodArray<z.ZodString, "many">;
|
|
250
|
+
datasets: z.ZodArray<z.ZodObject<{
|
|
251
|
+
label: z.ZodString;
|
|
252
|
+
data: z.ZodArray<z.ZodNumber, "many">;
|
|
253
|
+
color: z.ZodOptional<z.ZodString>;
|
|
254
|
+
}, "strip", z.ZodTypeAny, {
|
|
255
|
+
label: string;
|
|
256
|
+
data: number[];
|
|
257
|
+
color?: string | undefined;
|
|
258
|
+
}, {
|
|
259
|
+
label: string;
|
|
260
|
+
data: number[];
|
|
261
|
+
color?: string | undefined;
|
|
262
|
+
}>, "many">;
|
|
263
|
+
xLabel: z.ZodOptional<z.ZodString>;
|
|
264
|
+
yLabel: z.ZodOptional<z.ZodString>;
|
|
265
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
266
|
+
declare const TablePayloadSchema: z.ZodObject<{
|
|
267
|
+
type: z.ZodLiteral<"table">;
|
|
268
|
+
title: z.ZodOptional<z.ZodString>;
|
|
269
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
270
|
+
key: z.ZodString;
|
|
271
|
+
label: z.ZodString;
|
|
272
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
273
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
274
|
+
key: z.ZodString;
|
|
275
|
+
label: z.ZodString;
|
|
276
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
277
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
278
|
+
key: z.ZodString;
|
|
279
|
+
label: z.ZodString;
|
|
280
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
281
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
282
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
283
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
284
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
285
|
+
type: z.ZodLiteral<"table">;
|
|
286
|
+
title: z.ZodOptional<z.ZodString>;
|
|
287
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
288
|
+
key: z.ZodString;
|
|
289
|
+
label: z.ZodString;
|
|
290
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
291
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
292
|
+
key: z.ZodString;
|
|
293
|
+
label: z.ZodString;
|
|
294
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
295
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
296
|
+
key: z.ZodString;
|
|
297
|
+
label: z.ZodString;
|
|
298
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
299
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
300
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
301
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
302
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
303
|
+
type: z.ZodLiteral<"table">;
|
|
304
|
+
title: z.ZodOptional<z.ZodString>;
|
|
305
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
306
|
+
key: z.ZodString;
|
|
307
|
+
label: z.ZodString;
|
|
308
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
309
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
310
|
+
key: z.ZodString;
|
|
311
|
+
label: z.ZodString;
|
|
312
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
313
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
314
|
+
key: z.ZodString;
|
|
315
|
+
label: z.ZodString;
|
|
316
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
317
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
318
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
319
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
320
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
321
|
+
declare const StatPayloadSchema: z.ZodObject<{
|
|
322
|
+
type: z.ZodLiteral<"stat">;
|
|
323
|
+
title: z.ZodOptional<z.ZodString>;
|
|
324
|
+
stats: z.ZodArray<z.ZodObject<{
|
|
325
|
+
label: z.ZodString;
|
|
326
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
327
|
+
change: z.ZodOptional<z.ZodString>;
|
|
328
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
329
|
+
description: z.ZodOptional<z.ZodString>;
|
|
330
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
331
|
+
label: z.ZodString;
|
|
332
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
333
|
+
change: z.ZodOptional<z.ZodString>;
|
|
334
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
335
|
+
description: z.ZodOptional<z.ZodString>;
|
|
336
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
337
|
+
label: z.ZodString;
|
|
338
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
339
|
+
change: z.ZodOptional<z.ZodString>;
|
|
340
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
341
|
+
description: z.ZodOptional<z.ZodString>;
|
|
342
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
343
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
344
|
+
type: z.ZodLiteral<"stat">;
|
|
345
|
+
title: z.ZodOptional<z.ZodString>;
|
|
346
|
+
stats: z.ZodArray<z.ZodObject<{
|
|
347
|
+
label: z.ZodString;
|
|
348
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
349
|
+
change: z.ZodOptional<z.ZodString>;
|
|
350
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
351
|
+
description: z.ZodOptional<z.ZodString>;
|
|
352
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
353
|
+
label: z.ZodString;
|
|
354
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
355
|
+
change: z.ZodOptional<z.ZodString>;
|
|
356
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
357
|
+
description: z.ZodOptional<z.ZodString>;
|
|
358
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
359
|
+
label: z.ZodString;
|
|
360
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
361
|
+
change: z.ZodOptional<z.ZodString>;
|
|
362
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
363
|
+
description: z.ZodOptional<z.ZodString>;
|
|
364
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
365
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
366
|
+
type: z.ZodLiteral<"stat">;
|
|
367
|
+
title: z.ZodOptional<z.ZodString>;
|
|
368
|
+
stats: z.ZodArray<z.ZodObject<{
|
|
369
|
+
label: z.ZodString;
|
|
370
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
371
|
+
change: z.ZodOptional<z.ZodString>;
|
|
372
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
373
|
+
description: z.ZodOptional<z.ZodString>;
|
|
374
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
375
|
+
label: z.ZodString;
|
|
376
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
377
|
+
change: z.ZodOptional<z.ZodString>;
|
|
378
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
379
|
+
description: z.ZodOptional<z.ZodString>;
|
|
380
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
381
|
+
label: z.ZodString;
|
|
382
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
383
|
+
change: z.ZodOptional<z.ZodString>;
|
|
384
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
385
|
+
description: z.ZodOptional<z.ZodString>;
|
|
386
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
387
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
388
|
+
declare const CardPayloadSchema: z.ZodObject<{
|
|
389
|
+
type: z.ZodLiteral<"card">;
|
|
390
|
+
title: z.ZodString;
|
|
391
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
392
|
+
body: z.ZodOptional<z.ZodString>;
|
|
393
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
394
|
+
label: z.ZodString;
|
|
395
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
396
|
+
badge: z.ZodOptional<z.ZodBoolean>;
|
|
397
|
+
}, "strip", z.ZodTypeAny, {
|
|
398
|
+
label: string;
|
|
399
|
+
value: string | number | boolean;
|
|
400
|
+
badge?: boolean | undefined;
|
|
401
|
+
}, {
|
|
402
|
+
label: string;
|
|
403
|
+
value: string | number | boolean;
|
|
404
|
+
badge?: boolean | undefined;
|
|
405
|
+
}>, "many">>;
|
|
406
|
+
cta: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
407
|
+
label: z.ZodOptional<z.ZodString>;
|
|
408
|
+
text: z.ZodOptional<z.ZodString>;
|
|
409
|
+
url: z.ZodString;
|
|
410
|
+
}, "strip", z.ZodTypeAny, {
|
|
411
|
+
url: string;
|
|
412
|
+
label?: string | undefined;
|
|
413
|
+
text?: string | undefined;
|
|
414
|
+
}, {
|
|
415
|
+
url: string;
|
|
416
|
+
label?: string | undefined;
|
|
417
|
+
text?: string | undefined;
|
|
418
|
+
}>, {
|
|
419
|
+
label: string;
|
|
420
|
+
url: string;
|
|
421
|
+
text?: string | undefined;
|
|
422
|
+
}, {
|
|
423
|
+
url: string;
|
|
424
|
+
label?: string | undefined;
|
|
425
|
+
text?: string | undefined;
|
|
426
|
+
}>>;
|
|
427
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
428
|
+
type: z.ZodLiteral<"card">;
|
|
429
|
+
title: z.ZodString;
|
|
430
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
431
|
+
body: z.ZodOptional<z.ZodString>;
|
|
432
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
433
|
+
label: z.ZodString;
|
|
434
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
435
|
+
badge: z.ZodOptional<z.ZodBoolean>;
|
|
436
|
+
}, "strip", z.ZodTypeAny, {
|
|
437
|
+
label: string;
|
|
438
|
+
value: string | number | boolean;
|
|
439
|
+
badge?: boolean | undefined;
|
|
440
|
+
}, {
|
|
441
|
+
label: string;
|
|
442
|
+
value: string | number | boolean;
|
|
443
|
+
badge?: boolean | undefined;
|
|
444
|
+
}>, "many">>;
|
|
445
|
+
cta: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
446
|
+
label: z.ZodOptional<z.ZodString>;
|
|
447
|
+
text: z.ZodOptional<z.ZodString>;
|
|
448
|
+
url: z.ZodString;
|
|
449
|
+
}, "strip", z.ZodTypeAny, {
|
|
450
|
+
url: string;
|
|
451
|
+
label?: string | undefined;
|
|
452
|
+
text?: string | undefined;
|
|
453
|
+
}, {
|
|
454
|
+
url: string;
|
|
455
|
+
label?: string | undefined;
|
|
456
|
+
text?: string | undefined;
|
|
457
|
+
}>, {
|
|
458
|
+
label: string;
|
|
459
|
+
url: string;
|
|
460
|
+
text?: string | undefined;
|
|
461
|
+
}, {
|
|
462
|
+
url: string;
|
|
463
|
+
label?: string | undefined;
|
|
464
|
+
text?: string | undefined;
|
|
465
|
+
}>>;
|
|
466
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
467
|
+
type: z.ZodLiteral<"card">;
|
|
468
|
+
title: z.ZodString;
|
|
469
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
470
|
+
body: z.ZodOptional<z.ZodString>;
|
|
471
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
472
|
+
label: z.ZodString;
|
|
473
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
474
|
+
badge: z.ZodOptional<z.ZodBoolean>;
|
|
475
|
+
}, "strip", z.ZodTypeAny, {
|
|
476
|
+
label: string;
|
|
477
|
+
value: string | number | boolean;
|
|
478
|
+
badge?: boolean | undefined;
|
|
479
|
+
}, {
|
|
480
|
+
label: string;
|
|
481
|
+
value: string | number | boolean;
|
|
482
|
+
badge?: boolean | undefined;
|
|
483
|
+
}>, "many">>;
|
|
484
|
+
cta: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
485
|
+
label: z.ZodOptional<z.ZodString>;
|
|
486
|
+
text: z.ZodOptional<z.ZodString>;
|
|
487
|
+
url: z.ZodString;
|
|
488
|
+
}, "strip", z.ZodTypeAny, {
|
|
489
|
+
url: string;
|
|
490
|
+
label?: string | undefined;
|
|
491
|
+
text?: string | undefined;
|
|
492
|
+
}, {
|
|
493
|
+
url: string;
|
|
494
|
+
label?: string | undefined;
|
|
495
|
+
text?: string | undefined;
|
|
496
|
+
}>, {
|
|
497
|
+
label: string;
|
|
498
|
+
url: string;
|
|
499
|
+
text?: string | undefined;
|
|
500
|
+
}, {
|
|
501
|
+
url: string;
|
|
502
|
+
label?: string | undefined;
|
|
503
|
+
text?: string | undefined;
|
|
504
|
+
}>>;
|
|
505
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
506
|
+
/** Full discriminated union of all generative UI payload types */
|
|
507
|
+
declare const GenerativeUIPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
508
|
+
type: z.ZodLiteral<"html">;
|
|
509
|
+
html: z.ZodString;
|
|
510
|
+
title: z.ZodOptional<z.ZodString>;
|
|
511
|
+
height: z.ZodOptional<z.ZodString>;
|
|
512
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
513
|
+
type: z.ZodLiteral<"html">;
|
|
514
|
+
html: z.ZodString;
|
|
515
|
+
title: z.ZodOptional<z.ZodString>;
|
|
516
|
+
height: z.ZodOptional<z.ZodString>;
|
|
517
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
518
|
+
type: z.ZodLiteral<"html">;
|
|
519
|
+
html: z.ZodString;
|
|
520
|
+
title: z.ZodOptional<z.ZodString>;
|
|
521
|
+
height: z.ZodOptional<z.ZodString>;
|
|
522
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
523
|
+
type: z.ZodLiteral<"chart">;
|
|
524
|
+
chartType: z.ZodEnum<["bar", "line", "pie", "area", "scatter"]>;
|
|
525
|
+
title: z.ZodOptional<z.ZodString>;
|
|
526
|
+
labels: z.ZodArray<z.ZodString, "many">;
|
|
527
|
+
datasets: z.ZodArray<z.ZodObject<{
|
|
528
|
+
label: z.ZodString;
|
|
529
|
+
data: z.ZodArray<z.ZodNumber, "many">;
|
|
530
|
+
color: z.ZodOptional<z.ZodString>;
|
|
531
|
+
}, "strip", z.ZodTypeAny, {
|
|
532
|
+
label: string;
|
|
533
|
+
data: number[];
|
|
534
|
+
color?: string | undefined;
|
|
535
|
+
}, {
|
|
536
|
+
label: string;
|
|
537
|
+
data: number[];
|
|
538
|
+
color?: string | undefined;
|
|
539
|
+
}>, "many">;
|
|
540
|
+
xLabel: z.ZodOptional<z.ZodString>;
|
|
541
|
+
yLabel: z.ZodOptional<z.ZodString>;
|
|
542
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
543
|
+
type: z.ZodLiteral<"chart">;
|
|
544
|
+
chartType: z.ZodEnum<["bar", "line", "pie", "area", "scatter"]>;
|
|
545
|
+
title: z.ZodOptional<z.ZodString>;
|
|
546
|
+
labels: z.ZodArray<z.ZodString, "many">;
|
|
547
|
+
datasets: z.ZodArray<z.ZodObject<{
|
|
548
|
+
label: z.ZodString;
|
|
549
|
+
data: z.ZodArray<z.ZodNumber, "many">;
|
|
550
|
+
color: z.ZodOptional<z.ZodString>;
|
|
551
|
+
}, "strip", z.ZodTypeAny, {
|
|
552
|
+
label: string;
|
|
553
|
+
data: number[];
|
|
554
|
+
color?: string | undefined;
|
|
555
|
+
}, {
|
|
556
|
+
label: string;
|
|
557
|
+
data: number[];
|
|
558
|
+
color?: string | undefined;
|
|
559
|
+
}>, "many">;
|
|
560
|
+
xLabel: z.ZodOptional<z.ZodString>;
|
|
561
|
+
yLabel: z.ZodOptional<z.ZodString>;
|
|
562
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
563
|
+
type: z.ZodLiteral<"chart">;
|
|
564
|
+
chartType: z.ZodEnum<["bar", "line", "pie", "area", "scatter"]>;
|
|
565
|
+
title: z.ZodOptional<z.ZodString>;
|
|
566
|
+
labels: z.ZodArray<z.ZodString, "many">;
|
|
567
|
+
datasets: z.ZodArray<z.ZodObject<{
|
|
568
|
+
label: z.ZodString;
|
|
569
|
+
data: z.ZodArray<z.ZodNumber, "many">;
|
|
570
|
+
color: z.ZodOptional<z.ZodString>;
|
|
571
|
+
}, "strip", z.ZodTypeAny, {
|
|
572
|
+
label: string;
|
|
573
|
+
data: number[];
|
|
574
|
+
color?: string | undefined;
|
|
575
|
+
}, {
|
|
576
|
+
label: string;
|
|
577
|
+
data: number[];
|
|
578
|
+
color?: string | undefined;
|
|
579
|
+
}>, "many">;
|
|
580
|
+
xLabel: z.ZodOptional<z.ZodString>;
|
|
581
|
+
yLabel: z.ZodOptional<z.ZodString>;
|
|
582
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
583
|
+
type: z.ZodLiteral<"table">;
|
|
584
|
+
title: z.ZodOptional<z.ZodString>;
|
|
585
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
586
|
+
key: z.ZodString;
|
|
587
|
+
label: z.ZodString;
|
|
588
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
589
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
590
|
+
key: z.ZodString;
|
|
591
|
+
label: z.ZodString;
|
|
592
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
593
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
594
|
+
key: z.ZodString;
|
|
595
|
+
label: z.ZodString;
|
|
596
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
597
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
598
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
599
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
600
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
601
|
+
type: z.ZodLiteral<"table">;
|
|
602
|
+
title: z.ZodOptional<z.ZodString>;
|
|
603
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
604
|
+
key: z.ZodString;
|
|
605
|
+
label: z.ZodString;
|
|
606
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
607
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
608
|
+
key: z.ZodString;
|
|
609
|
+
label: z.ZodString;
|
|
610
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
611
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
612
|
+
key: z.ZodString;
|
|
613
|
+
label: z.ZodString;
|
|
614
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
615
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
616
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
617
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
618
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
619
|
+
type: z.ZodLiteral<"table">;
|
|
620
|
+
title: z.ZodOptional<z.ZodString>;
|
|
621
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
622
|
+
key: z.ZodString;
|
|
623
|
+
label: z.ZodString;
|
|
624
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
625
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
626
|
+
key: z.ZodString;
|
|
627
|
+
label: z.ZodString;
|
|
628
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
629
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
630
|
+
key: z.ZodString;
|
|
631
|
+
label: z.ZodString;
|
|
632
|
+
align: z.ZodOptional<z.ZodEnum<["left", "right", "center"]>>;
|
|
633
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
634
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
635
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
636
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
637
|
+
type: z.ZodLiteral<"stat">;
|
|
638
|
+
title: z.ZodOptional<z.ZodString>;
|
|
639
|
+
stats: z.ZodArray<z.ZodObject<{
|
|
640
|
+
label: z.ZodString;
|
|
641
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
642
|
+
change: z.ZodOptional<z.ZodString>;
|
|
643
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
644
|
+
description: z.ZodOptional<z.ZodString>;
|
|
645
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
646
|
+
label: z.ZodString;
|
|
647
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
648
|
+
change: z.ZodOptional<z.ZodString>;
|
|
649
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
650
|
+
description: z.ZodOptional<z.ZodString>;
|
|
651
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
652
|
+
label: z.ZodString;
|
|
653
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
654
|
+
change: z.ZodOptional<z.ZodString>;
|
|
655
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
656
|
+
description: z.ZodOptional<z.ZodString>;
|
|
657
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
658
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
659
|
+
type: z.ZodLiteral<"stat">;
|
|
660
|
+
title: z.ZodOptional<z.ZodString>;
|
|
661
|
+
stats: z.ZodArray<z.ZodObject<{
|
|
662
|
+
label: z.ZodString;
|
|
663
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
664
|
+
change: z.ZodOptional<z.ZodString>;
|
|
665
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
666
|
+
description: z.ZodOptional<z.ZodString>;
|
|
667
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
668
|
+
label: z.ZodString;
|
|
669
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
670
|
+
change: z.ZodOptional<z.ZodString>;
|
|
671
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
672
|
+
description: z.ZodOptional<z.ZodString>;
|
|
673
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
674
|
+
label: z.ZodString;
|
|
675
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
676
|
+
change: z.ZodOptional<z.ZodString>;
|
|
677
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
678
|
+
description: z.ZodOptional<z.ZodString>;
|
|
679
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
680
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
681
|
+
type: z.ZodLiteral<"stat">;
|
|
682
|
+
title: z.ZodOptional<z.ZodString>;
|
|
683
|
+
stats: z.ZodArray<z.ZodObject<{
|
|
684
|
+
label: z.ZodString;
|
|
685
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
686
|
+
change: z.ZodOptional<z.ZodString>;
|
|
687
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
688
|
+
description: z.ZodOptional<z.ZodString>;
|
|
689
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
690
|
+
label: z.ZodString;
|
|
691
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
692
|
+
change: z.ZodOptional<z.ZodString>;
|
|
693
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
694
|
+
description: z.ZodOptional<z.ZodString>;
|
|
695
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
696
|
+
label: z.ZodString;
|
|
697
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
698
|
+
change: z.ZodOptional<z.ZodString>;
|
|
699
|
+
changeDirection: z.ZodOptional<z.ZodEnum<["positive", "negative", "neutral"]>>;
|
|
700
|
+
description: z.ZodOptional<z.ZodString>;
|
|
701
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
702
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
703
|
+
type: z.ZodLiteral<"card">;
|
|
704
|
+
title: z.ZodString;
|
|
705
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
706
|
+
body: z.ZodOptional<z.ZodString>;
|
|
707
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
708
|
+
label: z.ZodString;
|
|
709
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
710
|
+
badge: z.ZodOptional<z.ZodBoolean>;
|
|
711
|
+
}, "strip", z.ZodTypeAny, {
|
|
712
|
+
label: string;
|
|
713
|
+
value: string | number | boolean;
|
|
714
|
+
badge?: boolean | undefined;
|
|
715
|
+
}, {
|
|
716
|
+
label: string;
|
|
717
|
+
value: string | number | boolean;
|
|
718
|
+
badge?: boolean | undefined;
|
|
719
|
+
}>, "many">>;
|
|
720
|
+
cta: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
721
|
+
label: z.ZodOptional<z.ZodString>;
|
|
722
|
+
text: z.ZodOptional<z.ZodString>;
|
|
723
|
+
url: z.ZodString;
|
|
724
|
+
}, "strip", z.ZodTypeAny, {
|
|
725
|
+
url: string;
|
|
726
|
+
label?: string | undefined;
|
|
727
|
+
text?: string | undefined;
|
|
728
|
+
}, {
|
|
729
|
+
url: string;
|
|
730
|
+
label?: string | undefined;
|
|
731
|
+
text?: string | undefined;
|
|
732
|
+
}>, {
|
|
733
|
+
label: string;
|
|
734
|
+
url: string;
|
|
735
|
+
text?: string | undefined;
|
|
736
|
+
}, {
|
|
737
|
+
url: string;
|
|
738
|
+
label?: string | undefined;
|
|
739
|
+
text?: string | undefined;
|
|
740
|
+
}>>;
|
|
741
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
742
|
+
type: z.ZodLiteral<"card">;
|
|
743
|
+
title: z.ZodString;
|
|
744
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
745
|
+
body: z.ZodOptional<z.ZodString>;
|
|
746
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
747
|
+
label: z.ZodString;
|
|
748
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
749
|
+
badge: z.ZodOptional<z.ZodBoolean>;
|
|
750
|
+
}, "strip", z.ZodTypeAny, {
|
|
751
|
+
label: string;
|
|
752
|
+
value: string | number | boolean;
|
|
753
|
+
badge?: boolean | undefined;
|
|
754
|
+
}, {
|
|
755
|
+
label: string;
|
|
756
|
+
value: string | number | boolean;
|
|
757
|
+
badge?: boolean | undefined;
|
|
758
|
+
}>, "many">>;
|
|
759
|
+
cta: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
760
|
+
label: z.ZodOptional<z.ZodString>;
|
|
761
|
+
text: z.ZodOptional<z.ZodString>;
|
|
762
|
+
url: z.ZodString;
|
|
763
|
+
}, "strip", z.ZodTypeAny, {
|
|
764
|
+
url: string;
|
|
765
|
+
label?: string | undefined;
|
|
766
|
+
text?: string | undefined;
|
|
767
|
+
}, {
|
|
768
|
+
url: string;
|
|
769
|
+
label?: string | undefined;
|
|
770
|
+
text?: string | undefined;
|
|
771
|
+
}>, {
|
|
772
|
+
label: string;
|
|
773
|
+
url: string;
|
|
774
|
+
text?: string | undefined;
|
|
775
|
+
}, {
|
|
776
|
+
url: string;
|
|
777
|
+
label?: string | undefined;
|
|
778
|
+
text?: string | undefined;
|
|
779
|
+
}>>;
|
|
780
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
781
|
+
type: z.ZodLiteral<"card">;
|
|
782
|
+
title: z.ZodString;
|
|
783
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
784
|
+
body: z.ZodOptional<z.ZodString>;
|
|
785
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
786
|
+
label: z.ZodString;
|
|
787
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
788
|
+
badge: z.ZodOptional<z.ZodBoolean>;
|
|
789
|
+
}, "strip", z.ZodTypeAny, {
|
|
790
|
+
label: string;
|
|
791
|
+
value: string | number | boolean;
|
|
792
|
+
badge?: boolean | undefined;
|
|
793
|
+
}, {
|
|
794
|
+
label: string;
|
|
795
|
+
value: string | number | boolean;
|
|
796
|
+
badge?: boolean | undefined;
|
|
797
|
+
}>, "many">>;
|
|
798
|
+
cta: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
799
|
+
label: z.ZodOptional<z.ZodString>;
|
|
800
|
+
text: z.ZodOptional<z.ZodString>;
|
|
801
|
+
url: z.ZodString;
|
|
802
|
+
}, "strip", z.ZodTypeAny, {
|
|
803
|
+
url: string;
|
|
804
|
+
label?: string | undefined;
|
|
805
|
+
text?: string | undefined;
|
|
806
|
+
}, {
|
|
807
|
+
url: string;
|
|
808
|
+
label?: string | undefined;
|
|
809
|
+
text?: string | undefined;
|
|
810
|
+
}>, {
|
|
811
|
+
label: string;
|
|
812
|
+
url: string;
|
|
813
|
+
text?: string | undefined;
|
|
814
|
+
}, {
|
|
815
|
+
url: string;
|
|
816
|
+
label?: string | undefined;
|
|
817
|
+
text?: string | undefined;
|
|
818
|
+
}>>;
|
|
819
|
+
}, z.ZodTypeAny, "passthrough">>]>;
|
|
820
|
+
type HtmlPayload = z.infer<typeof HtmlPayloadSchema>;
|
|
821
|
+
type ChartPayload = z.infer<typeof ChartPayloadSchema>;
|
|
822
|
+
type TablePayload = z.infer<typeof TablePayloadSchema>;
|
|
823
|
+
type StatPayload = z.infer<typeof StatPayloadSchema>;
|
|
824
|
+
type CardPayload = z.infer<typeof CardPayloadSchema>;
|
|
825
|
+
type GenerativeUIPayload = z.infer<typeof GenerativeUIPayloadSchema>;
|
|
826
|
+
/** Props passed to user-supplied chart renderer */
|
|
827
|
+
interface ChartRendererProps {
|
|
828
|
+
payload: ChartPayload;
|
|
829
|
+
}
|
|
830
|
+
/** Config for useGenerativeUI hook */
|
|
831
|
+
interface UseGenerativeUIConfig {
|
|
832
|
+
/**
|
|
833
|
+
* Tool name — must match the key used in generativeUITool() on the server.
|
|
834
|
+
* @default "render_ui"
|
|
835
|
+
*/
|
|
836
|
+
name?: string;
|
|
837
|
+
/**
|
|
838
|
+
* Renderer for chart payloads. The SDK does not bundle a chart library.
|
|
839
|
+
* Pass your own Recharts / Chart.js / Victory component here.
|
|
840
|
+
* If omitted, chart results show a JSON data fallback.
|
|
841
|
+
*
|
|
842
|
+
* @example
|
|
843
|
+
* ```tsx
|
|
844
|
+
* chartRenderer={({ payload }) => (
|
|
845
|
+
* <BarChart data={payload.datasets} xLabels={payload.labels} />
|
|
846
|
+
* )}
|
|
847
|
+
* ```
|
|
848
|
+
*/
|
|
849
|
+
chartRenderer?: React__default.ComponentType<ChartRendererProps>;
|
|
850
|
+
/**
|
|
851
|
+
* Override any built-in renderer per type.
|
|
852
|
+
* Useful when you want custom styling while keeping the SDK's schema validation.
|
|
853
|
+
*/
|
|
854
|
+
overrideRenderers?: Partial<{
|
|
855
|
+
html: React__default.ComponentType<{
|
|
856
|
+
payload: HtmlPayload;
|
|
857
|
+
}>;
|
|
858
|
+
chart: React__default.ComponentType<ChartRendererProps>;
|
|
859
|
+
table: React__default.ComponentType<{
|
|
860
|
+
payload: TablePayload;
|
|
861
|
+
}>;
|
|
862
|
+
stat: React__default.ComponentType<{
|
|
863
|
+
payload: StatPayload;
|
|
864
|
+
}>;
|
|
865
|
+
card: React__default.ComponentType<{
|
|
866
|
+
payload: CardPayload;
|
|
867
|
+
}>;
|
|
868
|
+
}>;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Register the generative UI tool and attach built-in renderers for all payload types.
|
|
873
|
+
*
|
|
874
|
+
* Must be called inside a `CopilotProvider`. The `name` must match
|
|
875
|
+
* the key used for `generativeUITool()` in your backend `streamText` tools map.
|
|
876
|
+
*
|
|
877
|
+
* @example
|
|
878
|
+
* ```tsx
|
|
879
|
+
* import { useGenerativeUI } from "@yourgpt/copilot-sdk/experimental";
|
|
880
|
+
*
|
|
881
|
+
* function App() {
|
|
882
|
+
* useGenerativeUI({
|
|
883
|
+
* chartRenderer: ({ payload }) => (
|
|
884
|
+
* <BarChart labels={payload.labels} datasets={payload.datasets} />
|
|
885
|
+
* ),
|
|
886
|
+
* });
|
|
887
|
+
* return <CopilotChat />;
|
|
888
|
+
* }
|
|
889
|
+
* ```
|
|
890
|
+
*
|
|
891
|
+
* @experimental This API may change without a semver major bump.
|
|
892
|
+
*/
|
|
893
|
+
declare function useGenerativeUI(config?: UseGenerativeUIConfig): void;
|
|
894
|
+
|
|
895
|
+
interface HtmlRendererProps {
|
|
896
|
+
payload: HtmlPayload;
|
|
897
|
+
className?: string;
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Renders AI-generated HTML inside an isolated iframe.
|
|
901
|
+
* Tailwind CSS is loaded via CDN — iframes provide a full document context
|
|
902
|
+
* so the Tailwind Play CDN can scan and style classes correctly.
|
|
903
|
+
*/
|
|
904
|
+
declare function HtmlRenderer({ payload, className }: HtmlRendererProps): react_jsx_runtime.JSX.Element;
|
|
905
|
+
|
|
906
|
+
interface TableRendererProps {
|
|
907
|
+
payload: TablePayload;
|
|
908
|
+
className?: string;
|
|
909
|
+
}
|
|
910
|
+
declare function TableRenderer({ payload, className }: TableRendererProps): react_jsx_runtime.JSX.Element;
|
|
911
|
+
|
|
912
|
+
interface StatRendererProps {
|
|
913
|
+
payload: StatPayload;
|
|
914
|
+
className?: string;
|
|
915
|
+
}
|
|
916
|
+
declare function StatRenderer({ payload, className }: StatRendererProps): react_jsx_runtime.JSX.Element;
|
|
917
|
+
|
|
918
|
+
interface CardRendererProps {
|
|
919
|
+
payload: CardPayload;
|
|
920
|
+
className?: string;
|
|
921
|
+
}
|
|
922
|
+
declare function CardRenderer({ payload, className }: CardRendererProps): react_jsx_runtime.JSX.Element;
|
|
923
|
+
|
|
924
|
+
export { type CardPayload, CardPayloadSchema, CardRenderer, type ChartPayload, ChartPayloadSchema, type ChartRendererProps, type GenerativeUIPayload, GenerativeUIPayloadSchema, type GenerativeUIToolConfig, type HtmlPayload, HtmlPayloadSchema, HtmlRenderer, type StatPayload, StatPayloadSchema, StatRenderer, type TablePayload, TablePayloadSchema, TableRenderer, type UseGenerativeUIConfig, generativeUITool, useGenerativeUI };
|