@tdesign-react/chat 1.0.0 → 1.0.2-alpha.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 (168) hide show
  1. package/es/_util/reactify.js +1 -1
  2. package/es/_util/useDynamicStyle.js +1 -1
  3. package/es/chat-actionbar/_example-js/base.d.ts +2 -0
  4. package/es/chat-actionbar/_example-js/custom.d.ts +2 -0
  5. package/es/chat-actionbar/_example-js/style.d.ts +2 -0
  6. package/es/chat-actionbar/index.js +1 -1
  7. package/es/chat-attachments/_example-js/base.d.ts +2 -0
  8. package/es/chat-attachments/_example-js/scroll-x.d.ts +2 -0
  9. package/es/chat-attachments/_example-js/scroll-y.d.ts +2 -0
  10. package/es/chat-attachments/index.js +1 -1
  11. package/es/chat-engine/_example-js/agui-basic.d.ts +10 -0
  12. package/es/chat-engine/_example-js/agui-comprehensive.d.ts +2 -0
  13. package/es/chat-engine/_example-js/agui-test.d.ts +11 -0
  14. package/es/chat-engine/_example-js/agui-toolcall.d.ts +5 -0
  15. package/es/chat-engine/_example-js/agui-videoclip.d.ts +8 -0
  16. package/es/chat-engine/_example-js/agui.d.ts +1 -0
  17. package/es/chat-engine/_example-js/basic.d.ts +9 -0
  18. package/es/chat-engine/_example-js/components/HotelCard.d.ts +3 -0
  19. package/es/chat-engine/_example-js/components/HumanInputForm.d.ts +6 -0
  20. package/es/chat-engine/_example-js/components/HumanInputResult.d.ts +3 -0
  21. package/es/chat-engine/_example-js/components/ItineraryCard.d.ts +3 -0
  22. package/es/chat-engine/_example-js/components/PlanningStatePanel.d.ts +4 -0
  23. package/es/chat-engine/_example-js/components/Toolcall.d.ts +4 -0
  24. package/es/chat-engine/_example-js/components/WeatherCard.d.ts +3 -0
  25. package/es/chat-engine/_example-js/components/login.d.ts +1 -0
  26. package/es/chat-engine/_example-js/comprehensive.d.ts +12 -0
  27. package/es/chat-engine/_example-js/custom-content.d.ts +1 -0
  28. package/es/chat-engine/_example-js/hookComponent.d.ts +1 -0
  29. package/es/chat-engine/_example-js/initial-messages.d.ts +9 -0
  30. package/es/chat-engine/_example-js/instance-methods.d.ts +13 -0
  31. package/es/chat-engine/_example-js/travel-actions.d.ts +91 -0
  32. package/es/chat-engine/_example-js/travelToolcall.d.ts +1 -0
  33. package/es/chat-engine/components/provider/agent-state.js +1 -1
  34. package/es/chat-engine/components/toolcall/index.js +1 -1
  35. package/es/chat-engine/components/toolcall/registry.js +1 -1
  36. package/es/chat-engine/components/toolcall/render.js +1 -1
  37. package/es/chat-engine/components/toolcall/types.d.ts +12 -4
  38. package/es/chat-engine/components/toolcall/types.js +1 -1
  39. package/es/chat-engine/components/toolcall/types.js.map +1 -1
  40. package/es/chat-engine/core/adapters/agui/event-mapper.d.ts +104 -0
  41. package/es/chat-engine/core/adapters/agui/event-mapper.js +348 -0
  42. package/es/chat-engine/core/adapters/agui/event-mapper.js.map +1 -0
  43. package/es/chat-engine/core/adapters/agui/events.d.ts +1394 -0
  44. package/es/chat-engine/core/adapters/agui/events.js +181 -0
  45. package/es/chat-engine/core/adapters/agui/events.js.map +1 -0
  46. package/es/chat-engine/core/adapters/agui/index.d.ts +75 -0
  47. package/es/chat-engine/core/adapters/agui/index.js +165 -0
  48. package/es/chat-engine/core/adapters/agui/index.js.map +1 -0
  49. package/es/chat-engine/core/adapters/agui/state-manager.d.ts +99 -0
  50. package/es/chat-engine/core/adapters/agui/state-manager.js +168 -0
  51. package/es/chat-engine/core/adapters/agui/state-manager.js.map +1 -0
  52. package/es/chat-engine/core/adapters/agui/types.d.ts +760 -0
  53. package/es/chat-engine/core/adapters/agui/types.js +89 -0
  54. package/es/chat-engine/core/adapters/agui/types.js.map +1 -0
  55. package/es/chat-engine/core/adapters/agui/utils.d.ts +180 -0
  56. package/es/chat-engine/core/adapters/agui/utils.js +302 -0
  57. package/es/chat-engine/core/adapters/agui/utils.js.map +1 -0
  58. package/es/chat-engine/core/index.d.ts +132 -0
  59. package/es/chat-engine/core/index.js +597 -0
  60. package/es/chat-engine/core/index.js.map +1 -0
  61. package/es/chat-engine/core/processor/index.d.ts +20 -0
  62. package/es/chat-engine/core/processor/index.js +146 -0
  63. package/es/chat-engine/core/processor/index.js.map +1 -0
  64. package/es/chat-engine/core/server/batch-client.d.ts +20 -0
  65. package/es/chat-engine/core/server/batch-client.js +114 -0
  66. package/es/chat-engine/core/server/batch-client.js.map +1 -0
  67. package/es/chat-engine/core/server/connection-manager.d.ts +39 -0
  68. package/es/chat-engine/core/server/connection-manager.js +84 -0
  69. package/es/chat-engine/core/server/connection-manager.js.map +1 -0
  70. package/es/chat-engine/core/server/errors.d.ts +22 -0
  71. package/es/chat-engine/core/server/errors.js +80 -0
  72. package/es/chat-engine/core/server/errors.js.map +1 -0
  73. package/es/chat-engine/core/server/index.d.ts +11 -0
  74. package/es/chat-engine/core/server/index.js +26 -0
  75. package/es/chat-engine/core/server/index.js.map +1 -0
  76. package/es/chat-engine/core/server/llm-service.d.ts +44 -0
  77. package/es/chat-engine/core/server/llm-service.js +198 -0
  78. package/es/chat-engine/core/server/llm-service.js.map +1 -0
  79. package/es/chat-engine/core/server/sse-client.d.ts +77 -0
  80. package/es/chat-engine/core/server/sse-client.js +362 -0
  81. package/es/chat-engine/core/server/sse-client.js.map +1 -0
  82. package/es/chat-engine/core/server/sse-parser.d.ts +49 -0
  83. package/es/chat-engine/core/server/sse-parser.js +116 -0
  84. package/es/chat-engine/core/server/sse-parser.js.map +1 -0
  85. package/es/chat-engine/core/server/types.d.ts +54 -0
  86. package/es/chat-engine/core/server/types.js +28 -0
  87. package/es/chat-engine/core/server/types.js.map +1 -0
  88. package/es/chat-engine/core/store/message.d.ts +27 -0
  89. package/es/chat-engine/core/store/message.js +263 -0
  90. package/es/chat-engine/core/store/message.js.map +1 -0
  91. package/es/chat-engine/core/store/model.d.ts +8 -0
  92. package/es/chat-engine/core/store/model.js +65 -0
  93. package/es/chat-engine/core/store/model.js.map +1 -0
  94. package/es/chat-engine/core/store/reactiveState.d.ts +52 -0
  95. package/es/chat-engine/core/store/reactiveState.js +1359 -0
  96. package/es/chat-engine/core/store/reactiveState.js.map +1 -0
  97. package/es/chat-engine/core/type.d.ts +248 -0
  98. package/es/chat-engine/core/type.js +7 -0
  99. package/es/chat-engine/core/type.js.map +1 -0
  100. package/es/chat-engine/core/utils/eventEmitter.d.ts +10 -0
  101. package/es/chat-engine/core/utils/eventEmitter.js +67 -0
  102. package/es/chat-engine/core/utils/eventEmitter.js.map +1 -0
  103. package/es/chat-engine/core/utils/index.d.ts +32 -0
  104. package/es/chat-engine/core/utils/index.js +996 -0
  105. package/es/chat-engine/core/utils/index.js.map +1 -0
  106. package/es/chat-engine/core/utils/logger.d.ts +30 -0
  107. package/es/chat-engine/core/utils/logger.js +87 -0
  108. package/es/chat-engine/core/utils/logger.js.map +1 -0
  109. package/es/chat-engine/hooks/useAgentState.js +1 -1
  110. package/es/chat-engine/hooks/useAgentToolcall.js +1 -1
  111. package/es/chat-engine/hooks/useChat.js +1 -1
  112. package/es/chat-engine/index.js +1 -1
  113. package/es/chat-filecard/_example-js/base.d.ts +1 -0
  114. package/es/chat-filecard/index.js +1 -1
  115. package/es/chat-loading/_example-js/base.d.ts +2 -0
  116. package/es/chat-loading/_example-js/text.d.ts +2 -0
  117. package/es/chat-loading/index.js +1 -1
  118. package/es/chat-markdown/_example-js/base.d.ts +1 -0
  119. package/es/chat-markdown/_example-js/custom.d.ts +2 -0
  120. package/es/chat-markdown/_example-js/event.d.ts +1 -0
  121. package/es/chat-markdown/_example-js/footnote.d.ts +2 -0
  122. package/es/chat-markdown/_example-js/plugin.d.ts +2 -0
  123. package/es/chat-markdown/_example-js/theme.d.ts +2 -0
  124. package/es/chat-markdown/index.js +1 -1
  125. package/es/chat-message/_example-js/action.d.ts +1 -0
  126. package/es/chat-message/_example-js/base.d.ts +1 -0
  127. package/es/chat-message/_example-js/configure.d.ts +1 -0
  128. package/es/chat-message/_example-js/content.d.ts +1 -0
  129. package/es/chat-message/_example-js/custom.d.ts +1 -0
  130. package/es/chat-message/_example-js/handle-actions.d.ts +7 -0
  131. package/es/chat-message/_example-js/status.d.ts +1 -0
  132. package/es/chat-message/_example-js/think.d.ts +1 -0
  133. package/es/chat-message/index.js +1 -1
  134. package/es/chat-sender/_example-js/attachment.d.ts +2 -0
  135. package/es/chat-sender/_example-js/base.d.ts +2 -0
  136. package/es/chat-sender/_example-js/custom.d.ts +2 -0
  137. package/es/chat-sender/index.js +1 -1
  138. package/es/chat-thinking/_example-js/base.d.ts +1 -0
  139. package/es/chat-thinking/_example-js/style.d.ts +1 -0
  140. package/es/chat-thinking/index.js +1 -1
  141. package/es/chatbot/_example-js/agent.d.ts +1 -0
  142. package/es/chatbot/_example-js/agui.d.ts +13 -0
  143. package/es/chatbot/_example-js/backup/travel.d.ts +1 -0
  144. package/es/chatbot/_example-js/basic.d.ts +1 -0
  145. package/es/chatbot/_example-js/code.d.ts +1 -0
  146. package/es/chatbot/_example-js/components/ItineraryCard.d.ts +3 -0
  147. package/es/chatbot/_example-js/components/login.d.ts +1 -0
  148. package/es/chatbot/_example-js/comprehensive.d.ts +1 -0
  149. package/es/chatbot/_example-js/custom-content.d.ts +1 -0
  150. package/es/chatbot/_example-js/custom-merge.d.ts +1 -0
  151. package/es/chatbot/_example-js/custom.d.ts +1 -0
  152. package/es/chatbot/_example-js/docs.d.ts +1 -0
  153. package/es/chatbot/_example-js/image.d.ts +1 -0
  154. package/es/chatbot/_example-js/initial-messages.d.ts +9 -0
  155. package/es/chatbot/_example-js/instance-methods.d.ts +14 -0
  156. package/es/chatbot/_example-js/nostream.d.ts +1 -0
  157. package/es/chatbot/_example-js/quick-start.d.ts +9 -0
  158. package/es/chatbot/_example-js/research.d.ts +1 -0
  159. package/es/chatbot/_example-js/role-message-config.d.ts +22 -0
  160. package/es/chatbot/_example-js/sender-config.d.ts +20 -0
  161. package/es/chatbot/_example-js/service-config.d.ts +17 -0
  162. package/es/chatbot/_example-js/simple.d.ts +1 -0
  163. package/es/chatbot/_example-js/utils/messageRenderer.d.ts +5 -0
  164. package/es/chatbot/index.js +1 -1
  165. package/es/index.d.ts +0 -1
  166. package/es/index.js +1 -1
  167. package/es/style/index.js +1 -1
  168. package/package.json +4 -6
