(messageId: string)
| 299 | // only /v1/reviews/{id}, which 403s an agent-scoped credential. For a pinned |
| 300 | // session this is one list call. |
| 301 | private async ownerOfPending(messageId: string): Promise<string> { |
| 302 | const addresses = this.agentEmail |
| 303 | ? [this.agentEmail] |
| 304 | : (await this.listAgents()).map((a) => a.email); |
| 305 | for (const address of addresses) { |
| 306 | const rows = await this.sdk.messages |
| 307 | .list(address, { direction: "outbound" }) |
| 308 | .toArray({ limit: DEFAULT_LIST_LIMIT }); |
| 309 | if (rows.some((r) => r.messageId === messageId)) return address; |
| 310 | } |
| 311 | throw new Error( |
| 312 | `pending message ${messageId} not found on any owned agent (it may have already been approved, rejected, or expired).`, |
| 313 | ); |
| 314 | } |
| 315 | |
| 316 | async getPendingMessage(messageId: string): Promise<MessageView> { |
| 317 | // Runtime-tier (agent-visible): use the agent-reachable messages path, not |
no test coverage detected