@zyro-sec/protocol 1.0.2 → 1.0.4

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 (61) hide show
  1. package/openapi.json +33222 -33222
  2. package/package.json +2 -2
  3. package/script/build.ts +9 -9
  4. package/script/generate-openapi.ts +25 -25
  5. package/script/openapi-parameters.ts +30 -30
  6. package/script/openapi-stabilize.ts +102 -102
  7. package/script/pack.ts +5 -5
  8. package/src/api.ts +264 -264
  9. package/src/client.ts +127 -127
  10. package/src/errors.ts +398 -398
  11. package/src/groups/agent.ts +39 -39
  12. package/src/groups/artifact.ts +103 -103
  13. package/src/groups/automation.ts +75 -75
  14. package/src/groups/blob.ts +20 -20
  15. package/src/groups/command.ts +27 -27
  16. package/src/groups/config.ts +46 -46
  17. package/src/groups/credential.ts +72 -72
  18. package/src/groups/debug.ts +68 -68
  19. package/src/groups/event.ts +86 -86
  20. package/src/groups/experimental.ts +19 -19
  21. package/src/groups/form.ts +26 -26
  22. package/src/groups/fs.ts +136 -136
  23. package/src/groups/generate.ts +120 -120
  24. package/src/groups/integration.ts +230 -230
  25. package/src/groups/job.ts +57 -57
  26. package/src/groups/location.ts +66 -66
  27. package/src/groups/machine.ts +120 -120
  28. package/src/groups/mcp.ts +167 -167
  29. package/src/groups/media.ts +23 -23
  30. package/src/groups/message.ts +124 -124
  31. package/src/groups/migration.ts +28 -28
  32. package/src/groups/model.ts +52 -52
  33. package/src/groups/permission.ts +164 -164
  34. package/src/groups/persistent-pty.ts +153 -153
  35. package/src/groups/plugin.ts +80 -80
  36. package/src/groups/project.ts +51 -51
  37. package/src/groups/provider.ts +45 -45
  38. package/src/groups/pty.ts +153 -153
  39. package/src/groups/push.ts +94 -94
  40. package/src/groups/reference.ts +42 -42
  41. package/src/groups/rpc.ts +30 -30
  42. package/src/groups/server.ts +80 -80
  43. package/src/groups/session.ts +918 -918
  44. package/src/groups/shell.ts +88 -88
  45. package/src/groups/skill.ts +46 -46
  46. package/src/groups/usage.ts +30 -30
  47. package/src/groups/vcs.ts +131 -131
  48. package/src/groups/voice.ts +96 -96
  49. package/src/groups/websearch.ts +46 -46
  50. package/src/groups/worktree.ts +78 -78
  51. package/src/middleware/authorization.ts +6 -6
  52. package/src/middleware/schema-error.ts +7 -7
  53. package/src/simulation.ts +691 -691
  54. package/tsconfig.build.json +11 -11
  55. package/tsconfig.json +14 -14
  56. package/test/event.test.ts +0 -34
  57. package/test/experimental-identifiers.test.ts +0 -24
  58. package/test/openapi-parameters.test.ts +0 -43
  59. package/test/openapi-patterns.test.ts +0 -28
  60. package/test/openapi-stabilize.test.ts +0 -161
  61. package/test/session-cursor.test.ts +0 -7
