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

Function toShellToolResult

packages/react/src/api/shell-host.ts:75–81  ·  view source on GitHub ↗
(response: ExecutionResponse)

Source from the content-addressed store, hash-verified

73 * throws inside the generated component instead of handing it a bogus value.
74 */
75const toShellToolResult = (response: ExecutionResponse): ShellToolResult => ({
76 content: [{ type: "text", text: response.text }],
77 structuredContent: isRecord(response.structured)
78 ? response.structured
79 : { result: response.structured },
80 isError: response.status === "completed" && response.isError ? true : undefined,
81});
82
83/** The resume action the shell sends back after the user answers the modal. */
84const isResumeAction = (value: unknown): value is "accept" | "decline" | "cancel" =>

Callers 1

createHttpShellHostFunction · 0.85

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected