opencode-python-sdk 0.1.0__py3-none-any.whl → 0.1.2__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 (40) hide show
  1. opencode/__init__.py +4 -0
  2. opencode/_exceptions.py +22 -0
  3. opencode/_pty.py +586 -0
  4. opencode/_server.py +8 -0
  5. opencode/resources/agent.py +14 -14
  6. opencode/resources/command.py +6 -6
  7. opencode/resources/config.py +18 -18
  8. opencode/resources/credential.py +22 -22
  9. opencode/resources/debug.py +10 -8
  10. opencode/resources/event.py +4 -4
  11. opencode/resources/experimental.py +77 -74
  12. opencode/resources/file.py +28 -28
  13. opencode/resources/form.py +6 -6
  14. opencode/resources/generate.py +8 -8
  15. opencode/resources/integration.py +102 -94
  16. opencode/resources/location.py +12 -12
  17. opencode/resources/mcp.py +44 -42
  18. opencode/resources/message.py +10 -10
  19. opencode/resources/migration.py +6 -4
  20. opencode/resources/model.py +16 -16
  21. opencode/resources/permission.py +68 -64
  22. opencode/resources/plugin.py +20 -20
  23. opencode/resources/project.py +14 -14
  24. opencode/resources/provider.py +18 -18
  25. opencode/resources/pty.py +51 -48
  26. opencode/resources/reference.py +6 -6
  27. opencode/resources/rpc.py +10 -10
  28. opencode/resources/server.py +12 -12
  29. opencode/resources/session.py +378 -366
  30. opencode/resources/shell.py +34 -34
  31. opencode/resources/skill.py +6 -6
  32. opencode/resources/vcs.py +48 -46
  33. opencode/resources/voice.py +8 -8
  34. opencode/resources/websearch.py +16 -16
  35. opencode/resources/worktree.py +30 -30
  36. {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.2.dist-info}/METADATA +28 -2
  37. opencode_python_sdk-0.1.2.dist-info/RECORD +56 -0
  38. opencode_python_sdk-0.1.0.dist-info/RECORD +0 -55
  39. {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.2.dist-info}/WHEEL +0 -0
  40. {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.2.dist-info}/licenses/LICENSE +0 -0
@@ -80,13 +80,13 @@ class SessionRevertResource(SyncAPIResource):
80
80
  Stage or move a reversible session boundary and optionally apply its file changes.
81
81
 
82
82
  Raises:
83
- InvalidRequestError
84
- UnauthorizedError
85
- MessageNotFoundError
86
- SessionNotFoundError
87
- LocationNotFoundError
88
- SessionBusyError
89
- UnknownError
83
+ InvalidRequestError: The server answered 400.
84
+ UnauthorizedError: The server answered 401.
85
+ MessageNotFoundError: The server answered 404.
86
+ SessionNotFoundError: The server answered 404.
87
+ LocationNotFoundError: The server answered 404.
88
+ SessionBusyError: The server answered 409.
89
+ UnknownError: The server answered 500.
90
90
 
91
91
  ``POST /api/session/:sessionID/revert/stage``
92
92
  """
@@ -119,12 +119,12 @@ class SessionRevertResource(SyncAPIResource):
119
119
  """Clear staged revert.
120
120
 
121
121
  Raises:
122
- InvalidRequestError
123
- UnauthorizedError
124
- SessionNotFoundError
125
- LocationNotFoundError
126
- SessionBusyError
127
- UnknownError
122
+ InvalidRequestError: The server answered 400.
123
+ UnauthorizedError: The server answered 401.
124
+ SessionNotFoundError: The server answered 404.
125
+ LocationNotFoundError: The server answered 404.
126
+ SessionBusyError: The server answered 409.
127
+ UnknownError: The server answered 500.
128
128
 
129
129
  ``DELETE /api/session/:sessionID/revert``
130
130
  """
@@ -152,11 +152,11 @@ class SessionRevertResource(SyncAPIResource):
152
152
  """Commit staged revert.
153
153
 
154
154
  Raises:
155
- InvalidRequestError
156
- UnauthorizedError
157
- SessionNotFoundError
158
- LocationNotFoundError
159
- SessionBusyError
155
+ InvalidRequestError: The server answered 400.
156
+ UnauthorizedError: The server answered 401.
157
+ SessionNotFoundError: The server answered 404.
158
+ LocationNotFoundError: The server answered 404.
159
+ SessionBusyError: The server answered 409.
160
160
 
161
161
  ``POST /api/session/:sessionID/revert/commit``
162
162
  """
@@ -190,9 +190,9 @@ class SessionInboxResource(SyncAPIResource):
190
190
  List durable enqueued session work not yet delivered, ordered by enqueue sequence. Includes user, synthetic, compaction, and move items.
191
191
 
192
192
  Raises:
193
- InvalidRequestError
194
- UnauthorizedError
195
- SessionNotFoundError
193
+ InvalidRequestError: The server answered 400.
194
+ UnauthorizedError: The server answered 401.
195
+ SessionNotFoundError: The server answered 404.
196
196
 
197
197
  ``GET /api/session/:sessionID/inbox``
198
198
  """
@@ -227,9 +227,9 @@ class SessionInboxResource(SyncAPIResource):
227
227
  Cancel an inbox item that has not yet been delivered. Unavailable items are a no-op.
228
228
 
229
229
  Raises:
230
- InvalidRequestError
231
- UnauthorizedError
232
- SessionNotFoundError
230
+ InvalidRequestError: The server answered 400.
231
+ UnauthorizedError: The server answered 401.
232
+ SessionNotFoundError: The server answered 404.
233
233
 
234
234
  ``DELETE /api/session/:sessionID/inbox/:inboxID``
235
235
  """
@@ -261,10 +261,10 @@ class SessionInboxResource(SyncAPIResource):
261
261
  Change a pending inbox item's delivery mode. Steering wakes session execution.
262
262
 
263
263
  Raises:
264
- InvalidRequestError
265
- UnauthorizedError
266
- SessionNotFoundError
267
- ConflictError
264
+ InvalidRequestError: The server answered 400.
265
+ UnauthorizedError: The server answered 401.
266
+ SessionNotFoundError: The server answered 404.
267
+ ConflictError: The server answered 409.
268
268
 
269
269
  ``PATCH /api/session/:sessionID/inbox/:inboxID``
270
270
  """
@@ -301,10 +301,10 @@ class SessionInstructionsEntryResource(SyncAPIResource):
301
301
  This endpoint is experimental in OpenCode and may change without notice.
302
302
 
303
303
  Raises:
304
- InvalidRequestError
305
- UnauthorizedError
306
- SessionNotFoundError
307
- LocationNotFoundError
304
+ InvalidRequestError: The server answered 400.
305
+ UnauthorizedError: The server answered 401.
306
+ SessionNotFoundError: The server answered 404.
307
+ LocationNotFoundError: The server answered 404.
308
308
 
309
309
  ``GET /api/experimental/session/:sessionID/instructions/entries``
310
310
  """
@@ -342,11 +342,11 @@ class SessionInstructionsEntryResource(SyncAPIResource):
342
342
  This endpoint is experimental in OpenCode and may change without notice.
343
343
 
344
344
  Raises:
345
- InvalidRequestError
346
- UnauthorizedError
347
- SessionNotFoundError
348
- LocationNotFoundError
349
- InstructionEntryValueTooLargeError
345
+ InvalidRequestError: The server answered 400.
346
+ UnauthorizedError: The server answered 401.
347
+ SessionNotFoundError: The server answered 404.
348
+ LocationNotFoundError: The server answered 404.
349
+ InstructionEntryValueTooLargeError: The server answered 413.
350
350
 
351
351
  ``PUT /api/experimental/session/:sessionID/instructions/entries/:key``
352
352
  """
@@ -380,10 +380,10 @@ class SessionInstructionsEntryResource(SyncAPIResource):
380
380
  This endpoint is experimental in OpenCode and may change without notice.
381
381
 
382
382
  Raises:
383
- InvalidRequestError
384
- UnauthorizedError
385
- SessionNotFoundError
386
- LocationNotFoundError
383
+ InvalidRequestError: The server answered 400.
384
+ UnauthorizedError: The server answered 401.
385
+ SessionNotFoundError: The server answered 404.
386
+ LocationNotFoundError: The server answered 404.
387
387
 
