@opencode/protocol 2.1.3 → 2.2.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 (44) hide show
  1. package/dist/api.d.ts +6 -4
  2. package/dist/api.js +7 -5
  3. package/dist/client.d.ts +1 -0
  4. package/dist/client.js +16 -2
  5. package/dist/errors.d.ts +32 -0
  6. package/dist/errors.js +35 -0
  7. package/dist/groups/agent.d.ts +12 -2
  8. package/dist/groups/agent.js +2 -1
  9. package/dist/groups/debug.d.ts +14 -1
  10. package/dist/groups/debug.js +26 -0
  11. package/dist/groups/event.d.ts +1235 -1467
  12. package/dist/groups/event.js +9 -0
  13. package/dist/groups/experimental.d.ts +238 -0
  14. package/dist/groups/experimental.js +4 -0
  15. package/dist/groups/fs.d.ts +15 -3
  16. package/dist/groups/fs.js +27 -1
  17. package/dist/groups/generate.d.ts +194 -3
  18. package/dist/groups/generate.js +41 -5
  19. package/dist/groups/mcp.d.ts +49 -25
  20. package/dist/groups/mcp.js +40 -4
  21. package/dist/groups/media.d.ts +8 -0
  22. package/dist/groups/media.js +18 -0
  23. package/dist/groups/message.d.ts +2266 -27
  24. package/dist/groups/message.js +29 -4
  25. package/dist/groups/model.d.ts +47 -0
  26. package/dist/groups/model.js +8 -2
  27. package/dist/groups/permission.d.ts +6 -13
  28. package/dist/groups/permission.js +4 -3
  29. package/dist/groups/persistent-pty.d.ts +0 -8
  30. package/dist/groups/plugin.d.ts +18 -2
  31. package/dist/groups/plugin.js +15 -1
  32. package/dist/groups/provider.d.ts +24 -0
  33. package/dist/groups/pty.d.ts +33 -33
  34. package/dist/groups/server.d.ts +2 -0
  35. package/dist/groups/server.js +2 -0
  36. package/dist/groups/session.d.ts +609 -551
  37. package/dist/groups/session.js +18 -34
  38. package/dist/groups/usage.d.ts +95 -0
  39. package/dist/groups/usage.js +22 -0
  40. package/dist/groups/vcs.d.ts +2 -0
  41. package/dist/groups/vcs.js +1 -0
  42. package/dist/groups/voice.d.ts +2 -18
  43. package/dist/groups/voice.js +3 -19
  44. package/package.json +6 -4
@@ -6,26 +6,7 @@ export declare const PTY_CONNECT_TOKEN_HEADER = "x-opencode-ticket";
6
6
  export declare const PTY_CONNECT_TOKEN_HEADER_VALUE = "1";
7
7
  export declare const PTY_CONNECT_PATH = "/api/pty/:ptyID/connect";
8
8
  export declare function hasPtyConnectTicketURL(url: URL): boolean;
9
- export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId, LocationService>(locationMiddleware: Context.Key<LocationId, LocationService>) => HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEndpoint.HttpApiEndpoint<"pty.connectToken", "POST", "/api/pty/:ptyID/connect-token", Schema.toCodecStringTree<Schema.Struct<{
10
- ptyID: Schema.brand<Schema.String, "PtyID"> & {
11
- create: () => string & import("effect/Brand").Brand<"PtyID">;
12
- ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
13
- };
14
- }>>, Schema.toCodecStringTree<Schema.Struct<{
15
- readonly location: Schema.optional<Schema.Struct<{
16
- readonly directory: Schema.optional<Schema.String>;
17
- }>>;
18
- }>>, never, Schema.toCodecStringTree<Schema.Struct<{
19
- readonly "x-opencode-ticket": Schema.optional<Schema.String>;
20
- }>>, Schema.toCodecJson<Schema.Struct<{
21
- readonly location: Schema.Struct<{
22
- readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
23
- }>;
24
- readonly data: Schema.Struct<{
25
- readonly ticket: Schema.String;
26
- readonly expires_in: Schema.Int;
27
- }>;
28
- }>>, Schema.toCodecJson<typeof ForbiddenError | typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.create", "POST", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
9
+ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId, LocationService>(locationMiddleware: Context.Key<LocationId, LocationService>) => HttpApiGroup.HttpApiGroup<"server.pty", HttpApiEndpoint.HttpApiEndpoint<"pty.create", "POST", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
29
10
  readonly location: Schema.optional<Schema.Struct<{
30
11
  readonly directory: Schema.optional<Schema.String>;
31
12
  }>>;
@@ -52,12 +33,7 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
52
33
  readonly pid: Schema.Int;
53
34
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
54
35
  }>;
55
- }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.get", "GET", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
56
- ptyID: Schema.brand<Schema.String, "PtyID"> & {
57
- create: () => string & import("effect/Brand").Brand<"PtyID">;
58
- ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
59
- };
60
- }>>, Schema.toCodecStringTree<Schema.Struct<{
36
+ }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.list", "GET", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
61
37
  readonly location: Schema.optional<Schema.Struct<{
62
38
  readonly directory: Schema.optional<Schema.String>;
63
39
  }>>;