package/src/errors.ts CHANGED
@@ -1,398 +1,398 @@
1
- import { Schema } from "effect"
2
- import { Skill } from "@zyro-sec/schema/skill"
3
- import { Location } from "@zyro-sec/schema/location"
4
-
5
- export class LocationNotFoundError extends Schema.TaggedError<LocationNotFoundError>()(
6
- "LocationNotFoundError",
7
- { location: Location.PublicRef, message: Schema.String },
8
- { httpApiStatus: 404 },
9
- ) {}
10
-
11
- export class InvalidRequestError extends Schema.TaggedError<InvalidRequestError>()(
12
- "InvalidRequestError",
13
- {
14
- message: Schema.String,
15
- kind: Schema.optional(Schema.String),
16
- field: Schema.optional(Schema.String),
17
- },
18
- { httpApiStatus: 400 },
19
- ) {}
20
-
21
- export class RpcError extends Schema.TaggedError<RpcError>()(
22
- "RpcError",
23
- {
24
- type: Schema.String,
25
- message: Schema.String,
26
- data: Schema.optional(Schema.Unknown),
27
- },
28
- { httpApiStatus: 400 },
29
- ) {}
30
-
31
- export class RpcInternalError extends Schema.TaggedError<RpcInternalError>()(
32
- "RpcInternalError",
33
- {
34
- type: Schema.Literals(["rpc.internal", "rpc.invalid_output"]),
35
- message: Schema.String,
36
- data: Schema.optional(Schema.Unknown),
37
- },
38
- { httpApiStatus: 500 },
39
- ) {}
40
-
41
- export class UnauthorizedError extends Schema.TaggedError<UnauthorizedError>()(
42
- "UnauthorizedError",
43
- { message: Schema.String },
44
- { httpApiStatus: 401 },
45
- ) {}
46
-
47
- export class ConflictError extends Schema.TaggedError<ConflictError>()(
48
- "ConflictError",
49
- {
50
- message: Schema.String,
51
- resource: Schema.optional(Schema.String),
52
- },
53
- { httpApiStatus: 409 },
54
- ) {}
55
-
56
- export class SessionBusyError extends Schema.TaggedError<SessionBusyError>()(
57
- "SessionBusyError",
58
- {
59
- sessionID: Schema.String,
60
- message: Schema.String,
61
- },
62
- { httpApiStatus: 409 },
63
- ) {}
64
-
65
- export class ServiceUnavailableError extends Schema.TaggedError<ServiceUnavailableError>()(
66
- "ServiceUnavailableError",
67
- {
68
- message: Schema.String,
69
- service: Schema.optional(Schema.String),
70
- },
71
- { httpApiStatus: 503 },
72
- ) {}
73
-
74
- export class UnknownError extends Schema.TaggedError<UnknownError>()(
75
- "UnknownError",
76
- {
77
- message: Schema.String,
78
- ref: Schema.optional(Schema.String),
79
- },
80
- { httpApiStatus: 500 },
81
- ) {}
82
-
83
- export class ProviderNotFoundError extends Schema.TaggedError<ProviderNotFoundError>()(
84
- "ProviderNotFoundError",
85
- {
86
- providerID: Schema.String,
87
- message: Schema.String,
88
- },
89
- { httpApiStatus: 404 },
90
- ) {}
91
-
92
- export class IntegrationNotFoundError extends Schema.TaggedError<IntegrationNotFoundError>()(
93
- "IntegrationNotFoundError",
94
- {
95
- integrationID: Schema.String,
96
- message: Schema.String,
97
- },
98
- { httpApiStatus: 404 },
99
- ) {}
100
-
101
- export class IntegrationAttemptNotFoundError extends Schema.TaggedError<IntegrationAttemptNotFoundError>()(
102
- "IntegrationAttemptNotFoundError",
103
- {
104
- integrationID: Schema.String,
105
- attemptID: Schema.String,
106
- message: Schema.String,
107
- },
108
- { httpApiStatus: 404 },
109
- ) {}
110
-
111
- export class IntegrationMethodNotFoundError extends Schema.TaggedError<IntegrationMethodNotFoundError>()(
112
- "IntegrationMethodNotFoundError",
113
- {
114
- integrationID: Schema.String,
115
- methodID: Schema.String,
116
- message: Schema.String,
117
- },
118
- { httpApiStatus: 404 },
119
- ) {}
120
-
121
- export class ProjectNotFoundError extends Schema.TaggedError<ProjectNotFoundError>()(
122
- "ProjectNotFoundError",
123
- {
124
- projectID: Schema.String,
125
- message: Schema.String,
126
- },
127
- { httpApiStatus: 404 },
128
- ) {}
129
-
130
- export class FileNotFoundError extends Schema.TaggedError<FileNotFoundError>()(
131
- "FileNotFoundError",
132
- {
133
- path: Schema.String,
134
- message: Schema.String,
135
- },
136
- { httpApiStatus: 404 },
137
- ) {}
138
-
139
- export class PluginNotFoundError extends Schema.TaggedError<PluginNotFoundError>()(
140
- "PluginNotFoundError",
141
- {
142
- pluginID: Schema.String,
143
- message: Schema.String,
144
- },
145
- { httpApiStatus: 404 },
146
- ) {}
147
- export class AgentNotFoundError extends Schema.TaggedError<AgentNotFoundError>()(
148
- "AgentNotFoundError",
149
- {
150
- agentID: Schema.String,
151
- message: Schema.String,
152
- },
153
- { httpApiStatus: 404 },
154
- ) {}
155
-
156
- export class SessionNotFoundError extends Schema.TaggedError<SessionNotFoundError>()(
157
- "SessionNotFoundError",
158
- {
159
- sessionID: Schema.String,
160
- message: Schema.String,
161
- },
162
- { httpApiStatus: 404 },
163
- ) {}
164
-
165
- export class MessageNotFoundError extends Schema.TaggedError<MessageNotFoundError>()(
166
- "MessageNotFoundError",
167
- {
168
- sessionID: Schema.String,
169
- messageID: Schema.String,
170
- message: Schema.String,
171
- },
172
- { httpApiStatus: 404 },
173
- ) {}
174
-
175
- export class SkillNotFoundError extends Schema.TaggedError<SkillNotFoundError>()(
176
- "SkillNotFoundError",
177
- {
178
- skill: Skill.ID,
179
- message: Schema.String,
180
- },
181
- { httpApiStatus: 404 },
182
- ) {}
183
-
184
- export class SkillLoadError extends Schema.TaggedError<SkillLoadError>()(
185
- "SkillLoadError",
186
- {
187
- skill: Skill.ID,
188
- message: Schema.String,
189
- },
190
- { httpApiStatus: 502 },
191
- ) {}
192
-
193
- export class McpServerNotFoundError extends Schema.TaggedError<McpServerNotFoundError>()(
194
- "McpServerNotFoundError",
195
- {
196
- server: Schema.String,
197
- message: Schema.String,
198
- },
199
- { httpApiStatus: 404 },
200
- ) {}
201
-
202
- export class CommandNotFoundError extends Schema.TaggedError<CommandNotFoundError>()(
203
- "CommandNotFoundError",
204
- {
205
- command: Schema.String,
206
- message: Schema.String,
207
- },
208
- { httpApiStatus: 404 },
209
- ) {}
210
-
211
- export class CommandExecutionError extends Schema.TaggedError<CommandExecutionError>()(
212
- "CommandExecutionError",
213
- {
214
- command: Schema.String,
215
- message: Schema.String,
216
- },
217
- { httpApiStatus: 500 },
218
- ) {}
219
-
220
- export class InvalidCursorError extends Schema.TaggedError<InvalidCursorError>()(
221
- "InvalidCursorError",
222
- { message: Schema.String },
223
- { httpApiStatus: 400 },
224
- ) {}
225
-
226
- export class PermissionNotFoundError extends Schema.TaggedError<PermissionNotFoundError>()(
227
- "PermissionNotFoundError",
228
- {
229
- requestID: Schema.String,
230
- message: Schema.String,
231
- },
232
- { httpApiStatus: 404 },
233
- ) {}
234
-
235
- export class PermissionSavedNotFoundError extends Schema.TaggedError<PermissionSavedNotFoundError>()(
236
- "PermissionSavedNotFoundError",
237
- {
238
- id: Schema.String,
239
- message: Schema.String,
240
- },
241
- { httpApiStatus: 404 },
242
- ) {}
243
-
244
- export class FormNotFoundError extends Schema.TaggedError<FormNotFoundError>()(
245
- "FormNotFoundError",
246
- {
247
- id: Schema.String,
248
- message: Schema.String,
249
- },
250
- { httpApiStatus: 404 },
251
- ) {}
252
-
253
- export class FormAlreadySettledError extends Schema.TaggedError<FormAlreadySettledError>()(
254
- "FormAlreadySettledError",
255
- {
256
- id: Schema.String,
257
- message: Schema.String,
258
- },
259
- { httpApiStatus: 409 },
260
- ) {}
261
-
262
- export class FormInvalidAnswerError extends Schema.TaggedError<FormInvalidAnswerError>()(
263
- "FormInvalidAnswerError",
264
- {
265
- id: Schema.String,
266
- message: Schema.String,
267
- },
268
- { httpApiStatus: 400 },
269
- ) {}
270
-
271
- export class ForbiddenError extends Schema.TaggedError<ForbiddenError>()(
272
- "ForbiddenError",
273
- { message: Schema.String },
274
- { httpApiStatus: 403 },
275
- ) {}
276
-
277
- export class PtyNotFoundError extends Schema.TaggedError<PtyNotFoundError>()(
278
- "PtyNotFoundError",
279
- {
280
- ptyID: Schema.String,
281
- message: Schema.String,
282
- },
283
- { httpApiStatus: 404 },
284
- ) {}
285
-
286
- export class PtyFeatureUnsupportedError extends Schema.TaggedError<PtyFeatureUnsupportedError>()(
287
- "PtyFeatureUnsupportedError",
288
- {
289
- feature: Schema.String,
290
- message: Schema.String,
291
- },
292
- { httpApiStatus: 501 },
293
- ) {}
294
-
295
- export class ShellNotFoundError extends Schema.TaggedError<ShellNotFoundError>()(
296
- "ShellNotFoundError",
297
- {
298
- id: Schema.String,
299
- message: Schema.String,
300
- },
301
- { httpApiStatus: 404 },
302
- ) {}
303
-
304
- export class ModelNotFoundError extends Schema.TaggedError<ModelNotFoundError>()(
305
- "ModelNotFoundError",
306
- {
307
- providerID: Schema.String,
308
- modelID: Schema.String,
309
- message: Schema.String,
310
- },
311
- { httpApiStatus: 404 },
312
- ) {}
313
-
314
- /** The model exists but cannot serve this request, such as a chat model asked for images. */
315
- export class UnsupportedModelError extends Schema.TaggedError<UnsupportedModelError>()(
316
- "UnsupportedModelError",
317
- {
318
- providerID: Schema.String,
319
- modelID: Schema.String,
320
- capability: Schema.String,
321
- message: Schema.String,
322
- },
323
- { httpApiStatus: 422 },
324
- ) {}
325
-
326
- /** The provider rejected or failed the request after the server sent it. */
327
- export class ProviderRequestError extends Schema.TaggedError<ProviderRequestError>()(
328
- "ProviderRequestError",
329
- {
330
- providerID: Schema.String,
331
- reason: Schema.Literals([
332
- "authentication",
333
- "rate_limit",
334
- "content_filter",
335
- "invalid_request",
336
- "overloaded",
337
- "provider",
338
- ]),
339
- message: Schema.String,
340
- status: Schema.optional(Schema.Int),
341
- retryAfterMs: Schema.optional(Schema.Int),
342
- },
343
- { httpApiStatus: 502 },
344
- ) {}
345
-
346
- export class AutomationNotFoundError extends Schema.TaggedError<AutomationNotFoundError>()(
347
- "AutomationNotFoundError",
348
- {
349
- automationID: Schema.String,
350
- message: Schema.String,
351
- },
352
- { httpApiStatus: 404 },
353
- ) {}
354
-
355
- export class VideoNotFoundError extends Schema.TaggedError<VideoNotFoundError>()(
356
- "VideoNotFoundError",
357
- {
358
- videoID: Schema.String,
359
- message: Schema.String,
360
- },
361
- { httpApiStatus: 404 },
362
- ) {}
363
-
364
- export class BlobNotFoundError extends Schema.TaggedError<BlobNotFoundError>()(
365
- "BlobNotFoundError",
366
- {
367
- blobID: Schema.String,
368
- message: Schema.String,
369
- },
370
- { httpApiStatus: 404 },
371
- ) {}
372
-
373
- export class ArtifactNotFoundError extends Schema.TaggedError<ArtifactNotFoundError>()(
374
- "ArtifactNotFoundError",
375
- {
376
- artifactID: Schema.String,
377
- message: Schema.String,
378
- },
379
- { httpApiStatus: 404 },
380
- ) {}
381
-
382
- export class MachineNotFoundError extends Schema.TaggedError<MachineNotFoundError>()(
383
- "MachineNotFoundError",
384
- {
385
- machine: Schema.String,
386
- message: Schema.String,
387
- },
388
- { httpApiStatus: 404 },
389
- ) {}
390
-
391
- export class PushDeviceNotFoundError extends Schema.TaggedError<PushDeviceNotFoundError>()(
392
- "PushDeviceNotFoundError",
393
- {
394
- deviceID: Schema.String,
395
- message: Schema.String,
396
- },
397
- { httpApiStatus: 404 },
398
- ) {}
1
+ import { Schema } from "effect"
2
+ import { Skill } from "@zyro-sec/schema/skill"
3
+ import { Location } from "@zyro-sec/schema/location"
4
+
5
+ export class LocationNotFoundError extends Schema.TaggedError<LocationNotFoundError>()(
6
+ "LocationNotFoundError",
7
+ { location: Location.PublicRef, message: Schema.String },
8
+ { httpApiStatus: 404 },
9
+ ) {}
10
+
11
+ export class InvalidRequestError extends Schema.TaggedError<InvalidRequestError>()(
12
+ "InvalidRequestError",
13
+ {
14
+ message: Schema.String,
15
+ kind: Schema.optional(Schema.String),
16
+ field: Schema.optional(Schema.String),
17
+ },
18
+ { httpApiStatus: 400 },
19
+ ) {}
20
+
21
+ export class RpcError extends Schema.TaggedError<RpcError>()(
22
+ "RpcError",
23
+ {
24
+ type: Schema.String,
25
+ message: Schema.String,
26
+ data: Schema.optional(Schema.Unknown),
27
+ },
28
+ { httpApiStatus: 400 },
29
+ ) {}
30
+
31
+ export class RpcInternalError extends Schema.TaggedError<RpcInternalError>()(
32
+ "RpcInternalError",
33
+ {
34
+ type: Schema.Literals(["rpc.internal", "rpc.invalid_output"]),
35
+ message: Schema.String,
36
+ data: Schema.optional(Schema.Unknown),
37
+ },
38
+ { httpApiStatus: 500 },
39
+ ) {}
40
+
41
+ export class UnauthorizedError extends Schema.TaggedError<UnauthorizedError>()(
42
+ "UnauthorizedError",
43
+ { message: Schema.String },
44
+ { httpApiStatus: 401 },
45
+ ) {}
46
+
47
+ export class ConflictError extends Schema.TaggedError<ConflictError>()(
48
+ "ConflictError",
49
+ {
50
+ message: Schema.String,
51
+ resource: Schema.optional(Schema.String),
52
+ },
53
+ { httpApiStatus: 409 },
54
+ ) {}
55
+
56
+ export class SessionBusyError extends Schema.TaggedError<SessionBusyError>()(
57
+ "SessionBusyError",
58
+ {
59
+ sessionID: Schema.String,
60
+ message: Schema.String,
61
+ },
62
+ { httpApiStatus: 409 },
63
+ ) {}
64
+
65
+ export class ServiceUnavailableError extends Schema.TaggedError<ServiceUnavailableError>()(
66
+ "ServiceUnavailableError",
67
+ {
68
+ message: Schema.String,
69
+ service: Schema.optional(Schema.String),
70
+ },
71
+ { httpApiStatus: 503 },
72
+ ) {}
73
+
74
+ export class UnknownError extends Schema.TaggedError<UnknownError>()(
75
+ "UnknownError",
76
+ {
77
+ message: Schema.String,
78
+ ref: Schema.optional(Schema.String),
79
+ },
80
+ { httpApiStatus: 500 },
81
+ ) {}
82
+
83
+ export class ProviderNotFoundError extends Schema.TaggedError<ProviderNotFoundError>()(
84
+ "ProviderNotFoundError",
85
+ {
86
+ providerID: Schema.String,
87
+ message: Schema.String,
88
+ },
89
+ { httpApiStatus: 404 },
90
+ ) {}
91
+
92
+ export class IntegrationNotFoundError extends Schema.TaggedError<IntegrationNotFoundError>()(
93
+ "IntegrationNotFoundError",
94
+ {
95
+ integrationID: Schema.String,
96
+ message: Schema.String,
97
+ },
98
+ { httpApiStatus: 404 },
99
+ ) {}
100
+
101
+ export class IntegrationAttemptNotFoundError extends Schema.TaggedError<IntegrationAttemptNotFoundError>()(
102
+ "IntegrationAttemptNotFoundError",
103
+ {
104
+ integrationID: Schema.String,
105
+ attemptID: Schema.String,
106
+ message: Schema.String,
107
+ },
108
+ { httpApiStatus: 404 },
109
+ ) {}
110
+
111
+ export class IntegrationMethodNotFoundError extends Schema.TaggedError<IntegrationMethodNotFoundError>()(
112
+ "IntegrationMethodNotFoundError",
113
+ {
114
+ integrationID: Schema.String,
115
+ methodID: Schema.String,
116
+ message: Schema.String,
117
+ },
118
+ { httpApiStatus: 404 },
119
+ ) {}
120
+
121
+ export class ProjectNotFoundError extends Schema.TaggedError<ProjectNotFoundError>()(
122
+ "ProjectNotFoundError",
123
+ {
124
+ projectID: Schema.String,
125
+ message: Schema.String,
126
+ },
127
+ { httpApiStatus: 404 },
128
+ ) {}
129
+
130
+ export class FileNotFoundError extends Schema.TaggedError<FileNotFoundError>()(
131
+ "FileNotFoundError",
132
+ {
133
+ path: Schema.String,
134
+ message: Schema.String,
135
+ },
136
+ { httpApiStatus: 404 },
137
+ ) {}
138
+
139
+ export class PluginNotFoundError extends Schema.TaggedError<PluginNotFoundError>()(
140
+ "PluginNotFoundError",
141
+ {
142
+ pluginID: Schema.String,
143
+ message: Schema.String,
144
+ },
145
+ { httpApiStatus: 404 },
146
+ ) {}
147
+ export class AgentNotFoundError extends Schema.TaggedError<AgentNotFoundError>()(
148
+ "AgentNotFoundError",
149
+ {
150
+ agentID: Schema.String,
151
+ message: Schema.String,
152
+ },
153
+ { httpApiStatus: 404 },
154
+ ) {}
155
+
156
+ export class SessionNotFoundError extends Schema.TaggedError<SessionNotFoundError>()(
157
+ "SessionNotFoundError",
158
+ {
159
+ sessionID: Schema.String,
160
+ message: Schema.String,
161
+ },
162
+ { httpApiStatus: 404 },
163
+ ) {}
164
+
165
+ export class MessageNotFoundError extends Schema.TaggedError<MessageNotFoundError>()(
166
+ "MessageNotFoundError",
167
+ {
168
+ sessionID: Schema.String,
169
+ messageID: Schema.String,
170
+ message: Schema.String,
171
+ },
172
+ { httpApiStatus: 404 },
173
+ ) {}
174
+
175
+ export class SkillNotFoundError extends Schema.TaggedError<SkillNotFoundError>()(
176
+ "SkillNotFoundError",
177
+ {
178
+ skill: Skill.ID,
179
+ message: Schema.String,
180
+ },
181
+ { httpApiStatus: 404 },
182
+ ) {}
183
+
184
+ export class SkillLoadError extends Schema.TaggedError<SkillLoadError>()(
185
+ "SkillLoadError",
186
+ {
187
+ skill: Skill.ID,
188
+ message: Schema.String,
189
+ },
190
+ { httpApiStatus: 502 },
191
+ ) {}
192
+
193
+ export class McpServerNotFoundError extends Schema.TaggedError<McpServerNotFoundError>()(
194
+ "McpServerNotFoundError",
195
+ {
196
+ server: Schema.String,
197
+ message: Schema.String,
198
+ },
199
+ { httpApiStatus: 404 },
200
+ ) {}
201
+
202
+ export class CommandNotFoundError extends Schema.TaggedError<CommandNotFoundError>()(
203
+ "CommandNotFoundError",
204
+ {
205
+ command: Schema.String,
206
+ message: Schema.String,
207
+ },
208
+ { httpApiStatus: 404 },
209
+ ) {}
210
+
211
+ export class CommandExecutionError extends Schema.TaggedError<CommandExecutionError>()(
212
+ "CommandExecutionError",
213
+ {
214
+ command: Schema.String,
215
+ message: Schema.String,
216
+ },
217
+ { httpApiStatus: 500 },
218
+ ) {}
219
+
220
+ export class InvalidCursorError extends Schema.TaggedError<InvalidCursorError>()(
221
+ "InvalidCursorError",
222
+ { message: Schema.String },
223
+ { httpApiStatus: 400 },
224
+ ) {}
225
+
226
+ export class PermissionNotFoundError extends Schema.TaggedError<PermissionNotFoundError>()(
227
+ "PermissionNotFoundError",
228
+ {
229
+ requestID: Schema.String,
230
+ message: Schema.String,
231
+ },
232
+ { httpApiStatus: 404 },
233
+ ) {}
234
+
235
+ export class PermissionSavedNotFoundError extends Schema.TaggedError<PermissionSavedNotFoundError>()(
236
+ "PermissionSavedNotFoundError",
237
+ {
238
+ id: Schema.String,
239
+ message: Schema.String,
240
+ },
241
+ { httpApiStatus: 404 },
242
+ ) {}
243
+
244
+ export class FormNotFoundError extends Schema.TaggedError<FormNotFoundError>()(
245
+ "FormNotFoundError",
246
+ {
247
+ id: Schema.String,
248
+ message: Schema.String,
249
+ },
250
+ { httpApiStatus: 404 },
251
+ ) {}
252
+
253
+ export class FormAlreadySettledError extends Schema.TaggedError<FormAlreadySettledError>()(
254
+ "FormAlreadySettledError",
255
+ {
256
+ id: Schema.String,
257
+ message: Schema.String,
258
+ },
259
+ { httpApiStatus: 409 },
260
+ ) {}
261
+
262
+ export class FormInvalidAnswerError extends Schema.TaggedError<FormInvalidAnswerError>()(
263
+ "FormInvalidAnswerError",
264
+ {
265
+ id: Schema.String,
266
+ message: Schema.String,
267
+ },
268
+ { httpApiStatus: 400 },
269
+ ) {}
270
+
271
+ export class ForbiddenError extends Schema.TaggedError<ForbiddenError>()(
272
+ "ForbiddenError",
273
+ { message: Schema.String },
274
+ { httpApiStatus: 403 },
275
+ ) {}
276
+
277
+ export class PtyNotFoundError extends Schema.TaggedError<PtyNotFoundError>()(
278
+ "PtyNotFoundError",
279
+ {
280
+ ptyID: Schema.String,
281
+ message: Schema.String,
282
+ },
283
+ { httpApiStatus: 404 },
284
+ ) {}
285
+
286
+ export class PtyFeatureUnsupportedError extends Schema.TaggedError<PtyFeatureUnsupportedError>()(
287
+ "PtyFeatureUnsupportedError",
288
+ {
289
+ feature: Schema.String,
290
+ message: Schema.String,
291
+ },
292
+ { httpApiStatus: 501 },
293
+ ) {}
294
+
295
+ export class ShellNotFoundError extends Schema.TaggedError<ShellNotFoundError>()(
296
+ "ShellNotFoundError",
297
+ {
298
+ id: Schema.String,
299
+ message: Schema.String,
300
+ },
301
+ { httpApiStatus: 404 },
302
+ ) {}
303
+
304
+ export class ModelNotFoundError extends Schema.TaggedError<ModelNotFoundError>()(
305
+ "ModelNotFoundError",
306
+ {
307
+ providerID: Schema.String,
308
+ modelID: Schema.String,
309
+ message: Schema.String,
310
+ },
311
+ { httpApiStatus: 404 },
312
+ ) {}
313
+
314
+ /** The model exists but cannot serve this request, such as a chat model asked for images. */
315
+ export class UnsupportedModelError extends Schema.TaggedError<UnsupportedModelError>()(
316
+ "UnsupportedModelError",
317
+ {
318
+ providerID: Schema.String,
319
+ modelID: Schema.String,
320
+ capability: Schema.String,
321
+ message: Schema.String,
322
+ },
323
+ { httpApiStatus: 422 },
324
+ ) {}
325
+
326
+ /** The provider rejected or failed the request after the server sent it. */
327
+ export class ProviderRequestError extends Schema.TaggedError<ProviderRequestError>()(
328
+ "ProviderRequestError",
329
+ {
330
+ providerID: Schema.String,
331
+ reason: Schema.Literals([
332
+ "authentication",
333
+ "rate_limit",
334
+ "content_filter",
335
+ "invalid_request",
336
+ "overloaded",
337
+ "provider",
338
+ ]),
339
+ message: Schema.String,
340
+ status: Schema.optional(Schema.Int),
341
+ retryAfterMs: Schema.optional(Schema.Int),
342
+ },
343
+ { httpApiStatus: 502 },
344
+ ) {}
345
+
346
+ export class AutomationNotFoundError extends Schema.TaggedError<AutomationNotFoundError>()(
347
+ "AutomationNotFoundError",
348
+ {
349
+ automationID: Schema.String,
350
+ message: Schema.String,
351
+ },
352
+ { httpApiStatus: 404 },
353
+ ) {}
354
+
355
+ export class VideoNotFoundError extends Schema.TaggedError<VideoNotFoundError>()(
356
+ "VideoNotFoundError",
357
+ {
358
+ videoID: Schema.String,
359
+ message: Schema.String,
360
+ },
361
+ { httpApiStatus: 404 },
362
+ ) {}
363
+
364
+ export class BlobNotFoundError extends Schema.TaggedError<BlobNotFoundError>()(
365
+ "BlobNotFoundError",
366
+ {
367
+ blobID: Schema.String,
368
+ message: Schema.String,
369
+ },
370
+ { httpApiStatus: 404 },
371
+ ) {}
372
+
373
+ export class ArtifactNotFoundError extends Schema.TaggedError<ArtifactNotFoundError>()(
374
+ "ArtifactNotFoundError",
375
+ {
376
+ artifactID: Schema.String,
377
+ message: Schema.String,
378
+ },
379
+ { httpApiStatus: 404 },
380
+ ) {}
381
+
382
+ export class MachineNotFoundError extends Schema.TaggedError<MachineNotFoundError>()(
383
+ "MachineNotFoundError",
384
+ {
385
+ machine: Schema.String,
386
+ message: Schema.String,
387
+ },
388
+ { httpApiStatus: 404 },
389
+ ) {}
390
+
391
+ export class PushDeviceNotFoundError extends Schema.TaggedError<PushDeviceNotFoundError>()(
392
+ "PushDeviceNotFoundError",
393
+ {
394
+ deviceID: Schema.String,
395
+ message: Schema.String,
396
+ },
397
+ { httpApiStatus: 404 },
398
+ ) {}