opencode-python-sdk 0.0.1.dev1__py3-none-any.whl
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.
- opencode/.generated.json +39 -0
- opencode/__init__.py +221 -0
- opencode/_base_client.py +539 -0
- opencode/_client.py +255 -0
- opencode/_constants.py +27 -0
- opencode/_errors.py +547 -0
- opencode/_events.py +732 -0
- opencode/_exceptions.py +271 -0
- opencode/_models.py +54 -0
- opencode/_pagination.py +192 -0
- opencode/_pty.py +586 -0
- opencode/_qs.py +95 -0
- opencode/_resource.py +42 -0
- opencode/_rpc.py +489 -0
- opencode/_server.py +335 -0
- opencode/_streaming.py +248 -0
- opencode/_types.py +77 -0
- opencode/_unions.py +46 -0
- opencode/_version.py +8 -0
- opencode/lib/__init__.py +5 -0
- opencode/lib/_ready.py +91 -0
- opencode/lib/_session.py +231 -0
- opencode/py.typed +0 -0
- opencode/resources/__init__.py +364 -0
- opencode/resources/agent.py +179 -0
- opencode/resources/command.py +100 -0
- opencode/resources/config.py +240 -0
- opencode/resources/credential.py +384 -0
- opencode/resources/debug.py +178 -0
- opencode/resources/event.py +88 -0
- opencode/resources/experimental.py +765 -0
- opencode/resources/file.py +355 -0
- opencode/resources/form.py +100 -0
- opencode/resources/generate.py +110 -0
- opencode/resources/integration.py +1033 -0
- opencode/resources/location.py +162 -0
- opencode/resources/mcp.py +492 -0
- opencode/resources/message.py +152 -0
- opencode/resources/migration.py +118 -0
- opencode/resources/model.py +177 -0
- opencode/resources/permission.py +704 -0
- opencode/resources/plugin.py +250 -0
- opencode/resources/project.py +187 -0
- opencode/resources/provider.py +183 -0
- opencode/resources/pty.py +522 -0
- opencode/resources/reference.py +100 -0
- opencode/resources/rpc.py +113 -0
- opencode/resources/server.py +230 -0
- opencode/resources/session.py +3567 -0
- opencode/resources/shell.py +412 -0
- opencode/resources/skill.py +100 -0
- opencode/resources/vcs.py +500 -0
- opencode/resources/voice.py +113 -0
- opencode/resources/websearch.py +184 -0
- opencode/resources/worktree.py +336 -0
- opencode/testing.py +508 -0
- opencode/types/__init__.py +1462 -0
- opencode/types/_generated.py +8540 -0
- opencode_python_sdk-0.0.1.dev1.dist-info/METADATA +468 -0
- opencode_python_sdk-0.0.1.dev1.dist-info/RECORD +62 -0
- opencode_python_sdk-0.0.1.dev1.dist-info/WHEEL +4 -0
- opencode_python_sdk-0.0.1.dev1.dist-info/licenses/LICENSE +21 -0
opencode/_errors.py
ADDED
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
# This file is generated by `python -m codegen` from spec/contract.json. Do not edit it by hand.
|
|
2
|
+
# OpenCode 2.1.2
|
|
3
|
+
|
|
4
|
+
"""Errors the OpenCode server declares, keyed by their ``_tag``."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from typing import TYPE_CHECKING
|
|
9
|
+
|
|
10
|
+
from ._exceptions import (
|
|
11
|
+
APIStatusError,
|
|
12
|
+
AuthenticationError,
|
|
13
|
+
BadRequestError,
|
|
14
|
+
ConflictError,
|
|
15
|
+
ContentTooLargeError,
|
|
16
|
+
InternalServerError,
|
|
17
|
+
NotFoundError,
|
|
18
|
+
NotImplementedServerError,
|
|
19
|
+
PermissionDeniedError,
|
|
20
|
+
ServiceUnavailableError,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from .types import (
|
|
25
|
+
AgentNotFoundErrorBody,
|
|
26
|
+
CommandExecutionErrorBody,
|
|
27
|
+
CommandNotFoundErrorBody,
|
|
28
|
+
FileNotFoundErrorBody,
|
|
29
|
+
ForbiddenErrorBody,
|
|
30
|
+
FormAlreadySettledErrorBody,
|
|
31
|
+
FormInvalidAnswerErrorBody,
|
|
32
|
+
FormNotFoundErrorBody,
|
|
33
|
+
InstructionEntryValueTooLargeErrorBody,
|
|
34
|
+
IntegrationAttemptNotFoundErrorBody,
|
|
35
|
+
IntegrationMethodNotFoundErrorBody,
|
|
36
|
+
IntegrationNotFoundErrorBody,
|
|
37
|
+
InvalidCursorErrorBody,
|
|
38
|
+
InvalidRequestErrorBody,
|
|
39
|
+
LocationNotFoundErrorBody,
|
|
40
|
+
McpServerNotFoundErrorBody,
|
|
41
|
+
MessageNotFoundErrorBody,
|
|
42
|
+
PermissionNotFoundErrorBody,
|
|
43
|
+
PermissionSavedNotFoundErrorBody,
|
|
44
|
+
ProjectNotFoundErrorBody,
|
|
45
|
+
ProviderNotFoundErrorBody,
|
|
46
|
+
PtyNotFoundErrorBody,
|
|
47
|
+
RpcErrorBody,
|
|
48
|
+
RpcInternalErrorBody,
|
|
49
|
+
SessionBusyErrorBody,
|
|
50
|
+
SessionNotFoundErrorBody,
|
|
51
|
+
ShellNotFoundErrorBody,
|
|
52
|
+
SkillNotFoundErrorBody,
|
|
53
|
+
UnauthorizedErrorBody,
|
|
54
|
+
UnknownErrorBody,
|
|
55
|
+
VcsInitNotSupportedErrorBody,
|
|
56
|
+
WorktreeErrorBody,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
__all__ = [
|
|
60
|
+
"TAGGED_ERRORS",
|
|
61
|
+
"AgentNotFoundError",
|
|
62
|
+
"CommandExecutionError",
|
|
63
|
+
"CommandNotFoundError",
|
|
64
|
+
"RemoteFileNotFoundError",
|
|
65
|
+
"ForbiddenError",
|
|
66
|
+
"FormAlreadySettledError",
|
|
67
|
+
"FormInvalidAnswerError",
|
|
68
|
+
"FormNotFoundError",
|
|
69
|
+
"InstructionEntryValueTooLargeError",
|
|
70
|
+
"IntegrationAttemptNotFoundError",
|
|
71
|
+
"IntegrationMethodNotFoundError",
|
|
72
|
+
"IntegrationNotFoundError",
|
|
73
|
+
"InvalidCursorError",
|
|
74
|
+
"InvalidRequestError",
|
|
75
|
+
"LocationNotFoundError",
|
|
76
|
+
"McpServerNotFoundError",
|
|
77
|
+
"MessageNotFoundError",
|
|
78
|
+
"PermissionNotFoundError",
|
|
79
|
+
"PermissionSavedNotFoundError",
|
|
80
|
+
"ProjectNotFoundError",
|
|
81
|
+
"ProviderNotFoundError",
|
|
82
|
+
"PtyNotFoundError",
|
|
83
|
+
"RpcError",
|
|
84
|
+
"RpcInternalError",
|
|
85
|
+
"SessionBusyError",
|
|
86
|
+
"SessionNotFoundError",
|
|
87
|
+
"ShellNotFoundError",
|
|
88
|
+
"SkillNotFoundError",
|
|
89
|
+
"UnauthorizedError",
|
|
90
|
+
"UnknownError",
|
|
91
|
+
"VcsInitNotSupportedError",
|
|
92
|
+
"WorktreeError",
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class AgentNotFoundError(NotFoundError):
|
|
97
|
+
"""The server answered 404 with ``_tag`` ``AgentNotFoundError``."""
|
|
98
|
+
|
|
99
|
+
tag = "AgentNotFoundError"
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def error(self) -> AgentNotFoundErrorBody:
|
|
103
|
+
"""The error body as a typed model."""
|
|
104
|
+
from .types import AgentNotFoundErrorBody
|
|
105
|
+
|
|
106
|
+
return self._typed_body(AgentNotFoundErrorBody)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class CommandExecutionError(InternalServerError):
|
|
110
|
+
"""The server answered 500 with ``_tag`` ``CommandExecutionError``."""
|
|
111
|
+
|
|
112
|
+
tag = "CommandExecutionError"
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def error(self) -> CommandExecutionErrorBody:
|
|
116
|
+
"""The error body as a typed model."""
|
|
117
|
+
from .types import CommandExecutionErrorBody
|
|
118
|
+
|
|
119
|
+
return self._typed_body(CommandExecutionErrorBody)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class CommandNotFoundError(NotFoundError):
|
|
123
|
+
"""The server answered 404 with ``_tag`` ``CommandNotFoundError``."""
|
|
124
|
+
|
|
125
|
+
tag = "CommandNotFoundError"
|
|
126
|
+
|
|
127
|
+
@property
|
|
128
|
+
def error(self) -> CommandNotFoundErrorBody:
|
|
129
|
+
"""The error body as a typed model."""
|
|
130
|
+
from .types import CommandNotFoundErrorBody
|
|
131
|
+
|
|
132
|
+
return self._typed_body(CommandNotFoundErrorBody)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class RemoteFileNotFoundError(NotFoundError):
|
|
136
|
+
"""The server answered 404 with ``_tag`` ``FileNotFoundError``."""
|
|
137
|
+
|
|
138
|
+
tag = "FileNotFoundError"
|
|
139
|
+
|
|
140
|
+
@property
|
|
141
|
+
def error(self) -> FileNotFoundErrorBody:
|
|
142
|
+
"""The error body as a typed model."""
|
|
143
|
+
from .types import FileNotFoundErrorBody
|
|
144
|
+
|
|
145
|
+
return self._typed_body(FileNotFoundErrorBody)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class ForbiddenError(PermissionDeniedError):
|
|
149
|
+
"""The server answered 403 with ``_tag`` ``ForbiddenError``."""
|
|
150
|
+
|
|
151
|
+
tag = "ForbiddenError"
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def error(self) -> ForbiddenErrorBody:
|
|
155
|
+
"""The error body as a typed model."""
|
|
156
|
+
from .types import ForbiddenErrorBody
|
|
157
|
+
|
|
158
|
+
return self._typed_body(ForbiddenErrorBody)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class FormAlreadySettledError(ConflictError):
|
|
162
|
+
"""The server answered 409 with ``_tag`` ``FormAlreadySettledError``."""
|
|
163
|
+
|
|
164
|
+
tag = "FormAlreadySettledError"
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def error(self) -> FormAlreadySettledErrorBody:
|
|
168
|
+
"""The error body as a typed model."""
|
|
169
|
+
from .types import FormAlreadySettledErrorBody
|
|
170
|
+
|
|
171
|
+
return self._typed_body(FormAlreadySettledErrorBody)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
class FormInvalidAnswerError(BadRequestError):
|
|
175
|
+
"""The server answered 400 with ``_tag`` ``FormInvalidAnswerError``."""
|
|
176
|
+
|
|
177
|
+
tag = "FormInvalidAnswerError"
|
|
178
|
+
|
|
179
|
+
@property
|
|
180
|
+
def error(self) -> FormInvalidAnswerErrorBody:
|
|
181
|
+
"""The error body as a typed model."""
|
|
182
|
+
from .types import FormInvalidAnswerErrorBody
|
|
183
|
+
|
|
184
|
+
return self._typed_body(FormInvalidAnswerErrorBody)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class FormNotFoundError(NotFoundError):
|
|
188
|
+
"""The server answered 404 with ``_tag`` ``FormNotFoundError``."""
|
|
189
|
+
|
|
190
|
+
tag = "FormNotFoundError"
|
|
191
|
+
|
|
192
|
+
@property
|
|
193
|
+
def error(self) -> FormNotFoundErrorBody:
|
|
194
|
+
"""The error body as a typed model."""
|
|
195
|
+
from .types import FormNotFoundErrorBody
|
|
196
|
+
|
|
197
|
+
return self._typed_body(FormNotFoundErrorBody)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class InstructionEntryValueTooLargeError(ContentTooLargeError):
|
|
201
|
+
"""The server answered 413 with ``_tag`` ``InstructionEntryValueTooLargeError``."""
|
|
202
|
+
|
|
203
|
+
tag = "InstructionEntryValueTooLargeError"
|
|
204
|
+
|
|
205
|
+
@property
|
|
206
|
+
def error(self) -> InstructionEntryValueTooLargeErrorBody:
|
|
207
|
+
"""The error body as a typed model."""
|
|
208
|
+
from .types import InstructionEntryValueTooLargeErrorBody
|
|
209
|
+
|
|
210
|
+
return self._typed_body(InstructionEntryValueTooLargeErrorBody)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class IntegrationAttemptNotFoundError(NotFoundError):
|
|
214
|
+
"""The server answered 404 with ``_tag`` ``IntegrationAttemptNotFoundError``."""
|
|
215
|
+
|
|
216
|
+
tag = "IntegrationAttemptNotFoundError"
|
|
217
|
+
|
|
218
|
+
@property
|
|
219
|
+
def error(self) -> IntegrationAttemptNotFoundErrorBody:
|
|
220
|
+
"""The error body as a typed model."""
|
|
221
|
+
from .types import IntegrationAttemptNotFoundErrorBody
|
|
222
|
+
|
|
223
|
+
return self._typed_body(IntegrationAttemptNotFoundErrorBody)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
class IntegrationMethodNotFoundError(NotFoundError):
|
|
227
|
+
"""The server answered 404 with ``_tag`` ``IntegrationMethodNotFoundError``."""
|
|
228
|
+
|
|
229
|
+
tag = "IntegrationMethodNotFoundError"
|
|
230
|
+
|
|
231
|
+
@property
|
|
232
|
+
def error(self) -> IntegrationMethodNotFoundErrorBody:
|
|
233
|
+
"""The error body as a typed model."""
|
|
234
|
+
from .types import IntegrationMethodNotFoundErrorBody
|
|
235
|
+
|
|
236
|
+
return self._typed_body(IntegrationMethodNotFoundErrorBody)
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
class IntegrationNotFoundError(NotFoundError):
|
|
240
|
+
"""The server answered 404 with ``_tag`` ``IntegrationNotFoundError``."""
|
|
241
|
+
|
|
242
|
+
tag = "IntegrationNotFoundError"
|
|
243
|
+
|
|
244
|
+
@property
|
|
245
|
+
def error(self) -> IntegrationNotFoundErrorBody:
|
|
246
|
+
"""The error body as a typed model."""
|
|
247
|
+
from .types import IntegrationNotFoundErrorBody
|
|
248
|
+
|
|
249
|
+
return self._typed_body(IntegrationNotFoundErrorBody)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
class InvalidCursorError(BadRequestError):
|
|
253
|
+
"""The server answered 400 with ``_tag`` ``InvalidCursorError``."""
|
|
254
|
+
|
|
255
|
+
tag = "InvalidCursorError"
|
|
256
|
+
|
|
257
|
+
@property
|
|
258
|
+
def error(self) -> InvalidCursorErrorBody:
|
|
259
|
+
"""The error body as a typed model."""
|
|
260
|
+
from .types import InvalidCursorErrorBody
|
|
261
|
+
|
|
262
|
+
return self._typed_body(InvalidCursorErrorBody)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
class InvalidRequestError(BadRequestError):
|
|
266
|
+
"""The server answered 400 with ``_tag`` ``InvalidRequestError``."""
|
|
267
|
+
|
|
268
|
+
tag = "InvalidRequestError"
|
|
269
|
+
|
|
270
|
+
@property
|
|
271
|
+
def error(self) -> InvalidRequestErrorBody:
|
|
272
|
+
"""The error body as a typed model."""
|
|
273
|
+
from .types import InvalidRequestErrorBody
|
|
274
|
+
|
|
275
|
+
return self._typed_body(InvalidRequestErrorBody)
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
class LocationNotFoundError(NotFoundError):
|
|
279
|
+
"""The server answered 404 with ``_tag`` ``LocationNotFoundError``."""
|
|
280
|
+
|
|
281
|
+
tag = "LocationNotFoundError"
|
|
282
|
+
|
|
283
|
+
@property
|
|
284
|
+
def error(self) -> LocationNotFoundErrorBody:
|
|
285
|
+
"""The error body as a typed model."""
|
|
286
|
+
from .types import LocationNotFoundErrorBody
|
|
287
|
+
|
|
288
|
+
return self._typed_body(LocationNotFoundErrorBody)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
class McpServerNotFoundError(NotFoundError):
|
|
292
|
+
"""The server answered 404 with ``_tag`` ``McpServerNotFoundError``."""
|
|
293
|
+
|
|
294
|
+
tag = "McpServerNotFoundError"
|
|
295
|
+
|
|
296
|
+
@property
|
|
297
|
+
def error(self) -> McpServerNotFoundErrorBody:
|
|
298
|
+
"""The error body as a typed model."""
|
|
299
|
+
from .types import McpServerNotFoundErrorBody
|
|
300
|
+
|
|
301
|
+
return self._typed_body(McpServerNotFoundErrorBody)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class MessageNotFoundError(NotFoundError):
|
|
305
|
+
"""The server answered 404 with ``_tag`` ``MessageNotFoundError``."""
|
|
306
|
+
|
|
307
|
+
tag = "MessageNotFoundError"
|
|
308
|
+
|
|
309
|
+
@property
|
|
310
|
+
def error(self) -> MessageNotFoundErrorBody:
|
|
311
|
+
"""The error body as a typed model."""
|
|
312
|
+
from .types import MessageNotFoundErrorBody
|
|
313
|
+
|
|
314
|
+
return self._typed_body(MessageNotFoundErrorBody)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
class PermissionNotFoundError(NotFoundError):
|
|
318
|
+
"""The server answered 404 with ``_tag`` ``PermissionNotFoundError``."""
|
|
319
|
+
|
|
320
|
+
tag = "PermissionNotFoundError"
|
|
321
|
+
|
|
322
|
+
@property
|
|
323
|
+
def error(self) -> PermissionNotFoundErrorBody:
|
|
324
|
+
"""The error body as a typed model."""
|
|
325
|
+
from .types import PermissionNotFoundErrorBody
|
|
326
|
+
|
|
327
|
+
return self._typed_body(PermissionNotFoundErrorBody)
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
class PermissionSavedNotFoundError(NotFoundError):
|
|
331
|
+
"""The server answered 404 with ``_tag`` ``PermissionSavedNotFoundError``."""
|
|
332
|
+
|
|
333
|
+
tag = "PermissionSavedNotFoundError"
|
|
334
|
+
|
|
335
|
+
@property
|
|
336
|
+
def error(self) -> PermissionSavedNotFoundErrorBody:
|
|
337
|
+
"""The error body as a typed model."""
|
|
338
|
+
from .types import PermissionSavedNotFoundErrorBody
|
|
339
|
+
|
|
340
|
+
return self._typed_body(PermissionSavedNotFoundErrorBody)
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
class ProjectNotFoundError(NotFoundError):
|
|
344
|
+
"""The server answered 404 with ``_tag`` ``ProjectNotFoundError``."""
|
|
345
|
+
|
|
346
|
+
tag = "ProjectNotFoundError"
|
|
347
|
+
|
|
348
|
+
@property
|
|
349
|
+
def error(self) -> ProjectNotFoundErrorBody:
|
|
350
|
+
"""The error body as a typed model."""
|
|
351
|
+
from .types import ProjectNotFoundErrorBody
|
|
352
|
+
|
|
353
|
+
return self._typed_body(ProjectNotFoundErrorBody)
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
class ProviderNotFoundError(NotFoundError):
|
|
357
|
+
"""The server answered 404 with ``_tag`` ``ProviderNotFoundError``."""
|
|
358
|
+
|
|
359
|
+
tag = "ProviderNotFoundError"
|
|
360
|
+
|
|
361
|
+
@property
|
|
362
|
+
def error(self) -> ProviderNotFoundErrorBody:
|
|
363
|
+
"""The error body as a typed model."""
|
|
364
|
+
from .types import ProviderNotFoundErrorBody
|
|
365
|
+
|
|
366
|
+
return self._typed_body(ProviderNotFoundErrorBody)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
class PtyNotFoundError(NotFoundError):
|
|
370
|
+
"""The server answered 404 with ``_tag`` ``PtyNotFoundError``."""
|
|
371
|
+
|
|
372
|
+
tag = "PtyNotFoundError"
|
|
373
|
+
|
|
374
|
+
@property
|
|
375
|
+
def error(self) -> PtyNotFoundErrorBody:
|
|
376
|
+
"""The error body as a typed model."""
|
|
377
|
+
from .types import PtyNotFoundErrorBody
|
|
378
|
+
|
|
379
|
+
return self._typed_body(PtyNotFoundErrorBody)
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
class RpcError(BadRequestError):
|
|
383
|
+
"""The server answered 400 with ``_tag`` ``RpcError``."""
|
|
384
|
+
|
|
385
|
+
tag = "RpcError"
|
|
386
|
+
|
|
387
|
+
@property
|
|
388
|
+
def error(self) -> RpcErrorBody:
|
|
389
|
+
"""The error body as a typed model."""
|
|
390
|
+
from .types import RpcErrorBody
|
|
391
|
+
|
|
392
|
+
return self._typed_body(RpcErrorBody)
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
class RpcInternalError(InternalServerError):
|
|
396
|
+
"""The server answered 500 with ``_tag`` ``RpcInternalError``."""
|
|
397
|
+
|
|
398
|
+
tag = "RpcInternalError"
|
|
399
|
+
|
|
400
|
+
@property
|
|
401
|
+
def error(self) -> RpcInternalErrorBody:
|
|
402
|
+
"""The error body as a typed model."""
|
|
403
|
+
from .types import RpcInternalErrorBody
|
|
404
|
+
|
|
405
|
+
return self._typed_body(RpcInternalErrorBody)
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
class SessionBusyError(ConflictError):
|
|
409
|
+
"""The server answered 409 with ``_tag`` ``SessionBusyError``."""
|
|
410
|
+
|
|
411
|
+
tag = "SessionBusyError"
|
|
412
|
+
|
|
413
|
+
@property
|
|
414
|
+
def error(self) -> SessionBusyErrorBody:
|
|
415
|
+
"""The error body as a typed model."""
|
|
416
|
+
from .types import SessionBusyErrorBody
|
|
417
|
+
|
|
418
|
+
return self._typed_body(SessionBusyErrorBody)
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
class SessionNotFoundError(NotFoundError):
|
|
422
|
+
"""The server answered 404 with ``_tag`` ``SessionNotFoundError``."""
|
|
423
|
+
|
|
424
|
+
tag = "SessionNotFoundError"
|
|
425
|
+
|
|
426
|
+
@property
|
|
427
|
+
def error(self) -> SessionNotFoundErrorBody:
|
|
428
|
+
"""The error body as a typed model."""
|
|
429
|
+
from .types import SessionNotFoundErrorBody
|
|
430
|
+
|
|
431
|
+
return self._typed_body(SessionNotFoundErrorBody)
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
class ShellNotFoundError(NotFoundError):
|
|
435
|
+
"""The server answered 404 with ``_tag`` ``ShellNotFoundError``."""
|
|
436
|
+
|
|
437
|
+
tag = "ShellNotFoundError"
|
|
438
|
+
|
|
439
|
+
@property
|
|
440
|
+
def error(self) -> ShellNotFoundErrorBody:
|
|
441
|
+
"""The error body as a typed model."""
|
|
442
|
+
from .types import ShellNotFoundErrorBody
|
|
443
|
+
|
|
444
|
+
return self._typed_body(ShellNotFoundErrorBody)
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
class SkillNotFoundError(NotFoundError):
|
|
448
|
+
"""The server answered 404 with ``_tag`` ``SkillNotFoundError``."""
|
|
449
|
+
|
|
450
|
+
tag = "SkillNotFoundError"
|
|
451
|
+
|
|
452
|
+
@property
|
|
453
|
+
def error(self) -> SkillNotFoundErrorBody:
|
|
454
|
+
"""The error body as a typed model."""
|
|
455
|
+
from .types import SkillNotFoundErrorBody
|
|
456
|
+
|
|
457
|
+
return self._typed_body(SkillNotFoundErrorBody)
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
class UnauthorizedError(AuthenticationError):
|
|
461
|
+
"""The server answered 401 with ``_tag`` ``UnauthorizedError``."""
|
|
462
|
+
|
|
463
|
+
tag = "UnauthorizedError"
|
|
464
|
+
|
|
465
|
+
@property
|
|
466
|
+
def error(self) -> UnauthorizedErrorBody:
|
|
467
|
+
"""The error body as a typed model."""
|
|
468
|
+
from .types import UnauthorizedErrorBody
|
|
469
|
+
|
|
470
|
+
return self._typed_body(UnauthorizedErrorBody)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
class UnknownError(InternalServerError):
|
|
474
|
+
"""The server answered 500 with ``_tag`` ``UnknownError``."""
|
|
475
|
+
|
|
476
|
+
tag = "UnknownError"
|
|
477
|
+
|
|
478
|
+
@property
|
|
479
|
+
def error(self) -> UnknownErrorBody:
|
|
480
|
+
"""The error body as a typed model."""
|
|
481
|
+
from .types import UnknownErrorBody
|
|
482
|
+
|
|
483
|
+
return self._typed_body(UnknownErrorBody)
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
class VcsInitNotSupportedError(NotImplementedServerError):
|
|
487
|
+
"""The server answered 501 with ``_tag`` ``VcsInitNotSupportedError``."""
|
|
488
|
+
|
|
489
|
+
tag = "VcsInitNotSupportedError"
|
|
490
|
+
|
|
491
|
+
@property
|
|
492
|
+
def error(self) -> VcsInitNotSupportedErrorBody:
|
|
493
|
+
"""The error body as a typed model."""
|
|
494
|
+
from .types import VcsInitNotSupportedErrorBody
|
|
495
|
+
|
|
496
|
+
return self._typed_body(VcsInitNotSupportedErrorBody)
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
class WorktreeError(BadRequestError):
|
|
500
|
+
"""The server answered 400 with ``_tag`` ``WorktreeError``."""
|
|
501
|
+
|
|
502
|
+
tag = "WorktreeError"
|
|
503
|
+
|
|
504
|
+
@property
|
|
505
|
+
def error(self) -> WorktreeErrorBody:
|
|
506
|
+
"""The error body as a typed model."""
|
|
507
|
+
from .types import WorktreeErrorBody
|
|
508
|
+
|
|
509
|
+
return self._typed_body(WorktreeErrorBody)
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
TAGGED_ERRORS: dict[str, type[APIStatusError]] = {
|
|
513
|
+
"AgentNotFoundError": AgentNotFoundError,
|
|
514
|
+
"CommandExecutionError": CommandExecutionError,
|
|
515
|
+
"CommandNotFoundError": CommandNotFoundError,
|
|
516
|
+
"ConflictError": ConflictError,
|
|
517
|
+
"FileNotFoundError": RemoteFileNotFoundError,
|
|
518
|
+
"ForbiddenError": ForbiddenError,
|
|
519
|
+
"FormAlreadySettledError": FormAlreadySettledError,
|
|
520
|
+
"FormInvalidAnswerError": FormInvalidAnswerError,
|
|
521
|
+
"FormNotFoundError": FormNotFoundError,
|
|
522
|
+
"InstructionEntryValueTooLargeError": InstructionEntryValueTooLargeError,
|
|
523
|
+
"IntegrationAttemptNotFoundError": IntegrationAttemptNotFoundError,
|
|
524
|
+
"IntegrationMethodNotFoundError": IntegrationMethodNotFoundError,
|
|
525
|
+
"IntegrationNotFoundError": IntegrationNotFoundError,
|
|
526
|
+
"InvalidCursorError": InvalidCursorError,
|
|
527
|
+
"InvalidRequestError": InvalidRequestError,
|
|
528
|
+
"LocationNotFoundError": LocationNotFoundError,
|
|
529
|
+
"McpServerNotFoundError": McpServerNotFoundError,
|
|
530
|
+
"MessageNotFoundError": MessageNotFoundError,
|
|
531
|
+
"PermissionNotFoundError": PermissionNotFoundError,
|
|
532
|
+
"PermissionSavedNotFoundError": PermissionSavedNotFoundError,
|
|
533
|
+
"ProjectNotFoundError": ProjectNotFoundError,
|
|
534
|
+
"ProviderNotFoundError": ProviderNotFoundError,
|
|
535
|
+
"PtyNotFoundError": PtyNotFoundError,
|
|
536
|
+
"RpcError": RpcError,
|
|
537
|
+
"RpcInternalError": RpcInternalError,
|
|
538
|
+
"ServiceUnavailableError": ServiceUnavailableError,
|
|
539
|
+
"SessionBusyError": SessionBusyError,
|
|
540
|
+
"SessionNotFoundError": SessionNotFoundError,
|
|
541
|
+
"ShellNotFoundError": ShellNotFoundError,
|
|
542
|
+
"SkillNotFoundError": SkillNotFoundError,
|
|
543
|
+
"UnauthorizedError": UnauthorizedError,
|
|
544
|
+
"UnknownError": UnknownError,
|
|
545
|
+
"VcsInitNotSupportedError": VcsInitNotSupportedError,
|
|
546
|
+
"WorktreeError": WorktreeError,
|
|
547
|
+
}
|