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

Function decodeEvent

packages/llm/src/route/client.ts:232–241  ·  view source on GitHub ↗
(route: string)

Source from the content-addressed store, hash-verified

230 const encodeBody = Schema.encodeSync(Schema.fromJsonString(protocol.body.schema))
231 const decodeEventEffect = Schema.decodeUnknownEffect(protocol.stream.event)
232 const decodeEvent = (route: string) => (frame: Frame) =>
233 decodeEventEffect(frame).pipe(
234 Effect.mapError(() =>
235 ProviderShared.eventError(
236 input.id,
237 `Invalid ${route} stream event`,
238 typeof frame === "string" ? frame : ProviderShared.encodeJson(frame),
239 ),
240 ),
241 )
242
243 type BuiltRouteInput = Omit<MakeTransportInput<Body, Prepared, Frame, Event, State>, "defaults"> & {
244 readonly defaults?: RouteDefaults

Callers 1

buildFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected