opencode-python-sdk 0.1.3__py3-none-any.whl → 0.2.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 +19 -1
- opencode/_base_client.py +24 -3
- opencode/_client.py +173 -2
- opencode/_events.py +5 -2
- opencode/_rpc.py +9 -2
- opencode/_service.py +1018 -0
- opencode/lib/__init__.py +5 -0
- opencode/lib/_ready.py +91 -0
- opencode/lib/_session.py +231 -0
- opencode/resources/agent.py +13 -11
- opencode/resources/command.py +9 -7
- opencode/resources/config.py +12 -10
- opencode/resources/credential.py +13 -11
- opencode/resources/debug.py +9 -7
- opencode/resources/event.py +9 -5
- opencode/resources/experimental.py +31 -29
- opencode/resources/file.py +15 -13
- opencode/resources/form.py +9 -7
- opencode/resources/generate.py +9 -7
- opencode/resources/integration.py +28 -26
- opencode/resources/location.py +9 -7
- opencode/resources/mcp.py +13 -11
- opencode/resources/message.py +9 -8
- opencode/resources/migration.py +10 -12
- opencode/resources/model.py +12 -10
- opencode/resources/permission.py +29 -27
- opencode/resources/plugin.py +12 -10
- opencode/resources/project.py +14 -12
- opencode/resources/provider.py +13 -11
- opencode/resources/pty.py +23 -21
- opencode/resources/reference.py +9 -7
- opencode/resources/rpc.py +9 -7
- opencode/resources/server.py +14 -12
- opencode/resources/session.py +92 -90
- opencode/resources/shell.py +19 -17
- opencode/resources/skill.py +9 -7
- opencode/resources/vcs.py +22 -20
- opencode/resources/voice.py +9 -7
- opencode/resources/websearch.py +13 -11
- opencode/resources/worktree.py +13 -11
- opencode/service.py +50 -0
- opencode/testing.py +508 -0
- {opencode_python_sdk-0.1.3.dist-info → opencode_python_sdk-0.2.2.dist-info}/METADATA +71 -1
- opencode_python_sdk-0.2.2.dist-info/RECORD +64 -0
- opencode_python_sdk-0.1.3.dist-info/RECORD +0 -58
- {opencode_python_sdk-0.1.3.dist-info → opencode_python_sdk-0.2.2.dist-info}/WHEEL +0 -0
- {opencode_python_sdk-0.1.3.dist-info → opencode_python_sdk-0.2.2.dist-info}/licenses/LICENSE +0 -0
opencode/resources/model.py
CHANGED
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import cast
|
|
8
|
+
from typing import TYPE_CHECKING, cast
|
|
9
9
|
|
|
10
10
|
from .._base_client import RequestOptions
|
|
11
11
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
12
12
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..types import (
|
|
16
|
+
Location,
|
|
17
|
+
ModelDefaultResponse,
|
|
18
|
+
ModelListResponse,
|
|
19
|
+
)
|
|
18
20
|
|
|
19
21
|
__all__ = ["ModelResource", "AsyncModelResource"]
|
|
20
22
|
|
|
@@ -55,7 +57,7 @@ class ModelResource(SyncAPIResource):
|
|
|
55
57
|
extra_body=extra_body,
|
|
56
58
|
timeout=timeout,
|
|
57
59
|
),
|
|
58
|
-
response_type=ModelListResponse,
|
|
60
|
+
response_type="ModelListResponse",
|
|
59
61
|
),
|
|
60
62
|
)
|
|
61
63
|
|
|
@@ -92,7 +94,7 @@ class ModelResource(SyncAPIResource):
|
|
|
92
94
|
extra_body=extra_body,
|
|
93
95
|
timeout=timeout,
|
|
94
96
|
),
|
|
95
|
-
response_type=ModelDefaultResponse,
|
|
97
|
+
response_type="ModelDefaultResponse",
|
|
96
98
|
),
|
|
97
99
|
)
|
|
98
100
|
|
|
@@ -133,7 +135,7 @@ class AsyncModelResource(AsyncAPIResource):
|
|
|
133
135
|
extra_body=extra_body,
|
|
134
136
|
timeout=timeout,
|
|
135
137
|
),
|
|
136
|
-
response_type=ModelListResponse,
|
|
138
|
+
response_type="ModelListResponse",
|
|
137
139
|
),
|
|
138
140
|
)
|
|
139
141
|
|
|
@@ -170,6 +172,6 @@ class AsyncModelResource(AsyncAPIResource):
|
|
|
170
172
|
extra_body=extra_body,
|
|
171
173
|
timeout=timeout,
|
|
172
174
|
),
|
|
173
|
-
response_type=ModelDefaultResponse,
|
|
175
|
+
response_type="ModelDefaultResponse",
|
|
174
176
|
),
|
|
175
177
|
)
|
opencode/resources/permission.py
CHANGED
|
@@ -8,26 +8,28 @@ from __future__ import annotations
|
|
|
8
8
|
import builtins
|
|
9
9
|
from collections.abc import Mapping, Sequence
|
|
10
10
|
from functools import cached_property
|
|
11
|
-
from typing import Any, cast
|
|
11
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
12
12
|
|
|
13
13
|
from .._base_client import RequestOptions
|
|
14
14
|
from .._qs import encode_path_segment
|
|
15
15
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
16
16
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from ..types import (
|
|
20
|
+
AgentID,
|
|
21
|
+
Location,
|
|
22
|
+
PermissionCreateResponse,
|
|
23
|
+
PermissionID,
|
|
24
|
+
PermissionReply,
|
|
25
|
+
PermissionRequest,
|
|
26
|
+
PermissionRequestListResponse,
|
|
27
|
+
PermissionSavedID,
|
|
28
|
+
PermissionSavedInfo,
|
|
29
|
+
PermissionSource,
|
|
30
|
+
ProjectID,
|
|
31
|
+
SessionID,
|
|
32
|
+
)
|
|
31
33
|
|
|
32
34
|
__all__ = ["PermissionResource", "AsyncPermissionResource"]
|
|
33
35
|
|
|
@@ -67,7 +69,7 @@ class PermissionRequestResource(SyncAPIResource):
|
|
|
67
69
|
extra_body=extra_body,
|
|
68
70
|
timeout=timeout,
|
|
69
71
|
),
|
|
70
|
-
response_type=PermissionRequestListResponse,
|
|
72
|
+
response_type="PermissionRequestListResponse",
|
|
71
73
|
),
|
|
72
74
|
)
|
|
73
75
|
|
|
@@ -107,7 +109,7 @@ class PermissionSavedResource(SyncAPIResource):
|
|
|
107
109
|
extra_body=extra_body,
|
|
108
110
|
timeout=timeout,
|
|
109
111
|
),
|
|
110
|
-
response_type=builtins.list[PermissionSavedInfo],
|
|
112
|
+
response_type="builtins.list[PermissionSavedInfo]",
|
|
111
113
|
unwrap=True,
|
|
112
114
|
),
|
|
113
115
|
)
|
|
@@ -148,7 +150,7 @@ class PermissionSavedResource(SyncAPIResource):
|
|
|
148
150
|
extra_body=extra_body,
|
|
149
151
|
timeout=timeout,
|
|
150
152
|
),
|
|
151
|
-
response_type=PermissionSavedInfo,
|
|
153
|
+
response_type="PermissionSavedInfo",
|
|
152
154
|
unwrap=True,
|
|
153
155
|
),
|
|
154
156
|
)
|
|
@@ -247,7 +249,7 @@ class PermissionResource(SyncAPIResource):
|
|
|
247
249
|
extra_body=extra_body,
|
|
248
250
|
timeout=timeout,
|
|
249
251
|
),
|
|
250
|
-
response_type=PermissionCreateResponse,
|
|
252
|
+
response_type="PermissionCreateResponse",
|
|
251
253
|
unwrap=True,
|
|
252
254
|
),
|
|
253
255
|
)
|
|
@@ -284,7 +286,7 @@ class PermissionResource(SyncAPIResource):
|
|
|
284
286
|
extra_body=extra_body,
|
|
285
287
|
timeout=timeout,
|
|
286
288
|
),
|
|
287
|
-
response_type=builtins.list[PermissionRequest],
|
|
289
|
+
response_type="builtins.list[PermissionRequest]",
|
|
288
290
|
unwrap=True,
|
|
289
291
|
),
|
|
290
292
|
)
|
|
@@ -323,7 +325,7 @@ class PermissionResource(SyncAPIResource):
|
|
|
323
325
|
extra_body=extra_body,
|
|
324
326
|
timeout=timeout,
|
|
325
327
|
),
|
|
326
|
-
response_type=PermissionRequest,
|
|
328
|
+
response_type="PermissionRequest",
|
|
327
329
|
unwrap=True,
|
|
328
330
|
),
|
|
329
331
|
)
|
|
@@ -402,7 +404,7 @@ class AsyncPermissionRequestResource(AsyncAPIResource):
|
|
|
402
404
|
extra_body=extra_body,
|
|
403
405
|
timeout=timeout,
|
|
404
406
|
),
|
|
405
|
-
response_type=PermissionRequestListResponse,
|
|
407
|
+
response_type="PermissionRequestListResponse",
|
|
406
408
|
),
|
|
407
409
|
)
|
|
408
410
|
|
|
@@ -442,7 +444,7 @@ class AsyncPermissionSavedResource(AsyncAPIResource):
|
|
|
442
444
|
extra_body=extra_body,
|
|
443
445
|
timeout=timeout,
|
|
444
446
|
),
|
|
445
|
-
response_type=builtins.list[PermissionSavedInfo],
|
|
447
|
+
response_type="builtins.list[PermissionSavedInfo]",
|
|
446
448
|
unwrap=True,
|
|
447
449
|
),
|
|
448
450
|
)
|
|
@@ -483,7 +485,7 @@ class AsyncPermissionSavedResource(AsyncAPIResource):
|
|
|
483
485
|
extra_body=extra_body,
|
|
484
486
|
timeout=timeout,
|
|
485
487
|
),
|
|
486
|
-
response_type=PermissionSavedInfo,
|
|
488
|
+
response_type="PermissionSavedInfo",
|
|
487
489
|
unwrap=True,
|
|
488
490
|
),
|
|
489
491
|
)
|
|
@@ -582,7 +584,7 @@ class AsyncPermissionResource(AsyncAPIResource):
|
|
|
582
584
|
extra_body=extra_body,
|
|
583
585
|
timeout=timeout,
|
|
584
586
|
),
|
|
585
|
-
response_type=PermissionCreateResponse,
|
|
587
|
+
response_type="PermissionCreateResponse",
|
|
586
588
|
unwrap=True,
|
|
587
589
|
),
|
|
588
590
|
)
|
|
@@ -619,7 +621,7 @@ class AsyncPermissionResource(AsyncAPIResource):
|
|
|
619
621
|
extra_body=extra_body,
|
|
620
622
|
timeout=timeout,
|
|
621
623
|
),
|
|
622
|
-
response_type=builtins.list[PermissionRequest],
|
|
624
|
+
response_type="builtins.list[PermissionRequest]",
|
|
623
625
|
unwrap=True,
|
|
624
626
|
),
|
|
625
627
|
)
|
|
@@ -658,7 +660,7 @@ class AsyncPermissionResource(AsyncAPIResource):
|
|
|
658
660
|
extra_body=extra_body,
|
|
659
661
|
timeout=timeout,
|
|
660
662
|
),
|
|
661
|
-
response_type=PermissionRequest,
|
|
663
|
+
response_type="PermissionRequest",
|
|
662
664
|
unwrap=True,
|
|
663
665
|
),
|
|
664
666
|
)
|
opencode/resources/plugin.py
CHANGED
|
@@ -6,16 +6,18 @@
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
from collections.abc import Sequence
|
|
9
|
-
from typing import cast
|
|
9
|
+
from typing import TYPE_CHECKING, cast
|
|
10
10
|
|
|
11
11
|
from .._base_client import RequestOptions
|
|
12
12
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
13
13
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..types import (
|
|
17
|
+
Location,
|
|
18
|
+
PluginCheckResponse,
|
|
19
|
+
PluginListResponse,
|
|
20
|
+
)
|
|
19
21
|
|
|
20
22
|
__all__ = ["PluginResource", "AsyncPluginResource"]
|
|
21
23
|
|
|
@@ -55,7 +57,7 @@ class PluginResource(SyncAPIResource):
|
|
|
55
57
|
extra_body=extra_body,
|
|
56
58
|
timeout=timeout,
|
|
57
59
|
),
|
|
58
|
-
response_type=PluginListResponse,
|
|
60
|
+
response_type="PluginListResponse",
|
|
59
61
|
),
|
|
60
62
|
)
|
|
61
63
|
|
|
@@ -93,7 +95,7 @@ class PluginResource(SyncAPIResource):
|
|
|
93
95
|
extra_body=extra_body,
|
|
94
96
|
timeout=timeout,
|
|
95
97
|
),
|
|
96
|
-
response_type=PluginCheckResponse,
|
|
98
|
+
response_type="PluginCheckResponse",
|
|
97
99
|
),
|
|
98
100
|
)
|
|
99
101
|
|
|
@@ -169,7 +171,7 @@ class AsyncPluginResource(AsyncAPIResource):
|
|
|
169
171
|
extra_body=extra_body,
|
|
170
172
|
timeout=timeout,
|
|
171
173
|
),
|
|
172
|
-
response_type=PluginListResponse,
|
|
174
|
+
response_type="PluginListResponse",
|
|
173
175
|
),
|
|
174
176
|
)
|
|
175
177
|
|
|
@@ -207,7 +209,7 @@ class AsyncPluginResource(AsyncAPIResource):
|
|
|
207
209
|
extra_body=extra_body,
|
|
208
210
|
timeout=timeout,
|
|
209
211
|
),
|
|
210
|
-
response_type=PluginCheckResponse,
|
|
212
|
+
response_type="PluginCheckResponse",
|
|
211
213
|
),
|
|
212
214
|
)
|
|
213
215
|
|
opencode/resources/project.py
CHANGED
|
@@ -6,19 +6,21 @@
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
import builtins
|
|
9
|
-
from typing import cast
|
|
9
|
+
from typing import TYPE_CHECKING, cast
|
|
10
10
|
|
|
11
11
|
from .._base_client import RequestOptions
|
|
12
12
|
from .._qs import encode_path_segment
|
|
13
13
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
14
14
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ..types import (
|
|
18
|
+
AbsolutePath,
|
|
19
|
+
Project,
|
|
20
|
+
ProjectCommands,
|
|
21
|
+
ProjectIcon,
|
|
22
|
+
ProjectID,
|
|
23
|
+
)
|
|
22
24
|
|
|
23
25
|
__all__ = ["ProjectResource", "AsyncProjectResource"]
|
|
24
26
|
|
|
@@ -58,7 +60,7 @@ class ProjectResource(SyncAPIResource):
|
|
|
58
60
|
extra_body=extra_body,
|
|
59
61
|
timeout=timeout,
|
|
60
62
|
),
|
|
61
|
-
response_type=builtins.list[Project],
|
|
63
|
+
response_type="builtins.list[Project]",
|
|
62
64
|
),
|
|
63
65
|
)
|
|
64
66
|
|
|
@@ -99,7 +101,7 @@ class ProjectResource(SyncAPIResource):
|
|
|
99
101
|
extra_body=extra_body,
|
|
100
102
|
timeout=timeout,
|
|
101
103
|
),
|
|
102
|
-
response_type=Project,
|
|
104
|
+
response_type="Project",
|
|
103
105
|
),
|
|
104
106
|
)
|
|
105
107
|
|
|
@@ -139,7 +141,7 @@ class AsyncProjectResource(AsyncAPIResource):
|
|
|
139
141
|
extra_body=extra_body,
|
|
140
142
|
timeout=timeout,
|
|
141
143
|
),
|
|
142
|
-
response_type=builtins.list[Project],
|
|
144
|
+
response_type="builtins.list[Project]",
|
|
143
145
|
),
|
|
144
146
|
)
|
|
145
147
|
|
|
@@ -180,6 +182,6 @@ class AsyncProjectResource(AsyncAPIResource):
|
|
|
180
182
|
extra_body=extra_body,
|
|
181
183
|
timeout=timeout,
|
|
182
184
|
),
|
|
183
|
-
response_type=Project,
|
|
185
|
+
response_type="Project",
|
|
184
186
|
),
|
|
185
187
|
)
|
opencode/resources/provider.py
CHANGED
|
@@ -5,18 +5,20 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import cast
|
|
8
|
+
from typing import TYPE_CHECKING, cast
|
|
9
9
|
|
|
10
10
|
from .._base_client import RequestOptions
|
|
11
11
|
from .._qs import encode_path_segment
|
|
12
12
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
13
13
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..types import (
|
|
17
|
+
Location,
|
|
18
|
+
ProviderGetResponse,
|
|
19
|
+
ProviderID,
|
|
20
|
+
ProviderListResponse,
|
|
21
|
+
)
|
|
20
22
|
|
|
21
23
|
__all__ = ["ProviderResource", "AsyncProviderResource"]
|
|
22
24
|
|
|
@@ -57,7 +59,7 @@ class ProviderResource(SyncAPIResource):
|
|
|
57
59
|
extra_body=extra_body,
|
|
58
60
|
timeout=timeout,
|
|
59
61
|
),
|
|
60
|
-
response_type=ProviderListResponse,
|
|
62
|
+
response_type="ProviderListResponse",
|
|
61
63
|
),
|
|
62
64
|
)
|
|
63
65
|
|
|
@@ -96,7 +98,7 @@ class ProviderResource(SyncAPIResource):
|
|
|
96
98
|
extra_body=extra_body,
|
|
97
99
|
timeout=timeout,
|
|
98
100
|
),
|
|
99
|
-
response_type=ProviderGetResponse,
|
|
101
|
+
response_type="ProviderGetResponse",
|
|
100
102
|
),
|
|
101
103
|
)
|
|
102
104
|
|
|
@@ -137,7 +139,7 @@ class AsyncProviderResource(AsyncAPIResource):
|
|
|
137
139
|
extra_body=extra_body,
|
|
138
140
|
timeout=timeout,
|
|
139
141
|
),
|
|
140
|
-
response_type=ProviderListResponse,
|
|
142
|
+
response_type="ProviderListResponse",
|
|
141
143
|
),
|
|
142
144
|
)
|
|
143
145
|
|
|
@@ -176,6 +178,6 @@ class AsyncProviderResource(AsyncAPIResource):
|
|
|
176
178
|
extra_body=extra_body,
|
|
177
179
|
timeout=timeout,
|
|
178
180
|
),
|
|
179
|
-
response_type=ProviderGetResponse,
|
|
181
|
+
response_type="ProviderGetResponse",
|
|
180
182
|
),
|
|
181
183
|
)
|
opencode/resources/pty.py
CHANGED
|
@@ -7,23 +7,25 @@ from __future__ import annotations
|
|
|
7
7
|
|
|
8
8
|
from collections.abc import Mapping, Sequence
|
|
9
9
|
from functools import cached_property
|
|
10
|
-
from typing import cast
|
|
10
|
+
from typing import TYPE_CHECKING, cast
|
|
11
11
|
|
|
12
12
|
from .._base_client import RequestOptions
|
|
13
13
|
from .._pty import AsyncPtyAttachMixin, PtyAttachMixin
|
|
14
14
|
from .._qs import encode_path_segment
|
|
15
15
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
16
16
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from ..types import (
|
|
20
|
+
Location,
|
|
21
|
+
PtyConnectTokenResponse,
|
|
22
|
+
PtyCreateResponse,
|
|
23
|
+
PtyGetResponse,
|
|
24
|
+
PtyID,
|
|
25
|
+
PtyListResponse,
|
|
26
|
+
PtyUpdateResponse,
|
|
27
|
+
PtyUpdateSize,
|
|
28
|
+
)
|
|
27
29
|
|
|
28
30
|
__all__ = ["PtyResource", "AsyncPtyResource"]
|
|
29
31
|
|
|
@@ -68,7 +70,7 @@ class PtyConnectResource(SyncAPIResource):
|
|
|
68
70
|
extra_body=extra_body,
|
|
69
71
|
timeout=timeout,
|
|
70
72
|
),
|
|
71
|
-
response_type=PtyConnectTokenResponse,
|
|
73
|
+
response_type="PtyConnectTokenResponse",
|
|
72
74
|
),
|
|
73
75
|
)
|
|
74
76
|
|
|
@@ -113,7 +115,7 @@ class PtyResource(PtyAttachMixin):
|
|
|
113
115
|
extra_body=extra_body,
|
|
114
116
|
timeout=timeout,
|
|
115
117
|
),
|
|
116
|
-
response_type=PtyListResponse,
|
|
118
|
+
response_type="PtyListResponse",
|
|
117
119
|
),
|
|
118
120
|
)
|
|
119
121
|
|
|
@@ -155,7 +157,7 @@ class PtyResource(PtyAttachMixin):
|
|
|
155
157
|
extra_body=extra_body,
|
|
156
158
|
timeout=timeout,
|
|
157
159
|
),
|
|
158
|
-
response_type=PtyCreateResponse,
|
|
160
|
+
response_type="PtyCreateResponse",
|
|
159
161
|
),
|
|
160
162
|
)
|
|
161
163
|
|
|
@@ -193,7 +195,7 @@ class PtyResource(PtyAttachMixin):
|
|
|
193
195
|
extra_body=extra_body,
|
|
194
196
|
timeout=timeout,
|
|
195
197
|
),
|
|
196
|
-
response_type=PtyGetResponse,
|
|
198
|
+
response_type="PtyGetResponse",
|
|
197
199
|
),
|
|
198
200
|
)
|
|
199
201
|
|
|
@@ -234,7 +236,7 @@ class PtyResource(PtyAttachMixin):
|
|
|
234
236
|
extra_body=extra_body,
|
|
235
237
|
timeout=timeout,
|
|
236
238
|
),
|
|
237
|
-
response_type=PtyUpdateResponse,
|
|
239
|
+
response_type="PtyUpdateResponse",
|
|
238
240
|
),
|
|
239
241
|
)
|
|
240
242
|
|
|
@@ -314,7 +316,7 @@ class AsyncPtyConnectResource(AsyncAPIResource):
|
|
|
314
316
|
extra_body=extra_body,
|
|
315
317
|
timeout=timeout,
|
|
316
318
|
),
|
|
317
|
-
response_type=PtyConnectTokenResponse,
|
|
319
|
+
response_type="PtyConnectTokenResponse",
|
|
318
320
|
),
|
|
319
321
|
)
|
|
320
322
|
|
|
@@ -359,7 +361,7 @@ class AsyncPtyResource(AsyncPtyAttachMixin):
|
|
|
359
361
|
extra_body=extra_body,
|
|
360
362
|
timeout=timeout,
|
|
361
363
|
),
|
|
362
|
-
response_type=PtyListResponse,
|
|
364
|
+
response_type="PtyListResponse",
|
|
363
365
|
),
|
|
364
366
|
)
|
|
365
367
|
|
|
@@ -401,7 +403,7 @@ class AsyncPtyResource(AsyncPtyAttachMixin):
|
|
|
401
403
|
extra_body=extra_body,
|
|
402
404
|
timeout=timeout,
|
|
403
405
|
),
|
|
404
|
-
response_type=PtyCreateResponse,
|
|
406
|
+
response_type="PtyCreateResponse",
|
|
405
407
|
),
|
|
406
408
|
)
|
|
407
409
|
|
|
@@ -439,7 +441,7 @@ class AsyncPtyResource(AsyncPtyAttachMixin):
|
|
|
439
441
|
extra_body=extra_body,
|
|
440
442
|
timeout=timeout,
|
|
441
443
|
),
|
|
442
|
-
response_type=PtyGetResponse,
|
|
444
|
+
response_type="PtyGetResponse",
|
|
443
445
|
),
|
|
444
446
|
)
|
|
445
447
|
|
|
@@ -480,7 +482,7 @@ class AsyncPtyResource(AsyncPtyAttachMixin):
|
|
|
480
482
|
extra_body=extra_body,
|
|
481
483
|
timeout=timeout,
|
|
482
484
|
),
|
|
483
|
-
response_type=PtyUpdateResponse,
|
|
485
|
+
response_type="PtyUpdateResponse",
|
|
484
486
|
),
|
|
485
487
|
)
|
|
486
488
|
|
opencode/resources/reference.py
CHANGED
|
@@ -5,15 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import cast
|
|
8
|
+
from typing import TYPE_CHECKING, cast
|
|
9
9
|
|
|
10
10
|
from .._base_client import RequestOptions
|
|
11
11
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
12
12
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..types import (
|
|
16
|
+
Location,
|
|
17
|
+
ReferenceListResponse,
|
|
18
|
+
)
|
|
17
19
|
|
|
18
20
|
__all__ = ["ReferenceResource", "AsyncReferenceResource"]
|
|
19
21
|
|
|
@@ -53,7 +55,7 @@ class ReferenceResource(SyncAPIResource):
|
|
|
53
55
|
extra_body=extra_body,
|
|
54
56
|
timeout=timeout,
|
|
55
57
|
),
|
|
56
|
-
response_type=ReferenceListResponse,
|
|
58
|
+
response_type="ReferenceListResponse",
|
|
57
59
|
),
|
|
58
60
|
)
|
|
59
61
|
|
|
@@ -93,6 +95,6 @@ class AsyncReferenceResource(AsyncAPIResource):
|
|
|
93
95
|
extra_body=extra_body,
|
|
94
96
|
timeout=timeout,
|
|
95
97
|
),
|
|
96
|
-
response_type=ReferenceListResponse,
|
|
98
|
+
response_type="ReferenceListResponse",
|
|
97
99
|
),
|
|
98
100
|
)
|
opencode/resources/rpc.py
CHANGED
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import Any, cast
|
|
8
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
9
9
|
|
|
10
10
|
from .._base_client import RequestOptions
|
|
11
11
|
from .._qs import encode_path_segment
|
|
12
12
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
13
13
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..types import (
|
|
17
|
+
Location,
|
|
18
|
+
RpcOutput,
|
|
19
|
+
)
|
|
18
20
|
|
|
19
21
|
__all__ = ["RpcResource", "AsyncRpcResource"]
|
|
20
22
|
|
|
@@ -60,7 +62,7 @@ class RpcResource(SyncAPIResource):
|
|
|
60
62
|
extra_body=extra_body,
|
|
61
63
|
timeout=timeout,
|
|
62
64
|
),
|
|
63
|
-
response_type=RpcOutput,
|
|
65
|
+
response_type="RpcOutput",
|
|
64
66
|
),
|
|
65
67
|
)
|
|
66
68
|
|
|
@@ -106,6 +108,6 @@ class AsyncRpcResource(AsyncAPIResource):
|
|
|
106
108
|
extra_body=extra_body,
|
|
107
109
|
timeout=timeout,
|
|
108
110
|
),
|
|
109
|
-
response_type=RpcOutput,
|
|
111
|
+
response_type="RpcOutput",
|
|
110
112
|
),
|
|
111
113
|
)
|
opencode/resources/server.py
CHANGED
|
@@ -5,17 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import cast
|
|
8
|
+
from typing import TYPE_CHECKING, cast
|
|
9
9
|
|
|
10
10
|
from .._base_client import RequestOptions
|
|
11
11
|
from .._qs import encode_path_segment
|
|
12
12
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
13
13
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..types import (
|
|
17
|
+
PairingCode,
|
|
18
|
+
PairingSession,
|
|
19
|
+
ServerInfo,
|
|
20
|
+
)
|
|
19
21
|
|
|
20
22
|
__all__ = ["ServerResource", "AsyncServerResource"]
|
|
21
23
|
|
|
@@ -52,7 +54,7 @@ class ServerResource(SyncAPIResource):
|
|
|
52
54
|
extra_body=extra_body,
|
|
53
55
|
timeout=timeout,
|
|
54
56
|
),
|
|
55
|
-
response_type=ServerInfo,
|
|
57
|
+
response_type="ServerInfo",
|
|
56
58
|
),
|
|
57
59
|
)
|
|
58
60
|
|
|
@@ -85,7 +87,7 @@ class ServerResource(SyncAPIResource):
|
|
|
85
87
|
extra_body=extra_body,
|
|
86
88
|
timeout=timeout,
|
|
87
89
|
),
|
|
88
|
-
response_type=PairingCode,
|
|
90
|
+
response_type="PairingCode",
|
|
89
91
|
),
|
|
90
92
|
)
|
|
91
93
|
|
|
@@ -119,7 +121,7 @@ class ServerResource(SyncAPIResource):
|
|
|
119
121
|
extra_body=extra_body,
|
|
120
122
|
timeout=timeout,
|
|
121
123
|
),
|
|
122
|
-
response_type=PairingSession,
|
|
124
|
+
response_type="PairingSession",
|
|
123
125
|
),
|
|
124
126
|
)
|
|
125
127
|
|
|
@@ -156,7 +158,7 @@ class AsyncServerResource(AsyncAPIResource):
|
|
|
156
158
|
extra_body=extra_body,
|
|
157
159
|
timeout=timeout,
|
|
158
160
|
),
|
|
159
|
-
response_type=ServerInfo,
|
|
161
|
+
response_type="ServerInfo",
|
|
160
162
|
),
|
|
161
163
|
)
|
|
162
164
|
|
|
@@ -189,7 +191,7 @@ class AsyncServerResource(AsyncAPIResource):
|
|
|
189
191
|
extra_body=extra_body,
|
|
190
192
|
timeout=timeout,
|
|
191
193
|
),
|
|
192
|
-
response_type=PairingCode,
|
|
194
|
+
response_type="PairingCode",
|
|
193
195
|
),
|
|
194
196
|
)
|
|
195
197
|
|
|
@@ -223,6 +225,6 @@ class AsyncServerResource(AsyncAPIResource):
|
|
|
223
225
|
extra_body=extra_body,
|
|
224
226
|
timeout=timeout,
|
|
225
227
|
),
|
|
226
|
-
response_type=PairingSession,
|
|
228
|
+
response_type="PairingSession",
|
|
227
229
|
),
|
|
228
230
|
)
|