@opencode/protocol 0.0.0-dev-21426 → 0.0.0-dev-21430

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.
@@ -6,7 +6,16 @@ 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.list", "GET", "/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.remove", "DELETE", "/api/pty/:ptyID", 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, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.list", "GET", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
10
19
  readonly location: Schema.optional<Schema.Struct<{
11
20
  readonly directory: Schema.optional<Schema.String>;
12
21
  }>>;
@@ -27,17 +36,16 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
27
36
  readonly pid: Schema.Int;
28
37
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
29
38
  }>>;
30
- }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.create", "POST", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
39
+ }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.get", "GET", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
40
+ ptyID: Schema.brand<Schema.String, "PtyID"> & {
41
+ create: () => string & import("effect/Brand").Brand<"PtyID">;
42
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
43
+ };
44
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
31
45
  readonly location: Schema.optional<Schema.Struct<{
32
46
  readonly directory: Schema.optional<Schema.String>;
33
47
  }>>;
34
- }>>, Schema.toCodecJson<Schema.Struct<{
35
- readonly command: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
36
- readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
37
- readonly cwd: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
38
- readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
39
- readonly env: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
40
- }>>, never, Schema.toCodecJson<Schema.Struct<{
48
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
41
49
  readonly location: Schema.Struct<{
42
50
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
43
51
  }>;
@@ -54,16 +62,17 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
54
62
  readonly pid: Schema.Int;
55
63
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
56
64
  }>;
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<{
65
+ }>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.create", "POST", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
63
66
  readonly location: Schema.optional<Schema.Struct<{
64
67
  readonly directory: Schema.optional<Schema.String>;
65
68
  }>>;
66
- }>>, never, never, Schema.toCodecJson<Schema.Struct<{
69
+ }>>, Schema.toCodecJson<Schema.Struct<{
70
+ readonly command: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
71
+ readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
72
+ readonly cwd: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
73
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
74
+ readonly env: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
75
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
67
76
  readonly location: Schema.Struct<{
68
77
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
69
78
  }>;
@@ -80,7 +89,7 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
80
89
  readonly pid: Schema.Int;
81
90
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
82
91
  }>;
83
- }>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.update", "PUT", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
92
+ }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.update", "PUT", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
84
93
  ptyID: Schema.brand<Schema.String, "PtyID"> & {
85
94
  create: () => string & import("effect/Brand").Brand<"PtyID">;
86
95
  ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
@@ -115,16 +124,7 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
115
124
  readonly pid: Schema.Int;
116
125
  readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
117
126
  }>;
