@opencode/protocol 0.0.0-dev-21907 → 0.0.0-dev-21915
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 -2
- package/dist/api.js +2 -2
- package/dist/client.js +1 -0
- package/dist/groups/event.d.ts +9 -0
- package/dist/groups/experimental.d.ts +238 -0
- package/dist/groups/experimental.js +4 -0
- package/dist/groups/media.d.ts +8 -0
- package/dist/groups/media.js +18 -0
- package/dist/groups/message.d.ts +2240 -0
- package/dist/groups/message.js +29 -4
- package/dist/groups/session.d.ts +284 -0
- package/dist/groups/session.js +6 -0
- package/dist/groups/vcs.d.ts +2 -0
- package/dist/groups/vcs.js +1 -0
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
import { HttpApi, HttpApiGroup, HttpApiMiddleware } from "effect/http-api";
|
|
3
3
|
import { SchemaErrorMiddleware } from "./middleware/schema-error.js";
|
|
4
4
|
import { GenerateGroup } from "./groups/generate.js";
|
|
5
|
+
import { ExperimentalGroup } from "./groups/experimental.js";
|
|
5
6
|
import { VoiceGroup } from "./groups/voice.js";
|
|
6
7
|
import { MessageGroup } from "./groups/message.js";
|
|
7
8
|
import { ModelGroup } from "./groups/model.js";
|
|
@@ -20,7 +21,6 @@ import { PluginGroup } from "./groups/plugin.js";
|
|
|
20
21
|
import { ServerGroup } from "./groups/server.js";
|
|
21
22
|
import { DebugGroup } from "./groups/debug.js";
|
|
22
23
|
import { makePtyGroup } from "./groups/pty.js";
|
|
23
|
-
import { PersistentPtyGroup } from "./groups/persistent-pty.js";
|
|
24
24
|
import { ShellGroup } from "./groups/shell.js";
|
|
25
25
|
import { ReferenceGroup } from "./groups/reference.js";
|
|
26
26
|
import { Authorization } from "./middleware/authorization.js";
|
|
@@ -42,7 +42,7 @@ type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLoc
|
|
|
42
42
|
type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService>>;
|
|
43
43
|
type LocationGroup<LocationId extends HttpApiMiddleware.AnyId, LocationService> = ReturnType<typeof makeLocationGroup<LocationId, LocationService>>;
|
|
44
44
|
type MixedMiddlewareGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makePermissionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>>;
|
|
45
|
-
type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = typeof ServerGroup | typeof DebugGroup | typeof MigrationGroup | typeof WorktreeGroup | typeof GenerateGroup | typeof VoiceGroup | typeof
|
|
45
|
+
type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = typeof ServerGroup | typeof DebugGroup | typeof MigrationGroup | typeof WorktreeGroup | typeof GenerateGroup | typeof VoiceGroup | typeof ExperimentalGroup | typeof CredentialGroup | typeof ProjectGroup | LocationGroups<LocationId> | LocationGroup<LocationId, LocationService> | PtyGroups<LocationId, LocationService> | McpGroups<LocationId, LocationService> | FormGroups<LocationId, LocationService> | SessionGroups<SessionLocationId, SessionLocationService, FormLocationId, FormLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
|
|
46
46
|
type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
|
|
47
47
|
export type Api<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = HttpApi.HttpApi<"server", HttpApiGroup.AddMiddleware<HttpApiGroup.AddMiddleware<ApiGroups<LocationId, LocationService, FormLocationId, FormLocationService, SessionLocationId, SessionLocationService, Event>, Authorization>, SchemaErrorMiddleware>>;
|
|
48
48
|
export declare const makeApi: <const Definitions extends ReadonlyArray<Definition>, LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(options: {
|
package/dist/api.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
import { HttpApi, HttpApiGroup, HttpApiMiddleware, OpenApi } from "effect/http-api";
|
|
3
3
|
import { SchemaErrorMiddleware } from "./middleware/schema-error.js";
|
|
4
4
|
import { GenerateGroup } from "./groups/generate.js";
|
|
5
|
+
import { ExperimentalGroup } from "./groups/experimental.js";
|
|
5
6
|
import { VoiceGroup } from "./groups/voice.js";
|
|
6
7
|
import { MessageGroup } from "./groups/message.js";
|
|
7
8
|
import { ModelGroup } from "./groups/model.js";
|
|
@@ -19,7 +20,6 @@ import { PluginGroup } from "./groups/plugin.js";
|
|
|
19
20
|
import { ServerGroup } from "./groups/server.js";
|
|
20
21
|
import { DebugGroup } from "./groups/debug.js";
|
|
21
22
|
import { makePtyGroup } from "./groups/pty.js";
|
|
22
|
-
import { PersistentPtyGroup } from "./groups/persistent-pty.js";
|
|
23
23
|
import { ShellGroup } from "./groups/shell.js";
|
|
24
24
|
import { ReferenceGroup } from "./groups/reference.js";
|
|
25
25
|
import { Authorization } from "./middleware/authorization.js";
|
|
@@ -58,7 +58,7 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware
|
|
|
58
58
|
.add(RpcGroup.middleware(locationMiddleware))
|
|
59
59
|
.add(eventGroup)
|
|
60
60
|
.add(makePtyGroup(locationMiddleware))
|
|
61
|
-
.add(
|
|
61
|
+
.add(ExperimentalGroup)
|
|
62
62
|
.add(ShellGroup.middleware(locationMiddleware))
|
|
63
63
|
.add(ReferenceGroup.middleware(locationMiddleware))
|
|
64
64
|
.add(WorktreeGroup)
|
package/dist/client.js
CHANGED
package/dist/groups/event.d.ts
CHANGED
|
@@ -4238,12 +4238,14 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
|
|
|
4238
4238
|
readonly additions: Schema.Int;
|
|
4239
4239
|
readonly deletions: Schema.Int;
|
|
4240
4240
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
4241
|
+
readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
4241
4242
|
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
4242
4243
|
readonly file: Schema.String;
|
|
4243
4244
|
readonly patch: Schema.String;
|
|
4244
4245
|
readonly additions: Schema.Int;
|
|
4245
4246
|
readonly deletions: Schema.Int;
|
|
4246
4247
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
4248
|
+
readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
4247
4249
|
}>>>, never, never>;
|
|
4248
4250
|
}>;
|
|
4249
4251
|
}>;
|
|
@@ -4271,12 +4273,14 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
|
|
|
4271
4273
|
readonly additions: Schema.Int;
|
|
4272
4274
|
readonly deletions: Schema.Int;
|
|
4273
4275
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
4276
|
+
readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
4274
4277
|
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
4275
4278
|
readonly file: Schema.String;
|
|
4276
4279
|
readonly patch: Schema.String;
|
|
4277
4280
|
readonly additions: Schema.Int;
|
|
4278
4281
|
readonly deletions: Schema.Int;
|
|
4279
4282
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
4283
|
+
readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
4280
4284
|
}>>>, never, never>;
|
|
4281
4285
|
}>;
|
|
4282
4286
|
}>;
|
|
@@ -7053,6 +7057,7 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
|
|
|
7053
7057
|
readonly additions: number;
|
|
7054
7058
|
readonly deletions: number;
|
|
7055
7059
|
readonly status: "added" | "deleted" | "modified";
|
|
7060
|
+
readonly more?: true | undefined;
|
|
7056
7061
|
}[] | undefined;
|
|
7057
7062
|
};
|
|
7058
7063
|
};
|
|
@@ -12794,12 +12799,14 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
12794
12799
|
readonly additions: Schema.Int;
|
|
12795
12800
|
readonly deletions: Schema.Int;
|
|
12796
12801
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
12802
|
+
readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
12797
12803
|
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
12798
12804
|
readonly file: Schema.String;
|
|
12799
12805
|
readonly patch: Schema.String;
|
|
12800
12806
|
readonly additions: Schema.Int;
|
|
12801
12807
|
readonly deletions: Schema.Int;
|
|
12802
12808
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
12809
|
+
readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
12803
12810
|
}>>>, never, never>;
|
|
12804
12811
|
}>;
|
|
12805
12812
|
}>;
|
|
@@ -12827,12 +12834,14 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
12827
12834
|
readonly additions: Schema.Int;
|
|
12828
12835
|
readonly deletions: Schema.Int;
|
|
12829
12836
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
12837
|
+
readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
12830
12838
|
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
12831
12839
|
readonly file: Schema.String;
|
|
12832
12840
|
readonly patch: Schema.String;
|
|
12833
12841
|
readonly additions: Schema.Int;
|
|
12834
12842
|
readonly deletions: Schema.Int;
|
|
12835
12843
|
readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
|
|
12844
|
+
readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
12836
12845
|
}>>>, never, never>;
|
|
12837
12846
|
}>;
|
|
12838
12847
|
}>;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/** `server.experimental`: routes under /api/experimental, without compatibility guarantees. */
|
|
2
|
+
export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").HttpApiGroup<"server.experimental", import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"media.get", "GET", "/api/experimental/media/:hash", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
3
|
+
hash: import("effect/Schema").String;
|
|
4
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Uint8Array>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").FileNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.connect", "GET", "/api/experimental/persistent-pty/:ptyID/connect", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
5
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
6
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
7
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
8
|
+
};
|
|
9
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Boolean>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").ForbiddenError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.connectToken", "POST", "/api/experimental/persistent-pty/:ptyID/connect-token", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
10
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
11
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
12
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
13
|
+
};
|
|
14
|
+
}>>, never, never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
15
|
+
readonly "x-opencode-ticket": import("effect/Schema").optional<import("effect/Schema").String>;
|
|
16
|
+
}>>, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
17
|
+
readonly data: import("effect/Schema").Struct<{
|
|
18
|
+
readonly ticket: import("effect/Schema").String;
|
|
19
|
+
readonly expires_in: import("effect/Schema").Int;
|
|
20
|
+
}>;
|
|
21
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").ForbiddenError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.create", "POST", "/api/experimental/session/:sessionID/terminal", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
22
|
+
sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
23
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
24
|
+
};
|
|
25
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
26
|
+
readonly command: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
|
|
27
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
28
|
+
readonly cwd: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
|
|
29
|
+
readonly title: import("effect/Schema").String;
|
|
30
|
+
readonly env: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>;
|
|
31
|
+
readonly size: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
|
|
32
|
+
readonly cols: import("effect/Schema").Int;
|
|
33
|
+
readonly rows: import("effect/Schema").Int;
|
|
34
|
+
}>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
|
|
35
|
+
readonly cols: import("effect/Schema").Int;
|
|
36
|
+
readonly rows: import("effect/Schema").Int;
|
|
37
|
+
}>>, never, never>;
|
|
38
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
39
|
+
readonly data: import("effect/Schema").Struct<{
|
|
40
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
41
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
42
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
43
|
+
};
|
|
44
|
+
readonly title: import("effect/Schema").String;
|
|
45
|
+
readonly command: import("effect/Schema").String;
|
|
46
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
47
|
+
readonly cwd: import("effect/Schema").String;
|
|
48
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
49
|
+
readonly pid: import("effect/Schema").Int;
|
|
50
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
51
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
52
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
53
|
+
};
|
|
54
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
55
|
+
readonly size: import("effect/Schema").Struct<{
|
|
56
|
+
readonly cols: import("effect/Schema").Int;
|
|
57
|
+
readonly rows: import("effect/Schema").Int;
|
|
58
|
+
}>;
|
|
59
|
+
readonly output: import("effect/Schema").Struct<{
|
|
60
|
+
readonly head: import("effect/Schema").Int;
|
|
61
|
+
readonly tail: import("effect/Schema").Int;
|
|
62
|
+
}>;
|
|
63
|
+
}>;
|
|
64
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.get", "GET", "/api/experimental/persistent-pty/:ptyID", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
65
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
66
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
67
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
68
|
+
};
|
|
69
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
70
|
+
readonly data: import("effect/Schema").Struct<{
|
|
71
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
72
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
73
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
74
|
+
};
|
|
75
|
+
readonly title: import("effect/Schema").String;
|
|
76
|
+
readonly command: import("effect/Schema").String;
|
|
77
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
78
|
+
readonly cwd: import("effect/Schema").String;
|
|
79
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
80
|
+
readonly pid: import("effect/Schema").Int;
|
|
81
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
82
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
83
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
84
|
+
};
|
|
85
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
86
|
+
readonly size: import("effect/Schema").Struct<{
|
|
87
|
+
readonly cols: import("effect/Schema").Int;
|
|
88
|
+
readonly rows: import("effect/Schema").Int;
|
|
89
|
+
}>;
|
|
90
|
+
readonly output: import("effect/Schema").Struct<{
|
|
91
|
+
readonly head: import("effect/Schema").Int;
|
|
92
|
+
readonly tail: import("effect/Schema").Int;
|
|
93
|
+
}>;
|
|
94
|
+
}>;
|
|
95
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.handoff", "POST", "/api/experimental/persistent-pty/handoff", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
96
|
+
readonly handoff: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
97
|
+
readonly directory: import("effect/Schema").String;
|
|
98
|
+
readonly instanceID: import("effect/Schema").String;
|
|
99
|
+
readonly ticket: import("effect/Schema").String;
|
|
100
|
+
readonly expiresAt: import("effect/Schema").Number;
|
|
101
|
+
}>>;
|
|
102
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.list", "GET", "/api/experimental/session/:sessionID/terminal", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
103
|
+
sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
104
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
105
|
+
};
|
|
106
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
107
|
+
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
108
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
109
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
110
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
111
|
+
};
|
|
112
|
+
readonly title: import("effect/Schema").String;
|
|
113
|
+
readonly command: import("effect/Schema").String;
|
|
114
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
115
|
+
readonly cwd: import("effect/Schema").String;
|
|
116
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
117
|
+
readonly pid: import("effect/Schema").Int;
|
|
118
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
119
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
120
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
121
|
+
};
|
|
122
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
123
|
+
readonly size: import("effect/Schema").Struct<{
|
|
124
|
+
readonly cols: import("effect/Schema").Int;
|
|
125
|
+
readonly rows: import("effect/Schema").Int;
|
|
126
|
+
}>;
|
|
127
|
+
readonly output: import("effect/Schema").Struct<{
|
|
128
|
+
readonly head: import("effect/Schema").Int;
|
|
129
|
+
readonly tail: import("effect/Schema").Int;
|
|
130
|
+
}>;
|
|
131
|
+
}>>;
|
|
132
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.read", "GET", "/api/experimental/session/:sessionID/terminal/read", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
133
|
+
sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
134
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
135
|
+
};
|
|
136
|
+
}>>, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
137
|
+
lines: import("effect/Schema").optional<import("effect/Schema").compose<import("effect/Schema").Int, import("effect/Schema").NumberFromString>>;
|
|
138
|
+
}>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
139
|
+
readonly data: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
140
|
+
readonly ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
141
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
142
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
143
|
+
};
|
|
144
|
+
readonly title: import("effect/Schema").String;
|
|
145
|
+
readonly cwd: import("effect/Schema").String;
|
|
146
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
147
|
+
readonly screen: import("effect/Schema").Struct<{
|
|
148
|
+
readonly text: import("effect/Schema").String;
|
|
149
|
+
readonly cols: import("effect/Schema").Int;
|
|
150
|
+
readonly rows: import("effect/Schema").Int;
|
|
151
|
+
readonly cursor: import("effect/Schema").Struct<{
|
|
152
|
+
readonly x: import("effect/Schema").Int;
|
|
153
|
+
readonly y: import("effect/Schema").Int;
|
|
154
|
+
}>;
|
|
155
|
+
}>;
|
|
156
|
+
}>>;
|
|
157
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.remove", "DELETE", "/api/experimental/persistent-pty/:ptyID", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
158
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
159
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
160
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
161
|
+
};
|
|
162
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/http-api/HttpApiSchema").NoContent>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.shutdown", "POST", "/api/experimental/persistent-pty/shutdown", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/http-api/HttpApiSchema").NoContent>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.snapshot", "GET", "/api/experimental/persistent-pty/:ptyID/snapshot", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
163
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
164
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
165
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
166
|
+
};
|
|
167
|
+
}>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
168
|
+
readonly data: import("effect/Schema").Struct<{
|
|
169
|
+
readonly info: import("effect/Schema").Struct<{
|
|
170
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
171
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
172
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
173
|
+
};
|
|
174
|
+
readonly title: import("effect/Schema").String;
|
|
175
|
+
readonly command: import("effect/Schema").String;
|
|
176
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
177
|
+
readonly cwd: import("effect/Schema").String;
|
|
178
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
179
|
+
readonly pid: import("effect/Schema").Int;
|
|
180
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
181
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
182
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
183
|
+
};
|
|
184
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
185
|
+
readonly size: import("effect/Schema").Struct<{
|
|
186
|
+
readonly cols: import("effect/Schema").Int;
|
|
187
|
+
readonly rows: import("effect/Schema").Int;
|
|
188
|
+
}>;
|
|
189
|
+
readonly output: import("effect/Schema").Struct<{
|
|
190
|
+
readonly head: import("effect/Schema").Int;
|
|
191
|
+
readonly tail: import("effect/Schema").Int;
|
|
192
|
+
}>;
|
|
193
|
+
}>;
|
|
194
|
+
readonly text: import("effect/Schema").String;
|
|
195
|
+
readonly checkpoint: import("effect/Schema").Uint8Array;
|
|
196
|
+
readonly cursor: import("effect/Schema").Struct<{
|
|
197
|
+
readonly x: import("effect/Schema").Int;
|
|
198
|
+
readonly y: import("effect/Schema").Int;
|
|
199
|
+
}>;
|
|
200
|
+
}>;
|
|
201
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").PtyNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.update", "PUT", "/api/experimental/persistent-pty/:ptyID", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
202
|
+
ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
203
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
204
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
205
|
+
};
|
|
206
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
207
|
+
readonly attachmentID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
|
|
208
|
+
readonly size: import("effect/Schema").Struct<{
|
|
209
|
+
readonly cols: import("effect/Schema").Int;
|
|
210
|
+
readonly rows: import("effect/Schema").Int;
|
|
211
|
+
}>;
|
|
212
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
213
|
+
readonly data: import("effect/Schema").Struct<{
|
|
214
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
|
|
215
|
+
create: () => string & import("effect/Brand").Brand<"PtyID">;
|
|
216
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
|
|
217
|
+
};
|
|
218
|
+
readonly title: import("effect/Schema").String;
|
|
219
|
+
readonly command: import("effect/Schema").String;
|
|
220
|
+
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
221
|
+
readonly cwd: import("effect/Schema").String;
|
|
222
|
+
readonly status: import("effect/Schema").Literals<readonly ["running", "exited"]>;
|
|
223
|
+
readonly pid: import("effect/Schema").Int;
|
|
224
|
+
readonly exitCode: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
|
|
225
|
+
readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
|
|
226
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
227
|
+
};
|
|
228
|
+
readonly foregroundProcess: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
229
|
+
readonly size: import("effect/Schema").Struct<{
|
|
230
|
+
readonly cols: import("effect/Schema").Int;
|
|
231
|
+
readonly rows: import("effect/Schema").Int;
|
|
232
|
+
}>;
|
|
233
|
+
readonly output: import("effect/Schema").Struct<{
|
|
234
|
+
readonly head: import("effect/Schema").Int;
|
|
235
|
+
readonly tail: import("effect/Schema").Int;
|
|
236
|
+
}>;
|
|
237
|
+
}>;
|
|
238
|
+
}>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ServiceUnavailableError | typeof import("../errors.js").PtyNotFoundError>, never, never>, false>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MediaGetEndpoint } from "./media.js";
|
|
2
|
+
import { PersistentPtyGroup } from "./persistent-pty.js";
|
|
3
|
+
/** `server.experimental`: routes under /api/experimental, without compatibility guarantees. */
|
|
4
|
+
export const ExperimentalGroup = PersistentPtyGroup.add(MediaGetEndpoint);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint } from "effect/http-api";
|
|
3
|
+
import { FileNotFoundError, InvalidRequestError } from "../errors.js";
|
|
4
|
+
export declare const MediaHash: Schema.String;
|
|
5
|
+
/** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
|
|
6
|
+
export declare const MediaGetEndpoint: HttpApiEndpoint.HttpApiEndpoint<"media.get", "GET", "/api/experimental/media/:hash", Schema.toCodecStringTree<Schema.Struct<{
|
|
7
|
+
hash: Schema.String;
|
|
8
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Uint8Array>, Schema.toCodecJson<typeof InvalidRequestError | typeof FileNotFoundError>, never, never>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
3
|
+
import { FileNotFoundError, InvalidRequestError } from "../errors.js";
|
|
4
|
+
export const MediaHash = Schema.String.check(Schema.isPattern(/^[0-9a-f]{64}$/u)).annotate({
|
|
5
|
+
identifier: "MediaHash",
|
|
6
|
+
});
|
|
7
|
+
/** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
|
|
8
|
+
export const MediaGetEndpoint = HttpApiEndpoint.get("media.get", "/api/experimental/media/:hash", {
|
|
9
|
+
params: { hash: MediaHash },
|
|
10
|
+
success: Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()),
|
|
11
|
+
error: [FileNotFoundError, InvalidRequestError],
|
|
12
|
+
}).annotateMerge(OpenApi.annotations({
|
|
13
|
+
identifier: "experimental.media.get",
|
|
14
|
+
summary: "Read media blob",
|
|
15
|
+
description: "Read a content-addressed media blob by SHA-256 hash with immutable Cache-Control, ETag, and 304 Not Modified support. Only blobs a stored message or inbox item still references are served. Experimental: may change without compatibility guarantees.",
|
|
16
|
+
// The route shares the `server.experimental` group with the persistent PTY prototype; tag it on its own.
|
|
17
|
+
transform: (operation) => ({ ...operation, tags: ["experimental"] }),
|
|
18
|
+
}));
|