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

Function executeJson

e2e/scenarios/openapi-ndjson-output.test.ts:149–159  ·  view source on GitHub ↗
(session: McpSession, code: string)

Source from the content-addressed store, hash-verified

147/** Run `execute`, auto-approving any policy-paused execution, and parse the
148 * sandbox's JSON return value. */
149const executeJson = (session: McpSession, code: string) =>
150 Effect.gen(function* () {
151 let result = yield* session.call("execute", { code });
152 let guard = 0;
153 while (result.text.includes("executionId:") && guard < 10) {
154 result = yield* session.approvePaused(result.text);
155 guard += 1;
156 }
157 expect(result.ok, `execute completed (got: ${result.text.slice(0, 400)})`).toBe(true);
158 return JSON.parse(result.text) as Record<string, unknown>;
159 });
160
161scenario(
162 "OpenAPI · an NDJSON operation's advertised output type matches what invoking it returns",

Callers 1

Calls 1

callMethod · 0.80

Tested by

no test coverage detected