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

Function unwrapResult

packages/hosts/mcp-apps-shell/src/shell/proxy.ts:167–177  ·  view source on GitHub ↗

* Unwrap execution result. The kernel wraps results as * `{ status: "completed", result: , logs: [...] }`. * Return just the inner result value.

(structured: Record<string, unknown> | undefined | null)

Source from the content-addressed store, hash-verified

165 * Return just the inner result value.
166 */
167function unwrapResult(structured: Record<string, unknown> | undefined | null): unknown {
168 if (
169 structured &&
170 typeof structured === "object" &&
171 "status" in structured &&
172 "result" in structured
173 ) {
174 return structured.result;
175 }
176 return structured;
177}
178
179function parseTextContent(r: { content?: Array<{ type: string; text?: string }> }): unknown {
180 const text = r.content?.find((c) => c.type === "text")?.text;

Callers 1

resolveToolResultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected