@kortyx/stream 0.3.0 → 0.3.1

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 (34) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{types/stream-chunk.d.ts → browser-2jZhtGOe.d.ts} +20 -4
  3. package/dist/browser.d.ts +2 -5
  4. package/dist/browser.js +100 -7
  5. package/dist/browser.js.map +1 -0
  6. package/dist/index.d.ts +17 -5
  7. package/dist/index.js +262 -18
  8. package/dist/index.js.map +1 -0
  9. package/package.json +6 -5
  10. package/dist/browser.d.ts.map +0 -1
  11. package/dist/client/read-stream.d.ts +0 -3
  12. package/dist/client/read-stream.d.ts.map +0 -1
  13. package/dist/client/read-stream.js +0 -32
  14. package/dist/client/stream-from-route.d.ts +0 -10
  15. package/dist/client/stream-from-route.d.ts.map +0 -1
  16. package/dist/client/stream-from-route.js +0 -49
  17. package/dist/index.d.ts.map +0 -1
  18. package/dist/server/create-stream-response.d.ts +0 -9
  19. package/dist/server/create-stream-response.d.ts.map +0 -1
  20. package/dist/server/create-stream-response.js +0 -45
  21. package/dist/server/json-to-sse.d.ts +0 -4
  22. package/dist/server/json-to-sse.d.ts.map +0 -1
  23. package/dist/server/json-to-sse.js +0 -16
  24. package/dist/types/stream-chunk.d.ts.map +0 -1
  25. package/dist/types/stream-chunk.js +0 -74
  26. package/dist/types/stream-result.d.ts +0 -465
  27. package/dist/types/stream-result.d.ts.map +0 -1
  28. package/dist/types/stream-result.js +0 -18
  29. package/dist/types/structured-data/index.d.ts +0 -76
  30. package/dist/types/structured-data/index.d.ts.map +0 -1
  31. package/dist/types/structured-data/index.js +0 -13
  32. package/dist/types/structured-data/jobs.d.ts +0 -43
  33. package/dist/types/structured-data/jobs.d.ts.map +0 -1
  34. package/dist/types/structured-data/jobs.js +0 -14
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.streamFromRoute = streamFromRoute;
4
- const read_stream_1 = require("./read-stream");
5
- const toErrorMessage = (error) => error instanceof Error ? error.message : String(error);
6
- const readErrorMessage = async (response) => {
7
- let message = `Request failed (${response.status})`;
8
- try {
9
- const payload = (await response.json());
10
- if (payload &&
11
- typeof payload === "object" &&
12
- "error" in payload &&
13
- typeof payload.error === "string") {
14
- message = payload.error;
15
- }
16
- }
17
- catch { }
18
- return message;
19
- };
20
- async function* streamFromRoute(args) {
21
- const fetchFn = args.fetchImpl ?? globalThis.fetch;
22
- if (!fetchFn) {
23
- yield { type: "error", message: "No fetch implementation available." };
24
- yield { type: "done" };
25
- return;
26
- }
27
- let response;
28
- try {
29
- response = await fetchFn(args.endpoint, {
30
- method: args.method ?? "POST",
31
- headers: {
32
- "content-type": "application/json",
33
- ...(args.headers ?? {}),
34
- },
35
- body: JSON.stringify(args.body),
36
- });
37
- }
38
- catch (error) {
39
- yield { type: "error", message: toErrorMessage(error) };
40
- yield { type: "done" };
41
- return;
42
- }
43
- if (!response.ok) {
44
- yield { type: "error", message: await readErrorMessage(response) };
45
- yield { type: "done" };
46
- return;
47
- }
48
- yield* (0, read_stream_1.readStream)(response.body);
49
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC"}
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,45 +0,0 @@
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
- }
@@ -1,4 +0,0 @@
1
- export declare class JsonToSseTransformStream extends TransformStream<unknown, string> {
2
- constructor();
3
- }
4
- //# sourceMappingURL=json-to-sse.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,16 +0,0 @@
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;
@@ -1 +0,0 @@
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"}
@@ -1,74 +0,0 @@
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
- ]);
@@ -1,465 +0,0 @@
1
- import { z } from "zod";
2
- export declare const StreamResultSchema: z.ZodObject<{
3
- chunks: z.ZodArray<z.ZodUnion<[z.ZodObject<{
4
- type: z.ZodLiteral<"session">;
5
- sessionId: z.ZodString;
6
- }, "strip", z.ZodTypeAny, {
7
- type?: "session";
8
- sessionId?: string;
9
- }, {
10
- type?: "session";
11
- sessionId?: string;
12
- }>, z.ZodObject<{
13
- type: z.ZodLiteral<"status">;
14
- message: z.ZodString;
15
- node: z.ZodOptional<z.ZodString>;
16
- }, "strip", z.ZodTypeAny, {
17
- message?: string;
18
- type?: "status";
19
- node?: string;
20
- }, {
21
- message?: string;
22
- type?: "status";
23
- node?: string;
24
- }>, z.ZodObject<{
25
- type: z.ZodLiteral<"message">;
26
- content: z.ZodString;
27
- node: z.ZodOptional<z.ZodString>;
28
- }, "strip", z.ZodTypeAny, {
29
- type?: "message";
30
- node?: string;
31
- content?: string;
32
- }, {
33
- type?: "message";
34
- node?: string;
35
- content?: string;
36
- }>, z.ZodObject<{
37
- type: z.ZodLiteral<"text-start">;
38
- node: z.ZodOptional<z.ZodString>;
39
- }, "strip", z.ZodTypeAny, {
40
- type?: "text-start";
41
- node?: string;
42
- }, {
43
- type?: "text-start";
44
- node?: string;
45
- }>, z.ZodObject<{
46
- type: z.ZodLiteral<"text-delta">;
47
- delta: z.ZodString;
48
- node: z.ZodOptional<z.ZodString>;
49
- }, "strip", z.ZodTypeAny, {
50
- type?: "text-delta";
51
- node?: string;
52
- delta?: string;
53
- }, {
54
- type?: "text-delta";
55
- node?: string;
56
- delta?: string;
57
- }>, z.ZodObject<{
58
- type: z.ZodLiteral<"text-end">;
59
- node: z.ZodOptional<z.ZodString>;
60
- }, "strip", z.ZodTypeAny, {
61
- type?: "text-end";
62
- node?: string;
63
- }, {
64
- type?: "text-end";
65
- node?: string;
66
- }>, z.ZodObject<{
67
- type: z.ZodLiteral<"tool-result">;
68
- tool: z.ZodOptional<z.ZodString>;
69
- node: z.ZodOptional<z.ZodString>;
70
- content: z.ZodUnknown;
71
- }, "strip", z.ZodTypeAny, {
72
- type?: "tool-result";
73
- node?: string;
74
- content?: unknown;
75
- tool?: string;
76
- }, {
77
- type?: "tool-result";
78
- node?: string;
79
- content?: unknown;
80
- tool?: string;
81
- }>, z.ZodObject<{
82
- type: z.ZodLiteral<"interrupt">;
83
- requestId: z.ZodString;
84
- resumeToken: z.ZodString;
85
- workflow: z.ZodOptional<z.ZodString>;
86
- node: z.ZodOptional<z.ZodString>;
87
- input: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
88
- kind: z.ZodLiteral<"text">;
89
- multiple: z.ZodBoolean;
90
- question: z.ZodOptional<z.ZodString>;
91
- options: z.ZodOptional<z.ZodArray<z.ZodNever, "many">>;
92
- }, "strip", z.ZodTypeAny, {
93
- options?: never[];
94
- kind?: "text";
95
- multiple?: boolean;
96
- question?: string;
97
- }, {
98
- options?: never[];
99
- kind?: "text";
100
- multiple?: boolean;
101
- question?: string;
102
- }>, z.ZodObject<{
103
- kind: z.ZodEnum<["choice", "multi-choice"]>;
104
- multiple: z.ZodBoolean;
105
- question: z.ZodString;
106
- options: z.ZodArray<z.ZodObject<{
107
- id: z.ZodString;
108
- label: z.ZodString;
109
- description: z.ZodOptional<z.ZodString>;
110
- }, "strip", z.ZodTypeAny, {
111
- id?: string;
112
- label?: string;
113
- description?: string;
114
- }, {
115
- id?: string;
116
- label?: string;
117
- description?: string;
118
- }>, "many">;
119
- }, "strip", z.ZodTypeAny, {
120
- options?: {
121
- id?: string;
122
- label?: string;
123
- description?: string;
124
- }[];
125
- kind?: "choice" | "multi-choice";
126
- multiple?: boolean;
127
- question?: string;
128
- }, {
129
- options?: {
130
- id?: string;
131
- label?: string;
132
- description?: string;
133
- }[];
134
- kind?: "choice" | "multi-choice";
135
- multiple?: boolean;
136
- question?: string;
137
- }>]>;
138
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
139
- }, "strip", z.ZodTypeAny, {
140
- type?: "interrupt";
141
- node?: string;
142
- requestId?: string;
143
- resumeToken?: string;
144
- workflow?: string;
145
- input?: {
146
- options?: never[];
147
- kind?: "text";
148
- multiple?: boolean;
149
- question?: string;
150
- } | {
151
- options?: {
152
- id?: string;
153
- label?: string;
154
- description?: string;
155
- }[];
156
- kind?: "choice" | "multi-choice";
157
- multiple?: boolean;
158
- question?: string;
159
- };
160
- meta?: Record<string, unknown>;
161
- }, {
162
- type?: "interrupt";
163
- node?: string;
164
- requestId?: string;
165
- resumeToken?: string;
166
- workflow?: string;
167
- input?: {
168
- options?: never[];
169
- kind?: "text";
170
- multiple?: boolean;
171
- question?: string;
172
- } | {
173
- options?: {
174
- id?: string;
175
- label?: string;
176
- description?: string;
177
- }[];
178
- kind?: "choice" | "multi-choice";
179
- multiple?: boolean;
180
- question?: string;
181
- };
182
- meta?: Record<string, unknown>;
183
- }>, z.ZodDiscriminatedUnion<"dataType", [z.ZodObject<{
184
- type: z.ZodLiteral<"structured-data">;
185
- dataType: z.ZodLiteral<"jobs">;
186
- node: z.ZodOptional<z.ZodString>;
187
- data: z.ZodObject<{
188
- jobs: z.ZodArray<z.ZodObject<{
189
- id: z.ZodString;
190
- title: z.ZodString;
191
- company: z.ZodString;
192
- location: z.ZodString;
193
- match: z.ZodNumber;
194
- }, "strip", z.ZodTypeAny, {
195
- id?: string;
196
- title?: string;
197
- company?: string;
198
- location?: string;
199
- match?: number;
200
- }, {
201
- id?: string;
202
- title?: string;
203
- company?: string;
204
- location?: string;
205
- match?: number;
206
- }>, "many">;
207
- reasoning: z.ZodOptional<z.ZodString>;
208
- }, "strip", z.ZodTypeAny, {
209
- jobs?: {
210
- id?: string;
211
- title?: string;
212
- company?: string;
213
- location?: string;
214
- match?: number;
215
- }[];
216
- reasoning?: string;
217
- }, {
218
- jobs?: {
219
- id?: string;
220
- title?: string;
221
- company?: string;
222
- location?: string;
223
- match?: number;
224
- }[];
225
- reasoning?: string;
226
- }>;
227
- }, "strip", z.ZodTypeAny, {
228
- type?: "structured-data";
229
- dataType?: "jobs";
230
- node?: string;
231
- data?: {
232
- jobs?: {
233
- id?: string;
234
- title?: string;
235
- company?: string;
236
- location?: string;
237
- match?: number;
238
- }[];
239
- reasoning?: string;
240
- };
241
- }, {
242
- type?: "structured-data";
243
- dataType?: "jobs";
244
- node?: string;
245
- data?: {
246
- jobs?: {
247
- id?: string;
248
- title?: string;
249
- company?: string;
250
- location?: string;
251
- match?: number;
252
- }[];
253
- reasoning?: string;
254
- };
255
- }>]>, z.ZodObject<{
256
- type: z.ZodLiteral<"transition">;
257
- transitionTo: z.ZodString;
258
- payload: z.ZodOptional<z.ZodAny>;
259
- }, "strip", z.ZodTypeAny, {
260
- type?: "transition";
261
- transitionTo?: string;
262
- payload?: any;
263
- }, {
264
- type?: "transition";
265
- transitionTo?: string;
266
- payload?: any;
267
- }>, z.ZodObject<{
268
- type: z.ZodLiteral<"done">;
269
- data: z.ZodOptional<z.ZodAny>;
270
- }, "strip", z.ZodTypeAny, {
271
- type?: "done";
272
- data?: any;
273
- }, {
274
- type?: "done";
275
- data?: any;
276
- }>, z.ZodObject<{
277
- type: z.ZodLiteral<"error">;
278
- message: z.ZodString;
279
- }, "strip", z.ZodTypeAny, {
280
- message?: string;
281
- type?: "error";
282
- }, {
283
- message?: string;
284
- type?: "error";
285
- }>]>, "many">;
286
- transitionTo: z.ZodOptional<z.ZodString>;
287
- payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
288
- error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
289
- message: z.ZodString;
290
- code: z.ZodOptional<z.ZodString>;
291
- cause: z.ZodOptional<z.ZodUnknown>;
292
- }, "strip", z.ZodTypeAny, {
293
- code?: string;
294
- message?: string;
295
- cause?: unknown;
296
- }, {
297
- code?: string;
298
- message?: string;
299
- cause?: unknown;
300
- }>>>;
301
- }, "strip", z.ZodTypeAny, {
302
- transitionTo?: string;
303
- payload?: Record<string, any>;
304
- error?: {
305
- code?: string;
306
- message?: string;
307
- cause?: unknown;
308
- };
309
- chunks?: ({
310
- type?: "structured-data";
311
- dataType?: "jobs";
312
- node?: string;
313
- data?: {
314
- jobs?: {
315
- id?: string;
316
- title?: string;
317
- company?: string;
318
- location?: string;
319
- match?: number;
320
- }[];
321
- reasoning?: string;
322
- };
323
- } | {
324
- type?: "session";
325
- sessionId?: string;
326
- } | {
327
- message?: string;
328
- type?: "status";
329
- node?: string;
330
- } | {
331
- type?: "message";
332
- node?: string;
333
- content?: string;
334
- } | {
335
- type?: "text-start";
336
- node?: string;
337
- } | {
338
- type?: "text-delta";
339
- node?: string;
340
- delta?: string;
341
- } | {
342
- type?: "text-end";
343
- node?: string;
344
- } | {
345
- type?: "tool-result";
346
- node?: string;
347
- content?: unknown;
348
- tool?: string;
349
- } | {
350
- type?: "interrupt";
351
- node?: string;
352
- requestId?: string;
353
- resumeToken?: string;
354
- workflow?: string;
355
- input?: {
356
- options?: never[];
357
- kind?: "text";
358
- multiple?: boolean;
359
- question?: string;
360
- } | {
361
- options?: {
362
- id?: string;
363
- label?: string;
364
- description?: string;
365
- }[];
366
- kind?: "choice" | "multi-choice";
367
- multiple?: boolean;
368
- question?: string;
369
- };
370
- meta?: Record<string, unknown>;
371
- } | {
372
- type?: "transition";
373
- transitionTo?: string;
374
- payload?: any;
375
- } | {
376
- type?: "done";
377
- data?: any;
378
- } | {
379
- message?: string;
380
- type?: "error";
381
- })[];
382
- }, {
383
- transitionTo?: string;
384
- payload?: Record<string, any>;
385
- error?: {
386
- code?: string;
387
- message?: string;
388
- cause?: unknown;
389
- };
390
- chunks?: ({
391
- type?: "structured-data";
392
- dataType?: "jobs";
393
- node?: string;
394
- data?: {
395
- jobs?: {
396
- id?: string;
397
- title?: string;
398
- company?: string;
399
- location?: string;
400
- match?: number;
401
- }[];
402
- reasoning?: string;
403
- };
404
- } | {
405
- type?: "session";
406
- sessionId?: string;
407
- } | {
408
- message?: string;
409
- type?: "status";
410
- node?: string;
411
- } | {
412
- type?: "message";
413
- node?: string;
414
- content?: string;
415
- } | {
416
- type?: "text-start";
417
- node?: string;
418
- } | {
419
- type?: "text-delta";
420
- node?: string;
421
- delta?: string;
422
- } | {
423
- type?: "text-end";
424
- node?: string;
425
- } | {
426
- type?: "tool-result";
427
- node?: string;
428
- content?: unknown;
429
- tool?: string;
430
- } | {
431
- type?: "interrupt";
432
- node?: string;
433
- requestId?: string;
434
- resumeToken?: string;
435
- workflow?: string;
436
- input?: {
437
- options?: never[];
438
- kind?: "text";
439
- multiple?: boolean;
440
- question?: string;
441
- } | {
442
- options?: {
443
- id?: string;
444
- label?: string;
445
- description?: string;
446
- }[];
447
- kind?: "choice" | "multi-choice";
448
- multiple?: boolean;
449
- question?: string;
450
- };
451
- meta?: Record<string, unknown>;
452
- } | {
453
- type?: "transition";
454
- transitionTo?: string;
455
- payload?: any;
456
- } | {
457
- type?: "done";
458
- data?: any;
459
- } | {
460
- message?: string;
461
- type?: "error";
462
- })[];
463
- }>;
464
- export type StreamResult = z.infer<typeof StreamResultSchema>;
465
- //# sourceMappingURL=stream-result.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-result.d.ts","sourceRoot":"","sources":["../../src/types/stream-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}