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

Function readApproval

apps/local/src/mcp-browser-resume.test.ts:136–153  ·  view source on GitHub ↗
(structured: unknown)

Source from the content-addressed store, hash-verified

134};
135
136const readApproval = (structured: unknown): { readonly executionId: string; readonly url: URL } => {
137 const record = readStructuredRecord(structured);
138 expect(record.status).toBe("user_approval_required");
139 expect(record).not.toHaveProperty("interaction");
140 expect(typeof record.executionId).toBe("string");
141 expect(typeof record.approvalUrl).toBe("string");
142 expect(record.resumePrompt).toBe(
143 "Return text to the user telling them to approve the action at this approvalUrl. Only after you have prompted the user, call the `resume` tool with this executionId; `resume` will wait for the user's browser decision.",
144 );
145 const { executionId, approvalUrl } = record as {
146 readonly executionId: string;
147 readonly approvalUrl: string;
148 };
149 return {
150 executionId,
151 url: new URL(approvalUrl),
152 };
153};
154
155const readResultArray = (structured: unknown): ReadonlyArray<unknown> => {
156 const record = readStructuredRecord(structured);

Callers 1

Calls 1

readStructuredRecordFunction · 0.85

Tested by

no test coverage detected