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

Function schema

packages/protocol/src/groups/event.ts:15–27  ·  view source on GitHub ↗
(definitions: Definitions)

Source from the content-addressed store, hash-verified

13}
14
15const schema = <const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions) =>
16 Schema.Union([
17 ...definitions,
18 ...(definitions.some((definition) => definition.type === "server.connected")
19 ? []
20 : [
21 Schema.Struct({
22 ...fields,
23 type: Schema.Literal("server.connected"),
24 data: Schema.Struct({}),
25 }).annotate({ identifier: "V2Event.server.connected" }),
26 ]),
27 ]).annotate({ identifier: "V2Event" })
28
29const make = <const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions) => {
30 const EventSchema = schema(definitions)

Callers 1

makeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected