@opencode/protocol 0.0.0-dev-21738 → 0.0.0-dev-21741
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 +2 -18
- package/dist/groups/voice.js +3 -19
- package/package.json +2 -2
package/dist/groups/voice.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { HttpApiEndpoint, HttpApiGroup
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
3
|
import { InvalidRequestError, LocationNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
4
4
|
export declare const VoiceTransportType: Schema.Literals<readonly ["webrtc", "websocket"]>;
|
|
5
5
|
export declare const VoiceModel: Schema.Struct<{
|
|
@@ -7,10 +7,6 @@ export declare const VoiceModel: Schema.Struct<{
|
|
|
7
7
|
readonly provider: Schema.String;
|
|
8
8
|
readonly transports: Schema.$Array<Schema.Literals<readonly ["webrtc", "websocket"]>>;
|
|
9
9
|
readonly available: Schema.Boolean;
|
|
10
|
-
/** The integration whose connection starts its sessions: the provider's stored key, or `opencode` when the connected OpenCode Console hosts it. */
|
|
11
|
-
readonly integration: Schema.optional<Schema.String>;
|
|
12
|
-
/** The OpenCode Console workspace a hosted model's sessions bill to. */
|
|
13
|
-
readonly workspace: Schema.optional<Schema.String>;
|
|
14
10
|
}>;
|
|
15
11
|
export declare const VoiceWebRTCTransportInput: Schema.Struct<{
|
|
16
12
|
readonly type: Schema.Literal<"webrtc">;
|
|
@@ -46,21 +42,13 @@ export declare const VoiceTransport: Schema.Union<readonly [Schema.Struct<{
|
|
|
46
42
|
readonly token: Schema.String;
|
|
47
43
|
readonly expiresAt: Schema.Number;
|
|
48
44
|
}>]>;
|
|
49
|
-
export declare const VoiceGroup: HttpApiGroup.HttpApiGroup<"server.voice", HttpApiEndpoint.HttpApiEndpoint<"voice.
|
|
50
|
-
sessionID: Schema.String;
|
|
51
|
-
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
52
|
-
readonly instructions: Schema.String;
|
|
53
|
-
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"voice.models", "GET", "/api/experimental/voice/models", never, never, 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<{
|
|
54
46
|
readonly data: Schema.Struct<{
|
|
55
47
|
readonly models: Schema.$Array<Schema.Struct<{
|
|
56
48
|
readonly model: Schema.String;
|
|
57
49
|
readonly provider: Schema.String;
|
|
58
50
|
readonly transports: Schema.$Array<Schema.Literals<readonly ["webrtc", "websocket"]>>;
|
|
59
51
|
readonly available: Schema.Boolean;
|
|
60
|
-
/** The integration whose connection starts its sessions: the provider's stored key, or `opencode` when the connected OpenCode Console hosts it. */
|
|
61
|
-
readonly integration: Schema.optional<Schema.String>;
|
|
62
|
-
/** The OpenCode Console workspace a hosted model's sessions bill to. */
|
|
63
|
-
readonly workspace: Schema.optional<Schema.String>;
|
|
64
52
|
}>>;
|
|
65
53
|
readonly default: Schema.optional<Schema.String>;
|
|
66
54
|
}>;
|
|
@@ -85,9 +73,5 @@ export declare const VoiceGroup: HttpApiGroup.HttpApiGroup<"server.voice", HttpA
|
|
|
85
73
|
readonly token: Schema.String;
|
|
86
74
|
readonly expiresAt: Schema.Number;
|
|
87
75
|
}>]>;
|
|
88
|
-
/** A hosted session's ID, for `voice.instructions`. */
|
|
89
|
-
readonly session: Schema.optional<Schema.Struct<{
|
|
90
|
-
readonly id: Schema.String;
|
|
91
|
-
}>>;
|
|
92
76
|
}>;
|
|
93
77
|
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never>, false>;
|
package/dist/groups/voice.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { HttpApiEndpoint, HttpApiGroup,
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
3
3
|
import { InvalidRequestError, LocationNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
4
4
|
export const VoiceTransportType = Schema.Literals(["webrtc", "websocket"]).annotate({
|
|
5
5
|
identifier: "VoiceTransportType",
|
|
@@ -9,10 +9,6 @@ export const VoiceModel = Schema.Struct({
|
|
|
9
9
|
provider: Schema.String,
|
|
10
10
|
transports: Schema.Array(VoiceTransportType),
|
|
11
11
|
available: Schema.Boolean,
|
|
12
|
-
/** The integration whose connection starts its sessions: the provider's stored key, or `opencode` when the connected OpenCode Console hosts it. */
|
|
13
|
-
integration: Schema.optional(Schema.String),
|
|
14
|
-
/** The OpenCode Console workspace a hosted model's sessions bill to. */
|
|
15
|
-
workspace: Schema.optional(Schema.String),
|
|
16
12
|
}).annotate({ identifier: "VoiceModel" });
|
|
17
13
|
export const VoiceWebRTCTransportInput = Schema.Struct({
|
|
18
14
|
type: Schema.Literal("webrtc"),
|
|
@@ -52,7 +48,7 @@ export const VoiceGroup = HttpApiGroup.make("server.voice")
|
|
|
52
48
|
}).annotateMerge(OpenApi.annotations({
|
|
53
49
|
identifier: "experimental.voice.models",
|
|
54
50
|
summary: "List voice models",
|
|
55
|
-
description: "List supported voice models, their transports, whether the server has a usable API key for each provider
|
|
51
|
+
description: "List supported voice models, their transports, and whether the server has a usable API key for each provider.",
|
|
56
52
|
})))
|
|
57
53
|
.add(HttpApiEndpoint.post("voice.session", "/api/experimental/voice/session", {
|
|
58
54
|
payload: Schema.Struct({
|
|
@@ -63,25 +59,13 @@ export const VoiceGroup = HttpApiGroup.make("server.voice")
|
|
|
63
59
|
success: Schema.Struct({
|
|
64
60
|
data: Schema.Struct({
|
|
65
61
|
transport: VoiceTransport,
|
|
66
|
-
/** A hosted session's ID, for `voice.instructions`. */
|
|
67
|
-
session: Schema.optional(Schema.Struct({ id: Schema.String })),
|
|
68
62
|
}),
|
|
69
63
|
}).annotate({ identifier: "VoiceSessionResponse" }),
|
|
70
64
|
error: [InvalidRequestError, ServiceUnavailableError, LocationNotFoundError],
|
|
71
65
|
}).annotateMerge(OpenApi.annotations({
|
|
72
66
|
identifier: "experimental.voice.session",
|
|
73
67
|
summary: "Create voice session",
|
|
74
|
-
description: "Create a server-brokered voice session using the server's configured provider credentials
|
|
75
|
-
})))
|
|
76
|
-
.add(HttpApiEndpoint.post("voice.instructions", "/api/experimental/voice/session/:sessionID/instructions", {
|
|
77
|
-
params: { sessionID: Schema.String },
|
|
78
|
-
payload: Schema.Struct({ instructions: Schema.String }),
|
|
79
|
-
success: HttpApiSchema.NoContent,
|
|
80
|
-
error: [InvalidRequestError, ServiceUnavailableError, LocationNotFoundError],
|
|
81
|
-
}).annotateMerge(OpenApi.annotations({
|
|
82
|
-
identifier: "experimental.voice.instructions",
|
|
83
|
-
summary: "Replace voice session instructions",
|
|
84
|
-
description: "Replace the backend instructions of a running session the connected OpenCode Console hosts, whose data channel can't change them.",
|
|
68
|
+
description: "Create a server-brokered voice session using the server's configured provider credentials and return the WebRTC SDP answer or WebSocket ephemeral token.",
|
|
85
69
|
})))
|
|
86
70
|
.annotateMerge(OpenApi.annotations({
|
|
87
71
|
title: "voice",
|
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-21741",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"typecheck:tsc": "tsc --noEmit"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@opencode/schema": "0.0.0-dev-
|
|
37
|
+
"@opencode/schema": "0.0.0-dev-21741",
|
|
38
38
|
"effect": "4.0.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|