Commit ff45062
committed
refactor: remove _tag wrapper and fix type safety in streaming events
- Import proper OpenResponsesStreamEvent type instead of using any
- Remove _tag wrapper from getFullResponsesStream events
- Emit events directly with clean discriminated union on type field
- Add ToolPreliminaryResultEvent type for generator tool results
- Add isToolPreliminaryResultEvent type guard helper
- Update tests to use clean API without internal _tag field
- Export new type and helper from main index
This provides a cleaner API surface without exposing internal
implementation details like _tag, while maintaining full type safety.1 parent 4817480 commit ff45062
File tree
4 files changed
+35
-25
lines changed- src
- lib
- tests/e2e
4 files changed
+35
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | 354 | | |
356 | 355 | | |
357 | 356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
213 | 224 | | |
214 | 225 | | |
215 | 226 | | |
216 | 227 | | |
217 | 228 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
226 | 240 | | |
227 | 241 | | |
228 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 315 | + | |
| 316 | + | |
321 | 317 | | |
322 | 318 | | |
323 | 319 | | |
324 | | - | |
325 | | - | |
| 320 | + | |
| 321 | + | |
326 | 322 | | |
327 | 323 | | |
328 | 324 | | |
| |||
340 | 336 | | |
341 | 337 | | |
342 | 338 | | |
343 | | - | |
344 | | - | |
345 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
346 | 342 | | |
347 | 343 | | |
348 | 344 | | |
| |||
0 commit comments