(session: McpSession, code: string)
| 90 | /** Run `execute`, auto-approving any paused executions (approval-gated tools |
| 91 | * pause once per gated call) and parse the sandbox's JSON return value. */ |
| 92 | const executeJson = (session: McpSession, code: string) => |
| 93 | Effect.gen(function* () { |
| 94 | let result = yield* session.call("execute", { code }); |
| 95 | let guard = 0; |
| 96 | while (result.text.includes("executionId:") && guard < 10) { |
| 97 | result = yield* session.approvePaused(result.text); |
| 98 | guard += 1; |
| 99 | } |
| 100 | expect(result.ok, `execute completed (got: ${result.text.slice(0, 400)})`).toBe(true); |
| 101 | return JSON.parse(result.text) as Record<string, unknown>; |
| 102 | }); |
| 103 | |
| 104 | // The typed control-plane client — minting and ledger reads with real shapes |
| 105 | // instead of hand-rolled fetch + casts, against this scenario's own instance. |
no test coverage detected