(logic: () => Promise<T>)
| 83 | } |
| 84 | |
| 85 | export async function runToolLogic<T>(logic: () => Promise<T>): Promise<{ |
| 86 | response: T; |
| 87 | result: MockToolHandlerResult; |
| 88 | }> { |
| 89 | const { result, run } = createMockToolHandlerContext(); |
| 90 | const response = await run(logic); |
| 91 | return { response, result }; |
| 92 | } |
| 93 | |
| 94 | export interface RunLogicResult { |
| 95 | content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; |