MCPcopy Index your code
hub / github.com/anomalyco/opencode / pull

Function pull

packages/opencode/src/plugin/snowflake-cortex.ts:421–429  ·  view source on GitHub ↗
(ctrl)

Source from the content-addressed store, hash-verified

419 const decoder = new TextDecoder()
420 const stream = new ReadableStream({
421 async pull(ctrl) {
422 const { done, value } = await reader.read()
423 if (done) {
424 ctrl.close()
425 return
426 }
427 const text = decoder.decode(value, { stream: true })
428 ctrl.enqueue(encoder.encode(text.replace(/"role"\s*:\s*""/g, '"role":"assistant"')))
429 },
430 cancel() {
431 reader.cancel()
432 },

Callers

nothing calls this directly

Calls 2

readMethod · 0.65
closeMethod · 0.45

Tested by

no test coverage detected