388
388
  ``DELETE /api/experimental/session/:sessionID/instructions/entries/:key``
389
389
  """
@@ -405,6 +405,7 @@ class SessionInstructionsResource(SyncAPIResource):
405
405
 
406
406
  @cached_property
407
407
  def entry(self) -> SessionInstructionsEntryResource:
408
+ """Operations under ``client.session.instructions.entry``."""
408
409
  return SessionInstructionsEntryResource(self._client)
409
410
 
410
411
 
@@ -426,10 +427,10 @@ class SessionMessageResource(SyncAPIResource):
426
427
  Retrieve one projected message owned by the Session.
427
428
 
428
429
  Raises:
429
- InvalidRequestError
430
- UnauthorizedError
431
- SessionNotFoundError
432
- MessageNotFoundError
430
+ InvalidRequestError: The server answered 400.
431
+ UnauthorizedError: The server answered 401.
432
+ SessionNotFoundError: The server answered 404.
433
+ MessageNotFoundError: The server answered 404.
433
434
 
434
435
  ``GET /api/session/:sessionID/message/:messageID``
435
436
  """
@@ -467,10 +468,10 @@ class SessionFormResource(SyncAPIResource):
467
468
  Retrieve pending forms for a session.
468
469
 
469
470
  Raises:
470
- InvalidRequestError
471
- UnauthorizedError
472
- SessionNotFoundError
473
- LocationNotFoundError
471
+ InvalidRequestError: The server answered 400.
472
+ UnauthorizedError: The server answered 401.
473
+ SessionNotFoundError: The server answered 404.
474
+ LocationNotFoundError: The server answered 404.
474
475
 
475
476
  ``GET /api/session/:sessionID/form``
476
477
  """
@@ -508,11 +509,11 @@ class SessionFormResource(SyncAPIResource):
508
509
  Create a form for a session.
509
510
 
510
511
  Raises:
511
- InvalidRequestError
512
- UnauthorizedError
513
- SessionNotFoundError
514
- LocationNotFoundError
515
- ConflictError
512
+ InvalidRequestError: The server answered 400.
513
+ UnauthorizedError: The server answered 401.
514
+ SessionNotFoundError: The server answered 404.
515
+ LocationNotFoundError: The server answered 404.
516
+ ConflictError: The server answered 409.
516
517
 
517
518
  ``POST /api/session/:sessionID/form``
518
519
  """
@@ -548,11 +549,11 @@ class SessionFormResource(SyncAPIResource):
548
549
  Retrieve a form and its current state for a session.
549
550
 
550
551
  Raises:
551
- InvalidRequestError
552
- UnauthorizedError
553
- SessionNotFoundError
554
- FormNotFoundError
555
- LocationNotFoundError
552
+ InvalidRequestError: The server answered 400.
553
+ UnauthorizedError: The server answered 401.
554
+ SessionNotFoundError: The server answered 404.
555
+ FormNotFoundError: The server answered 404.
556
+ LocationNotFoundError: The server answered 404.
556
557
 
557
558
  ``GET /api/session/:sessionID/form/:formID``
558
559
  """
@@ -588,13 +589,13 @@ class SessionFormResource(SyncAPIResource):
588
589
  Submit an answer to a pending form.
589
590
 
590
591
  Raises:
591
- FormInvalidAnswerError
592
- InvalidRequestError
593
- UnauthorizedError
594
- SessionNotFoundError
595
- FormNotFoundError
596
- LocationNotFoundError
597
- FormAlreadySettledError
592
+ FormInvalidAnswerError: The server answered 400.
593
+ InvalidRequestError: The server answered 400.
594
+ UnauthorizedError: The server answered 401.
595
+ SessionNotFoundError: The server answered 404.
596
+ FormNotFoundError: The server answered 404.
597
+ LocationNotFoundError: The server answered 404.
598
+ FormAlreadySettledError: The server answered 409.
598
599
 
599
600
  ``POST /api/session/:sessionID/form/:formID/reply``
600
601
  """
@@ -627,12 +628,12 @@ class SessionFormResource(SyncAPIResource):
627
628
  Cancel a pending form, optionally telling the asker why it was not answered.
628
629
 
629
630
  Raises:
630
- InvalidRequestError
631
- UnauthorizedError
632
- SessionNotFoundError
633
- FormNotFoundError
634
- LocationNotFoundError
635
- FormAlreadySettledError
631
+ InvalidRequestError: The server answered 400.
632
+ UnauthorizedError: The server answered 401.
633
+ SessionNotFoundError: The server answered 404.
634
+ FormNotFoundError: The server answered 404.
635
+ LocationNotFoundError: The server answered 404.
636
+ FormAlreadySettledError: The server answered 409.
636
637
 
637
638
  ``DELETE /api/session/:sessionID/form/:formID``
638
639
  """
@@ -655,22 +656,27 @@ class SessionResource(SyncAPIResource):
655
656
 
656
657
  @cached_property
657
658
  def revert(self) -> SessionRevertResource:
659
+ """Operations under ``client.session.revert``."""
658
660
  return SessionRevertResource(self._client)
659
661
 
660
662
  @cached_property
661
663
  def inbox(self) -> SessionInboxResource:
664
+ """Operations under ``client.session.inbox``."""
662
665
  return SessionInboxResource(self._client)
663
666
 
664
667
  @cached_property
665
668
  def instructions(self) -> SessionInstructionsResource:
669
+ """Operations under ``client.session.instructions``."""
666
670
  return SessionInstructionsResource(self._client)
667
671
 
668
672
  @cached_property
669
673
  def message(self) -> SessionMessageResource:
674
+ """Operations under ``client.session.message``."""
670
675
  return SessionMessageResource(self._client)
671
676
 
672
677
  @cached_property
673
678
  def form(self) -> SessionFormResource:
679
+ """Operations under ``client.session.form``."""
674
680
  return SessionFormResource(self._client)
675
681
 
676
682
  def list(
@@ -701,9 +707,9 @@ class SessionResource(SyncAPIResource):
701
707
  archived: Filter by archive state. Use true to return only archived sessions or false to exclude them. Omit to include both.
702
708
 
703
709
  Raises:
704
- InvalidCursorError
705
- InvalidRequestError
706
- UnauthorizedError
710
+ InvalidCursorError: The server answered 400.
711
+ InvalidRequestError: The server answered 400.
712
+ UnauthorizedError: The server answered 401.
707
713
 
708
714
  ``GET /api/session``
709
715
  """
@@ -750,8 +756,8 @@ class SessionResource(SyncAPIResource):
750
756
  This endpoint is experimental in OpenCode and may change without notice.
751
757
 
752
758
  Raises:
753
- InvalidRequestError
754
- UnauthorizedError
759
+ InvalidRequestError: The server answered 400.
760
+ UnauthorizedError: The server answered 401.
755
761
 
756
762
  ``GET /api/experimental/session/stats``
757
763
  """
@@ -793,9 +799,9 @@ class SessionResource(SyncAPIResource):
793
799
  Create a session at the requested location. A parentID creates a linked child session at its parent's location.
794
800
 
795
801
  Raises:
796
- InvalidRequestError
797
- UnauthorizedError
798
- SessionNotFoundError
802
+ InvalidRequestError: The server answered 400.
803
+ UnauthorizedError: The server answered 401.
804
+ SessionNotFoundError: The server answered 404.
799
805
 
800
806
  ``POST /api/session``
801
807
  """
@@ -843,10 +849,10 @@ class SessionResource(SyncAPIResource):
843
849
  This endpoint is experimental in OpenCode and may change without notice.
844
850
 
845
851
  Raises:
846
- InvalidRequestError
847
- UnauthorizedError
848
- SessionNotFoundError
849
- ConflictError
852
+ InvalidRequestError: The server answered 400.
853
+ UnauthorizedError: The server answered 401.
854
+ SessionNotFoundError: The server answered 404.
855
+ ConflictError: The server answered 409.
850
856
 
851
857
  ``POST /api/experimental/session/import``
