( session: RenderSession, )
| 25 | type RenderSession = ReturnType<typeof createRenderSession>; |
| 26 | |
| 27 | function buildStructuredContent( |
| 28 | session: RenderSession, |
| 29 | ): StructuredOutputEnvelope<unknown> | undefined { |
| 30 | const structuredOutput = session.getStructuredOutput?.(); |
| 31 | if (!structuredOutput) { |
| 32 | return undefined; |
| 33 | } |
| 34 | |
| 35 | return toStructuredEnvelope( |
| 36 | structuredOutput.result, |
| 37 | structuredOutput.schema, |
| 38 | structuredOutput.schemaVersion, |
| 39 | { |
| 40 | nextSteps: session.getNextSteps?.(), |
| 41 | nextStepRuntime: 'mcp', |
| 42 | outputStyle: 'minimal', |
| 43 | }, |
| 44 | ); |
| 45 | } |
| 46 | |
| 47 | function sessionToToolResponse(session: RenderSession): ToolResponse { |
| 48 | const text = session.finalize(); |
no test coverage detected