MCPcopy Index your code
hub / github.com/TanStack/ai / collect

Function collect

packages/ai-opencode/tests/translate.test.ts:32–41  ·  view source on GitHub ↗
(
  events: Array<OpencodeStreamEvent>,
  ctx: TranslateContext = makeCtx(),
)

Source from the content-addressed store, hash-verified

30}
31
32async function collect(
33 events: Array<OpencodeStreamEvent>,
34 ctx: TranslateContext = makeCtx(),
35): Promise<Array<StreamChunk>> {
36 const chunks: Array<StreamChunk> = []
37 for await (const chunk of translateOpencodeStream(fromArray(events), ctx)) {
38 chunks.push(chunk)
39 }
40 return chunks
41}
42
43const session: OpencodeStreamEvent = { kind: 'session', sessionId: 'sess-1' }
44

Callers 1

translate.test.tsFile · 0.70

Calls 4

translateOpencodeStreamFunction · 0.90
makeCtxFunction · 0.70
fromArrayFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected