@kortyx/stream 0.2.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/client/read-stream.d.ts +3 -0
  3. package/dist/client/read-stream.d.ts.map +1 -0
  4. package/dist/client/read-stream.js +32 -0
  5. package/dist/index.d.ts +4 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +19 -0
  8. package/dist/server/create-stream-response.d.ts +9 -0
  9. package/dist/server/create-stream-response.d.ts.map +1 -0
  10. package/dist/server/create-stream-response.js +45 -0
  11. package/dist/server/json-to-sse.d.ts +4 -0
  12. package/dist/server/json-to-sse.d.ts.map +1 -0
  13. package/dist/server/json-to-sse.js +16 -0
  14. package/dist/types/stream-chunk.d.ts +286 -0
  15. package/dist/types/stream-chunk.d.ts.map +1 -0
  16. package/dist/types/stream-chunk.js +74 -0
  17. package/dist/types/stream-result.d.ts +465 -0
  18. package/dist/types/stream-result.d.ts.map +1 -0
  19. package/dist/types/stream-result.js +18 -0
  20. package/dist/types/structured-data/index.d.ts +76 -0
  21. package/dist/types/structured-data/index.d.ts.map +1 -0
  22. package/dist/types/structured-data/index.js +13 -0
  23. package/dist/types/structured-data/jobs.d.ts +43 -0
  24. package/dist/types/structured-data/jobs.d.ts.map +1 -0
  25. package/dist/types/structured-data/jobs.js +14 -0
  26. package/eslint.config.mjs +12 -0
  27. package/package.json +28 -0
  28. package/src/client/read-stream.ts +36 -0
  29. package/src/index.ts +8 -0
  30. package/src/server/create-stream-response.ts +54 -0
  31. package/src/server/json-to-sse.ts +13 -0
  32. package/src/types/stream-chunk.ts +79 -0
  33. package/src/types/stream-result.ts +18 -0
  34. package/src/types/structured-data/index.ts +26 -0
  35. package/src/types/structured-data/jobs.ts +16 -0
  36. package/tsconfig.build.json +24 -0
  37. package/tsconfig.build.tsbuildinfo +1 -0
  38. package/tsconfig.json +16 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,32 @@