852
858
  """
@@ -884,10 +890,10 @@ class SessionResource(SyncAPIResource):
884
890
  This endpoint is experimental in OpenCode and may change without notice.
885
891
 
886
892
  Raises:
887
- InvalidRequestError
888
- UnauthorizedError
889
- SessionNotFoundError
890
- UnknownError
893
+ InvalidRequestError: The server answered 400.
894
+ UnauthorizedError: The server answered 401.
895
+ SessionNotFoundError: The server answered 404.
896
+ UnknownError: The server answered 500.
891
897
 
892
898
  ``GET /api/experimental/session/:sessionID/export``
893
899
  """
@@ -921,8 +927,8 @@ class SessionResource(SyncAPIResource):
921
927
  Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.
922
928
 
923
929
  Raises:
924
- InvalidRequestError
925
- UnauthorizedError
930
+ InvalidRequestError: The server answered 400.
931
+ UnauthorizedError: The server answered 401.
926
932
 
927
933
  ``GET /api/session/active``
928
934
  """
@@ -956,9 +962,9 @@ class SessionResource(SyncAPIResource):
956
962
  Retrieve a session by ID.
957
963
 
958
964
  Raises:
959
- InvalidRequestError
960
- UnauthorizedError
961
- SessionNotFoundError
965
+ InvalidRequestError: The server answered 400.
966
+ UnauthorizedError: The server answered 401.
967
+ SessionNotFoundError: The server answered 404.
962
968
 
963
969
  ``GET /api/session/:sessionID``
964
970
  """
@@ -992,9 +998,9 @@ class SessionResource(SyncAPIResource):
992
998
  Delete a session and its child sessions.
993
999
 
994
1000
  Raises:
995
- InvalidRequestError
996
- UnauthorizedError
997
- SessionNotFoundError
1001
+ InvalidRequestError: The server answered 400.
1002
+ UnauthorizedError: The server answered 401.
1003
+ SessionNotFoundError: The server answered 404.
998
1004
 
999
1005
  ``DELETE /api/session/:sessionID``
1000
1006
  """
@@ -1025,11 +1031,11 @@ class SessionResource(SyncAPIResource):
1025
1031
  Create a child session by copying projected history before a message. Omit before to copy the full history.
1026
1032
 
1027
1033
  Raises:
1028
- InvalidRequestError
1029
- UnauthorizedError
1030
- SessionNotFoundError
1031
- MessageNotFoundError
1032
- LocationNotFoundError
1034
+ InvalidRequestError: The server answered 400.
1035
+ UnauthorizedError: The server answered 401.
1036
+ SessionNotFoundError: The server answered 404.
1037
+ MessageNotFoundError: The server answered 404.
1038
+ LocationNotFoundError: The server answered 404.
1033
1039
 
1034
1040
  ``POST /api/session/:sessionID/fork``
1035
1041
  """
@@ -1065,10 +1071,10 @@ class SessionResource(SyncAPIResource):
1065
1071
  Switch the agent used by subsequent provider turns.
1066
1072
 
1067
1073
  Raises:
1068
- InvalidRequestError
1069
- UnauthorizedError
1070
- SessionNotFoundError
1071
- LocationNotFoundError
1074
+ InvalidRequestError: The server answered 400.
1075
+ UnauthorizedError: The server answered 401.
1076
+ SessionNotFoundError: The server answered 404.
1077
+ LocationNotFoundError: The server answered 404.
1072
1078
 
1073
1079
  ``POST /api/session/:sessionID/agent``
1074
1080
  """
@@ -1100,10 +1106,10 @@ class SessionResource(SyncAPIResource):
1100
1106
  Switch the model used by subsequent provider turns.
1101
1107
 
1102
1108
  Raises:
1103
- InvalidRequestError
1104
- UnauthorizedError
1105
- SessionNotFoundError
1106
- LocationNotFoundError
1109
+ InvalidRequestError: The server answered 400.
1110
+ UnauthorizedError: The server answered 401.
1111
+ SessionNotFoundError: The server answered 404.
1112
+ LocationNotFoundError: The server answered 404.
1107
1113
 
1108
1114
  ``POST /api/session/:sessionID/model``
1109
1115
  """
@@ -1141,10 +1147,10 @@ class SessionResource(SyncAPIResource):
1141
1147
  archived: Archive the session with true or restore it with false. Repeating the current state is a no-op.
1142
1148
 
1143
1149
  Raises:
1144
- InvalidRequestError
1145
- UnauthorizedError
1146
- SessionNotFoundError
1147
- LocationNotFoundError
1150
+ InvalidRequestError: The server answered 400.
1151
+ UnauthorizedError: The server answered 401.
1152
+ SessionNotFoundError: The server answered 404.
1153
+ LocationNotFoundError: The server answered 404.
1148
1154
 
1149
1155
  ``PATCH /api/session/:sessionID``
1150
1156
  """
@@ -1177,9 +1183,9 @@ class SessionResource(SyncAPIResource):
1177
1183
  Move a session to another project directory at the requested delivery boundary.
1178
1184
 
1179
1185
  Raises:
1180
- InvalidRequestError
1181
- UnauthorizedError
1182
- SessionNotFoundError
1186
+ InvalidRequestError: The server answered 400.
1187
+ UnauthorizedError: The server answered 401.
1188
+ SessionNotFoundError: The server answered 404.
1183
1189
 
1184
1190
  ``POST /api/session/:sessionID/move``
1185
1191
  """
@@ -1218,11 +1224,11 @@ class SessionResource(SyncAPIResource):
1218
1224
  Durably admit one session input and schedule agent-loop execution unless resume is false.
1219
1225
 
1220
1226
  Raises:
1221
- InvalidRequestError
1222
- UnauthorizedError
1223
- SessionNotFoundError
1224
- LocationNotFoundError
1225
- ConflictError
1227
+ InvalidRequestError: The server answered 400.
1228
+ UnauthorizedError: The server answered 401.
1229
+ SessionNotFoundError: The server answered 404.
1230
+ LocationNotFoundError: The server answered 404.
1231
+ ConflictError: The server answered 409.
1226
1232
 
1227
1233
  ``POST /api/session/:sessionID/prompt``
1228
1234
  """
@@ -1272,12 +1278,12 @@ class SessionResource(SyncAPIResource):
1272
1278
  Execute a slash command callback immediately.
1273
1279
 
1274
1280
  Raises:
1275
- InvalidRequestError
1276
- UnauthorizedError
1277
- SessionNotFoundError
1278
- CommandNotFoundError
1279
- LocationNotFoundError
1280
- CommandExecutionError
1281
+ InvalidRequestError: The server answered 400.
1282
+ UnauthorizedError: The server answered 401.
1283
+ SessionNotFoundError: The server answered 404.
1284
+ CommandNotFoundError: The server answered 404.
1285
+ LocationNotFoundError: The server answered 404.
1286
+ CommandExecutionError: The server answered 500.
1281
1287
 
1282
1288
  ``POST /api/session/:sessionID/command``
1283
1289
  """
@@ -1319,11 +1325,11 @@ class SessionResource(SyncAPIResource):
1319
1325
  This endpoint is experimental in OpenCode and may change without notice.
1320
1326
 
1321
1327
  Raises:
1322
- InvalidRequestError
1323
- UnauthorizedError
1324
- SessionNotFoundError
1325
- SkillNotFoundError
1326
- LocationNotFoundError
1328
+ InvalidRequestError: The server answered 400.
1329
+ UnauthorizedError: The server answered 401.
1330
+ SessionNotFoundError: The server answered 404.
1331
+ SkillNotFoundError: The server answered 404.
1332
+ LocationNotFoundError: The server answered 404.
1327
1333
 
1328
1334
  ``POST /api/experimental/session/:sessionID/skill``
1329
1335
  """
@@ -1360,11 +1366,11 @@ class SessionResource(SyncAPIResource):
1360
1366
  Durably admit synthetic session input and schedule execution unless resume is false.
1361
1367
 
1362
1368
  Raises:
1363
- InvalidRequestError
1364
- UnauthorizedError
1365
- SessionNotFoundError
1366
- LocationNotFoundError
1367
- ConflictError
1369
+ InvalidRequestError: The server answered 400.
1370
+ UnauthorizedError: The server answered 401.
1371
+ SessionNotFoundError: The server answered 404.
1372
+ LocationNotFoundError: The server answered 404.
1373
+ ConflictError: The server answered 409.
1368
1374
 
1369
1375
  ``POST /api/session/:sessionID/synthetic``
1370
1376
  """
