* Build the error to throw for a stream-terminal ERROR frame: the typed PIN * exception for a PIN-gate verdict, else the generic AgentStreamError.
(code: string, message: string)
| 50 | async *[Symbol.asyncIterator](): AsyncIterator<AskFrame> { |
| 51 | if (this.#consumed) throw new Error("an AskStream can only be consumed once"); |
| 52 | this.#consumed = true; |
| 53 | const iterator = this.source.envelopes(); |
| 54 | for (;;) { |
| 55 | const result = await withTimeout(iterator.next(), this.timeoutMs); |
| 56 | if (result.done) return; |
| 57 | const env = result.value; |
| 58 | if (env.kind === Envelope_Kind.EVENT && env.payload.case === "askEvent") { |
| 59 | let payload: unknown = env.payload.value.payloadJson; |
| 60 | try { |
no test coverage detected