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

Function onMessage

packages/desktop/src/main/server.ts:106–117  ·  view source on GitHub ↗
(message: SidecarMessage)

Source from the content-addressed store, hash-verified

104 }
105
106 const onMessage = (message: SidecarMessage) => {
107 if (message.type === "ready") {
108 if (done) return
109 done = true
110 cleanup()
111 resolve()
112 return
113 }
114 if (message.type === "error") {
115 fail(Object.assign(new Error(message.error.message), { stack: message.error.stack }))
116 }
117 }
118 const onExit = (code: number) => {
119 fail(new Error(`Sidecar exited before ready with code ${code}`))
120 }

Callers

nothing calls this directly

Calls 3

cleanupFunction · 0.70
failFunction · 0.70
resolveFunction · 0.50

Tested by

no test coverage detected