@@ -1408,10 +1414,10 @@ class SessionResource(SyncAPIResource):
1408
1414
  Execute one shell command in the session's working directory. Emits a shell.started event before execution and a shell.ended event with the merged output after.
1409
1415
 
1410
1416
  Raises:
1411
- InvalidRequestError
1412
- UnauthorizedError
1413
- SessionNotFoundError
1414
- LocationNotFoundError
1417
+ InvalidRequestError: The server answered 400.
1418
+ UnauthorizedError: The server answered 401.
1419
+ SessionNotFoundError: The server answered 404.
1420
+ LocationNotFoundError: The server answered 404.
1415
1421
 
1416
1422
  ``POST /api/session/:sessionID/shell``
1417
1423
  """
@@ -1444,11 +1450,11 @@ class SessionResource(SyncAPIResource):
1444
1450
  Durably admit a session compaction request. Steers by default: it runs at the next step boundary instead of waiting behind queued prompts.
1445
1451
 
1446
1452
  Raises:
1447
- InvalidRequestError
1448
- UnauthorizedError
1449
- SessionNotFoundError
1450
- LocationNotFoundError
1451
- ConflictError
1453
+ InvalidRequestError: The server answered 400.
1454
+ UnauthorizedError: The server answered 401.
1455
+ SessionNotFoundError: The server answered 404.
1456
+ LocationNotFoundError: The server answered 404.
1457
+ ConflictError: The server answered 409.
1452
1458
 
1453
1459
  ``POST /api/session/:sessionID/compact``
1454
1460
  """
@@ -1485,11 +1491,11 @@ class SessionResource(SyncAPIResource):
1485
1491
  This endpoint is experimental in OpenCode and may change without notice.
1486
1492
 
1487
1493
  Raises:
1488
- InvalidRequestError
1489
- UnauthorizedError
1490
- SessionNotFoundError
1491
- LocationNotFoundError
1492
- ServiceUnavailableError
1494
+ InvalidRequestError: The server answered 400.
1495
+ UnauthorizedError: The server answered 401.
1496
+ SessionNotFoundError: The server answered 404.
1497
+ LocationNotFoundError: The server answered 404.
1498
+ ServiceUnavailableError: The server answered 503.
1493
1499
 
1494
1500
  ``POST /api/experimental/session/:sessionID/wait``
1495
1501
  """
@@ -1519,10 +1525,10 @@ class SessionResource(SyncAPIResource):
1519
1525
  Retrieve the active context messages for a session (all messages after the last compaction).
1520
1526
 
1521
1527
  Raises:
1522
- InvalidRequestError
1523
- UnauthorizedError
1524
- SessionNotFoundError
1525
- UnknownError
1528
+ InvalidRequestError: The server answered 400.
1529
+ UnauthorizedError: The server answered 401.
1530
+ SessionNotFoundError: The server answered 404.
1531
+ UnknownError: The server answered 500.
1526
1532
 
1527
1533
  ``GET /api/session/:sessionID/context``
1528
1534
  """
@@ -1564,12 +1570,12 @@ class SessionResource(SyncAPIResource):
1564
1570
  context: Unchanged lines around each hunk. Omit for full-file patches.
1565
1571
 
1566
1572
  Raises:
1567
- InvalidRequestError
1568
- UnauthorizedError
1569
- MessageNotFoundError
1570
- SessionNotFoundError
1571
- LocationNotFoundError
1572
- UnknownError
1573
+ InvalidRequestError: The server answered 400.
1574
+ UnauthorizedError: The server answered 401.
1575
+ MessageNotFoundError: The server answered 404.
1576
+ SessionNotFoundError: The server answered 404.
1577
+ LocationNotFoundError: The server answered 404.
1578
+ UnknownError: The server answered 500.
1573
1579
 
1574
1580
  ``GET /api/session/:sessionID/diff``
1575
1581
  """
@@ -1605,11 +1611,11 @@ class SessionResource(SyncAPIResource):
1605
1611
  Generate transient text from the current session context without mutating session history.
1606
1612
 
1607
1613
  Raises:
1608
- InvalidRequestError
1609
- UnauthorizedError
1610
- SessionNotFoundError
1611
- LocationNotFoundError
1612
- ServiceUnavailableError
1614
+ InvalidRequestError: The server answered 400.
1615
+ UnauthorizedError: The server answered 401.
1616
+ SessionNotFoundError: The server answered 404.
1617
+ LocationNotFoundError: The server answered 404.
1618
+ ServiceUnavailableError: The server answered 503.
1613
1619
 
1614
1620
  ``POST /api/session/:sessionID/generate``
1615
1621
  """
@@ -1648,9 +1654,9 @@ class SessionResource(SyncAPIResource):
1648
1654
  This endpoint is experimental in OpenCode and may change without notice.
1649
1655
 
1650
1656
  Raises:
1651
- InvalidRequestError
1652
- UnauthorizedError
1653
- SessionNotFoundError
1657
+ InvalidRequestError: The server answered 400.
1658
+ UnauthorizedError: The server answered 401.
1659
+ SessionNotFoundError: The server answered 404.
1654
1660
 
1655
1661
  ``GET /api/experimental/session/:sessionID/log``
1656
1662
  """
@@ -1682,10 +1688,10 @@ class SessionResource(SyncAPIResource):
1682
1688
  Interrupt active execution owned by this OpenCode process. Returns interrupted=true when an active execution was interrupted and false for the idle no-op. When resume=true, execution resumes pending steering input and next-in-line control items (manual compaction, moves) while queued prompts remain parked.
1683
1689
 
1684
1690
  Raises:
1685
- InvalidRequestError
1686
- UnauthorizedError
1687
- SessionNotFoundError
1688
- LocationNotFoundError
1691
+ InvalidRequestError: The server answered 400.
1692
+ UnauthorizedError: The server answered 401.
1693
+ SessionNotFoundError: The server answered 404.
1694
+ LocationNotFoundError: The server answered 404.
1689
1695
 
1690
1696
  ``POST /api/session/:sessionID/interrupt``
1691
1697
  """
@@ -1719,10 +1725,10 @@ class SessionResource(SyncAPIResource):
1719
1725
  Move active foreground backgroundable tools for this session into background observation. Idle requests are a no-op.
1720
1726
 
1721
1727
  Raises:
1722
- InvalidRequestError
1723
- UnauthorizedError
1724
- SessionNotFoundError
1725
- LocationNotFoundError
1728
+ InvalidRequestError: The server answered 400.
1729
+ UnauthorizedError: The server answered 401.
1730
+ SessionNotFoundError: The server answered 404.
1731
+ LocationNotFoundError: The server answered 404.
1726
1732
 
1727
1733
  ``POST /api/session/:sessionID/background``
1728
1734
  """
@@ -1753,9 +1759,9 @@ class SessionResource(SyncAPIResource):
1753
1759
  Replace the process environment used by local shell commands for this session.
1754
1760
 
1755
1761
  Raises:
1756
- InvalidRequestError
1757
- UnauthorizedError
1758
- SessionNotFoundError
1762
+ InvalidRequestError: The server answered 400.
1763
+ UnauthorizedError: The server answered 401.
1764
+ SessionNotFoundError: The server answered 404.
1759
1765
 
1760
1766
  ``PUT /api/session/:sessionID/environment``
1761
1767
  """
@@ -1787,9 +1793,9 @@ class SessionResource(SyncAPIResource):
1787
1793
  Mark the idle transition observed by the viewer as viewed.
1788
1794
 
1789
1795
  Raises:
1790
- InvalidRequestError
1791
- UnauthorizedError
1792
- SessionNotFoundError
1796
+ InvalidRequestError: The server answered 400.
1797
+ UnauthorizedError: The server answered 401.
1798
+ SessionNotFoundError: The server answered 404.
1793
1799
 
1794
1800
  ``POST /api/session/:sessionID/view``