1
+ # @chatbot-core/types
2
+
3
+ ## [0.2.0](https://github.com/kortyx-io/kortyx/compare/stream-v0.1.2...stream-v0.2.0) (2026-01-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * create kortyx packages ([fb9d281](https://github.com/kortyx-io/kortyx/commit/fb9d281e92e885fcfc2948dc1ee9701e881f7321))
9
+
10
+ ## 0.1.2
11
+
12
+ ### Patch Changes
13
+
14
+ - Merge branch 'optimization/chat-flow-with-interrupt' into 'main'
15
+
16
+ Automatically generated changeset based on detected changes.
17
+
18
+ ## 0.1.1
19
+
20
+ ### Patch Changes
21
+
22
+ - Merge branch 'fix/stream-ui' into 'main'
23
+
24
+ Automatically generated changeset based on detected changes.
25
+
26
+ ## 0.2.1
27
+
28
+ ### Patch Changes
29
+
30
+ - Merge branch 'fix/ts-problem' into 'master'
31
+
32
+ Automatically generated changeset based on detected changes.
@@ -0,0 +1,3 @@
1
+ import type { StreamChunk } from "../types/stream-chunk";
2
+ export declare function readStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<StreamChunk, void, void>;
3
+ //# sourceMappingURL=read-stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-stream.d.ts","sourceRoot":"","sources":["../../src/client/read-stream.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKzD,wBAAuB,UAAU,CAC/B,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,GACtC,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CA2BzC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readStream = readStream;
4
+ async function* readStream(body) {
5
+ if (!body)
6
+ return;
7
+ const reader = body.getReader();
8
+ const decoder = new TextDecoder("utf-8");
9
+ let buffer = "";
10
+ while (true) {
11
+ const { done, value } = await reader.read();
12
+ if (done)
13
+ break;
14
+ buffer += decoder.decode(value, { stream: true });
15
+ const parts = buffer.split("\n\n");
16
+ buffer = parts.pop() ?? "";
17
+ for (const part of parts) {
18
+ if (!part.startsWith("data: "))
19
+ continue;
20
+ const payload = part.slice(6);
21
+ if (payload.trim() === "[DONE]")
22
+ return;
23
+ try {
24
+ yield JSON.parse(payload);
25
+ }
26
+ catch (err) {
27
+ console.warn("Invalid JSON in stream chunk:", payload);
28
+ console.error(err);
29
+ }
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./client/read-stream";
2
+ export * from "./server/create-stream-response";
3
+ export * from "./types/stream-chunk";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,sBAAsB,CAAC;AAGrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/read-stream"), exports);
18
+ __exportStar(require("./server/create-stream-response"), exports);
19
+ __exportStar(require("./types/stream-chunk"), exports);
@@ -0,0 +1,9 @@
1
+ import type { StreamChunk } from "../types/stream-chunk";
2
+ export declare const STREAM_HEADERS: {
3
+ "content-type": string;
4
+ "cache-control": string;
5
+ connection: string;
6
+ "x-accel-buffering": string;
7
+ };
8
+ export declare function createStreamResponse(stream: AsyncIterable<StreamChunk>): Response;
9
+ //# sourceMappingURL=create-stream-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-stream-response.d.ts","sourceRoot":"","sources":["../../src/server/create-stream-response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,eAAO,MAAM,cAAc;;;;;CAK1B,CAAC;AAmBF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,GACjC,QAAQ,CAwBV"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STREAM_HEADERS = void 0;
4
+ exports.createStreamResponse = createStreamResponse;
5
+ exports.STREAM_HEADERS = {
6
+ "content-type": "text/event-stream",
7
+ "cache-control": "no-cache",
8
+ connection: "keep-alive",
9
+ "x-accel-buffering": "no",
10
+ };
11
+ class JsonToSseTransformStream extends TransformStream {
12
+ constructor() {
13
+ super({
14
+ transform(part, controller) {
15
+ controller.enqueue(`data: ${JSON.stringify(part)}\n\n`);
16
+ },
17
+ flush(controller) {
18
+ controller.enqueue("data: [DONE]\n\n");
19
+ },
20
+ });
21
+ }
22
+ }
23
+ function createStreamResponse(stream) {
24
+ const readable = new ReadableStream({
25
+ async start(controller) {
26
+ try {
27
+ for await (const chunk of stream) {
28
+ controller.enqueue(chunk);
29
+ }
30
+ }
31
+ catch (err) {
32
+ controller.enqueue({
33
+ type: "error",
34
+ message: String(err?.message ?? err),
35
+ });
36
+ }
37
+ finally {
38
+ controller.close();
39
+ }
40
+ },
41
+ });
42
+ return new Response(readable
43
+ .pipeThrough(new JsonToSseTransformStream())
44
+ .pipeThrough(new TextEncoderStream()), { headers: exports.STREAM_HEADERS });
45
+ }
@@ -0,0 +1,4 @@
1
+ export declare class JsonToSseTransformStream extends TransformStream<unknown, string> {
2
+ constructor();
3
+ }
4
+ //# sourceMappingURL=json-to-sse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-to-sse.d.ts","sourceRoot":"","sources":["../../src/server/json-to-sse.ts"],"names":[],"mappings":"AACA,qBAAa,wBAAyB,SAAQ,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC;;CAW7E"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JsonToSseTransformStream = void 0;
4
+ class JsonToSseTransformStream extends TransformStream {
5
+ constructor() {
6
+ super({
7
+ transform(part, controller) {
8
+ controller.enqueue(`data: ${JSON.stringify(part)}\n\n`);
9
+ },
10
+ flush(controller) {
11
+ controller.enqueue("data: [DONE]\n\n");
12
+ },
13
+ });
14
+ }
15
+ }
16
+ exports.JsonToSseTransformStream = JsonToSseTransformStream;
@@ -0,0 +1,286 @@
1
+ import { z } from "zod";
2
+ export declare const StreamChunkSchema: z.ZodUnion<[z.ZodObject<{
3
+ type: z.ZodLiteral<"session">;
4
+ sessionId: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ type?: "session";
7
+ sessionId?: string;
8
+ }, {
9
+ type?: "session";
10
+ sessionId?: string;
11
+ }>, z.ZodObject<{
12
+ type: z.ZodLiteral<"status">;
13
+ message: z.ZodString;
14
+ node: z.ZodOptional<z.ZodString>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ message?: string;
17
+ type?: "status";
18
+ node?: string;
19
+ }, {
20
+ message?: string;
21
+ type?: "status";
22
+ node?: string;
23
+ }>, z.ZodObject<{
24
+ type: z.ZodLiteral<"message">;
25
+ content: z.ZodString;
26
+ node: z.ZodOptional<z.ZodString>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ type?: "message";
29
+ node?: string;
30
+ content?: string;
31
+ }, {
32
+ type?: "message";
33
+ node?: string;
34
+ content?: string;
35
+ }>, z.ZodObject<{
36
+ type: z.ZodLiteral<"text-start">;
37
+ node: z.ZodOptional<z.ZodString>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ type?: "text-start";
40
+ node?: string;
41
+ }, {
42
+ type?: "text-start";
43
+ node?: string;
44
+ }>, z.ZodObject<{
45
+ type: z.ZodLiteral<"text-delta">;
46
+ delta: z.ZodString;
47
+ node: z.ZodOptional<z.ZodString>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ type?: "text-delta";
50
+ node?: string;
51
+ delta?: string;
52
+ }, {
53
+ type?: "text-delta";
54
+ node?: string;
55
+ delta?: string;
56
+ }>, z.ZodObject<{
57
+ type: z.ZodLiteral<"text-end">;
58
+ node: z.ZodOptional<z.ZodString>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ type?: "text-end";
61
+ node?: string;
62
+ }, {
63
+ type?: "text-end";
64
+ node?: string;
65
+ }>, z.ZodObject<{
66
+ type: z.ZodLiteral<"tool-result">;
67
+ tool: z.ZodOptional<z.ZodString>;
68
+ node: z.ZodOptional<z.ZodString>;
69
+ content: z.ZodUnknown;
70
+ }, "strip", z.ZodTypeAny, {
71
+ type?: "tool-result";
72
+ node?: string;
73
+ content?: unknown;
74
+ tool?: string;
75
+ }, {
76
+ type?: "tool-result";
77
+ node?: string;
78
+ content?: unknown;
79
+ tool?: string;
80
+ }>, z.ZodObject<{
81
+ type: z.ZodLiteral<"interrupt">;
82
+ requestId: z.ZodString;
83
+ resumeToken: z.ZodString;
84
+ workflow: z.ZodOptional<z.ZodString>;
85
+ node: z.ZodOptional<z.ZodString>;
86
+ input: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
87
+ kind: z.ZodLiteral<"text">;
88
+ multiple: z.ZodBoolean;
89
+ question: z.ZodOptional<z.ZodString>;
90
+ options: z.ZodOptional<z.ZodArray<z.ZodNever, "many">>;
91
+ }, "strip", z.ZodTypeAny, {
92
+ options?: never[];
93
+ kind?: "text";
94
+ multiple?: boolean;
95
+ question?: string;
96
+ }, {
97
+ options?: never[];
98
+ kind?: "text";
99
+ multiple?: boolean;
100
+ question?: string;
101
+ }>, z.ZodObject<{
102
+ kind: z.ZodEnum<["choice", "multi-choice"]>;
103
+ multiple: z.ZodBoolean;
104
+ question: z.ZodString;
105
+ options: z.ZodArray<z.ZodObject<{
106
+ id: z.ZodString;
107
+ label: z.ZodString;
108
+ description: z.ZodOptional<z.ZodString>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ id?: string;
111
+ label?: string;
112
+ description?: string;
113
+ }, {
114
+ id?: string;
115
+ label?: string;
116
+ description?: string;
117
+ }>, "many">;
118
+ }, "strip", z.ZodTypeAny, {
119
+ options?: {
120
+ id?: string;
121
+ label?: string;
122
+ description?: string;
123
+ }[];
124
+ kind?: "choice" | "multi-choice";
125
+ multiple?: boolean;
126
+ question?: string;
127
+ }, {
128
+ options?: {
129
+ id?: string;
130
+ label?: string;
131
+ description?: string;
132
+ }[];
133
+ kind?: "choice" | "multi-choice";
134
+ multiple?: boolean;
135
+ question?: string;
136
+ }>]>;
137
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
138
+ }, "strip", z.ZodTypeAny, {
139
+ type?: "interrupt";
140
+ node?: string;
141
+ requestId?: string;
142
+ resumeToken?: string;
143
+ workflow?: string;
144
+ input?: {
145
+ options?: never[];
146
+ kind?: "text";
147
+ multiple?: boolean;
148
+ question?: string;
149
+ } | {
150
+ options?: {
151
+ id?: string;
152
+ label?: string;
153
+ description?: string;
154
+ }[];
155
+ kind?: "choice" | "multi-choice";
156
+ multiple?: boolean;
157
+ question?: string;
158
+ };
159
+ meta?: Record<string, unknown>;
160
+ }, {
161
+ type?: "interrupt";
162
+ node?: string;
163
+ requestId?: string;
164
+ resumeToken?: string;
165
+ workflow?: string;
166
+ input?: {
167
+ options?: never[];
168
+ kind?: "text";
169
+ multiple?: boolean;
170
+ question?: string;
171
+ } | {
172
+ options?: {
173
+ id?: string;
174
+ label?: string;
175
+ description?: string;
176
+ }[];
177
+ kind?: "choice" | "multi-choice";
178
+ multiple?: boolean;
179
+ question?: string;
180
+ };
181
+ meta?: Record<string, unknown>;
182
+ }>, z.ZodDiscriminatedUnion<"dataType", [z.ZodObject<{
183
+ type: z.ZodLiteral<"structured-data">;
184
+ dataType: z.ZodLiteral<"jobs">;
185
+ node: z.ZodOptional<z.ZodString>;
186
+ data: z.ZodObject<{
187
+ jobs: z.ZodArray<z.ZodObject<{
188
+ id: z.ZodString;
189
+ title: z.ZodString;
190
+ company: z.ZodString;
191
+ location: z.ZodString;
192
+ match: z.ZodNumber;
193
+ }, "strip", z.ZodTypeAny, {
194
+ id?: string;
195
+ title?: string;
196
+ company?: string;
197
+ location?: string;
198
+ match?: number;
199
+ }, {
200
+ id?: string;
201
+ title?: string;
202
+ company?: string;
203
+ location?: string;
204
+ match?: number;
205
+ }>, "many">;
206
+ reasoning: z.ZodOptional<z.ZodString>;
207
+ }, "strip", z.ZodTypeAny, {
208
+ jobs?: {
209
+ id?: string;
210
+ title?: string;
211
+ company?: string;
212
+ location?: string;
213
+ match?: number;
214
+ }[];
215
+ reasoning?: string;
216
+ }, {
217
+ jobs?: {
218
+ id?: string;
219
+ title?: string;
220
+ company?: string;
221
+ location?: string;
222
+ match?: number;
223
+ }[];
224
+ reasoning?: string;
225
+ }>;
226
+ }, "strip", z.ZodTypeAny, {
227
+ type?: "structured-data";
228
+ dataType?: "jobs";
229
+ node?: string;
230
+ data?: {
231
+ jobs?: {
232
+ id?: string;
233
+ title?: string;
234
+ company?: string;
235
+ location?: string;
236
+ match?: number;
237
+ }[];
238
+ reasoning?: string;
239
+ };
240
+ }, {
241
+ type?: "structured-data";
242
+ dataType?: "jobs";
243
+ node?: string;
244
+ data?: {
245
+ jobs?: {
246
+ id?: string;
247
+ title?: string;
248
+ company?: string;
249
+ location?: string;
250
+ match?: number;
251
+ }[];
252
+ reasoning?: string;
253
+ };
254
+ }>]>, z.ZodObject<{
255
+ type: z.ZodLiteral<"transition">;
256
+ transitionTo: z.ZodString;
257
+ payload: z.ZodOptional<z.ZodAny>;
258
+ }, "strip", z.ZodTypeAny, {
259
+ type?: "transition";
260
+ transitionTo?: string;
261
+ payload?: any;
262
+ }, {
263
+ type?: "transition";
264
+ transitionTo?: string;
265
+ payload?: any;
266
+ }>, z.ZodObject<{
267
+ type: z.ZodLiteral<"done">;
268
+ data: z.ZodOptional<z.ZodAny>;
269
+ }, "strip", z.ZodTypeAny, {
270
+ type?: "done";
271
+ data?: any;
272
+ }, {
273
+ type?: "done";
274
+ data?: any;
275
+ }>, z.ZodObject<{
276
+ type: z.ZodLiteral<"error">;
277
+ message: z.ZodString;
278
+ }, "strip", z.ZodTypeAny, {
279
+ message?: string;
280
+ type?: "error";
281
+ }, {
282
+ message?: string;
283
+ type?: "error";
284
+ }>]>;
285
+ export type StreamChunk = z.infer<typeof StreamChunkSchema>;
286
+ //# sourceMappingURL=stream-chunk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-chunk.d.ts","sourceRoot":"","sources":["../../src/types/stream-chunk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyE5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StreamChunkSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const structured_data_1 = require("./structured-data");
6
+ exports.StreamChunkSchema = zod_1.z.union([
7
+ zod_1.z.object({
8
+ type: zod_1.z.literal("session"),
9
+ sessionId: zod_1.z.string(),
10
+ }),
11
+ zod_1.z.object({
12
+ type: zod_1.z.literal("status"),
13
+ message: zod_1.z.string(),
14
+ node: zod_1.z.string().optional(),
15
+ }),
16
+ zod_1.z.object({
17
+ type: zod_1.z.literal("message"),
18
+ content: zod_1.z.string(),
19
+ node: zod_1.z.string().optional(),
20
+ }),
21
+ zod_1.z.object({
22
+ type: zod_1.z.literal("text-start"),
23
+ node: zod_1.z.string().optional(),
24
+ }),
25
+ zod_1.z.object({
26
+ type: zod_1.z.literal("text-delta"),
27
+ delta: zod_1.z.string(),
28
+ node: zod_1.z.string().optional(),
29
+ }),
30
+ zod_1.z.object({
31
+ type: zod_1.z.literal("text-end"),
32
+ node: zod_1.z.string().optional(),
33
+ }),
34
+ zod_1.z.object({
35
+ type: zod_1.z.literal("tool-result"),
36
+ tool: zod_1.z.string().optional(),
37
+ node: zod_1.z.string().optional(),
38
+ content: zod_1.z.unknown(),
39
+ }),
40
+ zod_1.z.object({
41
+ type: zod_1.z.literal("interrupt"),
42
+ requestId: zod_1.z.string(),
43
+ resumeToken: zod_1.z.string(),
44
+ workflow: zod_1.z.string().optional(),
45
+ node: zod_1.z.string().optional(),
46
+ input: zod_1.z.discriminatedUnion("kind", [
47
+ zod_1.z.object({
48
+ kind: zod_1.z.literal("text"),
49
+ multiple: zod_1.z.boolean(),
50
+ question: zod_1.z.string().optional(),
51
+ options: zod_1.z.array(zod_1.z.never()).optional(),
52
+ }),
53
+ zod_1.z.object({
54
+ kind: zod_1.z.enum(["choice", "multi-choice"]),
55
+ multiple: zod_1.z.boolean(),
56
+ question: zod_1.z.string(),
57
+ options: zod_1.z.array(zod_1.z.object({
58
+ id: zod_1.z.string(),
59
+ label: zod_1.z.string(),
60
+ description: zod_1.z.string().optional(),
61
+ })),
62
+ }),
63
+ ]),
64
+ meta: zod_1.z.record(zod_1.z.unknown()).optional(),
65
+ }),
66
+ structured_data_1.StructuredDataChunkSchema,
67
+ zod_1.z.object({
68
+ type: zod_1.z.literal("transition"),
69
+ transitionTo: zod_1.z.string(),
70
+ payload: zod_1.z.any().optional(),
71
+ }),
72
+ zod_1.z.object({ type: zod_1.z.literal("done"), data: zod_1.z.any().optional() }),
73
+ zod_1.z.object({ type: zod_1.z.literal("error"), message: zod_1.z.string() }),
74
+ ]);