MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / executeJson

Function executeJson

e2e/scenarios/connect-handoff.test.ts:93–103  ·  view source on GitHub ↗
(session: McpSession, code: string)

Source from the content-addressed store, hash-verified

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

Callers 2

runScenarioFunction · 0.70

Calls 1

callMethod · 0.80

Tested by

no test coverage detected