(response: ExecutionResponse)
| 73 | * throws inside the generated component instead of handing it a bogus value. |
| 74 | */ |
| 75 | const 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. */ |
| 84 | const isResumeAction = (value: unknown): value is "accept" | "decline" | "cancel" => |
no test coverage detected