( input: unknown, )
| 189 | type VALID_INTERRUPT_TYPES = "approval" | "general"; |
| 190 | |
| 191 | export const extractInterrupt = ( |
| 192 | input: unknown, |
| 193 | ): z.infer<typeof interruptSchema> | undefined => { |
| 194 | if (input && typeof input === "object" && INTERRUPT_KEY in input) { |
| 195 | const parsedInterrupt = interruptSchema.safeParse(input[INTERRUPT_KEY]); |
| 196 | |
| 197 | if (!parsedInterrupt.success) { |
| 198 | throw new AgentRPCError("Found invalid Interrupt data"); |
| 199 | } |
| 200 | |
| 201 | return parsedInterrupt.data; |
| 202 | } |
| 203 | }; |
| 204 | |
| 205 | export class Interrupt { |
| 206 | [INTERRUPT_KEY]: z.infer<typeof interruptSchema>; |
no outgoing calls
no test coverage detected