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.
- opencode/__init__.py +4 -0
- opencode/_exceptions.py +22 -0
- opencode/_pty.py +586 -0
- opencode/_server.py +8 -0
- opencode/resources/agent.py +14 -14
- opencode/resources/command.py +6 -6
- opencode/resources/config.py +18 -18
- opencode/resources/credential.py +22 -22
- opencode/resources/debug.py +10 -8
- opencode/resources/event.py +4 -4
- opencode/resources/experimental.py +77 -74
- opencode/resources/file.py +28 -28
- opencode/resources/form.py +6 -6
- opencode/resources/generate.py +8 -8
- opencode/resources/integration.py +102 -94
- opencode/resources/location.py +12 -12
- opencode/resources/mcp.py +44 -42
- opencode/resources/message.py +10 -10
- opencode/resources/migration.py +6 -4
- opencode/resources/model.py +16 -16
- opencode/resources/permission.py +68 -64
- opencode/resources/plugin.py +20 -20
- opencode/resources/project.py +14 -14
- opencode/resources/provider.py +18 -18
- opencode/resources/pty.py +51 -48
- opencode/resources/reference.py +6 -6
- opencode/resources/rpc.py +10 -10
- opencode/resources/server.py +12 -12
- opencode/resources/session.py +378 -366
- opencode/resources/shell.py +34 -34
- opencode/resources/skill.py +6 -6
- opencode/resources/vcs.py +48 -46
- opencode/resources/voice.py +8 -8
- opencode/resources/websearch.py +16 -16
- opencode/resources/worktree.py +30 -30
- {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.2.dist-info}/METADATA +28 -2
- opencode_python_sdk-0.1.2.dist-info/RECORD +56 -0
- opencode_python_sdk-0.1.0.dist-info/RECORD +0 -55
- {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.2.dist-info}/WHEEL +0 -0
- {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -49,9 +49,9 @@ class IntegrationWellknownResource(SyncAPIResource):
|
|
|
49
49
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
50
50
|
|
|
51
51
|
Raises:
|
|
52
|
-
InvalidRequestError
|
|
53
|
-
UnauthorizedError
|
|
54
|
-
LocationNotFoundError
|
|
52
|
+
InvalidRequestError: The server answered 400.
|
|
53
|
+
UnauthorizedError: The server answered 401.
|
|
54
|
+
LocationNotFoundError: The server answered 404.
|
|
55
55
|
|
|
56
56
|
``POST /api/experimental/integration/wellknown``
|
|
57
57
|
"""
|
|
@@ -91,10 +91,10 @@ class IntegrationConnectResource(SyncAPIResource):
|
|
|
91
91
|
Run a key authentication method and store the resulting credential.
|
|
92
92
|
|
|
93
93
|
Raises:
|
|
94
|
-
InvalidRequestError
|
|
95
|
-
UnauthorizedError
|
|
96
|
-
IntegrationNotFoundError
|
|
97
|
-
LocationNotFoundError
|
|
94
|
+
InvalidRequestError: The server answered 400.
|
|
95
|
+
UnauthorizedError: The server answered 401.
|
|
96
|
+
IntegrationNotFoundError: The server answered 404.
|
|
97
|
+
LocationNotFoundError: The server answered 404.
|
|
98
98
|
|
|
99
99
|
``POST /api/integration/:integrationID/connect/key``
|
|
100
100
|
"""
|
|
@@ -130,10 +130,10 @@ class IntegrationConnectResource(SyncAPIResource):
|
|
|
130
130
|
Run an external authentication method and store a reference to its credential source.
|
|
131
131
|
|
|
132
132
|
Raises:
|
|
133
|
-
InvalidRequestError
|
|
134
|
-
UnauthorizedError
|
|
135
|
-
IntegrationNotFoundError
|
|
136
|
-
LocationNotFoundError
|
|
133
|
+
InvalidRequestError: The server answered 400.
|
|
134
|
+
UnauthorizedError: The server answered 401.
|
|
135
|
+
IntegrationNotFoundError: The server answered 404.
|
|
136
|
+
LocationNotFoundError: The server answered 404.
|
|
137
137
|
|
|
138
138
|
``POST /api/integration/:integrationID/connect/external``
|
|
139
139
|
"""
|
|
@@ -173,9 +173,9 @@ class IntegrationOauthResource(SyncAPIResource):
|
|
|
173
173
|
Start an OAuth attempt and return the authorization details.
|
|
174
174
|
|
|
175
175
|
Raises:
|
|
176
|
-
InvalidRequestError
|
|
177
|
-
UnauthorizedError
|
|
178
|
-
LocationNotFoundError
|
|
176
|
+
InvalidRequestError: The server answered 400.
|
|
177
|
+
UnauthorizedError: The server answered 401.
|
|
178
|
+
LocationNotFoundError: The server answered 404.
|
|
179
179
|
|
|
180
180
|
``POST /api/integration/:integrationID/connect/oauth``
|
|
181
181
|
"""
|
|
@@ -212,11 +212,11 @@ class IntegrationOauthResource(SyncAPIResource):
|
|
|
212
212
|
Poll the current status of an OAuth attempt.
|
|
213
213
|
|
|
214
214
|
Raises:
|
|
215
|
-
InvalidRequestError
|
|
216
|
-
UnauthorizedError
|
|
217
|
-
IntegrationNotFoundError
|
|
218
|
-
IntegrationAttemptNotFoundError
|
|
219
|
-
LocationNotFoundError
|
|
215
|
+
InvalidRequestError: The server answered 400.
|
|
216
|
+
UnauthorizedError: The server answered 401.
|
|
217
|
+
IntegrationNotFoundError: The server answered 404.
|
|
218
|
+
IntegrationAttemptNotFoundError: The server answered 404.
|
|
219
|
+
LocationNotFoundError: The server answered 404.
|
|
220
220
|
|
|
221
221
|
``GET /api/integration/:integrationID/connect/oauth/:attemptID``
|
|
222
222
|
"""
|
|
@@ -253,11 +253,11 @@ class IntegrationOauthResource(SyncAPIResource):
|
|
|
253
253
|
Complete a code-based OAuth attempt and store the resulting credential.
|
|
254
254
|
|
|
255
255
|
Raises:
|
|
256
|
-
InvalidRequestError
|
|
257
|
-
UnauthorizedError
|
|
258
|
-
IntegrationNotFoundError
|
|
259
|
-
IntegrationAttemptNotFoundError
|
|
260
|
-
LocationNotFoundError
|
|
256
|
+
InvalidRequestError: The server answered 400.
|
|
257
|
+
UnauthorizedError: The server answered 401.
|
|
258
|
+
IntegrationNotFoundError: The server answered 404.
|
|
259
|
+
IntegrationAttemptNotFoundError: The server answered 404.
|
|
260
|
+
LocationNotFoundError: The server answered 404.
|
|
261
261
|
|
|
262
262
|
``POST /api/integration/:integrationID/connect/oauth/:attemptID/complete``
|
|
263
263
|
"""
|
|
@@ -291,9 +291,9 @@ class IntegrationOauthResource(SyncAPIResource):
|
|
|
291
291
|
Cancel an OAuth attempt and release its resources.
|
|
292
292
|
|
|
293
293
|
Raises:
|
|
294
|
-
InvalidRequestError
|
|
295
|
-
UnauthorizedError
|
|
296
|
-
LocationNotFoundError
|
|
294
|
+
InvalidRequestError: The server answered 400.
|
|
295
|
+
UnauthorizedError: The server answered 401.
|
|
296
|
+
LocationNotFoundError: The server answered 404.
|
|
297
297
|
|
|
298
298
|
``DELETE /api/integration/:integrationID/connect/oauth/:attemptID``
|
|
299
299
|
"""
|
|
@@ -331,11 +331,11 @@ class IntegrationCommandResource(SyncAPIResource):
|
|
|
331
331
|
Start a command authentication attempt.
|
|
332
332
|
|
|
333
333
|
Raises:
|
|
334
|
-
InvalidRequestError
|
|
335
|
-
UnauthorizedError
|
|
336
|
-
IntegrationNotFoundError
|
|
337
|
-
IntegrationMethodNotFoundError
|
|
338
|
-
LocationNotFoundError
|
|
334
|
+
InvalidRequestError: The server answered 400.
|
|
335
|
+
UnauthorizedError: The server answered 401.
|
|
336
|
+
IntegrationNotFoundError: The server answered 404.
|
|
337
|
+
IntegrationMethodNotFoundError: The server answered 404.
|
|
338
|
+
LocationNotFoundError: The server answered 404.
|
|
339
339
|
|
|
340
340
|
``POST /api/integration/:integrationID/connect/command``
|
|
341
341
|
"""
|
|
@@ -372,11 +372,11 @@ class IntegrationCommandResource(SyncAPIResource):
|
|
|
372
372
|
Poll the current status and output of a command authentication attempt.
|
|
373
373
|
|
|
374
374
|
Raises:
|
|
375
|
-
InvalidRequestError
|
|
376
|
-
UnauthorizedError
|
|
377
|
-
IntegrationNotFoundError
|
|
378
|
-
IntegrationAttemptNotFoundError
|
|
379
|
-
LocationNotFoundError
|
|
375
|
+
InvalidRequestError: The server answered 400.
|
|
376
|
+
UnauthorizedError: The server answered 401.
|
|
377
|
+
IntegrationNotFoundError: The server answered 404.
|
|
378
|
+
IntegrationAttemptNotFoundError: The server answered 404.
|
|
379
|
+
LocationNotFoundError: The server answered 404.
|
|
380
380
|
|
|
381
381
|
``GET /api/integration/:integrationID/connect/command/:attemptID``
|
|
382
382
|
"""
|
|
@@ -412,9 +412,9 @@ class IntegrationCommandResource(SyncAPIResource):
|
|
|
412
412
|
Cancel a command authentication attempt and terminate its process.
|
|
413
413
|
|
|
414
414
|
Raises:
|
|
415
|
-
InvalidRequestError
|
|
416
|
-
UnauthorizedError
|
|
417
|
-
LocationNotFoundError
|
|
415
|
+
InvalidRequestError: The server answered 400.
|
|
416
|
+
UnauthorizedError: The server answered 401.
|
|
417
|
+
LocationNotFoundError: The server answered 404.
|
|
418
418
|
|
|
419
419
|
``DELETE /api/integration/:integrationID/connect/command/:attemptID``
|
|
420
420
|
"""
|
|
@@ -437,18 +437,22 @@ class IntegrationResource(SyncAPIResource):
|
|
|
437
437
|
|
|
438
438
|
@cached_property
|
|
439
439
|
def wellknown(self) -> IntegrationWellknownResource:
|
|
440
|
+
"""Operations under ``client.integration.wellknown``."""
|
|
440
441
|
return IntegrationWellknownResource(self._client)
|
|
441
442
|
|
|
442
443
|
@cached_property
|
|
443
444
|
def connect(self) -> IntegrationConnectResource:
|
|
445
|
+
"""Operations under ``client.integration.connect``."""
|
|
444
446
|
return IntegrationConnectResource(self._client)
|
|
445
447
|
|
|
446
448
|
@cached_property
|
|
447
449
|
def oauth(self) -> IntegrationOauthResource:
|
|
450
|
+
"""Operations under ``client.integration.oauth``."""
|
|
448
451
|
return IntegrationOauthResource(self._client)
|
|
449
452
|
|
|
450
453
|
@cached_property
|
|
451
454
|
def command(self) -> IntegrationCommandResource:
|
|
455
|
+
"""Operations under ``client.integration.command``."""
|
|
452
456
|
return IntegrationCommandResource(self._client)
|
|
453
457
|
|
|
454
458
|
def list(
|
|
@@ -465,9 +469,9 @@ class IntegrationResource(SyncAPIResource):
|
|
|
465
469
|
Retrieve available integrations and their authentication methods.
|
|
466
470
|
|
|
467
471
|
Raises:
|
|
468
|
-
InvalidRequestError
|
|
469
|
-
UnauthorizedError
|
|
470
|
-
LocationNotFoundError
|
|
472
|
+
InvalidRequestError: The server answered 400.
|
|
473
|
+
UnauthorizedError: The server answered 401.
|
|
474
|
+
LocationNotFoundError: The server answered 404.
|
|
471
475
|
|
|
472
476
|
``GET /api/integration``
|
|
473
477
|
"""
|
|
@@ -502,10 +506,10 @@ class IntegrationResource(SyncAPIResource):
|
|
|
502
506
|
Retrieve one integration and its authentication methods.
|
|
503
507
|
|
|
504
508
|
Raises:
|
|
505
|
-
InvalidRequestError
|
|
506
|
-
UnauthorizedError
|
|
507
|
-
IntegrationNotFoundError
|
|
508
|
-
LocationNotFoundError
|
|
509
|
+
InvalidRequestError: The server answered 400.
|
|
510
|
+
UnauthorizedError: The server answered 401.
|
|
511
|
+
IntegrationNotFoundError: The server answered 404.
|
|
512
|
+
LocationNotFoundError: The server answered 404.
|
|
509
513
|
|
|
510
514
|
``GET /api/integration/:integrationID``
|
|
511
515
|
"""
|
|
@@ -546,9 +550,9 @@ class AsyncIntegrationWellknownResource(AsyncAPIResource):
|
|
|
546
550
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
547
551
|
|
|
548
552
|
Raises:
|
|
549
|
-
InvalidRequestError
|
|
550
|
-
UnauthorizedError
|
|
551
|
-
LocationNotFoundError
|
|
553
|
+
InvalidRequestError: The server answered 400.
|
|
554
|
+
UnauthorizedError: The server answered 401.
|
|
555
|
+
LocationNotFoundError: The server answered 404.
|
|
552
556
|
|
|
553
557
|
``POST /api/experimental/integration/wellknown``
|
|
554
558
|
"""
|
|
@@ -588,10 +592,10 @@ class AsyncIntegrationConnectResource(AsyncAPIResource):
|
|
|
588
592
|
Run a key authentication method and store the resulting credential.
|
|
589
593
|
|
|
590
594
|
Raises:
|
|
591
|
-
InvalidRequestError
|
|
592
|
-
UnauthorizedError
|
|
593
|
-
IntegrationNotFoundError
|
|
594
|
-
LocationNotFoundError
|
|
595
|
+
InvalidRequestError: The server answered 400.
|
|
596
|
+
UnauthorizedError: The server answered 401.
|
|
597
|
+
IntegrationNotFoundError: The server answered 404.
|
|
598
|
+
LocationNotFoundError: The server answered 404.
|
|
595
599
|
|
|
596
600
|
``POST /api/integration/:integrationID/connect/key``
|
|
597
601
|
"""
|
|
@@ -627,10 +631,10 @@ class AsyncIntegrationConnectResource(AsyncAPIResource):
|
|
|
627
631
|
Run an external authentication method and store a reference to its credential source.
|
|
628
632
|
|
|
629
633
|
Raises:
|
|
630
|
-
InvalidRequestError
|
|
631
|
-
UnauthorizedError
|
|
632
|
-
IntegrationNotFoundError
|
|
633
|
-
LocationNotFoundError
|
|
634
|
+
InvalidRequestError: The server answered 400.
|
|
635
|
+
UnauthorizedError: The server answered 401.
|
|
636
|
+
IntegrationNotFoundError: The server answered 404.
|
|
637
|
+
LocationNotFoundError: The server answered 404.
|
|
634
638
|
|
|
635
639
|
``POST /api/integration/:integrationID/connect/external``
|
|
636
640
|
"""
|
|
@@ -670,9 +674,9 @@ class AsyncIntegrationOauthResource(AsyncAPIResource):
|
|
|
670
674
|
Start an OAuth attempt and return the authorization details.
|
|
671
675
|
|
|
672
676
|
Raises:
|
|
673
|
-
InvalidRequestError
|
|
674
|
-
UnauthorizedError
|
|
675
|
-
LocationNotFoundError
|
|
677
|
+
InvalidRequestError: The server answered 400.
|
|
678
|
+
UnauthorizedError: The server answered 401.
|
|
679
|
+
LocationNotFoundError: The server answered 404.
|
|
676
680
|
|
|
677
681
|
``POST /api/integration/:integrationID/connect/oauth``
|
|
678
682
|
"""
|
|
@@ -709,11 +713,11 @@ class AsyncIntegrationOauthResource(AsyncAPIResource):
|
|
|
709
713
|
Poll the current status of an OAuth attempt.
|
|
710
714
|
|
|
711
715
|
Raises:
|
|
712
|
-
InvalidRequestError
|
|
713
|
-
UnauthorizedError
|
|
714
|
-
IntegrationNotFoundError
|
|
715
|
-
IntegrationAttemptNotFoundError
|
|
716
|
-
LocationNotFoundError
|
|
716
|
+
InvalidRequestError: The server answered 400.
|
|
717
|
+
UnauthorizedError: The server answered 401.
|
|
718
|
+
IntegrationNotFoundError: The server answered 404.
|
|
719
|
+
IntegrationAttemptNotFoundError: The server answered 404.
|
|
720
|
+
LocationNotFoundError: The server answered 404.
|
|
717
721
|
|
|
718
722
|
``GET /api/integration/:integrationID/connect/oauth/:attemptID``
|
|
719
723
|
"""
|
|
@@ -750,11 +754,11 @@ class AsyncIntegrationOauthResource(AsyncAPIResource):
|
|
|
750
754
|
Complete a code-based OAuth attempt and store the resulting credential.
|
|
751
755
|
|
|
752
756
|
Raises:
|
|
753
|
-
InvalidRequestError
|
|
754
|
-
UnauthorizedError
|
|
755
|
-
IntegrationNotFoundError
|
|
756
|
-
IntegrationAttemptNotFoundError
|
|
757
|
-
LocationNotFoundError
|
|
757
|
+
InvalidRequestError: The server answered 400.
|
|
758
|
+
UnauthorizedError: The server answered 401.
|
|
759
|
+
IntegrationNotFoundError: The server answered 404.
|
|
760
|
+
IntegrationAttemptNotFoundError: The server answered 404.
|
|
761
|
+
LocationNotFoundError: The server answered 404.
|
|
758
762
|
|
|
759
763
|
``POST /api/integration/:integrationID/connect/oauth/:attemptID/complete``
|
|
760
764
|
"""
|
|
@@ -788,9 +792,9 @@ class AsyncIntegrationOauthResource(AsyncAPIResource):
|
|
|
788
792
|
Cancel an OAuth attempt and release its resources.
|
|
789
793
|
|
|
790
794
|
Raises:
|
|
791
|
-
InvalidRequestError
|
|
792
|
-
UnauthorizedError
|
|
793
|
-
LocationNotFoundError
|
|
795
|
+
InvalidRequestError: The server answered 400.
|
|
796
|
+
UnauthorizedError: The server answered 401.
|
|
797
|
+
LocationNotFoundError: The server answered 404.
|
|
794
798
|
|
|
795
799
|
``DELETE /api/integration/:integrationID/connect/oauth/:attemptID``
|
|
796
800
|
"""
|
|
@@ -828,11 +832,11 @@ class AsyncIntegrationCommandResource(AsyncAPIResource):
|
|
|
828
832
|
Start a command authentication attempt.
|
|
829
833
|
|
|
830
834
|
Raises:
|
|
831
|
-
InvalidRequestError
|
|
832
|
-
UnauthorizedError
|
|
833
|
-
IntegrationNotFoundError
|
|
834
|
-
IntegrationMethodNotFoundError
|
|
835
|
-
LocationNotFoundError
|
|
835
|
+
InvalidRequestError: The server answered 400.
|
|
836
|
+
UnauthorizedError: The server answered 401.
|
|
837
|
+
IntegrationNotFoundError: The server answered 404.
|
|
838
|
+
IntegrationMethodNotFoundError: The server answered 404.
|
|
839
|
+
LocationNotFoundError: The server answered 404.
|
|
836
840
|
|
|
837
841
|
``POST /api/integration/:integrationID/connect/command``
|
|
838
842
|
"""
|
|
@@ -869,11 +873,11 @@ class AsyncIntegrationCommandResource(AsyncAPIResource):
|
|
|
869
873
|
Poll the current status and output of a command authentication attempt.
|
|
870
874
|
|
|
871
875
|
Raises:
|
|
872
|
-
InvalidRequestError
|
|
873
|
-
UnauthorizedError
|
|
874
|
-
IntegrationNotFoundError
|
|
875
|
-
IntegrationAttemptNotFoundError
|
|
876
|
-
LocationNotFoundError
|
|
876
|
+
InvalidRequestError: The server answered 400.
|
|
877
|
+
UnauthorizedError: The server answered 401.
|
|
878
|
+
IntegrationNotFoundError: The server answered 404.
|
|
879
|
+
IntegrationAttemptNotFoundError: The server answered 404.
|
|
880
|
+
LocationNotFoundError: The server answered 404.
|
|
877
881
|
|
|
878
882
|
``GET /api/integration/:integrationID/connect/command/:attemptID``
|
|
879
883
|
"""
|
|
@@ -909,9 +913,9 @@ class AsyncIntegrationCommandResource(AsyncAPIResource):
|
|
|
909
913
|
Cancel a command authentication attempt and terminate its process.
|
|
910
914
|
|
|
911
915
|
Raises:
|
|
912
|
-
InvalidRequestError
|
|
913
|
-
UnauthorizedError
|
|
914
|
-
LocationNotFoundError
|
|
916
|
+
InvalidRequestError: The server answered 400.
|
|
917
|
+
UnauthorizedError: The server answered 401.
|
|
918
|
+
LocationNotFoundError: The server answered 404.
|
|
915
919
|
|
|
916
920
|
``DELETE /api/integration/:integrationID/connect/command/:attemptID``
|
|
917
921
|
"""
|
|
@@ -934,18 +938,22 @@ class AsyncIntegrationResource(AsyncAPIResource):
|
|
|
934
938
|
|
|
935
939
|
@cached_property
|
|
936
940
|
def wellknown(self) -> AsyncIntegrationWellknownResource:
|
|
941
|
+
"""Operations under ``client.integration.wellknown``."""
|
|
937
942
|
return AsyncIntegrationWellknownResource(self._client)
|
|
938
943
|
|
|
939
944
|
@cached_property
|
|
940
945
|
def connect(self) -> AsyncIntegrationConnectResource:
|
|
946
|
+
"""Operations under ``client.integration.connect``."""
|
|
941
947
|
return AsyncIntegrationConnectResource(self._client)
|
|
942
948
|
|
|
943
949
|
@cached_property
|
|
944
950
|
def oauth(self) -> AsyncIntegrationOauthResource:
|
|
951
|
+
"""Operations under ``client.integration.oauth``."""
|
|
945
952
|
return AsyncIntegrationOauthResource(self._client)
|
|
946
953
|
|
|
947
954
|
@cached_property
|
|
948
955
|
def command(self) -> AsyncIntegrationCommandResource:
|
|
956
|
+
"""Operations under ``client.integration.command``."""
|
|
949
957
|
return AsyncIntegrationCommandResource(self._client)
|
|
950
958
|
|
|
951
959
|
async def list(
|
|
@@ -962,9 +970,9 @@ class AsyncIntegrationResource(AsyncAPIResource):
|
|
|
962
970
|
Retrieve available integrations and their authentication methods.
|
|
963
971
|
|
|
964
972
|
Raises:
|
|
965
|
-
InvalidRequestError
|
|
966
|
-
UnauthorizedError
|
|
967
|
-
LocationNotFoundError
|
|
973
|
+
InvalidRequestError: The server answered 400.
|
|
974
|
+
UnauthorizedError: The server answered 401.
|
|
975
|
+
LocationNotFoundError: The server answered 404.
|
|
968
976
|
|
|
969
977
|
``GET /api/integration``
|
|
970
978
|
"""
|
|
@@ -999,10 +1007,10 @@ class AsyncIntegrationResource(AsyncAPIResource):
|
|
|
999
1007
|
Retrieve one integration and its authentication methods.
|
|
1000
1008
|
|
|
1001
1009
|
Raises:
|
|
1002
|
-
InvalidRequestError
|
|
1003
|
-
UnauthorizedError
|
|
1004
|
-
IntegrationNotFoundError
|
|
1005
|
-
LocationNotFoundError
|
|
1010
|
+
InvalidRequestError: The server answered 400.
|
|
1011
|
+
UnauthorizedError: The server answered 401.
|
|
1012
|
+
IntegrationNotFoundError: The server answered 404.
|
|
1013
|
+
LocationNotFoundError: The server answered 404.
|
|
1006
1014
|
|
|
1007
1015
|
``GET /api/integration/:integrationID``
|
|
1008
1016
|
"""
|
opencode/resources/location.py
CHANGED
|
@@ -35,9 +35,9 @@ class LocationResource(SyncAPIResource):
|
|
|
35
35
|
Resolve the requested location or the server default 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/location``
|
|
43
43
|
"""
|
|
@@ -70,9 +70,9 @@ class LocationResource(SyncAPIResource):
|
|
|
70
70
|
Shut down and rebuild every loaded location. Pending permissions and forms are cancelled; running sessions continue with fresh services at the next step boundary. Emits location.shutdown for client recovery and responds once all replacement builds settle.
|
|
71
71
|
|
|
72
72
|
Raises:
|
|
73
|
-
InvalidRequestError
|
|
74
|
-
UnauthorizedError
|
|
75
|
-
ServiceUnavailableError
|
|
73
|
+
InvalidRequestError: The server answered 400.
|
|
74
|
+
UnauthorizedError: The server answered 401.
|
|
75
|
+
ServiceUnavailableError: The server answered 503.
|
|
76
76
|
|
|
77
77
|
``POST /api/location/reload``
|
|
78
78
|
"""
|
|
@@ -106,9 +106,9 @@ class AsyncLocationResource(AsyncAPIResource):
|
|
|
106
106
|
Resolve the requested location or the server default location.
|
|
107
107
|
|
|
108
108
|
Raises:
|
|
109
|
-
InvalidRequestError
|
|
110
|
-
UnauthorizedError
|
|
111
|
-
LocationNotFoundError
|
|
109
|
+
InvalidRequestError: The server answered 400.
|
|
110
|
+
UnauthorizedError: The server answered 401.
|
|
111
|
+
LocationNotFoundError: The server answered 404.
|
|
112
112
|
|
|
113
113
|
``GET /api/location``
|
|
114
114
|
"""
|
|
@@ -141,9 +141,9 @@ class AsyncLocationResource(AsyncAPIResource):
|
|
|
141
141
|
Shut down and rebuild every loaded location. Pending permissions and forms are cancelled; running sessions continue with fresh services at the next step boundary. Emits location.shutdown for client recovery and responds once all replacement builds settle.
|
|
142
142
|
|
|
143
143
|
Raises:
|
|
144
|
-
InvalidRequestError
|
|
145
|
-
UnauthorizedError
|
|
146
|
-
ServiceUnavailableError
|
|
144
|
+
InvalidRequestError: The server answered 400.
|
|
145
|
+
UnauthorizedError: The server answered 401.
|
|
146
|
+
ServiceUnavailableError: The server answered 503.
|
|
147
147
|
|
|
148
148
|
``POST /api/location/reload``
|
|
149
149
|
"""
|
opencode/resources/mcp.py
CHANGED
|
@@ -39,9 +39,9 @@ class McpResourceResource(SyncAPIResource):
|
|
|
39
39
|
Retrieve resources and resource templates from connected MCP servers.
|
|
40
40
|
|
|
41
41
|
Raises:
|
|
42
|
-
InvalidRequestError
|
|
43
|
-
UnauthorizedError
|
|
44
|
-
LocationNotFoundError
|
|
42
|
+
InvalidRequestError: The server answered 400.
|
|
43
|
+
UnauthorizedError: The server answered 401.
|
|
44
|
+
LocationNotFoundError: The server answered 404.
|
|
45
45
|
|
|
46
46
|
``GET /api/mcp/resource``
|
|
47
47
|
"""
|
|
@@ -67,6 +67,7 @@ class McpResource(SyncAPIResource):
|
|
|
67
67
|
|
|
68
68
|
@cached_property
|
|
69
69
|
def resource(self) -> McpResourceResource:
|
|
70
|
+
"""Operations under ``client.mcp.resource``."""
|
|
70
71
|
return McpResourceResource(self._client)
|
|
71
72
|
|
|
72
73
|
def list(
|
|
@@ -83,9 +84,9 @@ class McpResource(SyncAPIResource):
|
|
|
83
84
|
Retrieve configured MCP servers and their connection status.
|
|
84
85
|
|
|
85
86
|
Raises:
|
|
86
|
-
InvalidRequestError
|
|
87
|
-
UnauthorizedError
|
|
88
|
-
LocationNotFoundError
|
|
87
|
+
InvalidRequestError: The server answered 400.
|
|
88
|
+
UnauthorizedError: The server answered 401.
|
|
89
|
+
LocationNotFoundError: The server answered 404.
|
|
89
90
|
|
|
90
91
|
``GET /api/mcp``
|
|
91
92
|
"""
|
|
@@ -123,9 +124,9 @@ class McpResource(SyncAPIResource):
|
|
|
123
124
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
124
125
|
|
|
125
126
|
Raises:
|
|
126
|
-
InvalidRequestError
|
|
127
|
-
UnauthorizedError
|
|
128
|
-
LocationNotFoundError
|
|
127
|
+
InvalidRequestError: The server answered 400.
|
|
128
|
+
UnauthorizedError: The server answered 401.
|
|
129
|
+
LocationNotFoundError: The server answered 404.
|
|
129
130
|
|
|
130
131
|
``PUT /api/experimental/mcp/:server``
|
|
131
132
|
"""
|
|
@@ -160,10 +161,10 @@ class McpResource(SyncAPIResource):
|
|
|
160
161
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
161
162
|
|
|
162
163
|
Raises:
|
|
163
|
-
InvalidRequestError
|
|
164
|
-
UnauthorizedError
|
|
165
|
-
McpServerNotFoundError
|
|
166
|
-
LocationNotFoundError
|
|
164
|
+
InvalidRequestError: The server answered 400.
|
|
165
|
+
UnauthorizedError: The server answered 401.
|
|
166
|
+
McpServerNotFoundError: The server answered 404.
|
|
167
|
+
LocationNotFoundError: The server answered 404.
|
|
167
168
|
|
|
168
169
|
``DELETE /api/experimental/mcp/:server``
|
|
169
170
|
"""
|
|
@@ -197,10 +198,10 @@ class McpResource(SyncAPIResource):
|
|
|
197
198
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
198
199
|
|
|
199
200
|
Raises:
|
|
200
|
-
InvalidRequestError
|
|
201
|
-
UnauthorizedError
|
|
202
|
-
McpServerNotFoundError
|
|
203
|
-
LocationNotFoundError
|
|
201
|
+
InvalidRequestError: The server answered 400.
|
|
202
|
+
UnauthorizedError: The server answered 401.
|
|
203
|
+
McpServerNotFoundError: The server answered 404.
|
|
204
|
+
LocationNotFoundError: The server answered 404.
|
|
204
205
|
|
|
205
206
|
``POST /api/experimental/mcp/:server/connect``
|
|
206
207
|
"""
|
|
@@ -234,10 +235,10 @@ class McpResource(SyncAPIResource):
|
|
|
234
235
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
235
236
|
|
|
236
237
|
Raises:
|
|
237
|
-
InvalidRequestError
|
|
238
|
-
UnauthorizedError
|
|
239
|
-
McpServerNotFoundError
|
|
240
|
-
LocationNotFoundError
|
|
238
|
+
InvalidRequestError: The server answered 400.
|
|
239
|
+
UnauthorizedError: The server answered 401.
|
|
240
|
+
McpServerNotFoundError: The server answered 404.
|
|
241
|
+
LocationNotFoundError: The server answered 404.
|
|
241
242
|
|
|
242
243
|
``POST /api/experimental/mcp/:server/disconnect``
|
|
243
244
|
"""
|
|
@@ -272,9 +273,9 @@ class AsyncMcpResourceResource(AsyncAPIResource):
|
|
|
272
273
|
Retrieve resources and resource templates from connected MCP servers.
|
|
273
274
|
|
|
274
275
|
Raises:
|
|
275
|
-
InvalidRequestError
|
|
276
|
-
UnauthorizedError
|
|
277
|
-
LocationNotFoundError
|
|
276
|
+
InvalidRequestError: The server answered 400.
|
|
277
|
+
UnauthorizedError: The server answered 401.
|
|
278
|
+
LocationNotFoundError: The server answered 404.
|
|
278
279
|
|
|
279
280
|
``GET /api/mcp/resource``
|
|
280
281
|
"""
|
|
@@ -300,6 +301,7 @@ class AsyncMcpResource(AsyncAPIResource):
|
|
|
300
301
|
|
|
301
302
|
@cached_property
|
|
302
303
|
def resource(self) -> AsyncMcpResourceResource:
|
|
304
|
+
"""Operations under ``client.mcp.resource``."""
|
|
303
305
|
return AsyncMcpResourceResource(self._client)
|
|
304
306
|
|
|
305
307
|
async def list(
|
|
@@ -316,9 +318,9 @@ class AsyncMcpResource(AsyncAPIResource):
|
|
|
316
318
|
Retrieve configured MCP servers and their connection status.
|
|
317
319
|
|
|
318
320
|
Raises:
|
|
319
|
-
InvalidRequestError
|
|
320
|
-
UnauthorizedError
|
|
321
|
-
LocationNotFoundError
|
|
321
|
+
InvalidRequestError: The server answered 400.
|
|
322
|
+
UnauthorizedError: The server answered 401.
|
|
323
|
+
LocationNotFoundError: The server answered 404.
|
|
322
324
|
|
|
323
325
|
``GET /api/mcp``
|
|
324
326
|
"""
|
|
@@ -356,9 +358,9 @@ class AsyncMcpResource(AsyncAPIResource):
|
|
|
356
358
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
357
359
|
|
|
358
360
|
Raises:
|
|
359
|
-
InvalidRequestError
|
|
360
|
-
UnauthorizedError
|
|
361
|
-
LocationNotFoundError
|
|
361
|
+
InvalidRequestError: The server answered 400.
|
|
362
|
+
UnauthorizedError: The server answered 401.
|
|
363
|
+
LocationNotFoundError: The server answered 404.
|
|
362
364
|
|
|
363
365
|
``PUT /api/experimental/mcp/:server``
|
|
364
366
|
"""
|
|
@@ -393,10 +395,10 @@ class AsyncMcpResource(AsyncAPIResource):
|
|
|
393
395
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
394
396
|
|
|
395
397
|
Raises:
|
|
396
|
-
InvalidRequestError
|
|
397
|
-
UnauthorizedError
|
|
398
|
-
McpServerNotFoundError
|
|
399
|
-
LocationNotFoundError
|
|
398
|
+
InvalidRequestError: The server answered 400.
|
|
399
|
+
UnauthorizedError: The server answered 401.
|
|
400
|
+
McpServerNotFoundError: The server answered 404.
|
|
401
|
+
LocationNotFoundError: The server answered 404.
|
|
400
402
|
|
|
401
403
|
``DELETE /api/experimental/mcp/:server``
|
|
402
404
|
"""
|
|
@@ -430,10 +432,10 @@ class AsyncMcpResource(AsyncAPIResource):
|
|
|
430
432
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
431
433
|
|
|
432
434
|
Raises:
|
|
433
|
-
InvalidRequestError
|
|
434
|
-
UnauthorizedError
|
|
435
|
-
McpServerNotFoundError
|
|
436
|
-
LocationNotFoundError
|
|
435
|
+
InvalidRequestError: The server answered 400.
|
|
436
|
+
UnauthorizedError: The server answered 401.
|
|
437
|
+
McpServerNotFoundError: The server answered 404.
|
|
438
|
+
LocationNotFoundError: The server answered 404.
|
|
437
439
|
|
|
438
440
|
``POST /api/experimental/mcp/:server/connect``
|
|
439
441
|
"""
|
|
@@ -467,10 +469,10 @@ class AsyncMcpResource(AsyncAPIResource):
|
|
|
467
469
|
This endpoint is experimental in OpenCode and may change without notice.
|
|
468
470
|
|
|
469
471
|
Raises:
|
|
470
|
-
InvalidRequestError
|
|
471
|
-
UnauthorizedError
|
|
472
|
-
McpServerNotFoundError
|
|
473
|
-
LocationNotFoundError
|
|
472
|
+
InvalidRequestError: The server answered 400.
|
|
473
|
+
UnauthorizedError: The server answered 401.
|
|
474
|
+
McpServerNotFoundError: The server answered 404.
|
|
475
|
+
LocationNotFoundError: The server answered 404.
|
|
474
476
|
|
|
475
477
|
``POST /api/experimental/mcp/:server/disconnect``
|
|
476
478
|
"""
|
opencode/resources/message.py
CHANGED
|
@@ -64,11 +64,11 @@ class MessageResource(SyncAPIResource):
|
|
|
64
64
|
type: Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.
|
|
65
65
|
|
|
66
66
|
Raises:
|
|
67
|
-
InvalidCursorError
|
|
68
|
-
InvalidRequestError
|
|
69
|
-
UnauthorizedError
|
|
70
|
-
SessionNotFoundError
|
|
71
|
-
UnknownError
|
|
67
|
+
InvalidCursorError: The server answered 400.
|
|
68
|
+
InvalidRequestError: The server answered 400.
|
|
69
|
+
UnauthorizedError: The server answered 401.
|
|
70
|
+
SessionNotFoundError: The server answered 404.
|
|
71
|
+
UnknownError: The server answered 500.
|
|
72
72
|
|
|
73
73
|
``GET /api/session/:sessionID/message``
|
|
74
74
|
"""
|
|
@@ -129,11 +129,11 @@ class AsyncMessageResource(AsyncAPIResource):
|
|
|
129
129
|
type: Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.
|
|
130
130
|
|
|
131
131
|
Raises:
|
|
132
|
-
InvalidCursorError
|
|
133
|
-
InvalidRequestError
|
|
134
|
-
UnauthorizedError
|
|
135
|
-
SessionNotFoundError
|
|
136
|
-
UnknownError
|
|
132
|
+
InvalidCursorError: The server answered 400.
|
|
133
|
+
InvalidRequestError: The server answered 400.
|
|
134
|
+
UnauthorizedError: The server answered 401.
|
|
135
|
+
SessionNotFoundError: The server answered 404.
|
|
136
|
+
UnknownError: The server answered 500.
|
|
137
137
|
|
|
138
138
|
``GET /api/session/:sessionID/message``
|
|
139
139
|
"""
|