@tdesign-react/chat 1.0.0-beta.4 → 1.0.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 (120) hide show
  1. package/es/_util/reactify.js +1 -1
  2. package/es/_util/useDynamicStyle.js +1 -1
  3. package/es/chat-actionbar/index.js +1 -1
  4. package/es/chat-attachments/index.js +1 -1
  5. package/es/{chatbot → chat-engine}/components/provider/agent-state.js +1 -1
  6. package/es/chat-engine/components/provider/agent-state.js.map +1 -0
  7. package/es/{chatbot → chat-engine}/components/toolcall/index.js +1 -1
  8. package/es/{chatbot → chat-engine}/components/toolcall/registry.js +1 -1
  9. package/es/chat-engine/components/toolcall/registry.js.map +1 -0
  10. package/es/{chatbot → chat-engine}/components/toolcall/render.js +1 -2
  11. package/es/chat-engine/components/toolcall/render.js.map +1 -0
  12. package/es/{chatbot → chat-engine}/components/toolcall/types.d.ts +12 -4
  13. package/es/{chatbot → chat-engine}/components/toolcall/types.js +1 -1
  14. package/es/chat-engine/components/toolcall/types.js.map +1 -0
  15. package/es/{chatbot → chat-engine}/hooks/useAgentState.js +1 -1
  16. package/es/chat-engine/hooks/useAgentState.js.map +1 -0
  17. package/es/{chatbot → chat-engine}/hooks/useAgentToolcall.js +1 -1
  18. package/es/chat-engine/hooks/useAgentToolcall.js.map +1 -0
  19. package/es/{chatbot → chat-engine}/hooks/useChat.d.ts +1 -1
  20. package/es/{chatbot → chat-engine}/hooks/useChat.js +1 -1
  21. package/es/chat-engine/hooks/useChat.js.map +1 -0
  22. package/es/chat-engine/index.d.ts +6 -0
  23. package/es/chat-engine/index.js +24 -0
  24. package/es/{chatbot/core/server → chat-engine}/index.js.map +1 -1
  25. package/es/chat-filecard/index.js +1 -1
  26. package/es/chat-loading/index.js +1 -1
  27. package/es/chat-markdown/index.js +1 -1
  28. package/es/chat-message/index.js +1 -1
  29. package/es/chat-sender/index.js +1 -1
  30. package/es/chat-thinking/index.js +1 -1
  31. package/es/chatbot/index.d.ts +0 -5
  32. package/es/chatbot/index.js +1 -12
  33. package/es/chatbot/index.js.map +1 -1
  34. package/es/index.d.ts +1 -1
  35. package/es/index.js +10 -9
  36. package/es/index.js.map +1 -1
  37. package/es/style/index.js +1 -1
  38. package/package.json +3 -3
  39. package/es/chatbot/components/provider/agent-state.js.map +0 -1
  40. package/es/chatbot/components/toolcall/registry.js.map +0 -1
  41. package/es/chatbot/components/toolcall/render.js.map +0 -1
  42. package/es/chatbot/components/toolcall/types.js.map +0 -1
  43. package/es/chatbot/core/adapters/agui/event-mapper.d.ts +0 -104
  44. package/es/chatbot/core/adapters/agui/event-mapper.js +0 -342
  45. package/es/chatbot/core/adapters/agui/event-mapper.js.map +0 -1
  46. package/es/chatbot/core/adapters/agui/events.d.ts +0 -1394
  47. package/es/chatbot/core/adapters/agui/events.js +0 -181
  48. package/es/chatbot/core/adapters/agui/events.js.map +0 -1
  49. package/es/chatbot/core/adapters/agui/index.d.ts +0 -75
  50. package/es/chatbot/core/adapters/agui/index.js +0 -165
  51. package/es/chatbot/core/adapters/agui/index.js.map +0 -1
  52. package/es/chatbot/core/adapters/agui/state-manager.d.ts +0 -99
  53. package/es/chatbot/core/adapters/agui/state-manager.js +0 -168
  54. package/es/chatbot/core/adapters/agui/state-manager.js.map +0 -1
  55. package/es/chatbot/core/adapters/agui/types.d.ts +0 -760
  56. package/es/chatbot/core/adapters/agui/types.js +0 -89
  57. package/es/chatbot/core/adapters/agui/types.js.map +0 -1
  58. package/es/chatbot/core/adapters/agui/utils.d.ts +0 -188
  59. package/es/chatbot/core/adapters/agui/utils.js +0 -323
  60. package/es/chatbot/core/adapters/agui/utils.js.map +0 -1
  61. package/es/chatbot/core/index.d.ts +0 -131
  62. package/es/chatbot/core/index.js +0 -585
  63. package/es/chatbot/core/index.js.map +0 -1
  64. package/es/chatbot/core/processor/index.d.ts +0 -20
  65. package/es/chatbot/core/processor/index.js +0 -148
  66. package/es/chatbot/core/processor/index.js.map +0 -1
  67. package/es/chatbot/core/server/batch-client.d.ts +0 -20
  68. package/es/chatbot/core/server/batch-client.js +0 -114
  69. package/es/chatbot/core/server/batch-client.js.map +0 -1
  70. package/es/chatbot/core/server/connection-manager.d.ts +0 -39
  71. package/es/chatbot/core/server/connection-manager.js +0 -84
  72. package/es/chatbot/core/server/connection-manager.js.map +0 -1
  73. package/es/chatbot/core/server/errors.d.ts +0 -22
  74. package/es/chatbot/core/server/errors.js +0 -80
  75. package/es/chatbot/core/server/errors.js.map +0 -1
  76. package/es/chatbot/core/server/index.d.ts +0 -11
  77. package/es/chatbot/core/server/index.js +0 -26
  78. package/es/chatbot/core/server/llm-service.d.ts +0 -44
  79. package/es/chatbot/core/server/llm-service.js +0 -198
  80. package/es/chatbot/core/server/llm-service.js.map +0 -1
  81. package/es/chatbot/core/server/sse-client.d.ts +0 -77
  82. package/es/chatbot/core/server/sse-client.js +0 -362
  83. package/es/chatbot/core/server/sse-client.js.map +0 -1
  84. package/es/chatbot/core/server/sse-parser.d.ts +0 -49
  85. package/es/chatbot/core/server/sse-parser.js +0 -116
  86. package/es/chatbot/core/server/sse-parser.js.map +0 -1
  87. package/es/chatbot/core/server/types.d.ts +0 -54
  88. package/es/chatbot/core/server/types.js +0 -28
  89. package/es/chatbot/core/server/types.js.map +0 -1
  90. package/es/chatbot/core/store/message.d.ts +0 -27
  91. package/es/chatbot/core/store/message.js +0 -263
  92. package/es/chatbot/core/store/message.js.map +0 -1
  93. package/es/chatbot/core/store/model.d.ts +0 -8
  94. package/es/chatbot/core/store/model.js +0 -65
  95. package/es/chatbot/core/store/model.js.map +0 -1
  96. package/es/chatbot/core/store/reactiveState.d.ts +0 -52
  97. package/es/chatbot/core/store/reactiveState.js +0 -1359
  98. package/es/chatbot/core/store/reactiveState.js.map +0 -1
  99. package/es/chatbot/core/type.d.ts +0 -238
  100. package/es/chatbot/core/type.js +0 -7
  101. package/es/chatbot/core/type.js.map +0 -1
  102. package/es/chatbot/core/utils/eventEmitter.d.ts +0 -10
  103. package/es/chatbot/core/utils/eventEmitter.js +0 -67
  104. package/es/chatbot/core/utils/eventEmitter.js.map +0 -1
  105. package/es/chatbot/core/utils/index.d.ts +0 -31
  106. package/es/chatbot/core/utils/index.js +0 -221
  107. package/es/chatbot/core/utils/index.js.map +0 -1
  108. package/es/chatbot/core/utils/logger.d.ts +0 -30
  109. package/es/chatbot/core/utils/logger.js +0 -87
  110. package/es/chatbot/core/utils/logger.js.map +0 -1
  111. package/es/chatbot/hooks/useAgentState.js.map +0 -1
  112. package/es/chatbot/hooks/useAgentToolcall.js.map +0 -1
  113. package/es/chatbot/hooks/useChat.js.map +0 -1
  114. /package/es/{chatbot → chat-engine}/components/provider/agent-state.d.ts +0 -0
  115. /package/es/{chatbot → chat-engine}/components/toolcall/index.d.ts +0 -0
  116. /package/es/{chatbot → chat-engine}/components/toolcall/index.js.map +0 -0
  117. /package/es/{chatbot → chat-engine}/components/toolcall/registry.d.ts +0 -0
  118. /package/es/{chatbot → chat-engine}/components/toolcall/render.d.ts +0 -0
  119. /package/es/{chatbot → chat-engine}/hooks/useAgentState.d.ts +0 -0
  120. /package/es/{chatbot → chat-engine}/hooks/useAgentToolcall.d.ts +0 -0
