MCPcopy Create free account
hub / github.com/agentrpc/agentrpc / extractInterrupt

Function extractInterrupt

sdk-node/src/util.ts:191–203  ·  view source on GitHub ↗
(
  input: unknown,
)

Source from the content-addressed store, hash-verified

189type VALID_INTERRUPT_TYPES = "approval" | "general";
190
191export 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
205export class Interrupt {
206 [INTERRUPT_KEY]: z.infer<typeof interruptSchema>;

Callers 2

executeFnFunction · 0.90
util.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected