MCPcopy
hub / github.com/simstudioai/sim / start

Function start

apps/sim/app/api/chat/[identifier]/route.test.ts:52–63  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

50const createMockStream = () => {
51 return new ReadableStream({
52 start(controller) {
53 controller.enqueue(
54 new TextEncoder().encode('data: {"blockId":"agent-1","chunk":"Hello"}\n\n')
55 )
56 controller.enqueue(
57 new TextEncoder().encode('data: {"blockId":"agent-1","chunk":" world"}\n\n')
58 )
59 controller.enqueue(
60 new TextEncoder().encode('data: {"event":"final","data":{"success":true}}\n\n')
61 )
62 controller.close()
63 },
64 })
65}
66

Callers

nothing calls this directly

Calls 2

enqueueMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected