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

Function executeJson

e2e/scenarios/no-auth-connection.test.ts:131–141  ·  view source on GitHub ↗
(session: McpSession, code: string)

Source from the content-addressed store, hash-verified

129/** Run `execute`, auto-approving any policy-paused execution, and parse the
130 * sandbox's JSON return value. */
131const executeJson = (session: McpSession, code: string) =>
132 Effect.gen(function* () {
133 let result = yield* session.call("execute", { code });
134 let guard = 0;
135 while (result.text.includes("executionId:") && guard < 10) {
136 result = yield* session.approvePaused(result.text);
137 guard += 1;
138 }
139 expect(result.ok, `execute completed (got: ${result.text.slice(0, 400)})`).toBe(true);
140 return JSON.parse(result.text) as Record<string, unknown>;
141 });
142
143scenario(
144 "Connections · an agent creates a no-auth connection over the core tool and the public API answers 200",

Callers 1

Calls 1

callMethod · 0.80

Tested by

no test coverage detected