@opencode-ai/protocol 0.0.0-next-14854 → 0.0.0-reserved.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +3 -0
  2. package/index.js +1 -0
  3. package/package.json +3 -23
  4. package/dist/api.d.ts +0 -49
  5. package/dist/api.js +0 -65
  6. package/dist/client.d.ts +0 -75
  7. package/dist/client.js +0 -61
  8. package/dist/errors.d.ts +0 -127
  9. package/dist/errors.js +0 -99
  10. package/dist/groups/agent.d.ts +0 -95
  11. package/dist/groups/agent.js +0 -15
  12. package/dist/groups/command.d.ts +0 -51
  13. package/dist/groups/command.js +0 -20
  14. package/dist/groups/credential.d.ts +0 -23
  15. package/dist/groups/credential.js +0 -28
  16. package/dist/groups/event.d.ts +0 -17224
  17. package/dist/groups/event.js +0 -49
  18. package/dist/groups/form.d.ts +0 -789
  19. package/dist/groups/form.js +0 -99
  20. package/dist/groups/fs.d.ts +0 -35
  21. package/dist/groups/fs.js +0 -51
  22. package/dist/groups/generate.d.ts +0 -32
  23. package/dist/groups/generate.js +0 -27
  24. package/dist/groups/health.d.ts +0 -5
  25. package/dist/groups/health.js +0 -9
  26. package/dist/groups/integration.d.ts +0 -105
  27. package/dist/groups/integration.js +0 -98
  28. package/dist/groups/location.d.ts +0 -16
  29. package/dist/groups/location.js +0 -32
  30. package/dist/groups/mcp.d.ts +0 -30
  31. package/dist/groups/mcp.js +0 -17
  32. package/dist/groups/message.d.ts +0 -446
  33. package/dist/groups/message.js +0 -42
  34. package/dist/groups/model.d.ts +0 -312
  35. package/dist/groups/model.js +0 -33
  36. package/dist/groups/permission.d.ts +0 -153
  37. package/dist/groups/permission.js +0 -99
  38. package/dist/groups/plugin.d.ts +0 -14
  39. package/dist/groups/plugin.js +0 -20
  40. package/dist/groups/project-copy.d.ts +0 -49
  41. package/dist/groups/project-copy.js +0 -44
  42. package/dist/groups/project.d.ts +0 -24
  43. package/dist/groups/project.js +0 -30
  44. package/dist/groups/provider.d.ts +0 -164
  45. package/dist/groups/provider.js +0 -34
  46. package/dist/groups/pty.d.ts +0 -145
  47. package/dist/groups/pty.js +0 -111
  48. package/dist/groups/question.d.ts +0 -92
  49. package/dist/groups/question.js +0 -56
  50. package/dist/groups/reference.d.ts +0 -13
  51. package/dist/groups/reference.js +0 -20
  52. package/dist/groups/session.d.ts +0 -5457
  53. package/dist/groups/session.js +0 -423
  54. package/dist/groups/shell.d.ts +0 -120
  55. package/dist/groups/shell.js +0 -65
  56. package/dist/groups/skill.d.ts +0 -19
  57. package/dist/groups/skill.js +0 -20
  58. package/dist/groups/vcs.d.ts +0 -33
  59. package/dist/groups/vcs.js +0 -37
  60. package/dist/middleware/authorization.d.ts +0 -13
  61. package/dist/middleware/authorization.js +0 -6
  62. package/dist/middleware/schema-error.d.ts +0 -13
  63. package/dist/middleware/schema-error.js +0 -4
@@ -1,49 +0,0 @@
1
- import { Event } from "@opencode-ai/schema/event";
2
- import { EventLog } from "@opencode-ai/schema/event-log";
3
- import { EventManifest } from "@opencode-ai/schema/event-manifest";
4
- import { Location } from "@opencode-ai/schema/location";
5
- import { Schema } from "effect";
6
- import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
7
- const fields = {
8
- id: Event.ID,
9
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
10
- location: Schema.optional(Location.Ref),
11
- };
12
- const schema = (definitions) => Schema.Union([
13
- ...definitions,
14
- ...(definitions.some((definition) => definition.type === "server.connected")
15
- ? []
16
- : [
17
- Schema.Struct({
18
- ...fields,
19
- type: Schema.Literal("server.connected"),
20
- data: Schema.Struct({}),
21
- }).annotate({ identifier: "V2Event.server.connected" }),
22
- ]),
23
- ]).annotate({ identifier: "V2Event" });
24
- const make = (definitions) => {
25
- const EventSchema = schema(definitions);
26
- return {
27
- schema: EventSchema,
28
- group: HttpApiGroup.make("server.event")
29
- .add(HttpApiEndpoint.get("event.subscribe", "/api/event", {
30
- success: HttpApiSchema.StreamSse({ data: EventSchema }),
31
- }).annotateMerge(OpenApi.annotations({
32
- identifier: "v2.event.subscribe",
33
- summary: "Subscribe to events",
34
- description: "Subscribe to native event payloads for the server. Volatile by contract: a slow consumer overflows and fails the stream, and events during disconnection are missed. Consumers that need reliability should combine the changes feed with durable session log reads.",
35
- })))
36
- .add(HttpApiEndpoint.get("event.changes", "/api/event/changes", {
37
- success: HttpApiSchema.StreamSse({ data: EventLog.Change }),
38
- }).annotateMerge(OpenApi.annotations({
39
- identifier: "v2.event.changes",
40
- summary: "Subscribe to change hints",
41
- description: "Payload-free hint channel: after an event commits, a subscriber eventually receives a hint for that aggregate with seq at or beyond the event, or a sweep-required marker. Hints coalesce to the latest seq per aggregate under backpressure and the stream never fails from overflow. No consumer may derive correctness from receiving a hint; correctness always comes from durable log reads plus the consumer's own checkpoint. A sweep-required marker is emitted first on every (re)subscribe and whenever hint retention is exceeded: treat every aggregate as potentially dirty and recover via bounded sweep plus log reads.",
42
- })))
43
- .annotateMerge(OpenApi.annotations({ title: "events", description: "Experimental event stream routes." })),
44
- };
45
- };
46
- export const makeEventGroup = (definitions) => make(definitions).group;
47
- const event = make(EventManifest.ServerDefinitions);
48
- export const EventGroup = event.group;
49
- export const OpenCodeEvent = event.schema;