MCPcopy Create free account
hub / github.com/Effect-TS/effect / initialMessage

Function initialMessage

packages/effect/src/unstable/rpc/RpcWorker.ts:111–118  ·  view source on GitHub ↗
(
  schema: S
)

Source from the content-addressed store, hash-verified

109 * @since 4.0.0
110 */
111export const initialMessage = <S extends Schema.Constraint>(
112 schema: S
113): Effect.Effect<S["Type"], NoSuchElementError | Schema.SchemaError, Protocol | S["DecodingServices"]> =>
114 ProtocolTag.pipe(
115 Effect.flatMap((protocol) => protocol.initialMessage),
116 Effect.flatMap(Effect.fromOption),
117 Effect.flatMap(Schema.decodeUnknownEffect(Schema.toCodecJson(schema)))
118 )

Callers

nothing calls this directly

Calls 2

pipeMethod · 0.65
toCodecJsonMethod · 0.45

Tested by

no test coverage detected