opencode-python-sdk 0.1.3__py3-none-any.whl → 0.2.0__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 +14 -1
- opencode/_base_client.py +24 -3
- opencode/_client.py +67 -2
- opencode/_events.py +5 -2
- opencode/_rpc.py +9 -2
- 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/testing.py +508 -0
- {opencode_python_sdk-0.1.3.dist-info → opencode_python_sdk-0.2.0.dist-info}/METADATA +50 -1
- opencode_python_sdk-0.2.0.dist-info/RECORD +62 -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.0.dist-info}/WHEEL +0 -0
- {opencode_python_sdk-0.1.3.dist-info → opencode_python_sdk-0.2.0.dist-info}/licenses/LICENSE +0 -0
opencode/resources/agent.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
|
+
AgentGetResponse,
|
|
18
|
+
AgentID,
|
|
19
|
+
AgentListResponse,
|
|
20
|
+
Location,
|
|
21
|
+
)
|
|
20
22
|
|
|
21
23
|
__all__ = ["AgentResource", "AsyncAgentResource"]
|
|
22
24
|
|
|
@@ -56,7 +58,7 @@ class AgentResource(SyncAPIResource):
|
|
|
56
58
|
extra_body=extra_body,
|
|
57
59
|
timeout=timeout,
|
|
58
60
|
),
|
|
59
|
-
response_type=AgentListResponse,
|
|
61
|
+
response_type="AgentListResponse",
|
|
60
62
|
),
|
|
61
63
|
)
|
|
62
64
|
|
|
@@ -94,7 +96,7 @@ class AgentResource(SyncAPIResource):
|
|
|
94
96
|
extra_body=extra_body,
|
|
95
97
|
timeout=timeout,
|
|
96
98
|
),
|
|
97
|
-
response_type=AgentGetResponse,
|
|
99
|
+
response_type="AgentGetResponse",
|
|
98
100
|
),
|
|
99
101
|
)
|
|
100
102
|
|
|
@@ -134,7 +136,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
134
136
|
extra_body=extra_body,
|
|
135
137
|
timeout=timeout,
|
|
136
138
|
),
|
|
137
|
-
response_type=AgentListResponse,
|
|
139
|
+
response_type="AgentListResponse",
|
|
138
140
|
),
|
|
139
141
|
)
|
|
140
142
|
|
|
@@ -172,6 +174,6 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
172
174
|
extra_body=extra_body,
|
|
173
175
|
timeout=timeout,
|
|
174
176
|
),
|
|
175
|
-
response_type=AgentGetResponse,
|
|
177
|
+
response_type="AgentGetResponse",
|
|
176
178
|
),
|
|
177
179
|
)
|
opencode/resources/command.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
|
+
CommandListResponse,
|
|
17
|
+
Location,
|
|
18
|
+
)
|
|
17
19
|
|
|
18
20
|
__all__ = ["CommandResource", "AsyncCommandResource"]
|
|
19
21
|
|
|
@@ -53,7 +55,7 @@ class CommandResource(SyncAPIResource):
|
|
|
53
55
|
extra_body=extra_body,
|
|
54
56
|
timeout=timeout,
|
|
55
57
|
),
|
|
56
|
-
response_type=CommandListResponse,
|
|
58
|
+
response_type="CommandListResponse",
|
|
57
59
|
),
|
|
58
60
|
)
|
|
59
61
|
|
|
@@ -93,6 +95,6 @@ class AsyncCommandResource(AsyncAPIResource):
|
|
|
93
95
|
extra_body=extra_body,
|
|
94
96
|
timeout=timeout,
|
|
95
97
|
),
|
|
96
|
-
response_type=CommandListResponse,
|
|
98
|
+
response_type="CommandListResponse",
|
|
97
99
|
),
|
|
98
100
|
)
|
opencode/resources/config.py
CHANGED
|
@@ -6,16 +6,18 @@
|
|
|
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 .._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
|
+
ConfigEntry,
|
|
18
|
+
ConfigShellOption,
|
|
19
|
+
Location,
|
|
20
|
+
)
|
|
19
21
|
|
|
20
22
|
__all__ = ["ConfigResource", "AsyncConfigResource"]
|
|
21
23
|
|
|
@@ -55,7 +57,7 @@ class ConfigResource(SyncAPIResource):
|
|
|
55
57
|
extra_body=extra_body,
|
|
56
58
|
timeout=timeout,
|
|
57
59
|
),
|
|
58
|
-
response_type=builtins.list[ConfigEntry],
|
|
60
|
+
response_type="builtins.list[ConfigEntry]",
|
|
59
61
|
),
|
|
60
62
|
)
|
|
61
63
|
|
|
@@ -89,7 +91,7 @@ class ConfigResource(SyncAPIResource):
|
|
|
89
91
|
extra_body=extra_body,
|
|
90
92
|
timeout=timeout,
|
|
91
93
|
),
|
|
92
|
-
response_type=builtins.list[ConfigShellOption],
|
|
94
|
+
response_type="builtins.list[ConfigShellOption]",
|
|
93
95
|
),
|
|
94
96
|
)
|
|
95
97
|
|
|
@@ -164,7 +166,7 @@ class AsyncConfigResource(AsyncAPIResource):
|
|
|
164
166
|
extra_body=extra_body,
|
|
165
167
|
timeout=timeout,
|
|
166
168
|
),
|
|
167
|
-
response_type=builtins.list[ConfigEntry],
|
|
169
|
+
response_type="builtins.list[ConfigEntry]",
|
|
168
170
|
),
|
|
169
171
|
)
|
|
170
172
|
|
|
@@ -198,7 +200,7 @@ class AsyncConfigResource(AsyncAPIResource):
|
|
|
198
200
|
extra_body=extra_body,
|
|
199
201
|
timeout=timeout,
|
|
200
202
|
),
|
|
201
|
-
response_type=builtins.list[ConfigShellOption],
|
|
203
|
+
response_type="builtins.list[ConfigShellOption]",
|
|
202
204
|
),
|
|
203
205
|
)
|
|
204
206
|
|
opencode/resources/credential.py
CHANGED
|
@@ -6,18 +6,20 @@
|
|
|
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
|
-
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ..types import (
|
|
18
|
+
CredentialEntry,
|
|
19
|
+
CredentialID,
|
|
20
|
+
CredentialValue,
|
|
21
|
+
IntegrationID,
|
|
22
|
+
)
|
|
21
23
|
|
|
22
24
|
__all__ = ["CredentialResource", "AsyncCredentialResource"]
|
|
23
25
|
|
|
@@ -54,7 +56,7 @@ class CredentialResource(SyncAPIResource):
|
|
|
54
56
|
extra_body=extra_body,
|
|
55
57
|
timeout=timeout,
|
|
56
58
|
),
|
|
57
|
-
response_type=builtins.list[CredentialEntry],
|
|
59
|
+
response_type="builtins.list[CredentialEntry]",
|
|
58
60
|
unwrap=True,
|
|
59
61
|
),
|
|
60
62
|
)
|
|
@@ -101,7 +103,7 @@ class CredentialResource(SyncAPIResource):
|
|
|
101
103
|
extra_body=extra_body,
|
|
102
104
|
timeout=timeout,
|
|
103
105
|
),
|
|
104
|
-
response_type=CredentialEntry,
|
|
106
|
+
response_type="CredentialEntry",
|
|
105
107
|
unwrap=True,
|
|
106
108
|
),
|
|
107
109
|
)
|
|
@@ -234,7 +236,7 @@ class AsyncCredentialResource(AsyncAPIResource):
|
|
|
234
236
|
extra_body=extra_body,
|
|
235
237
|
timeout=timeout,
|
|
236
238
|
),
|
|
237
|
-
response_type=builtins.list[CredentialEntry],
|
|
239
|
+
response_type="builtins.list[CredentialEntry]",
|
|
238
240
|
unwrap=True,
|
|
239
241
|
),
|
|
240
242
|
)
|
|
@@ -281,7 +283,7 @@ class AsyncCredentialResource(AsyncAPIResource):
|
|
|
281
283
|
extra_body=extra_body,
|
|
282
284
|
timeout=timeout,
|
|
283
285
|
),
|
|
284
|
-
response_type=CredentialEntry,
|
|
286
|
+
response_type="CredentialEntry",
|
|
285
287
|
unwrap=True,
|
|
286
288
|
),
|
|
287
289
|
)
|
opencode/resources/debug.py
CHANGED
|
@@ -7,15 +7,17 @@ from __future__ import annotations
|
|
|
7
7
|
|
|
8
8
|
import builtins
|
|
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 .._resource import AsyncAPIResource, SyncAPIResource
|
|
14
14
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ..types import (
|
|
18
|
+
Location,
|
|
19
|
+
LocationPublicRef,
|
|
20
|
+
)
|
|
19
21
|
|
|
20
22
|
__all__ = ["DebugResource", "AsyncDebugResource"]
|
|
21
23
|
|
|
@@ -52,7 +54,7 @@ class DebugLocationResource(SyncAPIResource):
|
|
|
52
54
|
extra_body=extra_body,
|
|
53
55
|
timeout=timeout,
|
|
54
56
|
),
|
|
55
|
-
response_type=builtins.list[LocationPublicRef],
|
|
57
|
+
response_type="builtins.list[LocationPublicRef]",
|
|
56
58
|
),
|
|
57
59
|
)
|
|
58
60
|
|
|
@@ -130,7 +132,7 @@ class AsyncDebugLocationResource(AsyncAPIResource):
|
|
|
130
132
|
extra_body=extra_body,
|
|
131
133
|
timeout=timeout,
|
|
132
134
|
),
|
|
133
|
-
response_type=builtins.list[LocationPublicRef],
|
|
135
|
+
response_type="builtins.list[LocationPublicRef]",
|
|
134
136
|
),
|
|
135
137
|
)
|
|
136
138
|
|
opencode/resources/event.py
CHANGED
|
@@ -5,13 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
+
from typing import TYPE_CHECKING
|
|
9
|
+
|
|
8
10
|
from .._base_client import RequestOptions
|
|
9
11
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
10
12
|
from .._streaming import AsyncStream, Stream
|
|
11
13
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..types import (
|
|
17
|
+
Event,
|
|
18
|
+
)
|
|
15
19
|
|
|
16
20
|
__all__ = ["EventResource", "AsyncEventResource"]
|
|
17
21
|
|
|
@@ -46,7 +50,7 @@ class EventResource(SyncAPIResource):
|
|
|
46
50
|
extra_body=extra_body,
|
|
47
51
|
timeout=timeout,
|
|
48
52
|
),
|
|
49
|
-
item_type=Event,
|
|
53
|
+
item_type="Event",
|
|
50
54
|
)
|
|
51
55
|
|
|
52
56
|
|
|
@@ -80,5 +84,5 @@ class AsyncEventResource(AsyncAPIResource):
|
|
|
80
84
|
extra_body=extra_body,
|
|
81
85
|
timeout=timeout,
|
|
82
86
|
),
|
|
83
|
-
item_type=Event,
|
|
87
|
+
item_type="Event",
|
|
84
88
|
)
|
|
@@ -8,25 +8,27 @@ 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 cast
|
|
11
|
+
from typing import TYPE_CHECKING, cast
|
|
12
12
|
|
|
13
13
|
from .._base_client import RequestOptions
|
|
14
14
|
from .._pty import AsyncPersistentPtyAttachMixin, PersistentPtyAttachMixin
|
|
15
15
|
from .._qs import encode_path_segment
|
|
16
16
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
17
17
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from ..types import (
|
|
21
|
+
ExperimentalPersistentPtyCreateSize,
|
|
22
|
+
ExperimentalPersistentPtyHandoffResponse,
|
|
23
|
+
ExperimentalPersistentPtyUpdateSize,
|
|
24
|
+
PersistentPtyInfo,
|
|
25
|
+
PersistentPtyReadLines,
|
|
26
|
+
PersistentPtyReadResult,
|
|
27
|
+
PersistentPtySnapshot,
|
|
28
|
+
PtyID,
|
|
29
|
+
PtyTicketConnectToken,
|
|
30
|
+
SessionID,
|
|
31
|
+
)
|
|
30
32
|
|
|
31
33
|
__all__ = ["ExperimentalResource", "AsyncExperimentalResource"]
|
|
32
34
|
|
|
@@ -69,7 +71,7 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
|
|
|
69
71
|
extra_body=extra_body,
|
|
70
72
|
timeout=timeout,
|
|
71
73
|
),
|
|
72
|
-
response_type=PersistentPtyReadResult | None,
|
|
74
|
+
response_type="PersistentPtyReadResult | None",
|
|
73
75
|
unwrap=True,
|
|
74
76
|
),
|
|
75
77
|
)
|
|
@@ -103,7 +105,7 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
|
|
|
103
105
|
extra_body=extra_body,
|
|
104
106
|
timeout=timeout,
|
|
105
107
|
),
|
|
106
|
-
response_type=builtins.list[PersistentPtyInfo],
|
|
108
|
+
response_type="builtins.list[PersistentPtyInfo]",
|
|
107
109
|
unwrap=True,
|
|
108
110
|
),
|
|
109
111
|
)
|
|
@@ -144,7 +146,7 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
|
|
|
144
146
|
extra_body=extra_body,
|
|
145
147
|
timeout=timeout,
|
|
146
148
|
),
|
|
147
|
-
response_type=PersistentPtyInfo,
|
|
149
|
+
response_type="PersistentPtyInfo",
|
|
148
150
|
unwrap=True,
|
|
149
151
|
),
|
|
150
152
|
)
|
|
@@ -206,7 +208,7 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
|
|
|
206
208
|
extra_body=extra_body,
|
|
207
209
|
timeout=timeout,
|
|
208
210
|
),
|
|
209
|
-
response_type=ExperimentalPersistentPtyHandoffResponse,
|
|
211
|
+
response_type="ExperimentalPersistentPtyHandoffResponse",
|
|
210
212
|
),
|
|
211
213
|
)
|
|
212
214
|
|
|
@@ -240,7 +242,7 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
|
|
|
240
242
|
extra_body=extra_body,
|
|
241
243
|
timeout=timeout,
|
|
242
244
|
),
|
|
243
|
-
response_type=PersistentPtyInfo,
|
|
245
|
+
response_type="PersistentPtyInfo",
|
|
244
246
|
unwrap=True,
|
|
245
247
|
),
|
|
246
248
|
)
|
|
@@ -278,7 +280,7 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
|
|
|
278
280
|
extra_body=extra_body,
|
|
279
281
|
timeout=timeout,
|
|
280
282
|
),
|
|
281
|
-
response_type=PersistentPtyInfo,
|
|
283
|
+
response_type="PersistentPtyInfo",
|
|
282
284
|
unwrap=True,
|
|
283
285
|
),
|
|
284
286
|
)
|
|
@@ -313,7 +315,7 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
|
|
|
313
315
|
extra_body=extra_body,
|
|
314
316
|
timeout=timeout,
|
|
315
317
|
),
|
|
316
|
-
response_type=PersistentPtySnapshot,
|
|
318
|
+
response_type="PersistentPtySnapshot",
|
|
317
319
|
unwrap=True,
|
|
318
320
|
),
|
|
319
321
|
)
|
|
@@ -382,7 +384,7 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
|
|
|
382
384
|
extra_body=extra_body,
|
|
383
385
|
timeout=timeout,
|
|
384
386
|
),
|
|
385
|
-
response_type=PtyTicketConnectToken,
|
|
387
|
+
response_type="PtyTicketConnectToken",
|
|
386
388
|
unwrap=True,
|
|
387
389
|
),
|
|
388
390
|
)
|
|
@@ -435,7 +437,7 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
|
|
|
435
437
|
extra_body=extra_body,
|
|
436
438
|
timeout=timeout,
|
|
437
439
|
),
|
|
438
|
-
response_type=PersistentPtyReadResult | None,
|
|
440
|
+
response_type="PersistentPtyReadResult | None",
|
|
439
441
|
unwrap=True,
|
|
440
442
|
),
|
|
441
443
|
)
|
|
@@ -469,7 +471,7 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
|
|
|
469
471
|
extra_body=extra_body,
|
|
470
472
|
timeout=timeout,
|
|
471
473
|
),
|
|
472
|
-
response_type=builtins.list[PersistentPtyInfo],
|
|
474
|
+
response_type="builtins.list[PersistentPtyInfo]",
|
|
473
475
|
unwrap=True,
|
|
474
476
|
),
|
|
475
477
|
)
|
|
@@ -510,7 +512,7 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
|
|
|
510
512
|
extra_body=extra_body,
|
|
511
513
|
timeout=timeout,
|
|
512
514
|
),
|
|
513
|
-
response_type=PersistentPtyInfo,
|
|
515
|
+
response_type="PersistentPtyInfo",
|
|
514
516
|
unwrap=True,
|
|
515
517
|
),
|
|
516
518
|
)
|
|
@@ -572,7 +574,7 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
|
|
|
572
574
|
extra_body=extra_body,
|
|
573
575
|
timeout=timeout,
|
|
574
576
|
),
|
|
575
|
-
response_type=ExperimentalPersistentPtyHandoffResponse,
|
|
577
|
+
response_type="ExperimentalPersistentPtyHandoffResponse",
|
|
576
578
|
),
|
|
577
579
|
)
|
|
578
580
|
|
|
@@ -606,7 +608,7 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
|
|
|
606
608
|
extra_body=extra_body,
|
|
607
609
|
timeout=timeout,
|
|
608
610
|
),
|
|
609
|
-
response_type=PersistentPtyInfo,
|
|
611
|
+
response_type="PersistentPtyInfo",
|
|
610
612
|
unwrap=True,
|
|
611
613
|
),
|
|
612
614
|
)
|
|
@@ -644,7 +646,7 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
|
|
|
644
646
|
extra_body=extra_body,
|
|
645
647
|
timeout=timeout,
|
|
646
648
|
),
|
|
647
|
-
response_type=PersistentPtyInfo,
|
|
649
|
+
response_type="PersistentPtyInfo",
|
|
648
650
|
unwrap=True,
|
|
649
651
|
),
|
|
650
652
|
)
|
|
@@ -679,7 +681,7 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
|
|
|
679
681
|
extra_body=extra_body,
|
|
680
682
|
timeout=timeout,
|
|
681
683
|
),
|
|
682
|
-
response_type=PersistentPtySnapshot,
|
|
684
|
+
response_type="PersistentPtySnapshot",
|
|
683
685
|
unwrap=True,
|
|
684
686
|
),
|
|
685
687
|
)
|
|
@@ -748,7 +750,7 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
|
|
|
748
750
|
extra_body=extra_body,
|
|
749
751
|
timeout=timeout,
|
|
750
752
|
),
|
|
751
|
-
response_type=PtyTicketConnectToken,
|
|
753
|
+
response_type="PtyTicketConnectToken",
|
|
752
754
|
unwrap=True,
|
|
753
755
|
),
|
|
754
756
|
)
|
opencode/resources/file.py
CHANGED
|
@@ -5,18 +5,20 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import Literal, cast
|
|
8
|
+
from typing import TYPE_CHECKING, Literal, cast
|
|
9
9
|
|
|
10
10
|
from .._base_client import RequestOptions
|
|
11
11
|
from .._qs import encode_path
|
|
12
12
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
13
13
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, OpenEnum, Query, Timeout
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..types import (
|
|
17
|
+
FileFindResponse,
|
|
18
|
+
FileListResponse,
|
|
19
|
+
FileWriteResponse,
|
|
20
|
+
Location,
|
|
21
|
+
)
|
|
20
22
|
|
|
21
23
|
__all__ = ["FileResource", "AsyncFileResource"]
|
|
22
24
|
|
|
@@ -99,7 +101,7 @@ class FileResource(SyncAPIResource):
|
|
|
99
101
|
extra_body=extra_body,
|
|
100
102
|
timeout=timeout,
|
|
101
103
|
),
|
|
102
|
-
response_type=FileListResponse,
|
|
104
|
+
response_type="FileListResponse",
|
|
103
105
|
),
|
|
104
106
|
)
|
|
105
107
|
|
|
@@ -138,7 +140,7 @@ class FileResource(SyncAPIResource):
|
|
|
138
140
|
extra_body=extra_body,
|
|
139
141
|
timeout=timeout,
|
|
140
142
|
),
|
|
141
|
-
response_type=FileFindResponse,
|
|
143
|
+
response_type="FileFindResponse",
|
|
142
144
|
),
|
|
143
145
|
)
|
|
144
146
|
|
|
@@ -182,7 +184,7 @@ class FileResource(SyncAPIResource):
|
|
|
182
184
|
extra_body=extra_body,
|
|
183
185
|
timeout=timeout,
|
|
184
186
|
),
|
|
185
|
-
response_type=FileWriteResponse,
|
|
187
|
+
response_type="FileWriteResponse",
|
|
186
188
|
),
|
|
187
189
|
)
|
|
188
190
|
|
|
@@ -265,7 +267,7 @@ class AsyncFileResource(AsyncAPIResource):
|
|
|
265
267
|
extra_body=extra_body,
|
|
266
268
|
timeout=timeout,
|
|
267
269
|
),
|
|
268
|
-
response_type=FileListResponse,
|
|
270
|
+
response_type="FileListResponse",
|
|
269
271
|
),
|
|
270
272
|
)
|
|
271
273
|
|
|
@@ -304,7 +306,7 @@ class AsyncFileResource(AsyncAPIResource):
|
|
|
304
306
|
extra_body=extra_body,
|
|
305
307
|
timeout=timeout,
|
|
306
308
|
),
|
|
307
|
-
response_type=FileFindResponse,
|
|
309
|
+
response_type="FileFindResponse",
|
|
308
310
|
),
|
|
309
311
|
)
|
|
310
312
|
|
|
@@ -348,6 +350,6 @@ class AsyncFileResource(AsyncAPIResource):
|
|
|
348
350
|
extra_body=extra_body,
|
|
349
351
|
timeout=timeout,
|
|
350
352
|
),
|
|
351
|
-
response_type=FileWriteResponse,
|
|
353
|
+
response_type="FileWriteResponse",
|
|
352
354
|
),
|
|
353
355
|
)
|
opencode/resources/form.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
|
+
FormListResponse,
|
|
17
|
+
Location,
|
|
18
|
+
)
|
|
17
19
|
|
|
18
20
|
__all__ = ["FormResource", "AsyncFormResource"]
|
|
19
21
|
|
|
@@ -53,7 +55,7 @@ class FormResource(SyncAPIResource):
|
|
|
53
55
|
extra_body=extra_body,
|
|
54
56
|
timeout=timeout,
|
|
55
57
|
),
|
|
56
|
-
response_type=FormListResponse,
|
|
58
|
+
response_type="FormListResponse",
|
|
57
59
|
),
|
|
58
60
|
)
|
|
59
61
|
|
|
@@ -93,6 +95,6 @@ class AsyncFormResource(AsyncAPIResource):
|
|
|
93
95
|
extra_body=extra_body,
|
|
94
96
|
timeout=timeout,
|
|
95
97
|
),
|
|
96
|
-
response_type=FormListResponse,
|
|
98
|
+
response_type="FormListResponse",
|
|
97
99
|
),
|
|
98
100
|
)
|
opencode/resources/generate.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
|
+
GenerateTextResponseData,
|
|
17
|
+
ModelRef,
|
|
18
|
+
)
|
|
17
19
|
|
|
18
20
|
__all__ = ["GenerateResource", "AsyncGenerateResource"]
|
|
19
21
|
|
|
@@ -57,7 +59,7 @@ class GenerateResource(SyncAPIResource):
|
|
|
57
59
|
extra_body=extra_body,
|
|
58
60
|
timeout=timeout,
|
|
59
61
|
),
|
|
60
|
-
response_type=GenerateTextResponseData,
|
|
62
|
+
response_type="GenerateTextResponseData",
|
|
61
63
|
unwrap=True,
|
|
62
64
|
),
|
|
63
65
|
)
|
|
@@ -102,7 +104,7 @@ class AsyncGenerateResource(AsyncAPIResource):
|
|
|
102
104
|
extra_body=extra_body,
|
|
103
105
|
timeout=timeout,
|
|
104
106
|
),
|
|
105
|
-
response_type=GenerateTextResponseData,
|
|
107
|
+
response_type="GenerateTextResponseData",
|
|
106
108
|
unwrap=True,
|
|
107
109
|
),
|
|
108
110
|
)
|