(jobId: string, url: string)
| 37 | |
| 38 | // Helper to create video generation stream chunks |
| 39 | function createVideoChunks(jobId: string, url: string): Array<StreamChunk> { |
| 40 | return [ |
| 41 | { |
| 42 | type: EventType.RUN_STARTED, |
| 43 | runId: 'run-1', |
| 44 | threadId: 'thread-1', |
| 45 | timestamp: Date.now(), |
| 46 | }, |
| 47 | { |
| 48 | type: EventType.CUSTOM, |
| 49 | name: 'video:job:created', |
| 50 | value: { jobId }, |
| 51 | timestamp: Date.now(), |
| 52 | }, |
| 53 | { |
| 54 | type: EventType.CUSTOM, |
| 55 | name: 'video:status', |
| 56 | value: { jobId, status: 'processing', progress: 50 }, |
| 57 | timestamp: Date.now(), |
| 58 | }, |
| 59 | { |
| 60 | type: EventType.CUSTOM, |
| 61 | name: 'generation:result', |
| 62 | value: { jobId, status: 'completed', url }, |
| 63 | timestamp: Date.now(), |
| 64 | }, |
| 65 | { |
| 66 | type: EventType.RUN_FINISHED, |
| 67 | runId: 'run-1', |
| 68 | threadId: 'thread-1', |
| 69 | timestamp: Date.now(), |
| 70 | }, |
| 71 | ] |
| 72 | } |
| 73 | |
| 74 | // Helper to create error stream chunks. |
| 75 | // NOTE: The AG-UI spec for RUN_ERROR carries `message` directly on the event |
no test coverage detected