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

Function executeJson

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

Source from the content-addressed store, hash-verified

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. */
92const 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.

Callers 2

runScenarioFunction · 0.70

Calls 1

callMethod · 0.80

Tested by

no test coverage detected