@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.
- package/README.md +3 -0
- package/index.js +1 -0
- package/package.json +3 -23
- package/dist/api.d.ts +0 -49
- package/dist/api.js +0 -65
- package/dist/client.d.ts +0 -75
- package/dist/client.js +0 -61
- package/dist/errors.d.ts +0 -127
- package/dist/errors.js +0 -99
- package/dist/groups/agent.d.ts +0 -95
- package/dist/groups/agent.js +0 -15
- package/dist/groups/command.d.ts +0 -51
- package/dist/groups/command.js +0 -20
- package/dist/groups/credential.d.ts +0 -23
- package/dist/groups/credential.js +0 -28
- package/dist/groups/event.d.ts +0 -17224
- package/dist/groups/event.js +0 -49
- package/dist/groups/form.d.ts +0 -789
- package/dist/groups/form.js +0 -99
- package/dist/groups/fs.d.ts +0 -35
- package/dist/groups/fs.js +0 -51
- package/dist/groups/generate.d.ts +0 -32
- package/dist/groups/generate.js +0 -27
- package/dist/groups/health.d.ts +0 -5
- package/dist/groups/health.js +0 -9
- package/dist/groups/integration.d.ts +0 -105
- package/dist/groups/integration.js +0 -98
- package/dist/groups/location.d.ts +0 -16
- package/dist/groups/location.js +0 -32
- package/dist/groups/mcp.d.ts +0 -30
- package/dist/groups/mcp.js +0 -17
- package/dist/groups/message.d.ts +0 -446
- package/dist/groups/message.js +0 -42
- package/dist/groups/model.d.ts +0 -312
- package/dist/groups/model.js +0 -33
- package/dist/groups/permission.d.ts +0 -153
- package/dist/groups/permission.js +0 -99
- package/dist/groups/plugin.d.ts +0 -14
- package/dist/groups/plugin.js +0 -20
- package/dist/groups/project-copy.d.ts +0 -49
- package/dist/groups/project-copy.js +0 -44
- package/dist/groups/project.d.ts +0 -24
- package/dist/groups/project.js +0 -30
- package/dist/groups/provider.d.ts +0 -164
- package/dist/groups/provider.js +0 -34
- package/dist/groups/pty.d.ts +0 -145
- package/dist/groups/pty.js +0 -111
- package/dist/groups/question.d.ts +0 -92
- package/dist/groups/question.js +0 -56
- package/dist/groups/reference.d.ts +0 -13
- package/dist/groups/reference.js +0 -20
- package/dist/groups/session.d.ts +0 -5457
- package/dist/groups/session.js +0 -423
- package/dist/groups/shell.d.ts +0 -120
- package/dist/groups/shell.js +0 -65
- package/dist/groups/skill.d.ts +0 -19
- package/dist/groups/skill.js +0 -20
- package/dist/groups/vcs.d.ts +0 -33
- package/dist/groups/vcs.js +0 -37
- package/dist/middleware/authorization.d.ts +0 -13
- package/dist/middleware/authorization.js +0 -6
- package/dist/middleware/schema-error.d.ts +0 -13
- package/dist/middleware/schema-error.js +0 -4
package/dist/groups/event.js
DELETED
|
@@ -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;
|