(structured: unknown)
| 134 | }; |
| 135 | |
| 136 | const 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 | |
| 155 | const readResultArray = (structured: unknown): ReadonlyArray<unknown> => { |
| 156 | const record = readStructuredRecord(structured); |
no test coverage detected