opencode-python-sdk 0.1.0__py3-none-any.whl → 0.1.1__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.
Files changed (38) hide show
  1. opencode/_exceptions.py +22 -0
  2. opencode/_server.py +8 -0
  3. opencode/resources/agent.py +14 -14
  4. opencode/resources/command.py +6 -6
  5. opencode/resources/config.py +18 -18
  6. opencode/resources/credential.py +22 -22
  7. opencode/resources/debug.py +10 -8
  8. opencode/resources/event.py +4 -4
  9. opencode/resources/experimental.py +74 -72
  10. opencode/resources/file.py +28 -28
  11. opencode/resources/form.py +6 -6
  12. opencode/resources/generate.py +8 -8
  13. opencode/resources/integration.py +102 -94
  14. opencode/resources/location.py +12 -12
  15. opencode/resources/mcp.py +44 -42
  16. opencode/resources/message.py +10 -10
  17. opencode/resources/migration.py +6 -4
  18. opencode/resources/model.py +16 -16
  19. opencode/resources/permission.py +68 -64
  20. opencode/resources/plugin.py +20 -20
  21. opencode/resources/project.py +14 -14
  22. opencode/resources/provider.py +18 -18
  23. opencode/resources/pty.py +48 -46
  24. opencode/resources/reference.py +6 -6
  25. opencode/resources/rpc.py +10 -10
  26. opencode/resources/server.py +12 -12
  27. opencode/resources/session.py +378 -366
  28. opencode/resources/shell.py +34 -34
  29. opencode/resources/skill.py +6 -6
  30. opencode/resources/vcs.py +48 -46
  31. opencode/resources/voice.py +8 -8
  32. opencode/resources/websearch.py +16 -16
  33. opencode/resources/worktree.py +30 -30
  34. {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.1.dist-info}/METADATA +5 -2
  35. opencode_python_sdk-0.1.1.dist-info/RECORD +55 -0
  36. opencode_python_sdk-0.1.0.dist-info/RECORD +0 -55
  37. {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.1.dist-info}/WHEEL +0 -0
  38. {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.1.dist-info}/licenses/LICENSE +0 -0
@@ -50,9 +50,9 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
50
50
  This endpoint is experimental in OpenCode and may change without notice.
51
51
 
52
52
  Raises:
53
- InvalidRequestError
54
- UnauthorizedError
55
- ServiceUnavailableError
53
+ InvalidRequestError: The server answered 400.
54
+ UnauthorizedError: The server answered 401.
55
+ ServiceUnavailableError: The server answered 503.
56
56
 
57
57
  ``GET /api/experimental/session/:sessionID/terminal/read``
58
58
  """
@@ -85,9 +85,9 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
85
85
  """This endpoint is experimental in OpenCode and may change without notice.
86
86
 
87
87
  Raises:
88
- InvalidRequestError
89
- UnauthorizedError
90
- ServiceUnavailableError
88
+ InvalidRequestError: The server answered 400.
89
+ UnauthorizedError: The server answered 401.
90
+ ServiceUnavailableError: The server answered 503.
91
91
 
92
92
  ``GET /api/experimental/session/:sessionID/terminal``
93
93
  """
@@ -125,9 +125,9 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
125
125
  """This endpoint is experimental in OpenCode and may change without notice.
126
126
 
127
127
  Raises:
128
- InvalidRequestError
129
- UnauthorizedError
130
- ServiceUnavailableError
128
+ InvalidRequestError: The server answered 400.
129
+ UnauthorizedError: The server answered 401.
130
+ ServiceUnavailableError: The server answered 503.
131
131
 
132
132
  ``POST /api/experimental/session/:sessionID/terminal``
133
133
  """
@@ -159,9 +159,9 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
159
159
  """This endpoint is experimental in OpenCode and may change without notice.
160
160
 
161
161
  Raises:
162
- InvalidRequestError
163
- UnauthorizedError
164
- ServiceUnavailableError
162
+ InvalidRequestError: The server answered 400.
163
+ UnauthorizedError: The server answered 401.
164
+ ServiceUnavailableError: The server answered 503.
165
165
 
166
166
  ``POST /api/experimental/persistent-pty/shutdown``
167
167
  """
@@ -188,9 +188,9 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
188
188
  """This endpoint is experimental in OpenCode and may change without notice.
189
189
 
190
190
  Raises:
