MCPcopy Create free account
hub / github.com/TanStack/ai / fromChunks

Function fromChunks

packages/ai-sandbox/tests/runner.test.ts:5–11  ·  view source on GitHub ↗
(chunks: Array<string>)

Source from the content-addressed store, hash-verified

3import type { SandboxHandle, SpawnHandle } from '../src/contracts'
4
5async function* fromChunks(chunks: Array<string>): AsyncIterable<string> {
6 for (const c of chunks) {
7 // Yield asynchronously to mimic real stream scheduling.
8 await Promise.resolve()
9 yield c
10 }
11}
12
13async function collect<T>(it: AsyncIterable<T>): Promise<Array<T>> {
14 const out: Array<T> = []

Callers 2

handleSpawningFunction · 0.70
runner.test.tsFile · 0.70

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected