MCPcopy
hub / github.com/anomalyco/opencode / pull

Function pull

packages/core/src/plugin/provider/snowflake-cortex.ts:46–55  ·  view source on GitHub ↗
(ctrl)

Source from the content-addressed store, hash-verified

44 const decoder = new TextDecoder()
45 const stream = new ReadableStream({
46 async pull(ctrl) {
47 const { done, value } = await reader.read()
48 if (done) {
49 ctrl.close()
50 return
51 }
52 ctrl.enqueue(
53 encoder.encode(decoder.decode(value, { stream: true }).replace(/"role"\s*:\s*""/g, '"role":"assistant"')),
54 )
55 },
56 cancel() {
57 reader.cancel()
58 },

Callers

nothing calls this directly

Calls 2

readMethod · 0.65
closeMethod · 0.45

Tested by

no test coverage detected