191
- InvalidRequestError
192
- UnauthorizedError
193
- ServiceUnavailableError
191
+ InvalidRequestError: The server answered 400.
192
+ UnauthorizedError: The server answered 401.
193
+ ServiceUnavailableError: The server answered 503.
194
194
 
195
195
  ``POST /api/experimental/persistent-pty/handoff``
196
196
  """
@@ -221,10 +221,10 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
221
221
  """This endpoint is experimental in OpenCode and may change without notice.
222
222
 
223
223
  Raises:
224
- InvalidRequestError
225
- UnauthorizedError
226
- PtyNotFoundError
227
- ServiceUnavailableError
224
+ InvalidRequestError: The server answered 400.
225
+ UnauthorizedError: The server answered 401.
226
+ PtyNotFoundError: The server answered 404.
227
+ ServiceUnavailableError: The server answered 503.
228
228
 
229
229
  ``GET /api/experimental/persistent-pty/:ptyID``
230
230
  """
@@ -258,10 +258,10 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
258
258
  """This endpoint is experimental in OpenCode and may change without notice.
259
259
 
260
260
  Raises:
261
- InvalidRequestError
262
- UnauthorizedError
263
- PtyNotFoundError
264
- ServiceUnavailableError
261
+ InvalidRequestError: The server answered 400.
262
+ UnauthorizedError: The server answered 401.
263
+ PtyNotFoundError: The server answered 404.
264
+ ServiceUnavailableError: The server answered 503.
265
265
 
266
266
  ``PUT /api/experimental/persistent-pty/:ptyID``
267
267
  """
@@ -294,10 +294,10 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
294
294
  """This endpoint is experimental in OpenCode and may change without notice.
295
295
 
296
296
  Raises:
297
- InvalidRequestError
298
- UnauthorizedError
299
- PtyNotFoundError
300
- ServiceUnavailableError
297
+ InvalidRequestError: The server answered 400.
298
+ UnauthorizedError: The server answered 401.
299
+ PtyNotFoundError: The server answered 404.
300
+ ServiceUnavailableError: The server answered 503.
301
301
 
302
302
  ``GET /api/experimental/persistent-pty/:ptyID/snapshot``
303
303
  """
@@ -329,10 +329,10 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
329
329
  """This endpoint is experimental in OpenCode and may change without notice.
330
330
 
331
331
  Raises:
332
- InvalidRequestError
333
- UnauthorizedError
334
- PtyNotFoundError
335
- ServiceUnavailableError
332
+ InvalidRequestError: The server answered 400.
333
+ UnauthorizedError: The server answered 401.
334
+ PtyNotFoundError: The server answered 404.
335
+ ServiceUnavailableError: The server answered 503.
336
336
 
337
337
  ``DELETE /api/experimental/persistent-pty/:ptyID``
338
338
  """
@@ -361,11 +361,11 @@ class ExperimentalPersistentPtyResource(SyncAPIResource):
361
361
  """This endpoint is experimental in OpenCode and may change without notice.
362
362
 
363
363
  Raises:
364
- InvalidRequestError
365
- UnauthorizedError
366
- ForbiddenError
367
- PtyNotFoundError
368
- ServiceUnavailableError
364
+ InvalidRequestError: The server answered 400.
365
+ UnauthorizedError: The server answered 401.
366
+ ForbiddenError: The server answered 403.
367
+ PtyNotFoundError: The server answered 404.
368
+ ServiceUnavailableError: The server answered 503.
369
369
 
370
370
  ``POST /api/experimental/persistent-pty/:ptyID/connect-token``
371
371
  """
@@ -392,6 +392,7 @@ class ExperimentalResource(SyncAPIResource):
392
392
 
393
393
  @cached_property
394
394
  def persistent_pty(self) -> ExperimentalPersistentPtyResource:
395
+ """Operations under ``client.experimental.persistent_pty``."""
395
396
  return ExperimentalPersistentPtyResource(self._client)
396
397
 
397
398
 
@@ -415,9 +416,9 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
415
416
  This endpoint is experimental in OpenCode and may change without notice.
416
417
 
417
418
  Raises:
418
- InvalidRequestError
419
- UnauthorizedError
420
- ServiceUnavailableError
419
+ InvalidRequestError: The server answered 400.
420
+ UnauthorizedError: The server answered 401.
421
+ ServiceUnavailableError: The server answered 503.
421
422
 
422
423
  ``GET /api/experimental/session/:sessionID/terminal/read``
423
424
  """