1795
1801
  """
@@ -1826,13 +1832,13 @@ class AsyncSessionRevertResource(AsyncAPIResource):
1826
1832
  Stage or move a reversible session boundary and optionally apply its file changes.
1827
1833
 
1828
1834
  Raises:
1829
- InvalidRequestError
1830
- UnauthorizedError
1831
- MessageNotFoundError
1832
- SessionNotFoundError
1833
- LocationNotFoundError
1834
- SessionBusyError
1835
- UnknownError
1835
+ InvalidRequestError: The server answered 400.
1836
+ UnauthorizedError: The server answered 401.
1837
+ MessageNotFoundError: The server answered 404.
1838
+ SessionNotFoundError: The server answered 404.
1839
+ LocationNotFoundError: The server answered 404.
1840
+ SessionBusyError: The server answered 409.
1841
+ UnknownError: The server answered 500.
1836
1842
 
1837
1843
  ``POST /api/session/:sessionID/revert/stage``
1838
1844
  """
@@ -1865,12 +1871,12 @@ class AsyncSessionRevertResource(AsyncAPIResource):
1865
1871
  """Clear staged revert.
1866
1872
 
1867
1873
  Raises:
1868
- InvalidRequestError
1869
- UnauthorizedError
1870
- SessionNotFoundError
1871
- LocationNotFoundError
1872
- SessionBusyError
1873
- UnknownError
1874
+ InvalidRequestError: The server answered 400.
1875
+ UnauthorizedError: The server answered 401.
1876
+ SessionNotFoundError: The server answered 404.
1877
+ LocationNotFoundError: The server answered 404.
1878
+ SessionBusyError: The server answered 409.
1879
+ UnknownError: The server answered 500.
1874
1880
 
1875
1881
  ``DELETE /api/session/:sessionID/revert``
1876
1882
  """
@@ -1898,11 +1904,11 @@ class AsyncSessionRevertResource(AsyncAPIResource):
1898
1904
  """Commit staged revert.
1899
1905
 
1900
1906
  Raises:
1901
- InvalidRequestError
1902
- UnauthorizedError
1903
- SessionNotFoundError
1904
- LocationNotFoundError
1905
- SessionBusyError
1907
+ InvalidRequestError: The server answered 400.
1908
+ UnauthorizedError: The server answered 401.
1909
+ SessionNotFoundError: The server answered 404.
1910
+ LocationNotFoundError: The server answered 404.
1911
+ SessionBusyError: The server answered 409.
1906
1912
 
1907
1913
  ``POST /api/session/:sessionID/revert/commit``
1908
1914
  """
@@ -1936,9 +1942,9 @@ class AsyncSessionInboxResource(AsyncAPIResource):
1936
1942
  List durable enqueued session work not yet delivered, ordered by enqueue sequence. Includes user, synthetic, compaction, and move items.
1937
1943
 
1938
1944
  Raises:
1939
- InvalidRequestError
1940
- UnauthorizedError
1941
- SessionNotFoundError
1945
+ InvalidRequestError: The server answered 400.
1946
+ UnauthorizedError: The server answered 401.
1947
+ SessionNotFoundError: The server answered 404.
1942
1948
 
1943
1949
  ``GET /api/session/:sessionID/inbox``
1944
1950
  """
@@ -1973,9 +1979,9 @@ class AsyncSessionInboxResource(AsyncAPIResource):
1973
1979
  Cancel an inbox item that has not yet been delivered. Unavailable items are a no-op.
1974
1980
 
1975
1981
  Raises:
1976
- InvalidRequestError
1977
- UnauthorizedError
1978
- SessionNotFoundError
1982
+ InvalidRequestError: The server answered 400.
1983
+ UnauthorizedError: The server answered 401.
1984
+ SessionNotFoundError: The server answered 404.
1979
1985
 
1980
1986
  ``DELETE /api/session/:sessionID/inbox/:inboxID``
1981
1987
  """
@@ -2007,10 +2013,10 @@ class AsyncSessionInboxResource(AsyncAPIResource):
2007
2013
  Change a pending inbox item's delivery mode. Steering wakes session execution.
2008
2014
 
2009
2015
  Raises:
2010
- InvalidRequestError
2011
- UnauthorizedError
2012
- SessionNotFoundError
2013
- ConflictError
2016
+ InvalidRequestError: The server answered 400.
2017
+ UnauthorizedError: The server answered 401.
2018
+ SessionNotFoundError: The server answered 404.
2019
+ ConflictError: The server answered 409.
2014
2020
 
2015
2021
  ``PATCH /api/session/:sessionID/inbox/:inboxID``
2016
2022
  """
@@ -2047,10 +2053,10 @@ class AsyncSessionInstructionsEntryResource(AsyncAPIResource):
2047
2053
  This endpoint is experimental in OpenCode and may change without notice.
2048
2054
 
2049
2055
  Raises:
2050
- InvalidRequestError
2051
- UnauthorizedError
2052
- SessionNotFoundError
2053
- LocationNotFoundError
2056
+ InvalidRequestError: The server answered 400.
2057
+ UnauthorizedError: The server answered 401.
2058
+ SessionNotFoundError: The server answered 404.
2059
+ LocationNotFoundError: The server answered 404.
2054
2060
 
2055
2061
  ``GET /api/experimental/session/:sessionID/instructions/entries``
2056
2062
  """
@@ -2088,11 +2094,11 @@ class AsyncSessionInstructionsEntryResource(AsyncAPIResource):
2088
2094
  This endpoint is experimental in OpenCode and may change without notice.
2089
2095
 
2090
2096
  Raises:
2091
- InvalidRequestError
2092
- UnauthorizedError
2093
- SessionNotFoundError
2094
- LocationNotFoundError
2095
- InstructionEntryValueTooLargeError
2097
+ InvalidRequestError: The server answered 400.
2098
+ UnauthorizedError: The server answered 401.
2099
+ SessionNotFoundError: The server answered 404.
2100
+ LocationNotFoundError: The server answered 404.
2101
+ InstructionEntryValueTooLargeError: The server answered 413.
2096
2102
 
2097
2103
  ``PUT /api/experimental/session/:sessionID/instructions/entries/:key``
2098
2104
  """
@@ -2126,10 +2132,10 @@ class AsyncSessionInstructionsEntryResource(AsyncAPIResource):
2126
2132
  This endpoint is experimental in OpenCode and may change without notice.
2127
2133
 
2128
2134
  Raises:
2129
- InvalidRequestError
2130
- UnauthorizedError
2131
- SessionNotFoundError
2132
- LocationNotFoundError
2135
+ InvalidRequestError: The server answered 400.
2136
+ UnauthorizedError: The server answered 401.
2137
+ SessionNotFoundError: The server answered 404.
2138
+ LocationNotFoundError: The server answered 404.
2133
2139
 
2134
2140
  ``DELETE /api/experimental/session/:sessionID/instructions/entries/:key``
2135
2141
  """
@@ -2151,6 +2157,7 @@ class AsyncSessionInstructionsResource(AsyncAPIResource):
2151
2157
 
2152
2158
  @cached_property
2153
2159
  def entry(self) -> AsyncSessionInstructionsEntryResource:
2160
+ """Operations under ``client.session.instructions.entry``."""
2154
2161
  return AsyncSessionInstructionsEntryResource(self._client)
2155
2162
 
2156
2163
 
@@ -2172,10 +2179,10 @@ class AsyncSessionMessageResource(AsyncAPIResource):
2172
2179
  Retrieve one projected message owned by the Session.
2173
2180
 
2174
2181
  Raises:
2175
- InvalidRequestError
2176
- UnauthorizedError
2177
- SessionNotFoundError
2178
- MessageNotFoundError
2182
+ InvalidRequestError: The server answered 400.
2183
+ UnauthorizedError: The server answered 401.
2184
+ SessionNotFoundError: The server answered 404.
2185
+ MessageNotFoundError: The server answered 404.
2179
2186
 
2180
2187
  ``GET /api/session/:sessionID/message/:messageID``
