MCPcopy Create free account
hub / github.com/anomalyco/opencode / createEventSource

Function createEventSource

packages/opencode/src/cli/cmd/tui.ts:42–50  ·  view source on GitHub ↗
(client: RpcClient)

Source from the content-addressed store, hash-verified

40}
41
42function createEventSource(client: RpcClient): EventSource {
43 return {
44 subscribe: async (handler) => {
45 return client.on<GlobalEvent>("global.event", (e) => {
46 handler(e)
47 })
48 },
49 }
50}
51
52async function target() {
53 if (typeof OPENCODE_WORKER_PATH !== "undefined") return OPENCODE_WORKER_PATH

Callers 1

tui.tsFile · 0.70

Calls 2

onMethod · 0.80
handlerFunction · 0.70

Tested by

no test coverage detected