@@ -450,9 +451,9 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
450
451
  """This endpoint is experimental in OpenCode and may change without notice.
451
452
 
452
453
  Raises:
453
- InvalidRequestError
454
- UnauthorizedError
455
- ServiceUnavailableError
454
+ InvalidRequestError: The server answered 400.
455
+ UnauthorizedError: The server answered 401.
456
+ ServiceUnavailableError: The server answered 503.
456
457
 
457
458
  ``GET /api/experimental/session/:sessionID/terminal``
458
459
  """
@@ -490,9 +491,9 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
490
491
  """This endpoint is experimental in OpenCode and may change without notice.
491
492
 
492
493
  Raises:
493
- InvalidRequestError
494
- UnauthorizedError
495
- ServiceUnavailableError
494
+ InvalidRequestError: The server answered 400.
495
+ UnauthorizedError: The server answered 401.
496
+ ServiceUnavailableError: The server answered 503.
496
497
 
497
498
  ``POST /api/experimental/session/:sessionID/terminal``
498
499
  """
@@ -524,9 +525,9 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
524
525
  """This endpoint is experimental in OpenCode and may change without notice.
525
526
 
526
527
  Raises:
527
- InvalidRequestError
528
- UnauthorizedError
529
- ServiceUnavailableError
528
+ InvalidRequestError: The server answered 400.
529
+ UnauthorizedError: The server answered 401.
530
+ ServiceUnavailableError: The server answered 503.
530
531
 
531
532
  ``POST /api/experimental/persistent-pty/shutdown``
532
533
  """
@@ -553,9 +554,9 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
553
554
  """This endpoint is experimental in OpenCode and may change without notice.
554
555
 
555
556
  Raises:
556
- InvalidRequestError
557
- UnauthorizedError
558
- ServiceUnavailableError
557
+ InvalidRequestError: The server answered 400.
558
+ UnauthorizedError: The server answered 401.
559
+ ServiceUnavailableError: The server answered 503.
559
560
 
560
561
  ``POST /api/experimental/persistent-pty/handoff``
561
562
  """
@@ -586,10 +587,10 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
586
587
  """This endpoint is experimental in OpenCode and may change without notice.
587
588
 
588
589
  Raises:
589
- InvalidRequestError
590
- UnauthorizedError
591
- PtyNotFoundError
592
- ServiceUnavailableError
590
+ InvalidRequestError: The server answered 400.
591
+ UnauthorizedError: The server answered 401.
592
+ PtyNotFoundError: The server answered 404.
593
+ ServiceUnavailableError: The server answered 503.
593
594
 
594
595
  ``GET /api/experimental/persistent-pty/:ptyID``
595
596
  """
@@ -623,10 +624,10 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
623
624
  """This endpoint is experimental in OpenCode and may change without notice.
624
625
 
625
626
  Raises:
626
- InvalidRequestError
627
- UnauthorizedError
628
- PtyNotFoundError
629
- ServiceUnavailableError
627
+ InvalidRequestError: The server answered 400.
628
+ UnauthorizedError: The server answered 401.
629
+ PtyNotFoundError: The server answered 404.
630
+ ServiceUnavailableError: The server answered 503.
630
631
 
631
632
  ``PUT /api/experimental/persistent-pty/:ptyID``
632
633
  """
@@ -659,10 +660,10 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
659
660
  """This endpoint is experimental in OpenCode and may change without notice.
660
661
 
661
662
  Raises:
662
- InvalidRequestError
663
- UnauthorizedError
664
- PtyNotFoundError
665
- ServiceUnavailableError
663
+ InvalidRequestError: The server answered 400.
664
+ UnauthorizedError: The server answered 401.
665
+ PtyNotFoundError: The server answered 404.
666
+ ServiceUnavailableError: The server answered 503.
666
667
 
667
668
  ``GET /api/experimental/persistent-pty/:ptyID/snapshot``
668
669
  """
@@ -694,10 +695,10 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
694
695
  """This endpoint is experimental in OpenCode and may change without notice.
695
696
 
696
697
  Raises:
697
- InvalidRequestError
698
- UnauthorizedError
699
- PtyNotFoundError
700
- ServiceUnavailableError
698
+ InvalidRequestError: The server answered 400.
699
+ UnauthorizedError: The server answered 401.
700
+ PtyNotFoundError: The server answered 404.
701
+ ServiceUnavailableError: The server answered 503.
701
702
 
702
703
  ``DELETE /api/experimental/persistent-pty/:ptyID``
703
704
  """
