(body: string)
| 67 | } |
| 68 | |
| 69 | function parseCallResponse(body: string): CallHandlerResponse { |
| 70 | const parsed: unknown = JSON.parse(body) |
| 71 | if ( |
| 72 | typeof parsed !== 'object' || |
| 73 | parsed === null || |
| 74 | !('ok' in parsed) || |
| 75 | typeof parsed.ok !== 'boolean' |
| 76 | ) { |
| 77 | throw new Error(`expected a { ok: boolean } response, got: ${body}`) |
| 78 | } |
| 79 | return parsed |
| 80 | } |
| 81 | |
| 82 | test.describe('mcp-apps — data + interactive planes', () => { |
| 83 | test('STATIC: a ui-linked MCP tool emits a ui-resource part over the stream', async ({ |