@@ -65,7 +41,7 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
65
41
  readonly location: Schema.Struct<{
66
42
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
67
43
  }>;
68
- readonly data: Schema.Struct<{
44
+ readonly data: Schema.$Array<Schema.Struct<{
69
45
  readonly id: Schema.brand<Schema.String, "PtyID"> & {
70
46
  create: () => string & import("effect/Brand").Brand<"PtyID">;
71
47
  ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
@@ -77,8 +53,13 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
77
53
  readonly status: Schema.Literals<readonly ["running", "exited"]>;
78
54
  readonly pid: Schema.Int;
79
55
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
80
- }>;
81
- }>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.list", "GET", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
56
+ }>>;
57
+ }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.get", "GET", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
58
+ ptyID: Schema.brand<Schema.String, "PtyID"> & {
59
+ create: () => string & import("effect/Brand").Brand<"PtyID">;
60
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
61
+ };
62
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
82
63
  readonly location: Schema.optional<Schema.Struct<{
83
64
  readonly directory: Schema.optional<Schema.String>;
84
65
  }>>;
@@ -86,7 +67,7 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
86
67
  readonly location: Schema.Struct<{
87
68
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
88
69
  }>;
89
- readonly data: Schema.$Array<Schema.Struct<{
70
+ readonly data: Schema.Struct<{
90
71
  readonly id: Schema.brand<Schema.String, "PtyID"> & {
91
72
  create: () => string & import("effect/Brand").Brand<"PtyID">;
92
73
  ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
@@ -98,8 +79,8 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
98
79
  readonly status: Schema.Literals<readonly ["running", "exited"]>;
99
80
  readonly pid: Schema.Int;
100
81
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
101
- }>>;
102
- }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.remove", "DELETE", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
82
+ }>;
83
+ }>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.remove", "DELETE", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
103
84
  ptyID: Schema.brand<Schema.String, "PtyID"> & {
104
85
  create: () => string & import("effect/Brand").Brand<"PtyID">;
105
86
  ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
@@ -143,7 +124,26 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
143
124
  readonly pid: Schema.Int;
144
125
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
145
126
  }>;
146
- }>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.connect", "GET", "/api/pty/:ptyID/connect", Schema.toCodecStringTree<Schema.Struct<{
127
+ }>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.connectToken", "POST", "/api/pty/:ptyID/connect-token", Schema.toCodecStringTree<Schema.Struct<{
128
+ ptyID: Schema.brand<Schema.String, "PtyID"> & {
129
+ create: () => string & import("effect/Brand").Brand<"PtyID">;
130
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
131
+ };
132
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
133
+ readonly location: Schema.optional<Schema.Struct<{
134
+ readonly directory: Schema.optional<Schema.String>;
135
+ }>>;
136
+ }>>, never, Schema.toCodecStringTree<Schema.Struct<{
137
+ readonly "x-opencode-ticket": Schema.optional<Schema.String>;
138
+ }>>, Schema.toCodecJson<Schema.Struct<{
139
+ readonly location: Schema.Struct<{
140
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
141
+ }>;
142
+ readonly data: Schema.Struct<{
143
+ readonly ticket: Schema.String;
144
+ readonly expires_in: Schema.Int;
145
+ }>;
146
+ }>>, Schema.toCodecJson<typeof ForbiddenError | typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.connect", "GET", "/api/pty/:ptyID/connect", Schema.toCodecStringTree<Schema.Struct<{
147
147
  ptyID: Schema.brand<Schema.String, "PtyID"> & {
148
148
  create: () => string & import("effect/Brand").Brand<"PtyID">;
149
149
  ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
@@ -4,6 +4,7 @@ import { UnauthorizedError } from "../errors.js";
4
4
  export declare const ServerInfo: Schema.Struct<{
5
5
  readonly version: Schema.String;
6
6
  readonly pid: Schema.Int;
7
+ readonly hostname: Schema.optional<Schema.String>;
7
8
  readonly urls: Schema.$Array<Schema.String>;
8
9
  readonly paths: Schema.Struct<{
9
10
  readonly tmp: Schema.String;
@@ -31,6 +32,7 @@ export declare const ServerGroup: HttpApiGroup.HttpApiGroup<"server.server", Htt
31
32
  }>>, Schema.toCodecJson<typeof UnauthorizedError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"server.info", "GET", "/api/info", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
32
33
  readonly version: Schema.String;
33
34
  readonly pid: Schema.Int;
35
+ readonly hostname: Schema.optional<Schema.String>;
34
36
  readonly urls: Schema.$Array<Schema.String>;
35
37
  readonly paths: Schema.Struct<{
36
38
  readonly tmp: Schema.String;
@@ -5,6 +5,8 @@ export const ServerInfo = Schema.Struct({
5
5
  version: Schema.String,
6
6
  // 0 means the runtime has no OS process identity (e.g. workerd).
7
7
  pid: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
8
+ // The machine's name, absent where the runtime has none (e.g. workerd).
9
+ hostname: Schema.optional(Schema.String),
8
10
  urls: Schema.Array(Schema.String),
9
11
  paths: Schema.Struct({
10
12
  tmp: Schema.String,