@@ -726,11 +727,11 @@ class AsyncExperimentalPersistentPtyResource(AsyncAPIResource):
726
727
  """This endpoint is experimental in OpenCode and may change without notice.
727
728
 
728
729
  Raises:
729
- InvalidRequestError
730
- UnauthorizedError
731
- ForbiddenError
732
- PtyNotFoundError
733
- ServiceUnavailableError
730
+ InvalidRequestError: The server answered 400.
731
+ UnauthorizedError: The server answered 401.
732
+ ForbiddenError: The server answered 403.
733
+ PtyNotFoundError: The server answered 404.
734
+ ServiceUnavailableError: The server answered 503.
734
735
 
735
736
  ``POST /api/experimental/persistent-pty/:ptyID/connect-token``
736
737
  """
@@ -757,4 +758,5 @@ class AsyncExperimentalResource(AsyncAPIResource):
757
758
 
758
759
  @cached_property
759
760
  def persistent_pty(self) -> AsyncExperimentalPersistentPtyResource:
761
+ """Operations under ``client.experimental.persistent_pty``."""
760
762
  return AsyncExperimentalPersistentPtyResource(self._client)
@@ -39,10 +39,10 @@ class FileResource(SyncAPIResource):
39
39
  Stream one file relative to the requested location with ETag, Last-Modified, and single-range HTTP Range support (206 Partial Content, 416 Range Not Satisfiable, and 304 Not Modified; multi-range and malformed Range headers fall back to 200).
40
40
 
41
41
  Raises:
42
- InvalidRequestError
43
- UnauthorizedError
44
- RemoteFileNotFoundError
45
- LocationNotFoundError
42
+ InvalidRequestError: The server answered 400.
43
+ UnauthorizedError: The server answered 401.
44
+ RemoteFileNotFoundError: The server answered 404.
45
+ LocationNotFoundError: The server answered 404.
46
46
 
