@radheim/protocol 0.0.0-stage → 2.4.3

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.
Files changed (104) hide show
  1. package/dist/api.d.ts +60 -0
  2. package/dist/api.js +81 -0
  3. package/dist/client.d.ts +69 -0
  4. package/dist/client.js +102 -0
  5. package/dist/errors.d.ts +273 -0
  6. package/dist/errors.js +227 -0
  7. package/dist/groups/agent.d.ts +299 -0
  8. package/dist/groups/agent.js +30 -0
  9. package/dist/groups/artifact.d.ts +173 -0
  10. package/dist/groups/artifact.js +80 -0
  11. package/dist/groups/automation.d.ts +480 -0
  12. package/dist/groups/automation.js +55 -0
  13. package/dist/groups/blob.d.ts +415 -0
  14. package/dist/groups/blob.js +79 -0
  15. package/dist/groups/command.d.ts +15 -0
  16. package/dist/groups/command.js +20 -0
  17. package/dist/groups/config.d.ts +27 -0
  18. package/dist/groups/config.js +32 -0
  19. package/dist/groups/credential.d.ts +93 -0
  20. package/dist/groups/credential.js +50 -0
  21. package/dist/groups/debug.d.ts +22 -0
  22. package/dist/groups/debug.js +49 -0
  23. package/dist/groups/event.d.ts +16442 -0
  24. package/dist/groups/event.js +68 -0
  25. package/dist/groups/experimental/browser-tunnel.d.ts +20 -0
  26. package/dist/groups/experimental/browser-tunnel.js +29 -0
  27. package/dist/groups/experimental.d.ts +1519 -0
  28. package/dist/groups/experimental.js +12 -0
  29. package/dist/groups/flag.d.ts +12 -0
  30. package/dist/groups/flag.js +19 -0
  31. package/dist/groups/form.d.ts +138 -0
  32. package/dist/groups/form.js +18 -0
  33. package/dist/groups/fs.d.ts +60 -0
  34. package/dist/groups/fs.js +101 -0
  35. package/dist/groups/generate.d.ts +397 -0
  36. package/dist/groups/generate.js +77 -0
  37. package/dist/groups/integration.d.ts +1724 -0
  38. package/dist/groups/integration.js +169 -0
  39. package/dist/groups/job.d.ts +95 -0
  40. package/dist/groups/job.js +45 -0
  41. package/dist/groups/location.d.ts +23 -0
  42. package/dist/groups/location.js +47 -0
  43. package/dist/groups/machine.d.ts +91 -0
  44. package/dist/groups/machine.js +61 -0
  45. package/dist/groups/mcp.d.ts +104 -0
  46. package/dist/groups/mcp.js +125 -0
  47. package/dist/groups/media.d.ts +8 -0
  48. package/dist/groups/media.js +18 -0
  49. package/dist/groups/message.d.ts +3696 -0
  50. package/dist/groups/message.js +102 -0
  51. package/dist/groups/migration.d.ts +28 -0
  52. package/dist/groups/migration.js +21 -0
  53. package/dist/groups/model.d.ts +536 -0
  54. package/dist/groups/model.js +39 -0
  55. package/dist/groups/permission.d.ts +175 -0
  56. package/dist/groups/permission.js +115 -0
  57. package/dist/groups/persistent-pty.d.ts +251 -0
  58. package/dist/groups/persistent-pty.js +109 -0
  59. package/dist/groups/plugin.d.ts +102 -0
  60. package/dist/groups/plugin.js +59 -0
  61. package/dist/groups/project.d.ts +83 -0
  62. package/dist/groups/project.js +37 -0
  63. package/dist/groups/provider.d.ts +354 -0
  64. package/dist/groups/provider.js +34 -0
  65. package/dist/groups/pty.d.ts +151 -0
  66. package/dist/groups/pty.js +117 -0
  67. package/dist/groups/push.d.ts +123 -0
  68. package/dist/groups/push.js +60 -0
  69. package/dist/groups/reference.d.ts +25 -0
  70. package/dist/groups/reference.js +33 -0
  71. package/dist/groups/rpc.d.ts +21 -0
  72. package/dist/groups/rpc.js +24 -0
  73. package/dist/groups/server.d.ts +46 -0
  74. package/dist/groups/server.js +55 -0
  75. package/dist/groups/session.d.ts +11874 -0
  76. package/dist/groups/session.js +663 -0
  77. package/dist/groups/shell.d.ts +125 -0
  78. package/dist/groups/shell.js +65 -0
  79. package/dist/groups/skill.d.ts +26 -0
  80. package/dist/groups/skill.js +34 -0
  81. package/dist/groups/space.d.ts +56 -0
  82. package/dist/groups/space.js +59 -0
  83. package/dist/groups/usage.d.ts +96 -0
  84. package/dist/groups/usage.js +22 -0
  85. package/dist/groups/vcs.d.ts +89 -0
  86. package/dist/groups/vcs.js +94 -0
  87. package/dist/groups/voice.d.ts +81 -0
  88. package/dist/groups/voice.js +75 -0
  89. package/dist/groups/websearch.d.ts +29 -0
  90. package/dist/groups/websearch.js +34 -0
  91. package/dist/groups/worktree.d.ts +41 -0
  92. package/dist/groups/worktree.js +52 -0
  93. package/dist/middleware/authorization.d.ts +13 -0
  94. package/dist/middleware/authorization.js +6 -0
  95. package/dist/middleware/schema-error.d.ts +13 -0
  96. package/dist/middleware/schema-error.js +4 -0
  97. package/dist/simulation/image.d.ts +35 -0
  98. package/dist/simulation/image.js +21 -0
  99. package/dist/simulation/terminal.d.ts +81 -0
  100. package/dist/simulation/terminal.js +49 -0
  101. package/dist/simulation.d.ts +1784 -0
  102. package/dist/simulation.js +485 -0
  103. package/package.json +46 -4
  104. package/README.md +0 -3