118
- }>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.remove", "DELETE", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
119
- ptyID: Schema.brand<Schema.String, "PtyID"> & {
120
- create: () => string & import("effect/Brand").Brand<"PtyID">;
121
- ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
122
- };
123
- }>>, Schema.toCodecStringTree<Schema.Struct<{
124
- readonly location: Schema.optional<Schema.Struct<{
125
- readonly directory: Schema.optional<Schema.String>;
126
- }>>;
127
- }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.connectToken", "POST", "/api/pty/:ptyID/connect-token", 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
128
  ptyID: Schema.brand<Schema.String, "PtyID"> & {
129
129
  create: () => string & import("effect/Brand").Brand<"PtyID">;
130
130
  ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
@@ -1,6 +1,13 @@
1
1
  import { Schema } from "effect";
2
2
  import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
3
3
  import { InvalidRequestError, LocationNotFoundError, ServiceUnavailableError } from "../errors.js";
4
+ export declare const VoiceTransportType: Schema.Literals<readonly ["webrtc", "websocket"]>;
5
+ export declare const VoiceModel: Schema.Struct<{
6
+ readonly model: Schema.String;
7
+ readonly provider: Schema.String;
8
+ readonly transports: Schema.$Array<Schema.Literals<readonly ["webrtc", "websocket"]>>;
9
+ readonly available: Schema.Boolean;
10
+ }>;
4
11
  export declare const VoiceWebRTCTransportInput: Schema.Struct<{
5
12
  readonly type: Schema.Literal<"webrtc">;
6
13
  readonly sdp: Schema.String;
@@ -35,7 +42,17 @@ export declare const VoiceTransport: Schema.Union<readonly [Schema.Struct<{
35
42
  readonly token: Schema.String;
36
43
  readonly expiresAt: Schema.Number;
37
44
  }>]>;
38
- export declare const VoiceGroup: HttpApiGroup.HttpApiGroup<"server.voice", HttpApiEndpoint.HttpApiEndpoint<"voice.session", "POST", "/api/experimental/voice/session", never, never, Schema.toCodecJson<Schema.Struct<{
45
+ export declare const VoiceGroup: HttpApiGroup.HttpApiGroup<"server.voice", HttpApiEndpoint.HttpApiEndpoint<"voice.models", "GET", "/api/experimental/voice/models", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
46
+ readonly data: Schema.Struct<{
47
+ readonly models: Schema.$Array<Schema.Struct<{
48
+ readonly model: Schema.String;
49
+ readonly provider: Schema.String;
50
+ readonly transports: Schema.$Array<Schema.Literals<readonly ["webrtc", "websocket"]>>;
51
+ readonly available: Schema.Boolean;
52
+ }>>;
53
+ readonly default: Schema.optional<Schema.String>;
54
+ }>;
55
+ }>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"voice.session", "POST", "/api/experimental/voice/session", never, never, Schema.toCodecJson<Schema.Struct<{
39
56
  readonly model: Schema.String;
40
57
  readonly session: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
41
58
  readonly transport: Schema.Union<readonly [Schema.Struct<{
@@ -1,6 +1,15 @@
1
1
  import { Schema } from "effect";
2
2
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
3
3
  import { InvalidRequestError, LocationNotFoundError, ServiceUnavailableError } from "../errors.js";
4
+ export const VoiceTransportType = Schema.Literals(["webrtc", "websocket"]).annotate({
5
+ identifier: "VoiceTransportType",
6
+ });
7
+ export const VoiceModel = Schema.Struct({
8
+ model: Schema.String,
9
+ provider: Schema.String,
10
+ transports: Schema.Array(VoiceTransportType),
11
+ available: Schema.Boolean,
12
+ }).annotate({ identifier: "VoiceModel" });
4
13
  export const VoiceWebRTCTransportInput = Schema.Struct({
5
14
  type: Schema.Literal("webrtc"),
6
15
  sdp: Schema.String,
@@ -28,6 +37,19 @@ export const VoiceTransport = Schema.Union([
28
37
  VoiceWebSocketTransport,
29
38
  ]).annotate({ identifier: "VoiceTransport" });
30
39
  export const VoiceGroup = HttpApiGroup.make("server.voice")
40
+ .add(HttpApiEndpoint.get("voice.models", "/api/experimental/voice/models", {
41
+ success: Schema.Struct({
42
+ data: Schema.Struct({
43
+ models: Schema.Array(VoiceModel),
44
+ default: Schema.optional(Schema.String),
45
+ }),
46
+ }).annotate({ identifier: "VoiceModelsResponse" }),
47
+ error: [ServiceUnavailableError, LocationNotFoundError],
48
+ }).annotateMerge(OpenApi.annotations({
49
+ identifier: "experimental.voice.models",
50
+ summary: "List voice models",
51
+ description: "List supported voice models, their transports, and whether the server has a usable API key for each provider.",
52
+ })))
31
53
  .add(HttpApiEndpoint.post("voice.session", "/api/experimental/voice/session", {
32
54
  payload: Schema.Struct({
33
55
  model: Schema.String,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/protocol",
4
- "version": "0.0.0-dev-21426",
4
+ "version": "0.0.0-dev-21430",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "typecheck": "tsc --noEmit"
34
34
  },
35
35
  "dependencies": {
36
- "@opencode/schema": "0.0.0-dev-21426",
36
+ "@opencode/schema": "0.0.0-dev-21430",
37
37
  "effect": "4.0.1"
38
38
  },
39
39
  "devDependencies": {