| 168 | } |
| 169 | |
| 170 | function dispatchToolFixture(overrides: Partial<AIDevtoolsToolFixture> = {}) { |
| 171 | const fixture: AIDevtoolsToolFixture = { |
| 172 | hookId: 'chat-1', |
| 173 | threadId: 'thread-1', |
| 174 | runId: 'run-fixture', |
| 175 | toolName: 'weather', |
| 176 | input: { city: 'Paris' }, |
| 177 | output: { temperature: 21 }, |
| 178 | toolCallId: 'fixture-call', |
| 179 | messageId: 'fixture-message', |
| 180 | ...overrides, |
| 181 | } |
| 182 | |
| 183 | eventClientMock.dispatch('devtools:tool-fixture:apply', fixture) |
| 184 | return fixture |
| 185 | } |
| 186 | |
| 187 | function latestSnapshotMessages(): Array<UIMessage> { |
| 188 | const latestSnapshot = eventClientMock |