47
47
  ``GET /api/fs/read/*``
48
48
  """
@@ -80,10 +80,10 @@ class FileResource(SyncAPIResource):
80
80
  path: An absolute path or a path relative to the requested location. Defaults to the location directory.
81
81
 
82
82
  Raises:
83
- InvalidRequestError
84
- UnauthorizedError
85
- RemoteFileNotFoundError
86
- LocationNotFoundError
83
+ InvalidRequestError: The server answered 400.
84
+ UnauthorizedError: The server answered 401.
85
+ RemoteFileNotFoundError: The server answered 404.
86
+ LocationNotFoundError: The server answered 404.
87
87
 
88
88
  ``GET /api/fs/list``
89
89
  """
@@ -120,9 +120,9 @@ class FileResource(SyncAPIResource):
120
120
  Find recursively ranked filesystem entries relative to the requested location.
121
121
 
122
122
  Raises:
123
- InvalidRequestError
124
- UnauthorizedError
125
- LocationNotFoundError
123
+ InvalidRequestError: The server answered 400.
124
+ UnauthorizedError: The server answered 401.
125
+ LocationNotFoundError: The server answered 404.
126
126
 
127
127
  ``GET /api/fs/find``
128
128
  """
@@ -163,9 +163,9 @@ class FileResource(SyncAPIResource):
163
163
  path: An absolute path or a path relative to the requested location. Missing parent directories are created.
164
164
 
165
165
  Raises:
166
- InvalidRequestError
167
- UnauthorizedError
168
- LocationNotFoundError
166
+ InvalidRequestError: The server answered 400.
167
+ UnauthorizedError: The server answered 401.
168
+ LocationNotFoundError: The server answered 404.
169
169
 
170
170
  ``POST /api/experimental/fs/write``
171
171
  """
@@ -205,10 +205,10 @@ class AsyncFileResource(AsyncAPIResource):
205
205
  Stream one file relative to the requested location with ETag, Last-Modified, and single-range HTTP Range support (206 Partial Content, 416 Range Not Satisfiable, and 304 Not Modified; multi-range and malformed Range headers fall back to 200).
206
206
 
207
207
  Raises:
208
- InvalidRequestError
209
- UnauthorizedError
210
- RemoteFileNotFoundError
211
- LocationNotFoundError
208
+ InvalidRequestError: The server answered 400.
209
+ UnauthorizedError: The server answered 401.
210
+ RemoteFileNotFoundError: The server answered 404.
211
+ LocationNotFoundError: The server answered 404.
212
212
 
213
213
  ``GET /api/fs/read/*``
214
214
  """
@@ -246,10 +246,10 @@ class AsyncFileResource(AsyncAPIResource):
246
246
  path: An absolute path or a path relative to the requested location. Defaults to the location directory.
247
247
 
248
248
  Raises:
249
- InvalidRequestError
250
- UnauthorizedError
251
- RemoteFileNotFoundError
252
- LocationNotFoundError
249
+ InvalidRequestError: The server answered 400.
250
+ UnauthorizedError: The server answered 401.
251
+ RemoteFileNotFoundError: The server answered 404.
252
+ LocationNotFoundError: The server answered 404.
253
253
 
254
254
  ``GET /api/fs/list``
255
255
  """
@@ -286,9 +286,9 @@ class AsyncFileResource(AsyncAPIResource):
286
286
  Find recursively ranked filesystem entries relative to the requested location.
287
287
 
288
288
  Raises:
289
- InvalidRequestError
290
- UnauthorizedError
291
- LocationNotFoundError
289
+ InvalidRequestError: The server answered 400.
290
+ UnauthorizedError: The server answered 401.
291
+ LocationNotFoundError: The server answered 404.
292
292
 
293
293
  ``GET /api/fs/find``
294
294
  """
@@ -329,9 +329,9 @@ class AsyncFileResource(AsyncAPIResource):
329
329
  path: An absolute path or a path relative to the requested location. Missing parent directories are created.
330
330
 
331
331
  Raises:
332
- InvalidRequestError
333
- UnauthorizedError
334
- LocationNotFoundError
332
+ InvalidRequestError: The server answered 400.
333
+ UnauthorizedError: The server answered 401.
334
+ LocationNotFoundError: The server answered 404.
335
335
 
336
336
  ``POST /api/experimental/fs/write``
337
337
  """
@@ -35,9 +35,9 @@ class FormResource(SyncAPIResource):
35
35
  Retrieve pending forms for a location.
36
36
 
37
37
  Raises:
38
- InvalidRequestError
39
- UnauthorizedError
40
- LocationNotFoundError
38
+ InvalidRequestError: The server answered 400.
39
+ UnauthorizedError: The server answered 401.
40
+ LocationNotFoundError: The server answered 404.
41
41
 
42
42
  ``GET /api/form``
43
43
  """
@@ -75,9 +75,9 @@ class AsyncFormResource(AsyncAPIResource):
75
75
  Retrieve pending forms for a location.
76
76
 
77
77
  Raises:
78
- InvalidRequestError
79
- UnauthorizedError
80
- LocationNotFoundError
78
+ InvalidRequestError: The server answered 400.
79
+ UnauthorizedError: The server answered 401.
80
+ LocationNotFoundError: The server answered 404.
81
81
 
82
82
  ``GET /api/form``
83
83
  """
@@ -38,10 +38,10 @@ class GenerateResource(SyncAPIResource):
38
38
  This endpoint is experimental in OpenCode and may change without notice.
39
39
 
40
40
  Raises:
41
- InvalidRequestError
42
- UnauthorizedError
43
- LocationNotFoundError
44
- ServiceUnavailableError
41
+ InvalidRequestError: The server answered 400.
42
+ UnauthorizedError: The server answered 401.
43
+ LocationNotFoundError: The server answered 404.
44
+ ServiceUnavailableError: The server answered 503.
45
45
 
46
46
  ``POST /api/experimental/generate``
47
47
  """
@@ -83,10 +83,10 @@ class AsyncGenerateResource(AsyncAPIResource):
83
83
  This endpoint is experimental in OpenCode and may change without notice.
84
84
 
85
85
  Raises:
86
- InvalidRequestError
87
- UnauthorizedError
88
- LocationNotFoundError
89
- ServiceUnavailableError
86
+ InvalidRequestError: The server answered 400.
87
+ UnauthorizedError: The server answered 401.
88
+ LocationNotFoundError: The server answered 404.
89
+ ServiceUnavailableError: The server answered 503.
90
90
 
91
91
  ``POST /api/experimental/generate``
92
92
  """