@opencode/protocol 0.0.0-dev-21421 → 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.
- package/dist/groups/pty.d.ts +36 -36
- package/dist/groups/voice.d.ts +18 -1
- package/dist/groups/voice.js +22 -0
- package/package.json +2 -2
package/dist/groups/pty.d.ts
CHANGED
|
@@ -6,7 +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.
|
|
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
10
|
ptyID: Schema.brand<Schema.String, "PtyID"> & {
|
|
11
11
|
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
12
12
|
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
@@ -15,31 +15,15 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
|
|
|
15
15
|
readonly location: Schema.optional<Schema.Struct<{
|
|
16
16
|
readonly directory: Schema.optional<Schema.String>;
|
|
17
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<{
|
|
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<{
|
|
29
19
|
readonly location: Schema.optional<Schema.Struct<{
|
|
30
20
|
readonly directory: Schema.optional<Schema.String>;
|
|
31
21
|
}>>;
|
|
32
|
-
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
33
|
-
readonly command: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
34
|
-
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
35
|
-
readonly cwd: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
36
|
-
readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
37
|
-
readonly env: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
38
|
-
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
22
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
39
23
|
readonly location: Schema.Struct<{
|
|
40
24
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
41
25
|
}>;
|
|
42
|
-
readonly data: Schema.Struct<{
|
|
26
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
43
27
|
readonly id: Schema.brand<Schema.String, "PtyID"> & {
|
|
44
28
|
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
45
29
|
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
@@ -51,7 +35,7 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
|
|
|
51
35
|
readonly status: Schema.Literals<readonly ["running", "exited"]>;
|
|
52
36
|
readonly pid: Schema.Int;
|
|
53
37
|
readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
54
|
-
}
|
|
38
|
+
}>>;
|
|
55
39
|
}>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.get", "GET", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
|
|
56
40
|
ptyID: Schema.brand<Schema.String, "PtyID"> & {
|
|
57
41
|
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
@@ -78,15 +62,21 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
|
|
|
78
62
|
readonly pid: Schema.Int;
|
|
79
63
|
readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
80
64
|
}>;
|
|
81
|
-
}>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.
|
|
65
|
+
}>>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.create", "POST", "/api/pty", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
82
66
|
readonly location: Schema.optional<Schema.Struct<{
|
|
83
67
|
readonly directory: Schema.optional<Schema.String>;
|
|
84
68
|
}>>;
|
|
85
|
-
}>>,
|
|
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<{
|
|
86
76
|
readonly location: Schema.Struct<{
|
|
87
77
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
88
78
|
}>;
|
|
89
|
-
readonly data: Schema
|
|
79
|
+
readonly data: Schema.Struct<{
|
|
90
80
|
readonly id: Schema.brand<Schema.String, "PtyID"> & {
|
|
91
81
|
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
92
82
|
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
@@ -98,17 +88,8 @@ export declare const makePtyGroup: <LocationId extends HttpApiMiddleware.AnyId,
|
|
|
98
88
|
readonly status: Schema.Literals<readonly ["running", "exited"]>;
|
|
99
89
|
readonly pid: Schema.Int;
|
|
100
90
|
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.
|
|
103
|
-
ptyID: Schema.brand<Schema.String, "PtyID"> & {
|
|
104
|
-
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
105
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
106
|
-
};
|
|
107
|
-
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
108
|
-
readonly location: Schema.optional<Schema.Struct<{
|
|
109
|
-
readonly directory: Schema.optional<Schema.String>;
|
|
110
|
-
}>>;
|
|
111
|
-
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof PtyNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.update", "PUT", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
|
|
91
|
+
}>;
|
|
92
|
+
}>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"pty.update", "PUT", "/api/pty/:ptyID", Schema.toCodecStringTree<Schema.Struct<{
|
|
112
93
|
ptyID: Schema.brand<Schema.String, "PtyID"> & {
|
|
113
94
|
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
114
95
|
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.
|
|
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">;
|
package/dist/groups/voice.d.ts
CHANGED
|
@@ -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.
|
|
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<{
|
package/dist/groups/voice.js
CHANGED
|
@@ -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-
|
|
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-
|
|
36
|
+
"@opencode/schema": "0.0.0-dev-21430",
|
|
37
37
|
"effect": "4.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|