MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / onMessage

Function onMessage

apps/cli/src/commands/cli/list.ts:166–182  ·  view source on GitHub ↗
(message: unknown)

Source from the content-addressed store, hash-verified

164 }
165
166 const onMessage = (message: unknown) => {
167 if (!isRecord(message)) {
168 return
169 }
170
171 let result: T | undefined
172 try {
173 result = extract(message)
174 } catch (error) {
175 finish(() => reject(error instanceof Error ? error : new Error(String(error))))
176 return
177 }
178
179 if (result !== undefined) {
180 finish(() => resolve(result))
181 }
182 }
183
184 const offError = host.client.on("error", (error) => {
185 finish(() => reject(error))

Callers

nothing calls this directly

Calls 3

finishFunction · 0.85
isRecordFunction · 0.50
StringInterface · 0.50

Tested by

no test coverage detected