@opencode/protocol 2.0.31 → 2.1.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.
- package/dist/api.d.ts +2 -1
- package/dist/api.js +2 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +1 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +5 -0
- package/dist/groups/agent.d.ts +9 -9
- package/dist/groups/credential.d.ts +35 -38
- package/dist/groups/event.d.ts +2414 -2386
- package/dist/groups/form.d.ts +24 -24
- package/dist/groups/fs.d.ts +12 -12
- package/dist/groups/integration.d.ts +278 -278
- package/dist/groups/mcp.d.ts +22 -22
- package/dist/groups/message.d.ts +82 -182
- package/dist/groups/message.js +15 -12
- package/dist/groups/model.d.ts +112 -108
- package/dist/groups/permission.d.ts +36 -14
- package/dist/groups/permission.js +14 -1
- package/dist/groups/persistent-pty.d.ts +122 -122
- package/dist/groups/plugin.d.ts +7 -7
- package/dist/groups/provider.d.ts +24 -20
- package/dist/groups/pty.d.ts +45 -45
- package/dist/groups/reference.d.ts +5 -5
- package/dist/groups/server.d.ts +6 -6
- package/dist/groups/session.d.ts +5772 -5819
- package/dist/groups/session.js +27 -70
- package/dist/groups/shell.d.ts +20 -20
- package/dist/groups/vcs.d.ts +30 -30
- package/dist/groups/voice.d.ts +60 -0
- package/dist/groups/voice.js +51 -0
- package/dist/groups/worktree.d.ts +11 -11
- package/dist/simulation.d.ts +237 -237
- package/package.json +6 -5
package/dist/groups/session.js
CHANGED
|
@@ -5,10 +5,10 @@ import { Session } from "@opencode/schema/session";
|
|
|
5
5
|
import { SessionStats } from "@opencode/schema/session-stats";
|
|
6
6
|
import { InstructionEntry } from "@opencode/schema/instruction-entry";
|
|
7
7
|
import { Project } from "@opencode/schema/project";
|
|
8
|
-
import {
|
|
8
|
+
import { DateTimeUtcFromMillis, NonNegativeInt, PositiveInt } from "@opencode/schema/schema";
|
|
9
9
|
import { Event } from "@opencode/schema/event";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { SessionLegacy } from "@opencode/schema/session-legacy";
|
|
11
|
+
import { Context, Schema, SchemaGetter, Struct } from "effect";
|
|
12
12
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
13
13
|
import { ConflictError, LocationNotFoundError, CommandExecutionError, CommandNotFoundError, FormAlreadySettledError, FormInvalidAnswerError, FormNotFoundError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError, } from "../errors.js";
|
|
14
14
|
import { Agent } from "@opencode/schema/agent";
|
|
@@ -21,64 +21,6 @@ import { EventLog } from "@opencode/schema/event-log";
|
|
|
21
21
|
import { FileDiff } from "@opencode/schema/file-diff";
|
|
22
22
|
import { Form } from "@opencode/schema/form";
|
|
23
23
|
import { PublicSessionMessage } from "./message.js";
|
|
24
|
-
const ParentIDFilter = Schema.Union([
|
|
25
|
-
Session.ID,
|
|
26
|
-
Schema.Null.pipe(Schema.encodeTo(Schema.Literal("null"), {
|
|
27
|
-
decode: SchemaGetter.transform(() => null),
|
|
28
|
-
encode: SchemaGetter.transform(() => "null"),
|
|
29
|
-
})),
|
|
30
|
-
]).annotate({
|
|
31
|
-
description: "Filter by parent session. Use null to return only root sessions.",
|
|
32
|
-
});
|
|
33
|
-
const SessionsQueryFields = {
|
|
34
|
-
limit: Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional).annotate({
|
|
35
|
-
description: "Maximum number of sessions to return. Defaults to the newest 50 sessions.",
|
|
36
|
-
}),
|
|
37
|
-
order: Schema.optional(Schema.Union([Schema.Literal("asc"), Schema.Literal("desc")])).annotate({
|
|
38
|
-
description: "Session order for the first page. Use desc for newest first or asc for oldest first.",
|
|
39
|
-
}),
|
|
40
|
-
search: Schema.optional(Schema.String),
|
|
41
|
-
parentID: ParentIDFilter.pipe(Schema.optional),
|
|
42
|
-
};
|
|
43
|
-
const SessionsDirectoryQuery = Schema.Struct({
|
|
44
|
-
...SessionsQueryFields,
|
|
45
|
-
directory: AbsolutePath,
|
|
46
|
-
});
|
|
47
|
-
const SessionsProjectQuery = Schema.Struct({
|
|
48
|
-
...SessionsQueryFields,
|
|
49
|
-
project: Project.ID,
|
|
50
|
-
subpath: RelativePath.pipe(Schema.optional),
|
|
51
|
-
});
|
|
52
|
-
const SessionsAllQuery = Schema.Struct(SessionsQueryFields);
|
|
53
|
-
const withCursor = (schema) => schema.mapFields((fields) => ({
|
|
54
|
-
...Struct.omit(fields, ["limit"]),
|
|
55
|
-
anchor: Session.ListAnchor,
|
|
56
|
-
}));
|
|
57
|
-
const SessionsCursorInput = Schema.Union([
|
|
58
|
-
withCursor(SessionsDirectoryQuery),
|
|
59
|
-
withCursor(SessionsProjectQuery),
|
|
60
|
-
withCursor(SessionsAllQuery),
|
|
61
|
-
]);
|
|
62
|
-
const SessionsCursorJson = Schema.fromJsonString(SessionsCursorInput);
|
|
63
|
-
const encodeSessionsCursor = Schema.encodeSync(SessionsCursorJson);
|
|
64
|
-
const decodeSessionsCursor = Schema.decodeUnknownEffect(SessionsCursorJson);
|
|
65
|
-
const invalidCursor = "Invalid cursor";
|
|
66
|
-
export const SessionsCursor = Schema.String.pipe(Schema.brand("SessionsCursor"), Schema.annotate({
|
|
67
|
-
identifier: "SessionsCursor",
|
|
68
|
-
description: "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response.",
|
|
69
|
-
}), statics((schema) => {
|
|
70
|
-
// Read the default constructor without caching it on the schema, so `make` can be replaced.
|
|
71
|
-
const make = SchemaParser.make(schema);
|
|
72
|
-
return {
|
|
73
|
-
make: (input) => make(Base64Url.encode(encodeSessionsCursor(input))),
|
|
74
|
-
parse: (input) => Effect.suspend(() => {
|
|
75
|
-
const result = Base64Url.decodeString(input);
|
|
76
|
-
return Result.isFailure(result)
|
|
77
|
-
? Effect.fail(invalidCursor)
|
|
78
|
-
: decodeSessionsCursor(result.success).pipe(Effect.mapError(() => invalidCursor));
|
|
79
|
-
}),
|
|
80
|
-
};
|
|
81
|
-
}));
|
|
82
24
|
const SessionActive = Schema.Struct({
|
|
83
25
|
type: Schema.Literal("running"),
|
|
84
26
|
}).annotate({ identifier: "SessionActive" });
|
|
@@ -104,6 +46,15 @@ const PublicInboxInfo = Schema.Union([
|
|
|
104
46
|
SessionInbox.Compaction,
|
|
105
47
|
PublicMove,
|
|
106
48
|
]).annotate({ identifier: "Session.Inbox.Info" });
|
|
49
|
+
// Transcripts exported before v2.1 carry older names for native data. The wire stays plain JSON so any export file
|
|
50
|
+
// is accepted; decoding upgrades those names and then validates the current message shape.
|
|
51
|
+
const ImportedMessages = Schema.Array(Schema.Json).pipe(Schema.decodeTo(Schema.Array(Schema.Unknown), {
|
|
52
|
+
decode: SchemaGetter.transform(SessionLegacy.messages),
|
|
53
|
+
encode: SchemaGetter.passthrough({ strict: false }),
|
|
54
|
+
}), Schema.decodeTo(Schema.Array(PublicSessionMessage), {
|
|
55
|
+
decode: SchemaGetter.passthrough({ strict: false }),
|
|
56
|
+
encode: SchemaGetter.passthrough({ strict: false }),
|
|
57
|
+
}));
|
|
107
58
|
const FormCreatePayload = Schema.Struct({
|
|
108
59
|
id: Form.ID.pipe(Schema.optional),
|
|
109
60
|
title: Form.Info.fields.title,
|
|
@@ -114,12 +65,14 @@ const BooleanFromString = Schema.Literals(["true", "false"]).pipe(Schema.decodeT
|
|
|
114
65
|
decode: SchemaGetter.transform((value) => value === "true"),
|
|
115
66
|
encode: SchemaGetter.transform((value) => (value ? "true" : "false")),
|
|
116
67
|
}));
|
|
68
|
+
// Kept so existing imports of SessionsCursor from Protocol keep working.
|
|
69
|
+
export const SessionsCursor = Session.ListCursor;
|
|
117
70
|
export const SessionsQuery = Schema.Struct({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
cursor:
|
|
71
|
+
limit: Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional).annotate({
|
|
72
|
+
description: "Maximum number of sessions to return. Defaults to the newest 50 sessions.",
|
|
73
|
+
}),
|
|
74
|
+
...Session.ListFilter.fields,
|
|
75
|
+
cursor: Session.ListCursor.pipe(Schema.optional),
|
|
123
76
|
}).annotate({ identifier: "SessionsQuery" });
|
|
124
77
|
export const makeSessionGroup = (sessionLocationMiddleware, formLocationMiddleware) => HttpApiGroup.make("server.session")
|
|
125
78
|
.add(HttpApiEndpoint.get("session.list", "/api/session", {
|
|
@@ -127,8 +80,8 @@ export const makeSessionGroup = (sessionLocationMiddleware, formLocationMiddlewa
|
|
|
127
80
|
success: Schema.Struct({
|
|
128
81
|
data: Schema.Array(PublicSessionInfo),
|
|
129
82
|
cursor: Schema.Struct({
|
|
130
|
-
previous:
|
|
131
|
-
next:
|
|
83
|
+
previous: Session.ListCursor.pipe(Schema.optional),
|
|
84
|
+
next: Session.ListCursor.pipe(Schema.optional),
|
|
132
85
|
}),
|
|
133
86
|
}).annotate({ identifier: "SessionsResponse" }),
|
|
134
87
|
error: [InvalidCursorError, InvalidRequestError],
|
|
@@ -172,7 +125,8 @@ export const makeSessionGroup = (sessionLocationMiddleware, formLocationMiddlewa
|
|
|
172
125
|
})))
|
|
173
126
|
.add(HttpApiEndpoint.post("session.import", "/api/experimental/session/import", {
|
|
174
127
|
payload: Schema.Struct({
|
|
175
|
-
|
|
128
|
+
info: PublicSessionTransfer.fields.info,
|
|
129
|
+
messages: ImportedMessages,
|
|
176
130
|
location: Location.PublicRef.pipe(Schema.optional),
|
|
177
131
|
}),
|
|
178
132
|
success: Schema.Struct({ data: PublicSessionInfo }),
|
|
@@ -180,7 +134,7 @@ export const makeSessionGroup = (sessionLocationMiddleware, formLocationMiddlewa
|
|
|
180
134
|
}).annotateMerge(OpenApi.annotations({
|
|
181
135
|
identifier: "experimental.session.import",
|
|
182
136
|
summary: "Import session",
|
|
183
|
-
description: "Import a projected session transcript at the requested location. If parentID is supplied, the parent session must already exist; import parents before children.",
|
|
137
|
+
description: "Import a projected session transcript at the requested location. Accepts transcripts exported by earlier releases. If parentID is supplied, the parent session must already exist; import parents before children.",
|
|
184
138
|
})))
|
|
185
139
|
.add(HttpApiEndpoint.get("session.export", "/api/experimental/session/:sessionID/export", {
|
|
186
140
|
params: { sessionID: Session.ID },
|
|
@@ -259,6 +213,9 @@ export const makeSessionGroup = (sessionLocationMiddleware, formLocationMiddlewa
|
|
|
259
213
|
title: Schema.String.pipe(Schema.optional),
|
|
260
214
|
metadata: Session.Metadata.pipe(Schema.optional),
|
|
261
215
|
permissions: Permission.Ruleset.pipe(Schema.optional),
|
|
216
|
+
archived: Schema.Boolean.pipe(Schema.optional).annotate({
|
|
217
|
+
description: "Archive the session with true or restore it with false. Repeating the current state is a no-op.",
|
|
218
|
+
}),
|
|
262
219
|
}),
|
|
263
220
|
success: HttpApiSchema.NoContent,
|
|
264
221
|
error: SessionNotFoundError,
|
package/dist/groups/shell.d.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
3
3
|
import { ShellNotFoundError } from "../errors.js";
|
|
4
|
-
export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpApiEndpoint.HttpApiEndpoint<"shell.
|
|
4
|
+
export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpApiEndpoint.HttpApiEndpoint<"shell.create", "POST", "/api/shell", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
5
|
readonly location: Schema.optional<Schema.Struct<{
|
|
6
6
|
readonly directory: Schema.optional<Schema.String>;
|
|
7
7
|
}>>;
|
|
8
|
-
}>>,
|
|
8
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
9
|
+
readonly command: Schema.String;
|
|
10
|
+
readonly cwd: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
11
|
+
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
12
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
13
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
9
14
|
readonly location: Schema.Struct<{
|
|
10
15
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
11
16
|
}>;
|
|
12
|
-
readonly data: Schema
|
|
17
|
+
readonly data: Schema.Struct<{
|
|
13
18
|
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
14
19
|
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
15
20
|
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
@@ -27,17 +32,17 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
|
|
|
27
32
|
readonly started: Schema.Finite;
|
|
28
33
|
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
29
34
|
}>;
|
|
30
|
-
}
|
|
31
|
-
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.
|
|
35
|
+
}>;
|
|
36
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.get", "GET", "/api/shell/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
37
|
+
id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
38
|
+
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
39
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
40
|
+
};
|
|
41
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
32
42
|
readonly location: Schema.optional<Schema.Struct<{
|
|
33
43
|
readonly directory: Schema.optional<Schema.String>;
|
|
34
44
|
}>>;
|
|
35
|
-
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
36
|
-
readonly command: Schema.String;
|
|
37
|
-
readonly cwd: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
38
|
-
readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
39
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
40
|
-
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
45
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
41
46
|
readonly location: Schema.Struct<{
|
|
42
47
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
43
48
|
}>;
|
|
@@ -60,12 +65,7 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
|
|
|
60
65
|
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
61
66
|
}>;
|
|
62
67
|
}>;
|
|
63
|
-
}>>,
|
|
64
|
-
id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
65
|
-
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
66
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
67
|
-
};
|
|
68
|
-
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
68
|
+
}>>, Schema.toCodecJson<typeof ShellNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.list", "GET", "/api/shell", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
69
69
|
readonly location: Schema.optional<Schema.Struct<{
|
|
70
70
|
readonly directory: Schema.optional<Schema.String>;
|
|
71
71
|
}>>;
|
|
@@ -73,7 +73,7 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
|
|
|
73
73
|
readonly location: Schema.Struct<{
|
|
74
74
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
75
75
|
}>;
|
|
76
|
-
readonly data: Schema.Struct<{
|
|
76
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
77
77
|
readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
78
78
|
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
79
79
|
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
@@ -91,8 +91,8 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
|
|
|
91
91
|
readonly started: Schema.Finite;
|
|
92
92
|
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
|
|
93
93
|
}>;
|
|
94
|
-
}
|
|
95
|
-
}>>,
|
|
94
|
+
}>>;
|
|
95
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.output", "GET", "/api/shell/:id/output", Schema.toCodecStringTree<Schema.Struct<{
|
|
96
96
|
id: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
97
97
|
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
98
98
|
ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
|
package/dist/groups/vcs.d.ts
CHANGED
|
@@ -7,12 +7,7 @@ declare const VcsInitNotSupportedError_base: Schema.Class<VcsInitNotSupportedErr
|
|
|
7
7
|
}>, import("effect/Cause").YieldableError>;
|
|
8
8
|
export declare class VcsInitNotSupportedError extends VcsInitNotSupportedError_base {
|
|
9
9
|
}
|
|
10
|
-
export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEndpoint.HttpApiEndpoint<"vcs.
|
|
11
|
-
readonly provider: Schema.optional<Schema.String>;
|
|
12
|
-
readonly location: Schema.optional<Schema.Struct<{
|
|
13
|
-
readonly directory: Schema.optional<Schema.String>;
|
|
14
|
-
}>>;
|
|
15
|
-
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof InvalidRequestError | typeof ConflictError | typeof ServiceUnavailableError | typeof VcsInitNotSupportedError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.get", "GET", "/api/vcs", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
10
|
+
export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEndpoint.HttpApiEndpoint<"vcs.base", "GET", "/api/vcs/base", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
16
11
|
readonly location: Schema.optional<Schema.Struct<{
|
|
17
12
|
readonly directory: Schema.optional<Schema.String>;
|
|
18
13
|
}>>;
|
|
@@ -20,43 +15,41 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
|
|
|
20
15
|
readonly location: Schema.Struct<{
|
|
21
16
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
22
17
|
}>;
|
|
23
|
-
readonly data: Schema.Struct<{
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}>;
|
|
30
|
-
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.base", "GET", "/api/vcs/base", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
18
|
+
readonly data: Schema.NullOr<Schema.Struct<{
|
|
19
|
+
readonly name: Schema.String;
|
|
20
|
+
readonly ref: Schema.String;
|
|
21
|
+
readonly source: Schema.Literals<readonly ["reflog", "default"]>;
|
|
22
|
+
}>>;
|
|
23
|
+
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.branch.list", "GET", "/api/vcs/branch", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
31
24
|
readonly location: Schema.optional<Schema.Struct<{
|
|
32
25
|
readonly directory: Schema.optional<Schema.String>;
|
|
33
26
|
}>>;
|
|
27
|
+
readonly search: Schema.optional<Schema.String>;
|
|
28
|
+
readonly limit: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
|
|
34
29
|
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
35
30
|
readonly location: Schema.Struct<{
|
|
36
31
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
37
32
|
}>;
|
|
38
|
-
readonly data: Schema
|
|
39
|
-
|
|
40
|
-
readonly ref: Schema.String;
|
|
41
|
-
readonly source: Schema.Literals<readonly ["reflog", "default"]>;
|
|
42
|
-
}>>;
|
|
43
|
-
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.status", "GET", "/api/vcs/status", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
33
|
+
readonly data: Schema.$Array<Schema.String>;
|
|
34
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.diff", "GET", "/api/vcs/diff", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
44
35
|
readonly location: Schema.optional<Schema.Struct<{
|
|
45
36
|
readonly directory: Schema.optional<Schema.String>;
|
|
46
37
|
}>>;
|
|
38
|
+
readonly mode: Schema.Literals<readonly ["working", "branch", "committed"]>;
|
|
39
|
+
readonly base: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
40
|
+
readonly context: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
|
|
47
41
|
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
48
42
|
readonly location: Schema.Struct<{
|
|
49
43
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
50
44
|
}>;
|
|
51
45
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
52
46
|
readonly file: Schema.String;
|
|
47
|
+
readonly patch: Schema.String;
|
|
53
48
|
readonly additions: Schema.Int;
|
|
54
49
|
readonly deletions: Schema.Int;
|
|
55
50
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
56
51
|
}>>;
|
|
57
|
-
}>>,
|
|
58
|
-
readonly search: Schema.optional<Schema.String>;
|
|
59
|
-
readonly limit: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
|
|
52
|
+
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.get", "GET", "/api/vcs", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
60
53
|
readonly location: Schema.optional<Schema.Struct<{
|
|
61
54
|
readonly directory: Schema.optional<Schema.String>;
|
|
62
55
|
}>>;
|
|
@@ -64,11 +57,19 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
|
|
|
64
57
|
readonly location: Schema.Struct<{
|
|
65
58
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
66
59
|
}>;
|
|
67
|
-
readonly data: Schema
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
readonly data: Schema.Struct<{
|
|
61
|
+
readonly provider: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
62
|
+
readonly branch: Schema.Struct<{
|
|
63
|
+
readonly current: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
64
|
+
readonly default: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
65
|
+
}>;
|
|
66
|
+
}>;
|
|
67
|
+
}>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.init", "POST", "/api/vcs/init", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
68
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
69
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
70
|
+
}>>;
|
|
71
|
+
readonly provider: Schema.optional<Schema.String>;
|
|
72
|
+
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof InvalidRequestError | typeof ConflictError | typeof ServiceUnavailableError | typeof VcsInitNotSupportedError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.status", "GET", "/api/vcs/status", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
72
73
|
readonly location: Schema.optional<Schema.Struct<{
|
|
73
74
|
readonly directory: Schema.optional<Schema.String>;
|
|
74
75
|
}>>;
|
|
@@ -78,10 +79,9 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
|
|
|
78
79
|
}>;
|
|
79
80
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
80
81
|
readonly file: Schema.String;
|
|
81
|
-
readonly patch: Schema.String;
|
|
82
82
|
readonly additions: Schema.Int;
|
|
83
83
|
readonly deletions: Schema.Int;
|
|
84
84
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
85
85
|
}>>;
|
|
86
|
-
}>>,
|
|
86
|
+
}>>, never, never, never>, false>;
|
|
87
87
|
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
3
|
+
import { InvalidRequestError, LocationNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
4
|
+
export declare const VoiceWebRTCTransportInput: Schema.Struct<{
|
|
5
|
+
readonly type: Schema.Literal<"webrtc">;
|
|
6
|
+
readonly sdp: Schema.String;
|
|
7
|
+
readonly dcid: Schema.optional<Schema.Number>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const VoiceWebSocketTransportInput: Schema.Struct<{
|
|
10
|
+
readonly type: Schema.Literal<"websocket">;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const VoiceTransportInput: Schema.Union<readonly [Schema.Struct<{
|
|
13
|
+
readonly type: Schema.Literal<"webrtc">;
|
|
14
|
+
readonly sdp: Schema.String;
|
|
15
|
+
readonly dcid: Schema.optional<Schema.Number>;
|
|
16
|
+
}>, Schema.Struct<{
|
|
17
|
+
readonly type: Schema.Literal<"websocket">;
|
|
18
|
+
}>]>;
|
|
19
|
+
export declare const VoiceWebRTCTransport: Schema.Struct<{
|
|
20
|
+
readonly type: Schema.Literal<"webrtc">;
|
|
21
|
+
readonly sdp: Schema.String;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const VoiceWebSocketTransport: Schema.Struct<{
|
|
24
|
+
readonly type: Schema.Literal<"websocket">;
|
|
25
|
+
readonly url: Schema.String;
|
|
26
|
+
readonly token: Schema.String;
|
|
27
|
+
readonly expiresAt: Schema.Number;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const VoiceTransport: Schema.Union<readonly [Schema.Struct<{
|
|
30
|
+
readonly type: Schema.Literal<"webrtc">;
|
|
31
|
+
readonly sdp: Schema.String;
|
|
32
|
+
}>, Schema.Struct<{
|
|
33
|
+
readonly type: Schema.Literal<"websocket">;
|
|
34
|
+
readonly url: Schema.String;
|
|
35
|
+
readonly token: Schema.String;
|
|
36
|
+
readonly expiresAt: Schema.Number;
|
|
37
|
+
}>]>;
|
|
38
|
+
export declare const VoiceGroup: HttpApiGroup.HttpApiGroup<"server.voice", HttpApiEndpoint.HttpApiEndpoint<"voice.session", "POST", "/api/experimental/voice/session", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
39
|
+
readonly model: Schema.String;
|
|
40
|
+
readonly session: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
41
|
+
readonly transport: Schema.Union<readonly [Schema.Struct<{
|
|
42
|
+
readonly type: Schema.Literal<"webrtc">;
|
|
43
|
+
readonly sdp: Schema.String;
|
|
44
|
+
readonly dcid: Schema.optional<Schema.Number>;
|
|
45
|
+
}>, Schema.Struct<{
|
|
46
|
+
readonly type: Schema.Literal<"websocket">;
|
|
47
|
+
}>]>;
|
|
48
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
49
|
+
readonly data: Schema.Struct<{
|
|
50
|
+
readonly transport: Schema.Union<readonly [Schema.Struct<{
|
|
51
|
+
readonly type: Schema.Literal<"webrtc">;
|
|
52
|
+
readonly sdp: Schema.String;
|
|
53
|
+
}>, Schema.Struct<{
|
|
54
|
+
readonly type: Schema.Literal<"websocket">;
|
|
55
|
+
readonly url: Schema.String;
|
|
56
|
+
readonly token: Schema.String;
|
|
57
|
+
readonly expiresAt: Schema.Number;
|
|
58
|
+
}>]>;
|
|
59
|
+
}>;
|
|
60
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never>, false>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
3
|
+
import { InvalidRequestError, LocationNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
4
|
+
export const VoiceWebRTCTransportInput = Schema.Struct({
|
|
5
|
+
type: Schema.Literal("webrtc"),
|
|
6
|
+
sdp: Schema.String,
|
|
7
|
+
dcid: Schema.optional(Schema.Number),
|
|
8
|
+
}).annotate({ identifier: "VoiceWebRTCTransportInput" });
|
|
9
|
+
export const VoiceWebSocketTransportInput = Schema.Struct({
|
|
10
|
+
type: Schema.Literal("websocket"),
|
|
11
|
+
}).annotate({ identifier: "VoiceWebSocketTransportInput" });
|
|
12
|
+
export const VoiceTransportInput = Schema.Union([
|
|
13
|
+
VoiceWebRTCTransportInput,
|
|
14
|
+
VoiceWebSocketTransportInput,
|
|
15
|
+
]).annotate({ identifier: "VoiceTransportInput" });
|
|
16
|
+
export const VoiceWebRTCTransport = Schema.Struct({
|
|
17
|
+
type: Schema.Literal("webrtc"),
|
|
18
|
+
sdp: Schema.String,
|
|
19
|
+
}).annotate({ identifier: "VoiceWebRTCTransport" });
|
|
20
|
+
export const VoiceWebSocketTransport = Schema.Struct({
|
|
21
|
+
type: Schema.Literal("websocket"),
|
|
22
|
+
url: Schema.String,
|
|
23
|
+
token: Schema.String,
|
|
24
|
+
expiresAt: Schema.Number,
|
|
25
|
+
}).annotate({ identifier: "VoiceWebSocketTransport" });
|
|
26
|
+
export const VoiceTransport = Schema.Union([
|
|
27
|
+
VoiceWebRTCTransport,
|
|
28
|
+
VoiceWebSocketTransport,
|
|
29
|
+
]).annotate({ identifier: "VoiceTransport" });
|
|
30
|
+
export const VoiceGroup = HttpApiGroup.make("server.voice")
|
|
31
|
+
.add(HttpApiEndpoint.post("voice.session", "/api/experimental/voice/session", {
|
|
32
|
+
payload: Schema.Struct({
|
|
33
|
+
model: Schema.String,
|
|
34
|
+
session: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
35
|
+
transport: VoiceTransportInput,
|
|
36
|
+
}),
|
|
37
|
+
success: Schema.Struct({
|
|
38
|
+
data: Schema.Struct({
|
|
39
|
+
transport: VoiceTransport,
|
|
40
|
+
}),
|
|
41
|
+
}).annotate({ identifier: "VoiceSessionResponse" }),
|
|
42
|
+
error: [InvalidRequestError, ServiceUnavailableError, LocationNotFoundError],
|
|
43
|
+
}).annotateMerge(OpenApi.annotations({
|
|
44
|
+
identifier: "experimental.voice.session",
|
|
45
|
+
summary: "Create voice session",
|
|
46
|
+
description: "Create a server-brokered voice session using the server's configured provider credentials and return the WebRTC SDP answer or WebSocket ephemeral token.",
|
|
47
|
+
})))
|
|
48
|
+
.annotateMerge(OpenApi.annotations({
|
|
49
|
+
title: "voice",
|
|
50
|
+
description: "Experimental server-brokered voice session routes.",
|
|
51
|
+
}));
|
|
@@ -10,14 +10,7 @@ declare const WorktreeError_base: Schema.Class<WorktreeError, Schema.TaggedStruc
|
|
|
10
10
|
}>, import("effect/Cause").YieldableError>;
|
|
11
11
|
export declare class WorktreeError extends WorktreeError_base {
|
|
12
12
|
}
|
|
13
|
-
export declare const WorktreeGroup: HttpApiGroup.HttpApiGroup<"server.worktree", HttpApiEndpoint.HttpApiEndpoint<"worktree.
|
|
14
|
-
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
15
|
-
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
16
|
-
};
|
|
17
|
-
}>>, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
18
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
19
|
-
readonly strategy: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
20
|
-
}>>>, Schema.toCodecJson<typeof ProjectNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.create", "POST", "/api/worktree", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
13
|
+
export declare const WorktreeGroup: HttpApiGroup.HttpApiGroup<"server.worktree", HttpApiEndpoint.HttpApiEndpoint<"worktree.create", "POST", "/api/worktree", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
21
14
|
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
22
15
|
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
23
16
|
};
|
|
@@ -27,15 +20,22 @@ export declare const WorktreeGroup: HttpApiGroup.HttpApiGroup<"server.worktree",
|
|
|
27
20
|
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
28
21
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
29
22
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
30
|
-
}>>, Schema.toCodecJson<typeof ProjectNotFoundError | typeof WorktreeError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.
|
|
23
|
+
}>>, Schema.toCodecJson<typeof ProjectNotFoundError | typeof WorktreeError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.list", "GET", "/api/worktree", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
31
24
|
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
32
25
|
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
33
26
|
};
|
|
27
|
+
}>>, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
34
28
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
35
|
-
readonly
|
|
36
|
-
}
|
|
29
|
+
readonly strategy: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
30
|
+
}>>>, Schema.toCodecJson<typeof ProjectNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.refresh", "POST", "/api/worktree/refresh", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
37
31
|
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
38
32
|
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
39
33
|
};
|
|
34
|
+
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof ProjectNotFoundError | typeof WorktreeError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.remove", "DELETE", "/api/worktree", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
35
|
+
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
36
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
37
|
+
};
|
|
38
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
39
|
+
readonly force: Schema.Boolean;
|
|
40
40
|
}>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof ProjectNotFoundError | typeof WorktreeError>, never, never>, false>;
|
|
41
41
|
export {};
|