2181
2188
  """
@@ -2213,10 +2220,10 @@ class AsyncSessionFormResource(AsyncAPIResource):
2213
2220
  Retrieve pending forms for a session.
2214
2221
 
2215
2222
  Raises:
2216
- InvalidRequestError
2217
- UnauthorizedError
2218
- SessionNotFoundError
2219
- LocationNotFoundError
2223
+ InvalidRequestError: The server answered 400.
2224
+ UnauthorizedError: The server answered 401.
2225
+ SessionNotFoundError: The server answered 404.
2226
+ LocationNotFoundError: The server answered 404.
2220
2227
 
2221
2228
  ``GET /api/session/:sessionID/form``
2222
2229
  """
@@ -2254,11 +2261,11 @@ class AsyncSessionFormResource(AsyncAPIResource):
2254
2261
  Create a form for a session.
2255
2262
 
2256
2263
  Raises:
2257
- InvalidRequestError
2258
- UnauthorizedError
2259
- SessionNotFoundError
2260
- LocationNotFoundError
2261
- ConflictError
2264
+ InvalidRequestError: The server answered 400.
2265
+ UnauthorizedError: The server answered 401.
2266
+ SessionNotFoundError: The server answered 404.
2267
+ LocationNotFoundError: The server answered 404.
2268
+ ConflictError: The server answered 409.
2262
2269
 
2263
2270
  ``POST /api/session/:sessionID/form``
2264
2271
  """
@@ -2294,11 +2301,11 @@ class AsyncSessionFormResource(AsyncAPIResource):
2294
2301
  Retrieve a form and its current state for a session.
2295
2302
 
2296
2303
  Raises:
2297
- InvalidRequestError
2298
- UnauthorizedError
2299
- SessionNotFoundError
2300
- FormNotFoundError
2301
- LocationNotFoundError
2304
+ InvalidRequestError: The server answered 400.
2305
+ UnauthorizedError: The server answered 401.
2306
+ SessionNotFoundError: The server answered 404.
2307
+ FormNotFoundError: The server answered 404.
2308
+ LocationNotFoundError: The server answered 404.
2302
2309
 
2303
2310
  ``GET /api/session/:sessionID/form/:formID``
2304
2311
  """
@@ -2334,13 +2341,13 @@ class AsyncSessionFormResource(AsyncAPIResource):
2334
2341
  Submit an answer to a pending form.
2335
2342
 
2336
2343
  Raises:
2337
- FormInvalidAnswerError
2338
- InvalidRequestError
2339
- UnauthorizedError
2340
- SessionNotFoundError
2341
- FormNotFoundError
2342
- LocationNotFoundError
2343
- FormAlreadySettledError
2344
+ FormInvalidAnswerError: The server answered 400.
2345
+ InvalidRequestError: The server answered 400.
2346
+ UnauthorizedError: The server answered 401.
2347
+ SessionNotFoundError: The server answered 404.
2348
+ FormNotFoundError: The server answered 404.
2349
+ LocationNotFoundError: The server answered 404.
2350
+ FormAlreadySettledError: The server answered 409.
2344
2351
 
2345
2352
  ``POST /api/session/:sessionID/form/:formID/reply``
2346
2353
  """
@@ -2373,12 +2380,12 @@ class AsyncSessionFormResource(AsyncAPIResource):
2373
2380
  Cancel a pending form, optionally telling the asker why it was not answered.
2374
2381
 
2375
2382
  Raises:
2376
- InvalidRequestError
2377
- UnauthorizedError
2378
- SessionNotFoundError
2379
- FormNotFoundError
2380
- LocationNotFoundError
2381
- FormAlreadySettledError
2383
+ InvalidRequestError: The server answered 400.
2384
+ UnauthorizedError: The server answered 401.
2385
+ SessionNotFoundError: The server answered 404.
2386
+ FormNotFoundError: The server answered 404.
2387
+ LocationNotFoundError: The server answered 404.
2388
+ FormAlreadySettledError: The server answered 409.
2382
2389
 
2383
2390
  ``DELETE /api/session/:sessionID/form/:formID``
2384
2391
  """
@@ -2401,22 +2408,27 @@ class AsyncSessionResource(AsyncAPIResource):
2401
2408
 
2402
2409
  @cached_property
2403
2410
  def revert(self) -> AsyncSessionRevertResource:
2411
+ """Operations under ``client.session.revert``."""
2404
2412
  return AsyncSessionRevertResource(self._client)
2405
2413
 
2406
2414
  @cached_property
2407
2415
  def inbox(self) -> AsyncSessionInboxResource:
2416
+ """Operations under ``client.session.inbox``."""
2408
2417
  return AsyncSessionInboxResource(self._client)
2409
2418
 
2410
2419
  @cached_property
2411
2420
  def instructions(self) -> AsyncSessionInstructionsResource:
2421
+ """Operations under ``client.session.instructions``."""
2412
2422
  return AsyncSessionInstructionsResource(self._client)
2413
2423
 
2414
2424
  @cached_property
2415
2425
  def message(self) -> AsyncSessionMessageResource:
2426
+ """Operations under ``client.session.message``."""
2416
2427
  return AsyncSessionMessageResource(self._client)
2417
2428
 
2418
2429
  @cached_property
2419
2430
  def form(self) -> AsyncSessionFormResource:
2431
+ """Operations under ``client.session.form``."""
2420
2432
  return AsyncSessionFormResource(self._client)
2421
2433
 