@@ -0,0 +1,1394 @@
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
+ toolCallName?: string;
205
+ timestamp?: number;
206
+ toolCallId?: string;
207
+ rawEvent?: any;
208
+ parentMessageId?: string;
209
+ }, {
210
+ type?: EventType.TOOL_CALL_START;
211
+ toolCallName?: string;
212
+ timestamp?: number;
213
+ toolCallId?: string;
214
+ rawEvent?: any;
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
+ toolCallName?: string;
269
+ timestamp?: number;
270
+ toolCallId?: string;
271
+ rawEvent?: any;
272
+ messageId?: string;
273
+ }, {
274
+ type?: EventType.TOOL_CALL_RESULT;
275
+ content?: string;
276
+ role?: "tool";
277
+ toolCallName?: string;
278
+ timestamp?: number;
279
+ toolCallId?: string;
280
+ rawEvent?: any;
281
+ messageId?: 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
+ toolCallName?: string;
295
+ timestamp?: number;
296
+ toolCallId?: string;
297
+ rawEvent?: any;
298
+ delta?: string;
299
+ parentMessageId?: string;
300
+ }, {
301
+ type?: EventType.TOOL_CALL_CHUNK;
302
+ toolCallName?: string;
303
+ timestamp?: number;
304
+ toolCallId?: string;
305
+ rawEvent?: any;
306
+ delta?: 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
+ content?: string;
391
+ name?: string;
392
+ role?: "developer";
393
+ id?: string;
394
+ timestamp?: number;
395
+ }, {
396
+ content?: string;
397
+ name?: 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
+ content?: string;
410
+ name?: string;
411
+ role?: "system";
412
+ id?: string;
413
+ timestamp?: number;
414
+ }, {
415
+ content?: string;
416
+ name?: 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
+ content?: string;
458
+ name?: 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
+ content?: string;
473
+ name?: 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
+ content?: string;
495
+ name?: string;
496
+ role?: "user";
497
+ id?: string;
498
+ timestamp?: number;
499
+ }, {
500
+ content?: string;
501
+ name?: 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
+ content?: string;
525
+ name?: string;
526
+ role?: "developer";
527
+ id?: string;
528
+ timestamp?: number;
529
+ } | {
530
+ content?: string;
531
+ name?: string;
532
+ role?: "system";
533
+ id?: string;
534
+ timestamp?: number;
535
+ } | {
536
+ content?: string;
537
+ name?: 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
+ content?: string;
552
+ name?: 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
+ content?: string;
568
+ name?: string;
569
+ role?: "developer";
570
+ id?: string;
571
+ timestamp?: number;
572
+ } | {
573
+ content?: string;
574
+ name?: string;
575
+ role?: "system";
576
+ id?: string;
577
+ timestamp?: number;
578
+ } | {
579
+ content?: string;
580
+ name?: 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
+ content?: string;
595
+ name?: 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
+ toolCallName?: string;
877
+ timestamp?: number;
878
+ toolCallId?: string;
879
+ rawEvent?: any;
880
+ parentMessageId?: string;
881
+ }, {
882
+ type?: EventType.TOOL_CALL_START;
883
+ toolCallName?: string;
884
+ timestamp?: number;
885
+ toolCallId?: string;
886
+ rawEvent?: any;
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
+ toolCallName?: string;
935
+ timestamp?: number;
936
+ toolCallId?: string;
937
+ rawEvent?: any;
938
+ delta?: string;
939
+ parentMessageId?: string;
940
+ }, {
941
+ type?: EventType.TOOL_CALL_CHUNK;
942
+ toolCallName?: string;
943
+ timestamp?: number;
944
+ toolCallId?: string;
945
+ rawEvent?: any;
946
+ delta?: 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
+ toolCallName?: string;
963
+ timestamp?: number;
964
+ toolCallId?: string;
965
+ rawEvent?: any;
966
+ messageId?: string;
967
+ }, {
968
+ type?: EventType.TOOL_CALL_RESULT;
969
+ content?: string;
970
+ role?: "tool";
971
+ toolCallName?: string;
972
+ timestamp?: number;
973
+ toolCallId?: string;
974
+ rawEvent?: any;
975
+ messageId?: 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
+ content?: string;
1022
+ name?: string;
1023
+ role?: "developer";
1024
+ id?: string;
1025
+ timestamp?: number;
1026
+ }, {
1027
+ content?: string;
1028
+ name?: 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
+ content?: string;
1041
+ name?: string;
1042
+ role?: "system";
1043
+ id?: string;
1044
+ timestamp?: number;
1045
+ }, {
1046
+ content?: string;
1047
+ name?: 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
+ content?: string;
1089
+ name?: 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
+ content?: string;
1104
+ name?: 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
+ content?: string;
1126
+ name?: string;
1127
+ role?: "user";
1128
+ id?: string;
1129
+ timestamp?: number;
1130
+ }, {
1131
+ content?: string;
1132
+ name?: 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
+ content?: string;
1156
+ name?: string;
1157
+ role?: "developer";
1158
+ id?: string;
1159
+ timestamp?: number;
1160
+ } | {
1161
+ content?: string;
1162
+ name?: string;
1163
+ role?: "system";
1164
+ id?: string;
1165
+ timestamp?: number;
1166
+ } | {
1167
+ content?: string;
1168
+ name?: 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
+ content?: string;
1183
+ name?: 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
+ content?: string;
1199
+ name?: string;
1200
+ role?: "developer";
1201
+ id?: string;
1202
+ timestamp?: number;
1203
+ } | {
1204
+ content?: string;
1205
+ name?: string;
1206
+ role?: "system";
1207
+ id?: string;
1208
+ timestamp?: number;
1209
+ } | {
1210
+ content?: string;
1211
+ name?: 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
+ content?: string;
1226
+ name?: 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 {};