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

Function readApproval

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

Source from the content-addressed store, hash-verified

149};
150
151const readApproval = (structured: unknown): { readonly executionId: string; readonly url: URL } => {
152 const record = readStructuredRecord(structured);
153 expect(record.status).toBe("user_approval_required");
154 expect(record).not.toHaveProperty("interaction");
155 expect(typeof record.executionId).toBe("string");
156 expect(typeof record.approvalUrl).toBe("string");
157 expect(record.resumePrompt).toBe(
158 "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.",
159 );
160 const { executionId, approvalUrl } = record as {
161 readonly executionId: string;
162 readonly approvalUrl: string;
163 };
164 return {
165 executionId,
166 url: new URL(approvalUrl),
167 };
168};
169
170const readResultArray = (structured: unknown): ReadonlyArray<unknown> => {
171 const record = readStructuredRecord(structured);

Callers 1

Calls 1

readStructuredRecordFunction · 0.85

Tested by

no test coverage detected