@opencode/protocol 0.0.0-dev-21426 → 0.0.0-dev-21441
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/voice.d.ts +18 -1
- package/dist/groups/voice.js +22 -0
- package/package.json +2 -2
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-21441",
|
|
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-21441",
|
|
37
37
|
"effect": "4.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|