@@ -0,0 +1,415 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiSchema } from "effect/http-api";
3
+ import { BlobNotFoundError, InvalidCursorError, InvalidRequestError, ServiceUnavailableError, SessionNotFoundError } from "../errors.js";
4
+ export declare const ListQuery: Schema.Struct<{
5
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
6
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
7
+ }>;
8
+ readonly limit: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
9
+ readonly cursor: Schema.optional<Schema.brand<Schema.String, "Blob.ListCursor"> & {
10
+ make: (input: {
11
+ readonly sessionID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
12
+ readonly time: number;
13
+ readonly id: string & import("effect/Brand").Brand<"Blob.ID">;
14
+ readonly direction: "next" | "previous";
15
+ }) => string & import("effect/Brand").Brand<"Blob.ListCursor">;
16
+ parse: (input: string) => import("effect/Effect").Effect<{
17
+ readonly sessionID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
18
+ readonly time: number;
19
+ readonly id: string & import("effect/Brand").Brand<"Blob.ID">;
20
+ readonly direction: "next" | "previous";
21
+ }, "Invalid cursor", never>;
22
+ }>;
23
+ }>;
24
+ export type ListQuery = typeof ListQuery.Type;
25
+ export declare const CreateQuery: Schema.Struct<{
26
+ readonly name: Schema.optional<Schema.String>;
27
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
28
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
29
+ }>;
30
+ }>;
31
+ export type CreateQuery = typeof CreateQuery.Type;
32
+ export declare const UpdatePayload: Schema.Struct<{
33
+ readonly name: Schema.optional<Schema.String>;
34
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
35
+ }>;
36
+ export type UpdatePayload = typeof UpdatePayload.Type;
37
+ /** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
38
+ export declare const BlobEndpoints: readonly [HttpApiEndpoint.HttpApiEndpoint<"blob.list", "GET", "/api/experimental/blob", never, Schema.toCodecStringTree<Schema.Struct<{
39
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
40
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
41
+ }>;
42
+ readonly limit: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
43
+ readonly cursor: Schema.optional<Schema.brand<Schema.String, "Blob.ListCursor"> & {
44
+ make: (input: {
45
+ readonly sessionID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
46
+ readonly time: number;
47
+ readonly id: string & import("effect/Brand").Brand<"Blob.ID">;
48
+ readonly direction: "next" | "previous";
49
+ }) => string & import("effect/Brand").Brand<"Blob.ListCursor">;
50
+ parse: (input: string) => import("effect/Effect").Effect<{
51
+ readonly sessionID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
52
+ readonly time: number;
53
+ readonly id: string & import("effect/Brand").Brand<"Blob.ID">;
54
+ readonly direction: "next" | "previous";
55
+ }, "Invalid cursor", never>;
56
+ }>;
57
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
58
+ readonly data: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
59
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
60
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
61
+ };
62
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
63
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
64
+ }>;
65
+ readonly mime: Schema.String;
66
+ readonly bytes: Schema.Finite;
67
+ readonly name: Schema.optional<Schema.String>;
68
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
69
+ readonly time: Schema.Struct<{
70
+ readonly created: Schema.Finite;
71
+ readonly updated: Schema.Finite;
72
+ }>;
73
+ readonly type: Schema.Literal<"image">;
74
+ readonly size: Schema.optional<Schema.Struct<{
75
+ readonly width: Schema.Finite;
76
+ readonly height: Schema.Finite;
77
+ }>>;
78
+ }>, Schema.Struct<{
79
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
80
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
81
+ };
82
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
83
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
84
+ }>;
85
+ readonly mime: Schema.String;
86
+ readonly bytes: Schema.Finite;
87
+ readonly name: Schema.optional<Schema.String>;
88
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
89
+ readonly time: Schema.Struct<{
90
+ readonly created: Schema.Finite;
91
+ readonly updated: Schema.Finite;
92
+ }>;
93
+ readonly type: Schema.Literal<"video">;
94
+ readonly size: Schema.optional<Schema.Struct<{
95
+ readonly width: Schema.Finite;
96
+ readonly height: Schema.Finite;
97
+ }>>;
98
+ readonly durationMs: Schema.optional<Schema.Finite>;
99
+ }>, Schema.Struct<{
100
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
101
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
102
+ };
103
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
104
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
105
+ }>;
106
+ readonly mime: Schema.String;
107
+ readonly bytes: Schema.Finite;
108
+ readonly name: Schema.optional<Schema.String>;
109
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
110
+ readonly time: Schema.Struct<{
111
+ readonly created: Schema.Finite;
112
+ readonly updated: Schema.Finite;
113
+ }>;
114
+ readonly type: Schema.Literal<"audio">;
115
+ readonly durationMs: Schema.optional<Schema.Finite>;
116
+ }>, Schema.Struct<{
117
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
118
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
119
+ };
120
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
121
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
122
+ }>;
123
+ readonly mime: Schema.String;
124
+ readonly bytes: Schema.Finite;
125
+ readonly name: Schema.optional<Schema.String>;
126
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
127
+ readonly time: Schema.Struct<{
128
+ readonly created: Schema.Finite;
129
+ readonly updated: Schema.Finite;
130
+ }>;
131
+ readonly type: Schema.Literal<"file">;
132
+ }>]>>;
133
+ readonly cursor: Schema.Struct<{
134
+ readonly previous: Schema.optional<Schema.brand<Schema.String, "Blob.ListCursor"> & {
135
+ make: (input: {
136
+ readonly sessionID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
137
+ readonly time: number;
138
+ readonly id: string & import("effect/Brand").Brand<"Blob.ID">;
139
+ readonly direction: "next" | "previous";
140
+ }) => string & import("effect/Brand").Brand<"Blob.ListCursor">;
141
+ parse: (input: string) => import("effect/Effect").Effect<{
142
+ readonly sessionID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
143
+ readonly time: number;
144
+ readonly id: string & import("effect/Brand").Brand<"Blob.ID">;
145
+ readonly direction: "next" | "previous";
146
+ }, "Invalid cursor", never>;
147
+ }>;
148
+ readonly next: Schema.optional<Schema.brand<Schema.String, "Blob.ListCursor"> & {
149
+ make: (input: {
150
+ readonly sessionID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
151
+ readonly time: number;
152
+ readonly id: string & import("effect/Brand").Brand<"Blob.ID">;
153
+ readonly direction: "next" | "previous";
154
+ }) => string & import("effect/Brand").Brand<"Blob.ListCursor">;
155
+ parse: (input: string) => import("effect/Effect").Effect<{
156
+ readonly sessionID?: (string & import("effect/Brand").Brand<"SessionID">) | undefined;
157
+ readonly time: number;
158
+ readonly id: string & import("effect/Brand").Brand<"Blob.ID">;
159
+ readonly direction: "next" | "previous";
160
+ }, "Invalid cursor", never>;
161
+ }>;
162
+ }>;
163
+ }>>, Schema.toCodecJson<typeof InvalidCursorError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"blob.create", "POST", "/api/experimental/blob", never, Schema.toCodecStringTree<Schema.Struct<{
164
+ readonly name: Schema.optional<Schema.String>;
165
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
166
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
167
+ }>;
168
+ }>>, Schema.toCodecJson<Schema.Uint8Array>, never, Schema.toCodecJson<Schema.Struct<{
169
+ readonly data: Schema.Union<readonly [Schema.Struct<{
170
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
171
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
172
+ };
173
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
174
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
175
+ }>;
176
+ readonly mime: Schema.String;
177
+ readonly bytes: Schema.Finite;
178
+ readonly name: Schema.optional<Schema.String>;
179
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
180
+ readonly time: Schema.Struct<{
181
+ readonly created: Schema.Finite;
182
+ readonly updated: Schema.Finite;
183
+ }>;
184
+ readonly type: Schema.Literal<"image">;
185
+ readonly size: Schema.optional<Schema.Struct<{
186
+ readonly width: Schema.Finite;
187
+ readonly height: Schema.Finite;
188
+ }>>;
189
+ }>, Schema.Struct<{
190
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
191
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
192
+ };
193
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
194
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
195
+ }>;
196
+ readonly mime: Schema.String;
197
+ readonly bytes: Schema.Finite;
198
+ readonly name: Schema.optional<Schema.String>;
199
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
200
+ readonly time: Schema.Struct<{
201
+ readonly created: Schema.Finite;
202
+ readonly updated: Schema.Finite;
203
+ }>;
204
+ readonly type: Schema.Literal<"video">;
205
+ readonly size: Schema.optional<Schema.Struct<{
206
+ readonly width: Schema.Finite;
207
+ readonly height: Schema.Finite;
208
+ }>>;
209
+ readonly durationMs: Schema.optional<Schema.Finite>;
210
+ }>, Schema.Struct<{
211
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
212
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
213
+ };
214
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
215
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
216
+ }>;
217
+ readonly mime: Schema.String;
218
+ readonly bytes: Schema.Finite;
219
+ readonly name: Schema.optional<Schema.String>;
220
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
221
+ readonly time: Schema.Struct<{
222
+ readonly created: Schema.Finite;
223
+ readonly updated: Schema.Finite;
224
+ }>;
225
+ readonly type: Schema.Literal<"audio">;
226
+ readonly durationMs: Schema.optional<Schema.Finite>;
227
+ }>, Schema.Struct<{
228
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
229
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
230
+ };
231
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
232
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
233
+ }>;
234
+ readonly mime: Schema.String;
235
+ readonly bytes: Schema.Finite;
236
+ readonly name: Schema.optional<Schema.String>;
237
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
238
+ readonly time: Schema.Struct<{
239
+ readonly created: Schema.Finite;
240
+ readonly updated: Schema.Finite;
241
+ }>;
242
+ readonly type: Schema.Literal<"file">;
243
+ }>]>;
244
+ }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof ServiceUnavailableError | typeof SessionNotFoundError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"blob.get", "GET", "/api/experimental/blob/:blobID", Schema.toCodecStringTree<Schema.Struct<{
245
+ blobID: Schema.brand<Schema.String, "Blob.ID"> & {
246
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
247
+ };
248
+ }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
249
+ readonly data: Schema.Union<readonly [Schema.Struct<{
250
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
251
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
252
+ };
253
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
254
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
255
+ }>;
256
+ readonly mime: Schema.String;
257
+ readonly bytes: Schema.Finite;
258
+ readonly name: Schema.optional<Schema.String>;
259
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
260
+ readonly time: Schema.Struct<{
261
+ readonly created: Schema.Finite;
262
+ readonly updated: Schema.Finite;
263
+ }>;
264
+ readonly type: Schema.Literal<"image">;
265
+ readonly size: Schema.optional<Schema.Struct<{
266
+ readonly width: Schema.Finite;
267
+ readonly height: Schema.Finite;
268
+ }>>;
269
+ }>, Schema.Struct<{
270
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
271
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
272
+ };
273
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
274
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
275
+ }>;
276
+ readonly mime: Schema.String;
277
+ readonly bytes: Schema.Finite;
278
+ readonly name: Schema.optional<Schema.String>;
279
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
280
+ readonly time: Schema.Struct<{
281
+ readonly created: Schema.Finite;
282
+ readonly updated: Schema.Finite;
283
+ }>;
284
+ readonly type: Schema.Literal<"video">;
285
+ readonly size: Schema.optional<Schema.Struct<{
286
+ readonly width: Schema.Finite;
287
+ readonly height: Schema.Finite;
288
+ }>>;
289
+ readonly durationMs: Schema.optional<Schema.Finite>;
290
+ }>, Schema.Struct<{
291
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
292
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
293
+ };
294
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
295
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
296
+ }>;
297
+ readonly mime: Schema.String;
298
+ readonly bytes: Schema.Finite;
299
+ readonly name: Schema.optional<Schema.String>;
300
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
301
+ readonly time: Schema.Struct<{
302
+ readonly created: Schema.Finite;
303
+ readonly updated: Schema.Finite;
304
+ }>;
305
+ readonly type: Schema.Literal<"audio">;
306
+ readonly durationMs: Schema.optional<Schema.Finite>;
307
+ }>, Schema.Struct<{
308
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
309
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
310
+ };
311
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
312
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
313
+ }>;
314
+ readonly mime: Schema.String;
315
+ readonly bytes: Schema.Finite;
316
+ readonly name: Schema.optional<Schema.String>;
317
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
318
+ readonly time: Schema.Struct<{
319
+ readonly created: Schema.Finite;
320
+ readonly updated: Schema.Finite;
321
+ }>;
322
+ readonly type: Schema.Literal<"file">;
323
+ }>]>;
324
+ }>>, Schema.toCodecJson<typeof BlobNotFoundError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"blob.content", "GET", "/api/experimental/blob/:blobID/content", Schema.toCodecStringTree<Schema.Struct<{
325
+ blobID: Schema.brand<Schema.String, "Blob.ID"> & {
326
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
327
+ };
328
+ }>>, never, never, never, Schema.toCodecJson<Schema.Uint8Array>, Schema.toCodecJson<typeof BlobNotFoundError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"blob.update", "PATCH", "/api/experimental/blob/:blobID", Schema.toCodecStringTree<Schema.Struct<{
329
+ blobID: Schema.brand<Schema.String, "Blob.ID"> & {
330
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
331
+ };
332
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
333
+ readonly name: Schema.optional<Schema.String>;
334
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
335
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
336
+ readonly data: Schema.Union<readonly [Schema.Struct<{
337
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
338
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
339
+ };
340
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
341
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
342
+ }>;
343
+ readonly mime: Schema.String;
344
+ readonly bytes: Schema.Finite;
345
+ readonly name: Schema.optional<Schema.String>;
346
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
347
+ readonly time: Schema.Struct<{
348
+ readonly created: Schema.Finite;
349
+ readonly updated: Schema.Finite;
350
+ }>;
351
+ readonly type: Schema.Literal<"image">;
352
+ readonly size: Schema.optional<Schema.Struct<{
353
+ readonly width: Schema.Finite;
354
+ readonly height: Schema.Finite;
355
+ }>>;
356
+ }>, Schema.Struct<{
357
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
358
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
359
+ };
360
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
361
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
362
+ }>;
363
+ readonly mime: Schema.String;
364
+ readonly bytes: Schema.Finite;
365
+ readonly name: Schema.optional<Schema.String>;
366
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
367
+ readonly time: Schema.Struct<{
368
+ readonly created: Schema.Finite;
369
+ readonly updated: Schema.Finite;
370
+ }>;
371
+ readonly type: Schema.Literal<"video">;
372
+ readonly size: Schema.optional<Schema.Struct<{
373
+ readonly width: Schema.Finite;
374
+ readonly height: Schema.Finite;
375
+ }>>;
376
+ readonly durationMs: Schema.optional<Schema.Finite>;
377
+ }>, Schema.Struct<{
378
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
379
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
380
+ };
381
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
382
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
383
+ }>;
384
+ readonly mime: Schema.String;
385
+ readonly bytes: Schema.Finite;
386
+ readonly name: Schema.optional<Schema.String>;
387
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
388
+ readonly time: Schema.Struct<{
389
+ readonly created: Schema.Finite;
390
+ readonly updated: Schema.Finite;
391
+ }>;
392
+ readonly type: Schema.Literal<"audio">;
393
+ readonly durationMs: Schema.optional<Schema.Finite>;
394
+ }>, Schema.Struct<{
395
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
396
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
397
+ };
398
+ readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
399
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
400
+ }>;
401
+ readonly mime: Schema.String;
402
+ readonly bytes: Schema.Finite;
403
+ readonly name: Schema.optional<Schema.String>;
404
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
405
+ readonly time: Schema.Struct<{
406
+ readonly created: Schema.Finite;
407
+ readonly updated: Schema.Finite;
408
+ }>;
409
+ readonly type: Schema.Literal<"file">;
410
+ }>]>;
411
+ }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof BlobNotFoundError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"blob.remove", "DELETE", "/api/experimental/blob/:blobID", Schema.toCodecStringTree<Schema.Struct<{
412
+ blobID: Schema.brand<Schema.String, "Blob.ID"> & {
413
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
414
+ };
415
+ }>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof BlobNotFoundError>, never, never>];
@@ -0,0 +1,79 @@
1
+ import { BlobStore } from "@radheim/schema/blob-store";
2
+ import { Session } from "@radheim/schema/session";
3
+ import { Schema } from "effect";
4
+ import { HttpApiEndpoint, HttpApiSchema, OpenApi } from "effect/http-api";
5
+ import { PositiveInt } from "@radheim/schema/schema";
6
+ import { BlobNotFoundError, InvalidCursorError, InvalidRequestError, ServiceUnavailableError, SessionNotFoundError, } from "../errors.js";
7
+ const EXPERIMENTAL = "Experimental: may change without compatibility guarantees.";
8
+ const params = { blobID: BlobStore.ID };
9
+ const annotations = (identifier, summary, description) => OpenApi.annotations({
10
+ identifier: `experimental.blob.${identifier}`,
11
+ summary,
12
+ description: `${description} ${EXPERIMENTAL}`,
13
+ // The routes share the `server.experimental` group with the persistent PTY prototype; tag them on their own.
14
+ transform: (operation) => ({ ...operation, tags: ["experimental"] }),
15
+ });
16
+ export const ListQuery = Schema.Struct({
17
+ sessionID: Schema.optional(Session.ID).annotate({ description: "Only blobs made in this session." }),
18
+ limit: Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional).annotate({
19
+ description: "Maximum number of blobs to return. Defaults to 50.",
20
+ }),
21
+ cursor: BlobStore.ListCursor.pipe(Schema.optional).annotate({
22
+ description: "Opaque cursor from a previous page's cursor.next or cursor.previous. It carries that page's filter, so sessionID is ignored.",
23
+ }),
24
+ }).annotate({ identifier: "Blob.ListQuery" });
25
+ export const CreateQuery = Schema.Struct({
26
+ name: Schema.optional(Schema.String).annotate({ description: "A display name, such as the file name." }),
27
+ sessionID: Schema.optional(Session.ID).annotate({
28
+ description: "The session the blob belongs with. A label only: deleting the session keeps the blob.",
29
+ }),
30
+ }).annotate({ identifier: "Blob.CreateQuery" });
31
+ export const UpdatePayload = Schema.Struct({
32
+ name: Schema.optional(Schema.String),
33
+ metadata: Schema.optional(BlobStore.Metadata).annotate({
34
+ description: "Replaces the blob's metadata. At most 100 KB as JSON.",
35
+ }),
36
+ }).annotate({ identifier: "Blob.UpdatePayload" });
37
+ /** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
38
+ export const BlobEndpoints = [
39
+ HttpApiEndpoint.get("blob.list", "/api/experimental/blob", {
40
+ query: ListQuery,
41
+ success: Schema.Struct({
42
+ data: Schema.Array(BlobStore.Info),
43
+ cursor: Schema.Struct({
44
+ previous: BlobStore.ListCursor.pipe(Schema.optional),
45
+ next: BlobStore.ListCursor.pipe(Schema.optional),
46
+ }),
47
+ }).annotate({ identifier: "Blob.ListResponse" }),
48
+ error: [InvalidCursorError],
49
+ }).annotateMerge(annotations("list", "List blobs", "List stored blobs newest first, one session's or every blob. Use cursor.next or cursor.previous to move through the pages.")),
50
+ // Raw, so the body streams into the store and its content-type can serve as a hint.
51
+ HttpApiEndpoint.post("blob.create", "/api/experimental/blob", {
52
+ query: CreateQuery,
53
+ payload: Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()),
54
+ success: Schema.Struct({ data: BlobStore.Info }),
55
+ error: [InvalidRequestError, ServiceUnavailableError, SessionNotFoundError],
56
+ }).annotateMerge(annotations("create", "Create blob", `Store the raw request body as a new blob. Its type is read from its first bytes, falling back to the request's content-type; an image's or video's size and a video's length are read from its headers.`)),
57
+ HttpApiEndpoint.get("blob.get", "/api/experimental/blob/:blobID", {
58
+ params,
59
+ success: Schema.Struct({ data: BlobStore.Info }),
60
+ error: [BlobNotFoundError],
61
+ }).annotateMerge(annotations("get", "Get blob", "Read a stored blob's info. Its bytes are at /content.")),
62
+ // Raw, so it can stream the bytes and answer Range and 304 itself.
63
+ HttpApiEndpoint.get("blob.content", "/api/experimental/blob/:blobID/content", {
64
+ params,
65
+ success: Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()),
66
+ error: [BlobNotFoundError],
67
+ }).annotateMerge(annotations("content", "Read blob content", "Stream a stored blob's bytes, such as a generated video, with single byte Range, ETag and 304 Not Modified support.")),
68
+ HttpApiEndpoint.patch("blob.update", "/api/experimental/blob/:blobID", {
69
+ params,
70
+ payload: UpdatePayload,
71
+ success: Schema.Struct({ data: BlobStore.Info }),
72
+ error: [BlobNotFoundError, InvalidRequestError],
73
+ }).annotateMerge(annotations("update", "Update blob", `Change a blob's name or metadata. Its bytes, and what was read from them, never change.`)),
74
+ HttpApiEndpoint.delete("blob.remove", "/api/experimental/blob/:blobID", {
75
+ params,
76
+ success: HttpApiSchema.NoContent,
77
+ error: [BlobNotFoundError],
78
+ }).annotateMerge(annotations("remove", "Delete blob", `Delete a blob and its bytes.`)),
79
+ ];
@@ -0,0 +1,15 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
3
+ export declare const CommandGroup: HttpApiGroup.HttpApiGroup<"server.command", HttpApiEndpoint.HttpApiEndpoint<"command.list", "GET", "/api/command", never, Schema.toCodecStringTree<Schema.Struct<{
4
+ readonly location: Schema.optional<Schema.Struct<{
5
+ readonly directory: Schema.optional<Schema.String>;
6
+ }>>;
7
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
8
+ readonly location: Schema.Struct<{
9
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
10
+ }>;
11
+ readonly data: Schema.$Array<Schema.Struct<{
12
+ readonly name: Schema.String;
13
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14
+ }>>;
15
+ }>>, never, never, never>, false>;
@@ -0,0 +1,20 @@
1
+ import { Command } from "@radheim/schema/command";
2
+ import { Location } from "@radheim/schema/location";
3
+ import { Schema } from "effect";
4
+ import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
5
+ import { LocationQuery, locationQueryOpenApi } from "./location.js";
6
+ export const CommandGroup = HttpApiGroup.make("server.command")
7
+ .add(HttpApiEndpoint.get("command.list", "/api/command", {
8
+ query: LocationQuery,
9
+ success: Location.response(Schema.Array(Command.Info)),
10
+ })
11
+ .annotateMerge(locationQueryOpenApi)
12
+ .annotateMerge(OpenApi.annotations({
13
+ identifier: "command.list",
14
+ summary: "List commands",
15
+ description: "Retrieve currently registered commands.",
16
+ })))
17
+ .annotateMerge(OpenApi.annotations({
18
+ title: "command",
19
+ description: "Experimental command routes.",
20
+ }));
@@ -0,0 +1,27 @@
1
+ import { Config } from "@radheim/schema/config";
2
+ import { Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
4
+ export declare const ConfigGroup: HttpApiGroup.HttpApiGroup<"server.config", HttpApiEndpoint.HttpApiEndpoint<"config.get", "GET", "/api/config", never, Schema.toCodecStringTree<Schema.Struct<{
5
+ readonly location: Schema.optional<Schema.Struct<{
6
+ readonly directory: Schema.optional<Schema.String>;
7
+ }>>;
8
+ }>>, never, never, Schema.toCodecJson<Schema.$Array<Schema.Union<readonly [typeof Config.Document, typeof Config.Directory]>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"config.shells", "GET", "/api/config/shell", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
9
+ readonly path: Schema.String;
10
+ readonly name: Schema.String;
11
+ readonly acceptable: Schema.Boolean;
12
+ }>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"config.update", "PATCH", "/api/experimental/config", never, never, Schema.toCodecJson<Schema.Struct<{
13
+ readonly shell: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NullOr<Schema.String>>>, Schema.optionalKey<Schema.NullOr<Schema.String>>, never, never>;
14
+ readonly agents: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
15
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
16
+ readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NullOr<Schema.String>>>, Schema.optionalKey<Schema.NullOr<Schema.String>>, never, never>;
17
+ }>>>, Schema.optionalKey<Schema.Struct<{
18
+ readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NullOr<Schema.String>>>, Schema.optionalKey<Schema.NullOr<Schema.String>>, never, never>;
19
+ }>>, never, never>;
20
+ }>>>, Schema.optionalKey<Schema.Struct<{
21
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
22
+ readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NullOr<Schema.String>>>, Schema.optionalKey<Schema.NullOr<Schema.String>>, never, never>;
23
+ }>>>, Schema.optionalKey<Schema.Struct<{
24
+ readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NullOr<Schema.String>>>, Schema.optionalKey<Schema.NullOr<Schema.String>>, never, never>;
25
+ }>>, never, never>;
26
+ }>>, never, never>;
27
+ }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
@@ -0,0 +1,32 @@
1
+ import { Config } from "@radheim/schema/config";
2
+ import { ConfigShell } from "@radheim/schema/config/shell";
3
+ import { Schema } from "effect";
4
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
5
+ import { LocationQuery, locationQueryOpenApi } from "./location.js";
6
+ export const ConfigGroup = HttpApiGroup.make("server.config")
7
+ .add(HttpApiEndpoint.get("config.get", "/api/config", {
8
+ query: LocationQuery,
9
+ success: Schema.Array(Config.Entry),
10
+ })
11
+ .annotateMerge(locationQueryOpenApi)
12
+ .annotateMerge(OpenApi.annotations({
13
+ identifier: "config.get",
14
+ summary: "Get configuration",
15
+ description: "Return configuration documents and discovery sources for the requested location, from lowest to highest priority.",
16
+ })))
17
+ .add(HttpApiEndpoint.get("config.shells", "/api/config/shell", {
18
+ success: Schema.Array(ConfigShell.Option),
19
+ }).annotateMerge(OpenApi.annotations({
20
+ identifier: "config.shells",
21
+ summary: "List available shells",
22
+ description: "Return shells available to terminal and agent execution.",
23
+ })))
24
+ .add(HttpApiEndpoint.patch("config.update", "/api/experimental/config", {
25
+ payload: Config.Patch,
26
+ success: HttpApiSchema.NoContent,
27
+ }).annotateMerge(OpenApi.annotations({
28
+ identifier: "experimental.config.update",
29
+ summary: "Update global configuration",
30
+ description: "Patch supported fields in the highest-precedence global configuration document.",
31
+ })))
32
+ .annotateMerge(OpenApi.annotations({ title: "config", description: "Location-scoped configuration routes." }));