2422
2434
  def list(
@@ -2447,9 +2459,9 @@ class AsyncSessionResource(AsyncAPIResource):
2447
2459
  archived: Filter by archive state. Use true to return only archived sessions or false to exclude them. Omit to include both.
2448
2460
 
2449
2461
  Raises:
2450
- InvalidCursorError
2451
- InvalidRequestError
2452
- UnauthorizedError
2462
+ InvalidCursorError: The server answered 400.
2463
+ InvalidRequestError: The server answered 400.
2464
+ UnauthorizedError: The server answered 401.
2453
2465
 
2454
2466
  ``GET /api/session``
2455
2467
  """
@@ -2496,8 +2508,8 @@ class AsyncSessionResource(AsyncAPIResource):
2496
2508
  This endpoint is experimental in OpenCode and may change without notice.
2497
2509
 
2498
2510
  Raises:
2499
- InvalidRequestError
2500
- UnauthorizedError
2511
+ InvalidRequestError: The server answered 400.
2512
+ UnauthorizedError: The server answered 401.
2501
2513
 
2502
2514
  ``GET /api/experimental/session/stats``
2503
2515
  """
@@ -2539,9 +2551,9 @@ class AsyncSessionResource(AsyncAPIResource):
2539
2551
  Create a session at the requested location. A parentID creates a linked child session at its parent's location.
2540
2552
 
2541
2553
  Raises:
2542
- InvalidRequestError
2543
- UnauthorizedError
2544
- SessionNotFoundError
2554
+ InvalidRequestError: The server answered 400.
2555
+ UnauthorizedError: The server answered 401.
2556
+ SessionNotFoundError: The server answered 404.
2545
2557
 
2546
2558
  ``POST /api/session``
2547
2559
  """
@@ -2589,10 +2601,10 @@ class AsyncSessionResource(AsyncAPIResource):
2589
2601
  This endpoint is experimental in OpenCode and may change without notice.
2590
2602
 
2591
2603
  Raises:
2592
- InvalidRequestError
2593
- UnauthorizedError
2594
- SessionNotFoundError
2595
- ConflictError
2604
+ InvalidRequestError: The server answered 400.
2605
+ UnauthorizedError: The server answered 401.
2606
+ SessionNotFoundError: The server answered 404.
2607
+ ConflictError: The server answered 409.
2596
2608
 
2597
2609
  ``POST /api/experimental/session/import``
2598
2610
  """
@@ -2630,10 +2642,10 @@ class AsyncSessionResource(AsyncAPIResource):
2630
2642
  This endpoint is experimental in OpenCode and may change without notice.
2631
2643
 
2632
2644
  Raises:
2633
- InvalidRequestError
2634
- UnauthorizedError
2635
- SessionNotFoundError
2636
- UnknownError
2645
+ InvalidRequestError: The server answered 400.
2646
+ UnauthorizedError: The server answered 401.
2647
+ SessionNotFoundError: The server answered 404.
2648
+ UnknownError: The server answered 500.
2637
2649
 
2638
2650
  ``GET /api/experimental/session/:sessionID/export``
2639
2651
  """
@@ -2667,8 +2679,8 @@ class AsyncSessionResource(AsyncAPIResource):
2667
2679
  Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.
2668
2680
 
2669
2681
  Raises:
2670
- InvalidRequestError
2671
- UnauthorizedError
2682
+ InvalidRequestError: The server answered 400.
2683
+ UnauthorizedError: The server answered 401.
2672
2684
 
2673
2685
  ``GET /api/session/active``
2674
2686
  """
@@ -2702,9 +2714,9 @@ class AsyncSessionResource(AsyncAPIResource):
2702
2714
  Retrieve a session by ID.
2703
2715
 
2704
2716
  Raises:
2705
- InvalidRequestError
2706
- UnauthorizedError
2707
- SessionNotFoundError
2717
+ InvalidRequestError: The server answered 400.
2718
+ UnauthorizedError: The server answered 401.
2719
+ SessionNotFoundError: The server answered 404.
2708
2720
 
2709
2721
  ``GET /api/session/:sessionID``
2710
2722
  """
@@ -2738,9 +2750,9 @@ class AsyncSessionResource(AsyncAPIResource):
2738
2750
  Delete a session and its child sessions.
2739
2751
 
2740
2752
  Raises:
2741
- InvalidRequestError
2742
- UnauthorizedError
2743
- SessionNotFoundError
2753
+ InvalidRequestError: The server answered 400.
2754
+ UnauthorizedError: The server answered 401.
2755
+ SessionNotFoundError: The server answered 404.
2744
2756
 
2745
2757
  ``DELETE /api/session/:sessionID``
2746
2758
  """
@@ -2771,11 +2783,11 @@ class AsyncSessionResource(AsyncAPIResource):
2771
2783
  Create a child session by copying projected history before a message. Omit before to copy the full history.
2772
2784
 
2773
2785
  Raises:
2774
- InvalidRequestError
2775
- UnauthorizedError
2776
- SessionNotFoundError
2777
- MessageNotFoundError
2778
- LocationNotFoundError
2786
+ InvalidRequestError: The server answered 400.
2787
+ UnauthorizedError: The server answered 401.
2788
+ SessionNotFoundError: The server answered 404.
2789
+ MessageNotFoundError: The server answered 404.
2790
+ LocationNotFoundError: The server answered 404.
2779
2791
 
2780
2792
  ``POST /api/session/:sessionID/fork``
2781
2793
  """
@@ -2811,10 +2823,10 @@ class AsyncSessionResource(AsyncAPIResource):
2811
2823
  Switch the agent used by subsequent provider turns.
2812
2824
 
2813
2825
  Raises:
2814
- InvalidRequestError
2815
- UnauthorizedError
2816
- SessionNotFoundError
2817
- LocationNotFoundError
2826
+ InvalidRequestError: The server answered 400.
2827
+ UnauthorizedError: The server answered 401.
2828
+ SessionNotFoundError: The server answered 404.
2829
+ LocationNotFoundError: The server answered 404.
2818
2830
 
2819
2831
  ``POST /api/session/:sessionID/agent``
2820
2832
  """
@@ -2846,10 +2858,10 @@ class AsyncSessionResource(AsyncAPIResource):
2846
2858
  Switch the model used by subsequent provider turns.
2847
2859
 
2848
2860
  Raises:
2849
- InvalidRequestError
2850
- UnauthorizedError
2851
- SessionNotFoundError
2852
- LocationNotFoundError
2861
+ InvalidRequestError: The server answered 400.
2862
+ UnauthorizedError: The server answered 401.
2863
+ SessionNotFoundError: The server answered 404.
2864
+ LocationNotFoundError: The server answered 404.
2853
2865
 
2854
2866
  ``POST /api/session/:sessionID/model``
2855
2867
  """
@@ -2887,10 +2899,10 @@ class AsyncSessionResource(AsyncAPIResource):
2887
2899
  archived: Archive the session with true or restore it with false. Repeating the current state is a no-op.
2888
2900
 
2889
2901
  Raises:
2890
- InvalidRequestError
2891
- UnauthorizedError
2892
- SessionNotFoundError
2893
- LocationNotFoundError
2902
+ InvalidRequestError: The server answered 400.
2903
+ UnauthorizedError: The server answered 401.
2904
+ SessionNotFoundError: The server answered 404.
2905
+ LocationNotFoundError: The server answered 404.
2894
2906
 
2895
2907
  ``PATCH /api/session/:sessionID``
2896
2908
  """
@@ -2923,9 +2935,9 @@ class AsyncSessionResource(AsyncAPIResource):
2923
2935
  Move a session to another project directory at the requested delivery boundary.
2924
2936
 
2925
2937
  Raises:
2926
- InvalidRequestError
2927
- UnauthorizedError
2928
- SessionNotFoundError
2938
+ InvalidRequestError: The server answered 400.
2939
+ UnauthorizedError: The server answered 401.
2940
+ SessionNotFoundError: The server answered 404.
2929
2941
 
2930
2942
  ``POST /api/session/:sessionID/move``
2931
2943
  """
@@ -2964,11 +2976,11 @@ class AsyncSessionResource(AsyncAPIResource):
2964
2976
  Durably admit one session input and schedule agent-loop execution unless resume is false.
2965
2977
 
2966
2978
  Raises:
2967
- InvalidRequestError
2968
- UnauthorizedError
2969
- SessionNotFoundError
2970
- LocationNotFoundError
2971
- ConflictError
2979
+ InvalidRequestError: The server answered 400.
2980
+ UnauthorizedError: The server answered 401.
2981
+ SessionNotFoundError: The server answered 404.
2982
+ LocationNotFoundError: The server answered 404.
2983
+ ConflictError: The server answered 409.
2972
2984
 
2973
2985
  ``POST /api/session/:sessionID/prompt``
2974
2986
  """
@@ -3018,12 +3030,12 @@ class AsyncSessionResource(AsyncAPIResource):
3018
3030
  Execute a slash command callback immediately.
3019
3031
 
3020
3032
  Raises:
3021
- InvalidRequestError
3022
- UnauthorizedError
3023
- SessionNotFoundError
3024
- CommandNotFoundError
3025
- LocationNotFoundError
3026
- CommandExecutionError
3033
+ InvalidRequestError: The server answered 400.
3034
+ UnauthorizedError: The server answered 401.
3035
+ SessionNotFoundError: The server answered 404.
3036
+ CommandNotFoundError: The server answered 404.
3037
+ LocationNotFoundError: The server answered 404.
3038
+ CommandExecutionError: The server answered 500.
3027
3039
 
3028
3040
  ``POST /api/session/:sessionID/command``
3029
3041
  """
@@ -3065,11 +3077,11 @@ class AsyncSessionResource(AsyncAPIResource):
3065
3077
  This endpoint is experimental in OpenCode and may change without notice.
3066
3078
 
3067
3079
  Raises:
3068
- InvalidRequestError
3069
- UnauthorizedError
3070
- SessionNotFoundError
3071
- SkillNotFoundError
3072
- LocationNotFoundError
3080
+ InvalidRequestError: The server answered 400.
3081
+ UnauthorizedError: The server answered 401.
3082
+ SessionNotFoundError: The server answered 404.
3083
+ SkillNotFoundError: The server answered 404.
3084
+ LocationNotFoundError: The server answered 404.
3073
3085
 
3074
3086
  ``POST /api/experimental/session/:sessionID/skill``
3075
3087
  """
@@ -3106,11 +3118,11 @@ class AsyncSessionResource(AsyncAPIResource):
3106
3118
  Durably admit synthetic session input and schedule execution unless resume is false.
3107
3119
 
3108
3120
  Raises:
3109
- InvalidRequestError
3110
- UnauthorizedError
3111
- SessionNotFoundError
3112
- LocationNotFoundError
3113
- ConflictError
3121
+ InvalidRequestError: The server answered 400.
3122
+ UnauthorizedError: The server answered 401.
3123
+ SessionNotFoundError: The server answered 404.
3124
+ LocationNotFoundError: The server answered 404.
3125
+ ConflictError: The server answered 409.
3114
3126
 
3115
3127
  ``POST /api/session/:sessionID/synthetic``
3116
3128
  """
@@ -3154,10 +3166,10 @@ class AsyncSessionResource(AsyncAPIResource):
3154
3166
  Execute one shell command in the session's working directory. Emits a shell.started event before execution and a shell.ended event with the merged output after.
3155
3167
 
3156
3168
  Raises:
3157
- InvalidRequestError
3158
- UnauthorizedError
3159
- SessionNotFoundError
3160
- LocationNotFoundError
3169
+ InvalidRequestError: The server answered 400.
3170
+ UnauthorizedError: The server answered 401.
3171
+ SessionNotFoundError: The server answered 404.
3172
+ LocationNotFoundError: The server answered 404.
3161
3173
 
3162
3174
  ``POST /api/session/:sessionID/shell``
3163
3175
  """
@@ -3190,11 +3202,11 @@ class AsyncSessionResource(AsyncAPIResource):
3190
3202
  Durably admit a session compaction request. Steers by default: it runs at the next step boundary instead of waiting behind queued prompts.
3191
3203
 
3192
3204
  Raises:
3193
- InvalidRequestError
3194
- UnauthorizedError
3195
- SessionNotFoundError
3196
- LocationNotFoundError
3197
- ConflictError
3205
+ InvalidRequestError: The server answered 400.
3206
+ UnauthorizedError: The server answered 401.
3207
+ SessionNotFoundError: The server answered 404.
3208
+ LocationNotFoundError: The server answered 404.
3209
+ ConflictError: The server answered 409.
3198
3210
 
3199
3211
  ``POST /api/session/:sessionID/compact``
3200
3212
  """
@@ -3231,11 +3243,11 @@ class AsyncSessionResource(AsyncAPIResource):
3231
3243
  This endpoint is experimental in OpenCode and may change without notice.
3232
3244
 
3233
3245
  Raises:
3234
- InvalidRequestError
3235
- UnauthorizedError
3236
- SessionNotFoundError
3237
- LocationNotFoundError
3238
- ServiceUnavailableError
3246
+ InvalidRequestError: The server answered 400.
3247
+ UnauthorizedError: The server answered 401.
3248
+ SessionNotFoundError: The server answered 404.
3249
+ LocationNotFoundError: The server answered 404.
3250
+ ServiceUnavailableError: The server answered 503.
3239
3251
 
3240
3252
  ``POST /api/experimental/session/:sessionID/wait``
3241
3253
  """
@@ -3265,10 +3277,10 @@ class AsyncSessionResource(AsyncAPIResource):
3265
3277
  Retrieve the active context messages for a session (all messages after the last compaction).
3266
3278
 
3267
3279
  Raises:
3268
- InvalidRequestError
3269
- UnauthorizedError
3270
- SessionNotFoundError
3271
- UnknownError
3280
+ InvalidRequestError: The server answered 400.
3281
+ UnauthorizedError: The server answered 401.
3282
+ SessionNotFoundError: The server answered 404.
3283
+ UnknownError: The server answered 500.
3272
3284
 
3273
3285
  ``GET /api/session/:sessionID/context``
3274
3286
  """
@@ -3310,12 +3322,12 @@ class AsyncSessionResource(AsyncAPIResource):
3310
3322
  context: Unchanged lines around each hunk. Omit for full-file patches.
3311
3323
 
3312
3324
  Raises:
3313
- InvalidRequestError
3314
- UnauthorizedError
3315
- MessageNotFoundError
3316
- SessionNotFoundError
3317
- LocationNotFoundError
3318
- UnknownError
3325
+ InvalidRequestError: The server answered 400.
3326
+ UnauthorizedError: The server answered 401.
3327
+ MessageNotFoundError: The server answered 404.
3328
+ SessionNotFoundError: The server answered 404.
3329
+ LocationNotFoundError: The server answered 404.
3330
+ UnknownError: The server answered 500.
3319
3331
 
3320
3332
  ``GET /api/session/:sessionID/diff``
3321
3333
  """
@@ -3351,11 +3363,11 @@ class AsyncSessionResource(AsyncAPIResource):
3351
3363
  Generate transient text from the current session context without mutating session history.
3352
3364
 
3353
3365
  Raises:
3354
- InvalidRequestError
3355
- UnauthorizedError
3356
- SessionNotFoundError
3357
- LocationNotFoundError
3358
- ServiceUnavailableError
3366
+ InvalidRequestError: The server answered 400.
3367
+ UnauthorizedError: The server answered 401.
3368
+ SessionNotFoundError: The server answered 404.
3369
+ LocationNotFoundError: The server answered 404.
3370
+ ServiceUnavailableError: The server answered 503.
3359
3371
 
3360
3372
  ``POST /api/session/:sessionID/generate``
3361
3373
  """
@@ -3394,9 +3406,9 @@ class AsyncSessionResource(AsyncAPIResource):
3394
3406
  This endpoint is experimental in OpenCode and may change without notice.
3395
3407
 
3396
3408
  Raises:
3397
- InvalidRequestError
3398
- UnauthorizedError
3399
- SessionNotFoundError
3409
+ InvalidRequestError: The server answered 400.
3410
+ UnauthorizedError: The server answered 401.
3411
+ SessionNotFoundError: The server answered 404.
3400
3412
 
3401
3413
  ``GET /api/experimental/session/:sessionID/log``
3402
3414
  """
@@ -3428,10 +3440,10 @@ class AsyncSessionResource(AsyncAPIResource):
3428
3440
  Interrupt active execution owned by this OpenCode process. Returns interrupted=true when an active execution was interrupted and false for the idle no-op. When resume=true, execution resumes pending steering input and next-in-line control items (manual compaction, moves) while queued prompts remain parked.
3429
3441
 
3430
3442
  Raises:
3431
- InvalidRequestError
3432
- UnauthorizedError
3433
- SessionNotFoundError
3434
- LocationNotFoundError
3443
+ InvalidRequestError: The server answered 400.
3444
+ UnauthorizedError: The server answered 401.
3445
+ SessionNotFoundError: The server answered 404.
3446
+ LocationNotFoundError: The server answered 404.
3435
3447
 
3436
3448
  ``POST /api/session/:sessionID/interrupt``
3437
3449
  """
@@ -3465,10 +3477,10 @@ class AsyncSessionResource(AsyncAPIResource):
3465
3477
  Move active foreground backgroundable tools for this session into background observation. Idle requests are a no-op.
3466
3478
 
3467
3479
  Raises:
3468
- InvalidRequestError
3469
- UnauthorizedError
3470
- SessionNotFoundError
3471
- LocationNotFoundError
3480
+ InvalidRequestError: The server answered 400.
3481
+ UnauthorizedError: The server answered 401.
3482
+ SessionNotFoundError: The server answered 404.
3483
+ LocationNotFoundError: The server answered 404.
3472
3484
 
3473
3485
  ``POST /api/session/:sessionID/background``
3474
3486
  """
@@ -3499,9 +3511,9 @@ class AsyncSessionResource(AsyncAPIResource):
3499
3511
  Replace the process environment used by local shell commands for this session.
3500
3512
 
3501
3513
  Raises:
3502
- InvalidRequestError
3503
- UnauthorizedError
3504
- SessionNotFoundError
3514
+ InvalidRequestError: The server answered 400.
3515
+ UnauthorizedError: The server answered 401.
3516
+ SessionNotFoundError: The server answered 404.
3505
3517
 
3506
3518
  ``PUT /api/session/:sessionID/environment``
3507
3519
  """
@@ -3533,9 +3545,9 @@ class AsyncSessionResource(AsyncAPIResource):
3533
3545
  Mark the idle transition observed by the viewer as viewed.
3534
3546
 
3535
3547
  Raises:
3536
- InvalidRequestError
3537
- UnauthorizedError
3538
- SessionNotFoundError
3548
+ InvalidRequestError: The server answered 400.
3549
+ UnauthorizedError: The server answered 401.
3550
+ SessionNotFoundError: The server answered 404.
3539
3551
 
3540
3552
  ``POST /api/session/:sessionID/view``
3541
3553
  """