@@ -1,1394 +0,0 @@
1
- import { z } from 'zod';
2
- export type ToolCallEventType = 'TOOL_CALL_START' | 'TOOL_CALL_ARGS' | 'TOOL_CALL_END' | 'TOOL_CALL_CHUNK' | 'TOOL_CALL_RESULT';
3
- export declare enum EventType {
4
- TEXT_MESSAGE_START = "TEXT_MESSAGE_START",
5
- TEXT_MESSAGE_CONTENT = "TEXT_MESSAGE_CONTENT",
6
- TEXT_MESSAGE_END = "TEXT_MESSAGE_END",
7
- TEXT_MESSAGE_CHUNK = "TEXT_MESSAGE_CHUNK",
8
- THINKING_TEXT_MESSAGE_START = "THINKING_TEXT_MESSAGE_START",
9
- THINKING_TEXT_MESSAGE_CONTENT = "THINKING_TEXT_MESSAGE_CONTENT",
10
- THINKING_TEXT_MESSAGE_END = "THINKING_TEXT_MESSAGE_END",
11
- THINKING_START = "THINKING_START",
12
- THINKING_END = "THINKING_END",
13
- TOOL_CALL_START = "TOOL_CALL_START",
14
- TOOL_CALL_ARGS = "TOOL_CALL_ARGS",
15
- TOOL_CALL_END = "TOOL_CALL_END",
16
- TOOL_CALL_CHUNK = "TOOL_CALL_CHUNK",
17
- TOOL_CALL_RESULT = "TOOL_CALL_RESULT",
18
- STATE_SNAPSHOT = "STATE_SNAPSHOT",
19
- STATE_DELTA = "STATE_DELTA",
20
- MESSAGES_SNAPSHOT = "MESSAGES_SNAPSHOT",
21
- RAW = "RAW",
22
- CUSTOM = "CUSTOM",
23
- RUN_STARTED = "RUN_STARTED",
24
- RUN_FINISHED = "RUN_FINISHED",
25
- RUN_ERROR = "RUN_ERROR",
26
- STEP_STARTED = "STEP_STARTED",
27
- STEP_FINISHED = "STEP_FINISHED"
28
- }
29
- /**
30
- * 检查事件类型是否为文本消息相关
31
- * @param eventType 事件类型
32
- * @returns 是否为文本消息事件
33
- */
34
- export declare function isTextMessageEvent(eventType: string): boolean;
35
- /**
36
- * 检查事件类型是否为思考相关
37
- * @param eventType 事件类型
38
- * @returns 是否为思考事件
39
- */
40
- export declare function isThinkingEvent(eventType: string): boolean;
41
- /**
42
- * 检查事件类型是否为工具调用相关
43
- * @param eventType 事件类型
44
- * @returns 是否为工具调用事件
45
- */
46
- export declare function isToolCallEvent(eventType: string): boolean;
47
- /**
48
- * 检查事件类型是否为状态相关
49
- * @param eventType 事件类型
50
- * @returns 是否为状态事件
51
- */
52
- export declare function isStateEvent(eventType: string): boolean;
53
- declare const BaseEventSchema: z.ZodObject<{
54
- type: z.ZodNativeEnum<typeof EventType>;
55
- timestamp: z.ZodOptional<z.ZodNumber>;
56
- rawEvent: z.ZodOptional<z.ZodAny>;
57
- }, "strip", z.ZodTypeAny, {
58
- type?: EventType;
59
- timestamp?: number;
60
- rawEvent?: any;
61
- }, {
62
- type?: EventType;
63
- timestamp?: number;
64
- rawEvent?: any;
65
- }>;
66
- export declare const TextMessageStartEventSchema: z.ZodObject<{
67
- timestamp: z.ZodOptional<z.ZodNumber>;
68
- rawEvent: z.ZodOptional<z.ZodAny>;
69
- } & {
70
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_START>;
71
- messageId: z.ZodString;
72
- role: z.ZodLiteral<"assistant">;
73
- }, "strip", z.ZodTypeAny, {
74
- type?: EventType.TEXT_MESSAGE_START;
75
- role?: "assistant";
76
- timestamp?: number;
77
- rawEvent?: any;
78
- messageId?: string;
79
- }, {
80
- type?: EventType.TEXT_MESSAGE_START;
81
- role?: "assistant";
82
- timestamp?: number;
83
- rawEvent?: any;
84
- messageId?: string;
85
- }>;
86
- export declare const TextMessageContentEventSchema: z.ZodObject<{
87
- timestamp: z.ZodOptional<z.ZodNumber>;
88
- rawEvent: z.ZodOptional<z.ZodAny>;
89
- } & {
90
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_CONTENT>;
91
- messageId: z.ZodString;
92
- delta: z.ZodEffects<z.ZodString, string, string>;
93
- }, "strip", z.ZodTypeAny, {
94
- type?: EventType.TEXT_MESSAGE_CONTENT;
95
- timestamp?: number;
96
- rawEvent?: any;
97
- messageId?: string;
98
- delta?: string;
99
- }, {
100
- type?: EventType.TEXT_MESSAGE_CONTENT;
101
- timestamp?: number;
102
- rawEvent?: any;
103
- messageId?: string;
104
- delta?: string;
105
- }>;
106
- export declare const TextMessageEndEventSchema: z.ZodObject<{
107
- timestamp: z.ZodOptional<z.ZodNumber>;
108
- rawEvent: z.ZodOptional<z.ZodAny>;
109
- } & {
110
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_END>;
111
- messageId: z.ZodString;
112
- }, "strip", z.ZodTypeAny, {
113
- type?: EventType.TEXT_MESSAGE_END;
114
- timestamp?: number;
115
- rawEvent?: any;
116
- messageId?: string;
117
- }, {
118
- type?: EventType.TEXT_MESSAGE_END;
119
- timestamp?: number;
120
- rawEvent?: any;
121
- messageId?: string;
122
- }>;
123
- export declare const TextMessageChunkEventSchema: z.ZodObject<{
124
- timestamp: z.ZodOptional<z.ZodNumber>;
125
- rawEvent: z.ZodOptional<z.ZodAny>;
126
- } & {
127
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_CHUNK>;
128
- messageId: z.ZodOptional<z.ZodString>;
129
- role: z.ZodOptional<z.ZodLiteral<"assistant">>;
130
- delta: z.ZodOptional<z.ZodString>;
131
- }, "strip", z.ZodTypeAny, {
132
- type?: EventType.TEXT_MESSAGE_CHUNK;
133
- role?: "assistant";
134
- timestamp?: number;
135
- rawEvent?: any;
136
- messageId?: string;
137
- delta?: string;
138
- }, {
139
- type?: EventType.TEXT_MESSAGE_CHUNK;
140
- role?: "assistant";
141
- timestamp?: number;
142
- rawEvent?: any;
143
- messageId?: string;
144
- delta?: string;
145
- }>;
146
- export declare const ThinkingTextMessageStartEventSchema: z.ZodObject<{
147
- timestamp: z.ZodOptional<z.ZodNumber>;
148
- rawEvent: z.ZodOptional<z.ZodAny>;
149
- } & {
150
- type: z.ZodLiteral<EventType.THINKING_TEXT_MESSAGE_START>;
151
- }, "strip", z.ZodTypeAny, {
152
- type?: EventType.THINKING_TEXT_MESSAGE_START;
153
- timestamp?: number;
154
- rawEvent?: any;
155
- }, {
156
- type?: EventType.THINKING_TEXT_MESSAGE_START;
157
- timestamp?: number;
158
- rawEvent?: any;
159
- }>;
160
- export declare const ThinkingTextMessageContentEventSchema: z.ZodObject<Omit<{
161
- timestamp: z.ZodOptional<z.ZodNumber>;
162
- rawEvent: z.ZodOptional<z.ZodAny>;
163
- } & {
164
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_CONTENT>;
165
- messageId: z.ZodString;
166
- delta: z.ZodEffects<z.ZodString, string, string>;
167
- }, "type" | "messageId"> & {
168
- type: z.ZodLiteral<EventType.THINKING_TEXT_MESSAGE_CONTENT>;
169
- }, "strip", z.ZodTypeAny, {
170
- type?: EventType.THINKING_TEXT_MESSAGE_CONTENT;
171
- timestamp?: number;
172
- rawEvent?: any;
173
- delta?: string;
174
- }, {
175
- type?: EventType.THINKING_TEXT_MESSAGE_CONTENT;
176
- timestamp?: number;
177
- rawEvent?: any;
178
- delta?: string;
179
- }>;
180
- export declare const ThinkingTextMessageEndEventSchema: z.ZodObject<{
181
- timestamp: z.ZodOptional<z.ZodNumber>;
182
- rawEvent: z.ZodOptional<z.ZodAny>;
183
- } & {
184
- type: z.ZodLiteral<EventType.THINKING_TEXT_MESSAGE_END>;
185
- }, "strip", z.ZodTypeAny, {
186
- type?: EventType.THINKING_TEXT_MESSAGE_END;
187
- timestamp?: number;
188
- rawEvent?: any;
189
- }, {
190
- type?: EventType.THINKING_TEXT_MESSAGE_END;
191
- timestamp?: number;
192
- rawEvent?: any;
193
- }>;
194
- export declare const ToolCallStartEventSchema: z.ZodObject<{
195
- timestamp: z.ZodOptional<z.ZodNumber>;
196
- rawEvent: z.ZodOptional<z.ZodAny>;
197
- } & {
198
- type: z.ZodLiteral<EventType.TOOL_CALL_START>;
199
- toolCallId: z.ZodString;
200
- toolCallName: z.ZodString;
201
- parentMessageId: z.ZodOptional<z.ZodString>;
202
- }, "strip", z.ZodTypeAny, {
203
- type?: EventType.TOOL_CALL_START;
204
- timestamp?: number;
205
- toolCallId?: string;
206
- rawEvent?: any;
207
- toolCallName?: string;
208
- parentMessageId?: string;
209
- }, {
210
- type?: EventType.TOOL_CALL_START;
211
- timestamp?: number;
212
- toolCallId?: string;
213
- rawEvent?: any;
214
- toolCallName?: string;
215
- parentMessageId?: string;
216
- }>;
217
- export declare const ToolCallArgsEventSchema: z.ZodObject<{
218
- timestamp: z.ZodOptional<z.ZodNumber>;
219
- rawEvent: z.ZodOptional<z.ZodAny>;
220
- } & {
221
- type: z.ZodLiteral<EventType.TOOL_CALL_ARGS>;
222
- toolCallId: z.ZodString;
223
- delta: z.ZodString;
224
- }, "strip", z.ZodTypeAny, {
225
- type?: EventType.TOOL_CALL_ARGS;
226
- timestamp?: number;
227
- toolCallId?: string;
228
- rawEvent?: any;
229
- delta?: string;
230
- }, {
231
- type?: EventType.TOOL_CALL_ARGS;
232
- timestamp?: number;
233
- toolCallId?: string;
234
- rawEvent?: any;
235
- delta?: string;
236
- }>;
237
- export declare const ToolCallEndEventSchema: z.ZodObject<{
238
- timestamp: z.ZodOptional<z.ZodNumber>;
239
- rawEvent: z.ZodOptional<z.ZodAny>;
240
- } & {
241
- type: z.ZodLiteral<EventType.TOOL_CALL_END>;
242
- toolCallId: z.ZodString;
243
- }, "strip", z.ZodTypeAny, {
244
- type?: EventType.TOOL_CALL_END;
245
- timestamp?: number;
246
- toolCallId?: string;
247
- rawEvent?: any;
248
- }, {
249
- type?: EventType.TOOL_CALL_END;
250
- timestamp?: number;
251
- toolCallId?: string;
252
- rawEvent?: any;
253
- }>;
254
- export declare const ToolCallResultEventSchema: z.ZodObject<{
255
- timestamp: z.ZodOptional<z.ZodNumber>;
256
- rawEvent: z.ZodOptional<z.ZodAny>;
257
- } & {
258
- messageId: z.ZodString;
259
- type: z.ZodLiteral<EventType.TOOL_CALL_RESULT>;
260
- toolCallId: z.ZodString;
261
- toolCallName: z.ZodString;
262
- content: z.ZodString;
263
- role: z.ZodOptional<z.ZodLiteral<"tool">>;
264
- }, "strip", z.ZodTypeAny, {
265
- type?: EventType.TOOL_CALL_RESULT;
266
- content?: string;
267
- role?: "tool";
268
- timestamp?: number;
269
- toolCallId?: string;
270
- rawEvent?: any;
271
- messageId?: string;
272
- toolCallName?: string;
273
- }, {
274
- type?: EventType.TOOL_CALL_RESULT;
275
- content?: string;
276
- role?: "tool";
277
- timestamp?: number;
278
- toolCallId?: string;
279
- rawEvent?: any;
280
- messageId?: string;
281
- toolCallName?: string;
282
- }>;
283
- export declare const ToolCallChunkEventSchema: z.ZodObject<{
284
- timestamp: z.ZodOptional<z.ZodNumber>;
285
- rawEvent: z.ZodOptional<z.ZodAny>;
286
- } & {
287
- type: z.ZodLiteral<EventType.TOOL_CALL_CHUNK>;
288
- toolCallId: z.ZodOptional<z.ZodString>;
289
- toolCallName: z.ZodOptional<z.ZodString>;
290
- parentMessageId: z.ZodOptional<z.ZodString>;
291
- delta: z.ZodOptional<z.ZodString>;
292
- }, "strip", z.ZodTypeAny, {
293
- type?: EventType.TOOL_CALL_CHUNK;
294
- timestamp?: number;
295
- toolCallId?: string;
296
- rawEvent?: any;
297
- delta?: string;
298
- toolCallName?: string;
299
- parentMessageId?: string;
300
- }, {
301
- type?: EventType.TOOL_CALL_CHUNK;
302
- timestamp?: number;
303
- toolCallId?: string;
304
- rawEvent?: any;
305
- delta?: string;
306
- toolCallName?: string;
307
- parentMessageId?: string;
308
- }>;
309
- export declare const ThinkingStartEventSchema: z.ZodObject<{
310
- timestamp: z.ZodOptional<z.ZodNumber>;
311
- rawEvent: z.ZodOptional<z.ZodAny>;
312
- } & {
313
- type: z.ZodLiteral<EventType.THINKING_START>;
314
- title: z.ZodOptional<z.ZodString>;
315
- }, "strip", z.ZodTypeAny, {
316
- title?: string;
317
- type?: EventType.THINKING_START;
318
- timestamp?: number;
319
- rawEvent?: any;
320
- }, {
321
- title?: string;
322
- type?: EventType.THINKING_START;
323
- timestamp?: number;
324
- rawEvent?: any;
325
- }>;
326
- export declare const ThinkingEndEventSchema: z.ZodObject<{
327
- timestamp: z.ZodOptional<z.ZodNumber>;
328
- rawEvent: z.ZodOptional<z.ZodAny>;
329
- } & {
330
- type: z.ZodLiteral<EventType.THINKING_END>;
331
- title: z.ZodOptional<z.ZodString>;
332
- }, "strip", z.ZodTypeAny, {
333
- title?: string;
334
- type?: EventType.THINKING_END;
335
- timestamp?: number;
336
- rawEvent?: any;
337
- }, {
338
- title?: string;
339
- type?: EventType.THINKING_END;
340
- timestamp?: number;
341
- rawEvent?: any;
342
- }>;
343
- export declare const StateSnapshotEventSchema: z.ZodObject<{
344
- timestamp: z.ZodOptional<z.ZodNumber>;
345
- rawEvent: z.ZodOptional<z.ZodAny>;
346
- } & {
347
- type: z.ZodLiteral<EventType.STATE_SNAPSHOT>;
348
- snapshot: z.ZodAny;
349
- }, "strip", z.ZodTypeAny, {
350
- type?: EventType.STATE_SNAPSHOT;
351
- timestamp?: number;
352
- rawEvent?: any;
353
- snapshot?: any;
354
- }, {
355
- type?: EventType.STATE_SNAPSHOT;
356
- timestamp?: number;
357
- rawEvent?: any;
358
- snapshot?: any;
359
- }>;
360
- export declare const StateDeltaEventSchema: z.ZodObject<{
361
- timestamp: z.ZodOptional<z.ZodNumber>;
362
- rawEvent: z.ZodOptional<z.ZodAny>;
363
- } & {
364
- type: z.ZodLiteral<EventType.STATE_DELTA>;
365
- delta: z.ZodArray<z.ZodAny, "many">;
366
- }, "strip", z.ZodTypeAny, {
367
- type?: EventType.STATE_DELTA;
368
- timestamp?: number;
369
- rawEvent?: any;
370
- delta?: any[];
371
- }, {
372
- type?: EventType.STATE_DELTA;
373
- timestamp?: number;
374
- rawEvent?: any;
375
- delta?: any[];
376
- }>;
377
- export declare const MessagesSnapshotEventSchema: z.ZodObject<{
378
- timestamp: z.ZodOptional<z.ZodNumber>;
379
- rawEvent: z.ZodOptional<z.ZodAny>;
380
- } & {
381
- type: z.ZodLiteral<EventType.MESSAGES_SNAPSHOT>;
382
- messages: z.ZodArray<z.ZodDiscriminatedUnion<"role", [z.ZodObject<{
383
- id: z.ZodString;
384
- name: z.ZodOptional<z.ZodString>;
385
- timestamp: z.ZodOptional<z.ZodNumber>;
386
- } & {
387
- role: z.ZodLiteral<"developer">;
388
- content: z.ZodString;
389
- }, "strip", z.ZodTypeAny, {
390
- name?: string;
391
- content?: string;
392
- role?: "developer";
393
- id?: string;
394
- timestamp?: number;
395
- }, {
396
- name?: string;
397
- content?: string;
398
- role?: "developer";
399
- id?: string;
400
- timestamp?: number;
401
- }>, z.ZodObject<{
402
- id: z.ZodString;
403
- name: z.ZodOptional<z.ZodString>;
404
- timestamp: z.ZodOptional<z.ZodNumber>;
405
- } & {
406
- role: z.ZodLiteral<"system">;
407
- content: z.ZodString;
408
- }, "strip", z.ZodTypeAny, {
409
- name?: string;
410
- content?: string;
411
- role?: "system";
412
- id?: string;
413
- timestamp?: number;
414
- }, {
415
- name?: string;
416
- content?: string;
417
- role?: "system";
418
- id?: string;
419
- timestamp?: number;
420
- }>, z.ZodObject<{
421
- id: z.ZodString;
422
- name: z.ZodOptional<z.ZodString>;
423
- timestamp: z.ZodOptional<z.ZodNumber>;
424
- } & {
425
- role: z.ZodLiteral<"assistant">;
426
- content: z.ZodOptional<z.ZodString>;
427
- reasoningContent: z.ZodOptional<z.ZodString>;
428
- toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
429
- id: z.ZodString;
430
- type: z.ZodLiteral<"function">;
431
- function: z.ZodObject<{
432
- name: z.ZodString;
433
- arguments: z.ZodString;
434
- }, "strip", z.ZodTypeAny, {
435
- name?: string;
436
- arguments?: string;
437
- }, {
438
- name?: string;
439
- arguments?: string;
440
- }>;
441
- }, "strip", z.ZodTypeAny, {
442
- function?: {
443
- name?: string;
444
- arguments?: string;
445
- };
446
- type?: "function";
447
- id?: string;
448
- }, {
449
- function?: {
450
- name?: string;
451
- arguments?: string;
452
- };
453
- type?: "function";
454
- id?: string;
455
- }>, "many">>;
456
- }, "strip", z.ZodTypeAny, {
457
- name?: string;
458
- content?: string;
459
- role?: "assistant";
460
- id?: string;
461
- timestamp?: number;
462
- reasoningContent?: string;
463
- toolCalls?: {
464
- function?: {
465
- name?: string;
466
- arguments?: string;
467
- };
468
- type?: "function";
469
- id?: string;
470
- }[];
471
- }, {
472
- name?: string;
473
- content?: string;
474
- role?: "assistant";
475
- id?: string;
476
- timestamp?: number;
477
- reasoningContent?: string;
478
- toolCalls?: {
479
- function?: {
480
- name?: string;
481
- arguments?: string;
482
- };
483
- type?: "function";
484
- id?: string;
485
- }[];
486
- }>, z.ZodObject<{
487
- id: z.ZodString;
488
- name: z.ZodOptional<z.ZodString>;
489
- timestamp: z.ZodOptional<z.ZodNumber>;
490
- } & {
491
- role: z.ZodLiteral<"user">;
492
- content: z.ZodString;
493
- }, "strip", z.ZodTypeAny, {
494
- name?: string;
495
- content?: string;
496
- role?: "user";
497
- id?: string;
498
- timestamp?: number;
499
- }, {
500
- name?: string;
501
- content?: string;
502
- role?: "user";
503
- id?: string;
504
- timestamp?: number;
505
- }>, z.ZodObject<{
506
- id: z.ZodString;
507
- content: z.ZodString;
508
- role: z.ZodLiteral<"tool">;
509
- toolCallId: z.ZodString;
510
- }, "strip", z.ZodTypeAny, {
511
- content?: string;
512
- role?: "tool";
513
- id?: string;
514
- toolCallId?: string;
515
- }, {
516
- content?: string;
517
- role?: "tool";
518
- id?: string;
519
- toolCallId?: string;
520
- }>]>, "many">;
521
- }, "strip", z.ZodTypeAny, {
522
- type?: EventType.MESSAGES_SNAPSHOT;
523
- messages?: ({
524
- name?: string;
525
- content?: string;
526
- role?: "developer";
527
- id?: string;
528
- timestamp?: number;
529
- } | {
530
- name?: string;
531
- content?: string;
532
- role?: "system";
533
- id?: string;
534
- timestamp?: number;
535
- } | {
536
- name?: string;
537
- content?: string;
538
- role?: "assistant";
539
- id?: string;
540
- timestamp?: number;
541
- reasoningContent?: string;
542
- toolCalls?: {
543
- function?: {
544
- name?: string;
545
- arguments?: string;
546
- };
547
- type?: "function";
548
- id?: string;
549
- }[];
550
- } | {
551
- name?: string;
552
- content?: string;
553
- role?: "user";
554
- id?: string;
555
- timestamp?: number;
556
- } | {
557
- content?: string;
558
- role?: "tool";
559
- id?: string;
560
- toolCallId?: string;
561
- })[];
562
- timestamp?: number;
563
- rawEvent?: any;
564
- }, {
565
- type?: EventType.MESSAGES_SNAPSHOT;
566
- messages?: ({
567
- name?: string;
568
- content?: string;
569
- role?: "developer";
570
- id?: string;
571
- timestamp?: number;
572
- } | {
573
- name?: string;
574
- content?: string;
575
- role?: "system";
576
- id?: string;
577
- timestamp?: number;
578
- } | {
579
- name?: string;
580
- content?: string;
581
- role?: "assistant";
582
- id?: string;
583
- timestamp?: number;
584
- reasoningContent?: string;
585
- toolCalls?: {
586
- function?: {
587
- name?: string;
588
- arguments?: string;
589
- };
590
- type?: "function";
591
- id?: string;
592
- }[];
593
- } | {
594
- name?: string;
595
- content?: string;
596
- role?: "user";
597
- id?: string;
598
- timestamp?: number;
599
- } | {
600
- content?: string;
601
- role?: "tool";
602
- id?: string;
603
- toolCallId?: string;
604
- })[];
605
- timestamp?: number;
606
- rawEvent?: any;
607
- }>;
608
- export declare const RawEventSchema: z.ZodObject<{
609
- timestamp: z.ZodOptional<z.ZodNumber>;
610
- rawEvent: z.ZodOptional<z.ZodAny>;
611
- } & {
612
- type: z.ZodLiteral<EventType.RAW>;
613
- event: z.ZodAny;
614
- source: z.ZodOptional<z.ZodString>;
615
- }, "strip", z.ZodTypeAny, {
616
- source?: string;
617
- event?: any;
618
- type?: EventType.RAW;
619
- timestamp?: number;
620
- rawEvent?: any;
621
- }, {
622
- source?: string;
623
- event?: any;
624
- type?: EventType.RAW;
625
- timestamp?: number;
626
- rawEvent?: any;
627
- }>;
628
- export declare const CustomEventSchema: z.ZodObject<{
629
- timestamp: z.ZodOptional<z.ZodNumber>;
630
- rawEvent: z.ZodOptional<z.ZodAny>;
631
- } & {
632
- type: z.ZodLiteral<EventType.CUSTOM>;
633
- name: z.ZodString;
634
- value: z.ZodAny;
635
- }, "strip", z.ZodTypeAny, {
636
- value?: any;
637
- type?: EventType.CUSTOM;
638
- name?: string;
639
- timestamp?: number;
640
- rawEvent?: any;
641
- }, {
642
- value?: any;
643
- type?: EventType.CUSTOM;
644
- name?: string;
645
- timestamp?: number;
646
- rawEvent?: any;
647
- }>;
648
- export declare const RunStartedEventSchema: z.ZodObject<{
649
- timestamp: z.ZodOptional<z.ZodNumber>;
650
- rawEvent: z.ZodOptional<z.ZodAny>;
651
- } & {
652
- type: z.ZodLiteral<EventType.RUN_STARTED>;
653
- threadId: z.ZodString;
654
- runId: z.ZodString;
655
- }, "strip", z.ZodTypeAny, {
656
- type?: EventType.RUN_STARTED;
657
- timestamp?: number;
658
- threadId?: string;
659
- runId?: string;
660
- rawEvent?: any;
661
- }, {
662
- type?: EventType.RUN_STARTED;
663
- timestamp?: number;
664
- threadId?: string;
665
- runId?: string;
666
- rawEvent?: any;
667
- }>;
668
- export declare const RunFinishedEventSchema: z.ZodObject<{
669
- timestamp: z.ZodOptional<z.ZodNumber>;
670
- rawEvent: z.ZodOptional<z.ZodAny>;
671
- } & {
672
- type: z.ZodLiteral<EventType.RUN_FINISHED>;
673
- threadId: z.ZodString;
674
- runId: z.ZodString;
675
- result: z.ZodOptional<z.ZodAny>;
676
- }, "strip", z.ZodTypeAny, {
677
- type?: EventType.RUN_FINISHED;
678
- result?: any;
679
- timestamp?: number;
680
- threadId?: string;
681
- runId?: string;
682
- rawEvent?: any;
683
- }, {
684
- type?: EventType.RUN_FINISHED;
685
- result?: any;
686
- timestamp?: number;
687
- threadId?: string;
688
- runId?: string;
689
- rawEvent?: any;
690
- }>;
691
- export declare const RunErrorEventSchema: z.ZodObject<{
692
- timestamp: z.ZodOptional<z.ZodNumber>;
693
- rawEvent: z.ZodOptional<z.ZodAny>;
694
- } & {
695
- type: z.ZodLiteral<EventType.RUN_ERROR>;
696
- message: z.ZodString;
697
- code: z.ZodOptional<z.ZodString>;
698
- }, "strip", z.ZodTypeAny, {
699
- code?: string;
700
- type?: EventType.RUN_ERROR;
701
- message?: string;
702
- timestamp?: number;
703
- rawEvent?: any;
704
- }, {
705
- code?: string;
706
- type?: EventType.RUN_ERROR;
707
- message?: string;
708
- timestamp?: number;
709
- rawEvent?: any;
710
- }>;
711
- export declare const StepStartedEventSchema: z.ZodObject<{
712
- timestamp: z.ZodOptional<z.ZodNumber>;
713
- rawEvent: z.ZodOptional<z.ZodAny>;
714
- } & {
715
- type: z.ZodLiteral<EventType.STEP_STARTED>;
716
- stepName: z.ZodString;
717
- }, "strip", z.ZodTypeAny, {
718
- type?: EventType.STEP_STARTED;
719
- timestamp?: number;
720
- rawEvent?: any;
721
- stepName?: string;
722
- }, {
723
- type?: EventType.STEP_STARTED;
724
- timestamp?: number;
725
- rawEvent?: any;
726
- stepName?: string;
727
- }>;
728
- export declare const StepFinishedEventSchema: z.ZodObject<{
729
- timestamp: z.ZodOptional<z.ZodNumber>;
730
- rawEvent: z.ZodOptional<z.ZodAny>;
731
- } & {
732
- type: z.ZodLiteral<EventType.STEP_FINISHED>;
733
- stepName: z.ZodString;
734
- }, "strip", z.ZodTypeAny, {
735
- type?: EventType.STEP_FINISHED;
736
- timestamp?: number;
737
- rawEvent?: any;
738
- stepName?: string;
739
- }, {
740
- type?: EventType.STEP_FINISHED;
741
- timestamp?: number;
742
- rawEvent?: any;
743
- stepName?: string;
744
- }>;
745
- export declare const EventSchemas: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
746
- timestamp: z.ZodOptional<z.ZodNumber>;
747
- rawEvent: z.ZodOptional<z.ZodAny>;
748
- } & {
749
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_START>;
750
- messageId: z.ZodString;
751
- role: z.ZodLiteral<"assistant">;
752
- }, "strip", z.ZodTypeAny, {
753
- type?: EventType.TEXT_MESSAGE_START;
754
- role?: "assistant";
755
- timestamp?: number;
756
- rawEvent?: any;
757
- messageId?: string;
758
- }, {
759
- type?: EventType.TEXT_MESSAGE_START;
760
- role?: "assistant";
761
- timestamp?: number;
762
- rawEvent?: any;
763
- messageId?: string;
764
- }>, z.ZodObject<{
765
- timestamp: z.ZodOptional<z.ZodNumber>;
766
- rawEvent: z.ZodOptional<z.ZodAny>;
767
- } & {
768
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_CONTENT>;
769
- messageId: z.ZodString;
770
- delta: z.ZodEffects<z.ZodString, string, string>;
771
- }, "strip", z.ZodTypeAny, {
772
- type?: EventType.TEXT_MESSAGE_CONTENT;
773
- timestamp?: number;
774
- rawEvent?: any;
775
- messageId?: string;
776
- delta?: string;
777
- }, {
778
- type?: EventType.TEXT_MESSAGE_CONTENT;
779
- timestamp?: number;
780
- rawEvent?: any;
781
- messageId?: string;
782
- delta?: string;
783
- }>, z.ZodObject<{
784
- timestamp: z.ZodOptional<z.ZodNumber>;
785
- rawEvent: z.ZodOptional<z.ZodAny>;
786
- } & {
787
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_END>;
788
- messageId: z.ZodString;
789
- }, "strip", z.ZodTypeAny, {
790
- type?: EventType.TEXT_MESSAGE_END;
791
- timestamp?: number;
792
- rawEvent?: any;
793
- messageId?: string;
794
- }, {
795
- type?: EventType.TEXT_MESSAGE_END;
796
- timestamp?: number;
797
- rawEvent?: any;
798
- messageId?: string;
799
- }>, z.ZodObject<{
800
- timestamp: z.ZodOptional<z.ZodNumber>;
801
- rawEvent: z.ZodOptional<z.ZodAny>;
802
- } & {
803
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_CHUNK>;
804
- messageId: z.ZodOptional<z.ZodString>;
805
- role: z.ZodOptional<z.ZodLiteral<"assistant">>;
806
- delta: z.ZodOptional<z.ZodString>;
807
- }, "strip", z.ZodTypeAny, {
808
- type?: EventType.TEXT_MESSAGE_CHUNK;
809
- role?: "assistant";
810
- timestamp?: number;
811
- rawEvent?: any;
812
- messageId?: string;
813
- delta?: string;
814
- }, {
815
- type?: EventType.TEXT_MESSAGE_CHUNK;
816
- role?: "assistant";
817
- timestamp?: number;
818
- rawEvent?: any;
819
- messageId?: string;
820
- delta?: string;
821
- }>, z.ZodObject<{
822
- timestamp: z.ZodOptional<z.ZodNumber>;
823
- rawEvent: z.ZodOptional<z.ZodAny>;
824
- } & {
825
- type: z.ZodLiteral<EventType.THINKING_TEXT_MESSAGE_START>;
826
- }, "strip", z.ZodTypeAny, {
827
- type?: EventType.THINKING_TEXT_MESSAGE_START;
828
- timestamp?: number;
829
- rawEvent?: any;
830
- }, {
831
- type?: EventType.THINKING_TEXT_MESSAGE_START;
832
- timestamp?: number;
833
- rawEvent?: any;
834
- }>, z.ZodObject<Omit<{
835
- timestamp: z.ZodOptional<z.ZodNumber>;
836
- rawEvent: z.ZodOptional<z.ZodAny>;
837
- } & {
838
- type: z.ZodLiteral<EventType.TEXT_MESSAGE_CONTENT>;
839
- messageId: z.ZodString;
840
- delta: z.ZodEffects<z.ZodString, string, string>;
841
- }, "type" | "messageId"> & {
842
- type: z.ZodLiteral<EventType.THINKING_TEXT_MESSAGE_CONTENT>;
843
- }, "strip", z.ZodTypeAny, {
844
- type?: EventType.THINKING_TEXT_MESSAGE_CONTENT;
845
- timestamp?: number;
846
- rawEvent?: any;
847
- delta?: string;
848
- }, {
849
- type?: EventType.THINKING_TEXT_MESSAGE_CONTENT;
850
- timestamp?: number;
851
- rawEvent?: any;
852
- delta?: string;
853
- }>, z.ZodObject<{
854
- timestamp: z.ZodOptional<z.ZodNumber>;
855
- rawEvent: z.ZodOptional<z.ZodAny>;
856
- } & {
857
- type: z.ZodLiteral<EventType.THINKING_TEXT_MESSAGE_END>;
858
- }, "strip", z.ZodTypeAny, {
859
- type?: EventType.THINKING_TEXT_MESSAGE_END;
860
- timestamp?: number;
861
- rawEvent?: any;
862
- }, {
863
- type?: EventType.THINKING_TEXT_MESSAGE_END;
864
- timestamp?: number;
865
- rawEvent?: any;
866
- }>, z.ZodObject<{
867
- timestamp: z.ZodOptional<z.ZodNumber>;
868
- rawEvent: z.ZodOptional<z.ZodAny>;
869
- } & {
870
- type: z.ZodLiteral<EventType.TOOL_CALL_START>;
871
- toolCallId: z.ZodString;
872
- toolCallName: z.ZodString;
873
- parentMessageId: z.ZodOptional<z.ZodString>;
874
- }, "strip", z.ZodTypeAny, {
875
- type?: EventType.TOOL_CALL_START;
876
- timestamp?: number;
877
- toolCallId?: string;
878
- rawEvent?: any;
879
- toolCallName?: string;
880
- parentMessageId?: string;
881
- }, {
882
- type?: EventType.TOOL_CALL_START;
883
- timestamp?: number;
884
- toolCallId?: string;
885
- rawEvent?: any;
886
- toolCallName?: string;
887
- parentMessageId?: string;
888
- }>, z.ZodObject<{
889
- timestamp: z.ZodOptional<z.ZodNumber>;
890
- rawEvent: z.ZodOptional<z.ZodAny>;
891
- } & {
892
- type: z.ZodLiteral<EventType.TOOL_CALL_ARGS>;
893
- toolCallId: z.ZodString;
894
- delta: z.ZodString;
895
- }, "strip", z.ZodTypeAny, {
896
- type?: EventType.TOOL_CALL_ARGS;
897
- timestamp?: number;
898
- toolCallId?: string;
899
- rawEvent?: any;
900
- delta?: string;
901
- }, {
902
- type?: EventType.TOOL_CALL_ARGS;
903
- timestamp?: number;
904
- toolCallId?: string;
905
- rawEvent?: any;
906
- delta?: string;
907
- }>, z.ZodObject<{
908
- timestamp: z.ZodOptional<z.ZodNumber>;
909
- rawEvent: z.ZodOptional<z.ZodAny>;
910
- } & {
911
- type: z.ZodLiteral<EventType.TOOL_CALL_END>;
912
- toolCallId: z.ZodString;
913
- }, "strip", z.ZodTypeAny, {
914
- type?: EventType.TOOL_CALL_END;
915
- timestamp?: number;
916
- toolCallId?: string;
917
- rawEvent?: any;
918
- }, {
919
- type?: EventType.TOOL_CALL_END;
920
- timestamp?: number;
921
- toolCallId?: string;
922
- rawEvent?: any;
923
- }>, z.ZodObject<{
924
- timestamp: z.ZodOptional<z.ZodNumber>;
925
- rawEvent: z.ZodOptional<z.ZodAny>;
926
- } & {
927
- type: z.ZodLiteral<EventType.TOOL_CALL_CHUNK>;
928
- toolCallId: z.ZodOptional<z.ZodString>;
929
- toolCallName: z.ZodOptional<z.ZodString>;
930
- parentMessageId: z.ZodOptional<z.ZodString>;
931
- delta: z.ZodOptional<z.ZodString>;
932
- }, "strip", z.ZodTypeAny, {
933
- type?: EventType.TOOL_CALL_CHUNK;
934
- timestamp?: number;
935
- toolCallId?: string;
936
- rawEvent?: any;
937
- delta?: string;
938
- toolCallName?: string;
939
- parentMessageId?: string;
940
- }, {
941
- type?: EventType.TOOL_CALL_CHUNK;
942
- timestamp?: number;
943
- toolCallId?: string;
944
- rawEvent?: any;
945
- delta?: string;
946
- toolCallName?: string;
947
- parentMessageId?: string;
948
- }>, z.ZodObject<{
949
- timestamp: z.ZodOptional<z.ZodNumber>;
950
- rawEvent: z.ZodOptional<z.ZodAny>;
951
- } & {
952
- messageId: z.ZodString;
953
- type: z.ZodLiteral<EventType.TOOL_CALL_RESULT>;
954
- toolCallId: z.ZodString;
955
- toolCallName: z.ZodString;
956
- content: z.ZodString;
957
- role: z.ZodOptional<z.ZodLiteral<"tool">>;
958
- }, "strip", z.ZodTypeAny, {
959
- type?: EventType.TOOL_CALL_RESULT;
960
- content?: string;
961
- role?: "tool";
962
- timestamp?: number;
963
- toolCallId?: string;
964
- rawEvent?: any;
965
- messageId?: string;
966
- toolCallName?: string;
967
- }, {
968
- type?: EventType.TOOL_CALL_RESULT;
969
- content?: string;
970
- role?: "tool";
971
- timestamp?: number;
972
- toolCallId?: string;
973
- rawEvent?: any;
974
- messageId?: string;
975
- toolCallName?: string;
976
- }>, z.ZodObject<{
977
- timestamp: z.ZodOptional<z.ZodNumber>;
978
- rawEvent: z.ZodOptional<z.ZodAny>;
979
- } & {
980
- type: z.ZodLiteral<EventType.STATE_SNAPSHOT>;
981
- snapshot: z.ZodAny;
982
- }, "strip", z.ZodTypeAny, {
983
- type?: EventType.STATE_SNAPSHOT;
984
- timestamp?: number;
985
- rawEvent?: any;
986
- snapshot?: any;
987
- }, {
988
- type?: EventType.STATE_SNAPSHOT;
989
- timestamp?: number;
990
- rawEvent?: any;
991
- snapshot?: any;
992
- }>, z.ZodObject<{
993
- timestamp: z.ZodOptional<z.ZodNumber>;
994
- rawEvent: z.ZodOptional<z.ZodAny>;
995
- } & {
996
- type: z.ZodLiteral<EventType.STATE_DELTA>;
997
- delta: z.ZodArray<z.ZodAny, "many">;
998
- }, "strip", z.ZodTypeAny, {
999
- type?: EventType.STATE_DELTA;
1000
- timestamp?: number;
1001
- rawEvent?: any;
1002
- delta?: any[];
1003
- }, {
1004
- type?: EventType.STATE_DELTA;
1005
- timestamp?: number;
1006
- rawEvent?: any;
1007
- delta?: any[];
1008
- }>, z.ZodObject<{
1009
- timestamp: z.ZodOptional<z.ZodNumber>;
1010
- rawEvent: z.ZodOptional<z.ZodAny>;
1011
- } & {
1012
- type: z.ZodLiteral<EventType.MESSAGES_SNAPSHOT>;
1013
- messages: z.ZodArray<z.ZodDiscriminatedUnion<"role", [z.ZodObject<{
1014
- id: z.ZodString;
1015
- name: z.ZodOptional<z.ZodString>;
1016
- timestamp: z.ZodOptional<z.ZodNumber>;
1017
- } & {
1018
- role: z.ZodLiteral<"developer">;
1019
- content: z.ZodString;
1020
- }, "strip", z.ZodTypeAny, {
1021
- name?: string;
1022
- content?: string;
1023
- role?: "developer";
1024
- id?: string;
1025
- timestamp?: number;
1026
- }, {
1027
- name?: string;
1028
- content?: string;
1029
- role?: "developer";
1030
- id?: string;
1031
- timestamp?: number;
1032
- }>, z.ZodObject<{
1033
- id: z.ZodString;
1034
- name: z.ZodOptional<z.ZodString>;
1035
- timestamp: z.ZodOptional<z.ZodNumber>;
1036
- } & {
1037
- role: z.ZodLiteral<"system">;
1038
- content: z.ZodString;
1039
- }, "strip", z.ZodTypeAny, {
1040
- name?: string;
1041
- content?: string;
1042
- role?: "system";
1043
- id?: string;
1044
- timestamp?: number;
1045
- }, {
1046
- name?: string;
1047
- content?: string;
1048
- role?: "system";
1049
- id?: string;
1050
- timestamp?: number;
1051
- }>, z.ZodObject<{
1052
- id: z.ZodString;
1053
- name: z.ZodOptional<z.ZodString>;
1054
- timestamp: z.ZodOptional<z.ZodNumber>;
1055
- } & {
1056
- role: z.ZodLiteral<"assistant">;
1057
- content: z.ZodOptional<z.ZodString>;
1058
- reasoningContent: z.ZodOptional<z.ZodString>;
1059
- toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1060
- id: z.ZodString;
1061
- type: z.ZodLiteral<"function">;
1062
- function: z.ZodObject<{
1063
- name: z.ZodString;
1064
- arguments: z.ZodString;
1065
- }, "strip", z.ZodTypeAny, {
1066
- name?: string;
1067
- arguments?: string;
1068
- }, {
1069
- name?: string;
1070
- arguments?: string;
1071
- }>;
1072
- }, "strip", z.ZodTypeAny, {
1073
- function?: {
1074
- name?: string;
1075
- arguments?: string;
1076
- };
1077
- type?: "function";
1078
- id?: string;
1079
- }, {
1080
- function?: {
1081
- name?: string;
1082
- arguments?: string;
1083
- };
1084
- type?: "function";
1085
- id?: string;
1086
- }>, "many">>;
1087
- }, "strip", z.ZodTypeAny, {
1088
- name?: string;
1089
- content?: string;
1090
- role?: "assistant";
1091
- id?: string;
1092
- timestamp?: number;
1093
- reasoningContent?: string;
1094
- toolCalls?: {
1095
- function?: {
1096
- name?: string;
1097
- arguments?: string;
1098
- };
1099
- type?: "function";
1100
- id?: string;
1101
- }[];
1102
- }, {
1103
- name?: string;
1104
- content?: string;
1105
- role?: "assistant";
1106
- id?: string;
1107
- timestamp?: number;
1108
- reasoningContent?: string;
1109
- toolCalls?: {
1110
- function?: {
1111
- name?: string;
1112
- arguments?: string;
1113
- };
1114
- type?: "function";
1115
- id?: string;
1116
- }[];
1117
- }>, z.ZodObject<{
1118
- id: z.ZodString;
1119
- name: z.ZodOptional<z.ZodString>;
1120
- timestamp: z.ZodOptional<z.ZodNumber>;
1121
- } & {
1122
- role: z.ZodLiteral<"user">;
1123
- content: z.ZodString;
1124
- }, "strip", z.ZodTypeAny, {
1125
- name?: string;
1126
- content?: string;
1127
- role?: "user";
1128
- id?: string;
1129
- timestamp?: number;
1130
- }, {
1131
- name?: string;
1132
- content?: string;
1133
- role?: "user";
1134
- id?: string;
1135
- timestamp?: number;
1136
- }>, z.ZodObject<{
1137
- id: z.ZodString;
1138
- content: z.ZodString;
1139
- role: z.ZodLiteral<"tool">;
1140
- toolCallId: z.ZodString;
1141
- }, "strip", z.ZodTypeAny, {
1142
- content?: string;
1143
- role?: "tool";
1144
- id?: string;
1145
- toolCallId?: string;
1146
- }, {
1147
- content?: string;
1148
- role?: "tool";
1149
- id?: string;
1150
- toolCallId?: string;
1151
- }>]>, "many">;
1152
- }, "strip", z.ZodTypeAny, {
1153
- type?: EventType.MESSAGES_SNAPSHOT;
1154
- messages?: ({
1155
- name?: string;
1156
- content?: string;
1157
- role?: "developer";
1158
- id?: string;
1159
- timestamp?: number;
1160
- } | {
1161
- name?: string;
1162
- content?: string;
1163
- role?: "system";
1164
- id?: string;
1165
- timestamp?: number;
1166
- } | {
1167
- name?: string;
1168
- content?: string;
1169
- role?: "assistant";
1170
- id?: string;
1171
- timestamp?: number;
1172
- reasoningContent?: string;
1173
- toolCalls?: {
1174
- function?: {
1175
- name?: string;
1176
- arguments?: string;
1177
- };
1178
- type?: "function";
1179
- id?: string;
1180
- }[];
1181
- } | {
1182
- name?: string;
1183
- content?: string;
1184
- role?: "user";
1185
- id?: string;
1186
- timestamp?: number;
1187
- } | {
1188
- content?: string;
1189
- role?: "tool";
1190
- id?: string;
1191
- toolCallId?: string;
1192
- })[];
1193
- timestamp?: number;
1194
- rawEvent?: any;
1195
- }, {
1196
- type?: EventType.MESSAGES_SNAPSHOT;
1197
- messages?: ({
1198
- name?: string;
1199
- content?: string;
1200
- role?: "developer";
1201
- id?: string;
1202
- timestamp?: number;
1203
- } | {
1204
- name?: string;
1205
- content?: string;
1206
- role?: "system";
1207
- id?: string;
1208
- timestamp?: number;
1209
- } | {
1210
- name?: string;
1211
- content?: string;
1212
- role?: "assistant";
1213
- id?: string;
1214
- timestamp?: number;
1215
- reasoningContent?: string;
1216
- toolCalls?: {
1217
- function?: {
1218
- name?: string;
1219
- arguments?: string;
1220
- };
1221
- type?: "function";
1222
- id?: string;
1223
- }[];
1224
- } | {
1225
- name?: string;
1226
- content?: string;
1227
- role?: "user";
1228
- id?: string;
1229
- timestamp?: number;
1230
- } | {
1231
- content?: string;
1232
- role?: "tool";
1233
- id?: string;
1234
- toolCallId?: string;
1235
- })[];
1236
- timestamp?: number;
1237
- rawEvent?: any;
1238
- }>, z.ZodObject<{
1239
- timestamp: z.ZodOptional<z.ZodNumber>;
1240
- rawEvent: z.ZodOptional<z.ZodAny>;
1241
- } & {
1242
- type: z.ZodLiteral<EventType.RAW>;
1243
- event: z.ZodAny;
1244
- source: z.ZodOptional<z.ZodString>;
1245
- }, "strip", z.ZodTypeAny, {
1246
- source?: string;
1247
- event?: any;
1248
- type?: EventType.RAW;
1249
- timestamp?: number;
1250
- rawEvent?: any;
1251
- }, {
1252
- source?: string;
1253
- event?: any;
1254
- type?: EventType.RAW;
1255
- timestamp?: number;
1256
- rawEvent?: any;
1257
- }>, z.ZodObject<{
1258
- timestamp: z.ZodOptional<z.ZodNumber>;
1259
- rawEvent: z.ZodOptional<z.ZodAny>;
1260
- } & {
1261
- type: z.ZodLiteral<EventType.CUSTOM>;
1262
- name: z.ZodString;
1263
- value: z.ZodAny;
1264
- }, "strip", z.ZodTypeAny, {
1265
- value?: any;
1266
- type?: EventType.CUSTOM;
1267
- name?: string;
1268
- timestamp?: number;
1269
- rawEvent?: any;
1270
- }, {
1271
- value?: any;
1272
- type?: EventType.CUSTOM;
1273
- name?: string;
1274
- timestamp?: number;
1275
- rawEvent?: any;
1276
- }>, z.ZodObject<{
1277
- timestamp: z.ZodOptional<z.ZodNumber>;
1278
- rawEvent: z.ZodOptional<z.ZodAny>;
1279
- } & {
1280
- type: z.ZodLiteral<EventType.RUN_STARTED>;
1281
- threadId: z.ZodString;
1282
- runId: z.ZodString;
1283
- }, "strip", z.ZodTypeAny, {
1284
- type?: EventType.RUN_STARTED;
1285
- timestamp?: number;
1286
- threadId?: string;
1287
- runId?: string;
1288
- rawEvent?: any;
1289
- }, {
1290
- type?: EventType.RUN_STARTED;
1291
- timestamp?: number;
1292
- threadId?: string;
1293
- runId?: string;
1294
- rawEvent?: any;
1295
- }>, z.ZodObject<{
1296
- timestamp: z.ZodOptional<z.ZodNumber>;
1297
- rawEvent: z.ZodOptional<z.ZodAny>;
1298
- } & {
1299
- type: z.ZodLiteral<EventType.RUN_FINISHED>;
1300
- threadId: z.ZodString;
1301
- runId: z.ZodString;
1302
- result: z.ZodOptional<z.ZodAny>;
1303
- }, "strip", z.ZodTypeAny, {
1304
- type?: EventType.RUN_FINISHED;
1305
- result?: any;
1306
- timestamp?: number;
1307
- threadId?: string;
1308
- runId?: string;
1309
- rawEvent?: any;
1310
- }, {
1311
- type?: EventType.RUN_FINISHED;
1312
- result?: any;
1313
- timestamp?: number;
1314
- threadId?: string;
1315
- runId?: string;
1316
- rawEvent?: any;
1317
- }>, z.ZodObject<{
1318
- timestamp: z.ZodOptional<z.ZodNumber>;
1319
- rawEvent: z.ZodOptional<z.ZodAny>;
1320
- } & {
1321
- type: z.ZodLiteral<EventType.RUN_ERROR>;
1322
- message: z.ZodString;
1323
- code: z.ZodOptional<z.ZodString>;
1324
- }, "strip", z.ZodTypeAny, {
1325
- code?: string;
1326
- type?: EventType.RUN_ERROR;
1327
- message?: string;
1328
- timestamp?: number;
1329
- rawEvent?: any;
1330
- }, {
1331
- code?: string;
1332
- type?: EventType.RUN_ERROR;
1333
- message?: string;
1334
- timestamp?: number;
1335
- rawEvent?: any;
1336
- }>, z.ZodObject<{
1337
- timestamp: z.ZodOptional<z.ZodNumber>;
1338
- rawEvent: z.ZodOptional<z.ZodAny>;
1339
- } & {
1340
- type: z.ZodLiteral<EventType.STEP_STARTED>;
1341
- stepName: z.ZodString;
1342
- }, "strip", z.ZodTypeAny, {
1343
- type?: EventType.STEP_STARTED;
1344
- timestamp?: number;
1345
- rawEvent?: any;
1346
- stepName?: string;
1347
- }, {
1348
- type?: EventType.STEP_STARTED;
1349
- timestamp?: number;
1350
- rawEvent?: any;
1351
- stepName?: string;
1352
- }>, z.ZodObject<{
1353
- timestamp: z.ZodOptional<z.ZodNumber>;
1354
- rawEvent: z.ZodOptional<z.ZodAny>;
1355
- } & {
1356
- type: z.ZodLiteral<EventType.STEP_FINISHED>;
1357
- stepName: z.ZodString;
1358
- }, "strip", z.ZodTypeAny, {
1359
- type?: EventType.STEP_FINISHED;
1360
- timestamp?: number;
1361
- rawEvent?: any;
1362
- stepName?: string;
1363
- }, {
1364
- type?: EventType.STEP_FINISHED;
1365
- timestamp?: number;
1366
- rawEvent?: any;
1367
- stepName?: string;
1368
- }>]>;
1369
- export type BaseEvent = z.infer<typeof BaseEventSchema>;
1370
- export type TextMessageStartEvent = z.infer<typeof TextMessageStartEventSchema>;
1371
- export type TextMessageContentEvent = z.infer<typeof TextMessageContentEventSchema>;
1372
- export type TextMessageEndEvent = z.infer<typeof TextMessageEndEventSchema>;
1373
- export type TextMessageChunkEvent = z.infer<typeof TextMessageChunkEventSchema>;
1374
- export type ThinkingTextMessageStartEvent = z.infer<typeof ThinkingTextMessageStartEventSchema>;
1375
- export type ThinkingTextMessageContentEvent = z.infer<typeof ThinkingTextMessageContentEventSchema>;
1376
- export type ThinkingTextMessageEndEvent = z.infer<typeof ThinkingTextMessageEndEventSchema>;
1377
- export type ToolCallStartEvent = z.infer<typeof ToolCallStartEventSchema>;
1378
- export type ToolCallArgsEvent = z.infer<typeof ToolCallArgsEventSchema>;
1379
- export type ToolCallEndEvent = z.infer<typeof ToolCallEndEventSchema>;
1380
- export type ToolCallChunkEvent = z.infer<typeof ToolCallChunkEventSchema>;
1381
- export type ToolCallResultEvent = z.infer<typeof ToolCallResultEventSchema>;
1382
- export type ThinkingStartEvent = z.infer<typeof ThinkingStartEventSchema>;
1383
- export type ThinkingEndEvent = z.infer<typeof ThinkingEndEventSchema>;
1384
- export type StateSnapshotEvent = z.infer<typeof StateSnapshotEventSchema>;
1385
- export type StateDeltaEvent = z.infer<typeof StateDeltaEventSchema>;
1386
- export type MessagesSnapshotEvent = z.infer<typeof MessagesSnapshotEventSchema>;
1387
- export type RawEvent = z.infer<typeof RawEventSchema>;
1388
- export type CustomEvent = z.infer<typeof CustomEventSchema>;
1389
- export type RunStartedEvent = z.infer<typeof RunStartedEventSchema>;
1390
- export type RunFinishedEvent = z.infer<typeof RunFinishedEventSchema>;
1391
- export type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;
1392
- export type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;
1393
- export type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;
1394
- export {};