mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-11 02:03:59 +08:00
pi-ai consumes every provider stream with `for await` over an EventStream whose `async *[Symbol.asyncIterator](): AsyncIterator<T>` is an async generator method; that was SC1070. The loop now opens the iterator with the method call and drives the returned async generator like any other (break and throw close it). An `async *` declaration annotated with the protocol interfaces (AsyncIterator, AsyncIterableIterator, AsyncIterable) maps like AsyncGenerator. Boxing a class instance whose fields hold a promise now links the dynamic async unit (the materializer boxes the promise), which EventStream's own `this.isComplete(event)` calls need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>