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

Function writeJsonResult

packages/plugins/mcp/src/sdk/codex-repl.ts:51–58  ·  view source on GitHub ↗
(body: readonly string[], expression: string)

Source from the content-addressed store, hash-verified

49 * well-formed JSON body rather than an empty string.
50 */
51export const writeJsonResult = (body: readonly string[], expression: string): string =>
52 [
53 "await (async () => {",
54 ...body.map((line) => ` ${line}`),
55 ` const result = ${expression};`,
56 " nodeRepl.write(JSON.stringify(result ?? null));",
57 "})();",
58 ].join("\n");

Callers 3

codex-repl.test.tsFile · 0.90
skyCallProgramFunction · 0.90
browserCallProgramFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected