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

Function make

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

Source from the content-addressed store, hash-verified

27 ]).annotate({ identifier: "V2Event" })
28
29const make = <const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions) => {
30 const EventSchema = schema(definitions)
31 return {
32 schema: EventSchema,
33 group: HttpApiGroup.make("server.event")
34 .add(
35 HttpApiEndpoint.get("event.subscribe", "/api/event", {
36 success: HttpApiSchema.StreamSse({ data: EventSchema }),
37 }).annotateMerge(
38 OpenApi.annotations({
39 identifier: "v2.event.subscribe",
40 summary: "Subscribe to events",
41 description: "Subscribe to native event payloads for the server.",
42 }),
43 ),
44 )
45 .annotateMerge(OpenApi.annotations({ title: "events", description: "Experimental event stream route." })),
46 }
47}
48
49export const makeEventGroup = <const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions) =>
50 make(definitions).group

Callers 3

session.tsFile · 0.70
makeEventGroupFunction · 0.70
event.tsFile · 0.70

Calls 4

schemaFunction · 0.70
addMethod · 0.65
getMethod · 0.65
makeMethod · 0.45

Tested by

no test coverage detected