opencode-python-sdk 0.1.2__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 +62 -1
- opencode/_base_client.py +24 -3
- opencode/_client.py +90 -2
- opencode/_events.py +732 -0
- opencode/_rpc.py +489 -0
- opencode/_streaming.py +22 -1
- 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.2.dist-info → opencode_python_sdk-0.2.0.dist-info}/METADATA +126 -1
- opencode_python_sdk-0.2.0.dist-info/RECORD +62 -0
- opencode_python_sdk-0.1.2.dist-info/RECORD +0 -56
- {opencode_python_sdk-0.1.2.dist-info → opencode_python_sdk-0.2.0.dist-info}/WHEEL +0 -0
- {opencode_python_sdk-0.1.2.dist-info → opencode_python_sdk-0.2.0.dist-info}/licenses/LICENSE +0 -0
opencode/resources/session.py
CHANGED
|
@@ -8,7 +8,7 @@ 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, Literal, cast
|
|
11
|
+
from typing import TYPE_CHECKING, Any, Literal, cast
|
|
12
12
|
|
|
13
13
|
from .._base_client import RequestOptions
|
|
14
14
|
from .._pagination import AsyncPaginator, SyncCursorPage
|
|
@@ -16,47 +16,49 @@ from .._qs import encode_path_segment
|
|
|
16
16
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
17
17
|
from .._streaming import AsyncStream, Stream
|
|
18
18
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, OpenEnum, Query, Timeout
|
|
19
|
-
from ..
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
19
|
+
from ..lib._session import AsyncSessionHelpers, SessionHelpers
|
|
20
|
+
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
from ..types import (
|
|
23
|
+
AbsolutePath,
|
|
24
|
+
AgentID,
|
|
25
|
+
EventSeq,
|
|
26
|
+
FileDiffInfo,
|
|
27
|
+
FormAnswer,
|
|
28
|
+
FormDetail,
|
|
29
|
+
FormFields,
|
|
30
|
+
FormID,
|
|
31
|
+
FormInfo,
|
|
32
|
+
FormMetadata,
|
|
33
|
+
InstructionEntryInfo,
|
|
34
|
+
InstructionEntryKey,
|
|
35
|
+
LocationPublicRef,
|
|
36
|
+
ModelRef,
|
|
37
|
+
PermissionRuleset,
|
|
38
|
+
ProjectID,
|
|
39
|
+
PromptAgentAttachment,
|
|
40
|
+
PromptInputFileAttachment,
|
|
41
|
+
PromptInputSkillAttachment,
|
|
42
|
+
RelativePath,
|
|
43
|
+
SessionGenerateResponseData,
|
|
44
|
+
SessionID,
|
|
45
|
+
SessionInboxCompaction,
|
|
46
|
+
SessionInboxDelivery,
|
|
47
|
+
SessionInboxInfo,
|
|
48
|
+
SessionInboxSynthetic,
|
|
49
|
+
SessionInboxUser,
|
|
50
|
+
SessionInfo,
|
|
51
|
+
SessionInterruptResponse,
|
|
52
|
+
SessionLogItem,
|
|
53
|
+
SessionMessageID,
|
|
54
|
+
SessionMessageInfo,
|
|
55
|
+
SessionMetadata,
|
|
56
|
+
SessionRevert,
|
|
57
|
+
SessionsCursor,
|
|
58
|
+
SessionStatsInfo,
|
|
59
|
+
SessionTransferData,
|
|
60
|
+
SkillID,
|
|
61
|
+
)
|
|
60
62
|
|
|
61
63
|
__all__ = ["SessionResource", "AsyncSessionResource"]
|
|
62
64
|
|
|
@@ -102,7 +104,7 @@ class SessionRevertResource(SyncAPIResource):
|
|
|
102
104
|
extra_body=extra_body,
|
|
103
105
|
timeout=timeout,
|
|
104
106
|
),
|
|
105
|
-
response_type=SessionRevert,
|
|
107
|
+
response_type="SessionRevert",
|
|
106
108
|
unwrap=True,
|
|
107
109
|
),
|
|
108
110
|
)
|
|
@@ -207,7 +209,7 @@ class SessionInboxResource(SyncAPIResource):
|
|
|
207
209
|
extra_body=extra_body,
|
|
208
210
|
timeout=timeout,
|
|
209
211
|
),
|
|
210
|
-
response_type=builtins.list[SessionInboxInfo],
|
|
212
|
+
response_type="builtins.list[SessionInboxInfo]",
|
|
211
213
|
unwrap=True,
|
|
212
214
|
),
|
|
213
215
|
)
|
|
@@ -319,7 +321,7 @@ class SessionInstructionsEntryResource(SyncAPIResource):
|
|
|
319
321
|
extra_body=extra_body,
|
|
320
322
|
timeout=timeout,
|
|
321
323
|
),
|
|
322
|
-
response_type=builtins.list[InstructionEntryInfo],
|
|
324
|
+
response_type="builtins.list[InstructionEntryInfo]",
|
|
323
325
|
unwrap=True,
|
|
324
326
|
),
|
|
325
327
|
)
|
|
@@ -445,7 +447,7 @@ class SessionMessageResource(SyncAPIResource):
|
|
|
445
447
|
extra_body=extra_body,
|
|
446
448
|
timeout=timeout,
|
|
447
449
|
),
|
|
448
|
-
response_type=SessionMessageInfo,
|
|
450
|
+
response_type="SessionMessageInfo",
|
|
449
451
|
unwrap=True,
|
|
450
452
|
),
|
|
451
453
|
)
|
|
@@ -486,7 +488,7 @@ class SessionFormResource(SyncAPIResource):
|
|
|
486
488
|
extra_body=extra_body,
|
|
487
489
|
timeout=timeout,
|
|
488
490
|
),
|
|
489
|
-
response_type=builtins.list[FormInfo],
|
|
491
|
+
response_type="builtins.list[FormInfo]",
|
|
490
492
|
unwrap=True,
|
|
491
493
|
),
|
|
492
494
|
)
|
|
@@ -529,7 +531,7 @@ class SessionFormResource(SyncAPIResource):
|
|
|
529
531
|
extra_body=extra_body,
|
|
530
532
|
timeout=timeout,
|
|
531
533
|
),
|
|
532
|
-
response_type=FormInfo,
|
|
534
|
+
response_type="FormInfo",
|
|
533
535
|
unwrap=True,
|
|
534
536
|
),
|
|
535
537
|
)
|
|
@@ -568,7 +570,7 @@ class SessionFormResource(SyncAPIResource):
|
|
|
568
570
|
extra_body=extra_body,
|
|
569
571
|
timeout=timeout,
|
|
570
572
|
),
|
|
571
|
-
response_type=FormDetail,
|
|
573
|
+
response_type="FormDetail",
|
|
572
574
|
unwrap=True,
|
|
573
575
|
),
|
|
574
576
|
)
|
|
@@ -651,7 +653,7 @@ class SessionFormResource(SyncAPIResource):
|
|
|
651
653
|
)
|
|
652
654
|
|
|
653
655
|
|
|
654
|
-
class SessionResource(
|
|
656
|
+
class SessionResource(SessionHelpers):
|
|
655
657
|
"""Operations under ``client.session`` (OpenCode ``session``)."""
|
|
656
658
|
|
|
657
659
|
@cached_property
|
|
@@ -733,7 +735,7 @@ class SessionResource(SyncAPIResource):
|
|
|
733
735
|
extra_body=extra_body,
|
|
734
736
|
timeout=timeout,
|
|
735
737
|
),
|
|
736
|
-
response_type=SessionsResponse,
|
|
738
|
+
response_type="SessionsResponse",
|
|
737
739
|
)
|
|
738
740
|
|
|
739
741
|
def stats(
|
|
@@ -773,7 +775,7 @@ class SessionResource(SyncAPIResource):
|
|
|
773
775
|
extra_body=extra_body,
|
|
774
776
|
timeout=timeout,
|
|
775
777
|
),
|
|
776
|
-
response_type=SessionStatsInfo,
|
|
778
|
+
response_type="SessionStatsInfo",
|
|
777
779
|
unwrap=True,
|
|
778
780
|
),
|
|
779
781
|
)
|
|
@@ -826,7 +828,7 @@ class SessionResource(SyncAPIResource):
|
|
|
826
828
|
extra_body=extra_body,
|
|
827
829
|
timeout=timeout,
|
|
828
830
|
),
|
|
829
|
-
response_type=SessionInfo,
|
|
831
|
+
response_type="SessionInfo",
|
|
830
832
|
unwrap=True,
|
|
831
833
|
),
|
|
832
834
|
)
|
|
@@ -868,7 +870,7 @@ class SessionResource(SyncAPIResource):
|
|
|
868
870
|
extra_body=extra_body,
|
|
869
871
|
timeout=timeout,
|
|
870
872
|
),
|
|
871
|
-
response_type=SessionInfo,
|
|
873
|
+
response_type="SessionInfo",
|
|
872
874
|
unwrap=True,
|
|
873
875
|
),
|
|
874
876
|
)
|
|
@@ -909,7 +911,7 @@ class SessionResource(SyncAPIResource):
|
|
|
909
911
|
extra_body=extra_body,
|
|
910
912
|
timeout=timeout,
|
|
911
913
|
),
|
|
912
|
-
response_type=SessionTransferData,
|
|
914
|
+
response_type="SessionTransferData",
|
|
913
915
|
unwrap=True,
|
|
914
916
|
),
|
|
915
917
|
)
|
|
@@ -943,7 +945,7 @@ class SessionResource(SyncAPIResource):
|
|
|
943
945
|
extra_body=extra_body,
|
|
944
946
|
timeout=timeout,
|
|
945
947
|
),
|
|
946
|
-
response_type=builtins.dict[str, Any],
|
|
948
|
+
response_type="builtins.dict[str, Any]",
|
|
947
949
|
unwrap=True,
|
|
948
950
|
),
|
|
949
951
|
)
|
|
@@ -979,7 +981,7 @@ class SessionResource(SyncAPIResource):
|
|
|
979
981
|
extra_body=extra_body,
|
|
980
982
|
timeout=timeout,
|
|
981
983
|
),
|
|
982
|
-
response_type=SessionInfo,
|
|
984
|
+
response_type="SessionInfo",
|
|
983
985
|
unwrap=True,
|
|
984
986
|
),
|
|
985
987
|
)
|
|
@@ -1051,7 +1053,7 @@ class SessionResource(SyncAPIResource):
|
|
|
1051
1053
|
extra_body=extra_body,
|
|
1052
1054
|
timeout=timeout,
|
|
1053
1055
|
),
|
|
1054
|
-
response_type=SessionInfo,
|
|
1056
|
+
response_type="SessionInfo",
|
|
1055
1057
|
unwrap=True,
|
|
1056
1058
|
),
|
|
1057
1059
|
)
|
|
@@ -1253,7 +1255,7 @@ class SessionResource(SyncAPIResource):
|
|
|
1253
1255
|
extra_body=extra_body,
|
|
1254
1256
|
timeout=timeout,
|
|
1255
1257
|
),
|
|
1256
|
-
response_type=SessionInboxUser,
|
|
1258
|
+
response_type="SessionInboxUser",
|
|
1257
1259
|
unwrap=True,
|
|
1258
1260
|
),
|
|
1259
1261
|
)
|
|
@@ -1393,7 +1395,7 @@ class SessionResource(SyncAPIResource):
|
|
|
1393
1395
|
extra_body=extra_body,
|
|
1394
1396
|
timeout=timeout,
|
|
1395
1397
|
),
|
|
1396
|
-
response_type=SessionInboxSynthetic,
|
|
1398
|
+
response_type="SessionInboxSynthetic",
|
|
1397
1399
|
unwrap=True,
|
|
1398
1400
|
),
|
|
1399
1401
|
)
|
|
@@ -1470,7 +1472,7 @@ class SessionResource(SyncAPIResource):
|
|
|
1470
1472
|
extra_body=extra_body,
|
|
1471
1473
|
timeout=timeout,
|
|
1472
1474
|
),
|
|
1473
|
-
response_type=SessionInboxCompaction,
|
|
1475
|
+
response_type="SessionInboxCompaction",
|
|
1474
1476
|
unwrap=True,
|
|
1475
1477
|
),
|
|
1476
1478
|
)
|
|
@@ -1543,7 +1545,7 @@ class SessionResource(SyncAPIResource):
|
|
|
1543
1545
|
extra_body=extra_body,
|
|
1544
1546
|
timeout=timeout,
|
|
1545
1547
|
),
|
|
1546
|
-
response_type=builtins.list[SessionMessageInfo],
|
|
1548
|
+
response_type="builtins.list[SessionMessageInfo]",
|
|
1547
1549
|
unwrap=True,
|
|
1548
1550
|
),
|
|
1549
1551
|
)
|
|
@@ -1591,7 +1593,7 @@ class SessionResource(SyncAPIResource):
|
|
|
1591
1593
|
extra_body=extra_body,
|
|
1592
1594
|
timeout=timeout,
|
|
1593
1595
|
),
|
|
1594
|
-
response_type=builtins.list[FileDiffInfo],
|
|
1596
|
+
response_type="builtins.list[FileDiffInfo]",
|
|
1595
1597
|
unwrap=True,
|
|
1596
1598
|
),
|
|
1597
1599
|
)
|
|
@@ -1631,7 +1633,7 @@ class SessionResource(SyncAPIResource):
|
|
|
1631
1633
|
extra_body=extra_body,
|
|
1632
1634
|
timeout=timeout,
|
|
1633
1635
|
),
|
|
1634
|
-
response_type=SessionGenerateResponseData,
|
|
1636
|
+
response_type="SessionGenerateResponseData",
|
|
1635
1637
|
unwrap=True,
|
|
1636
1638
|
),
|
|
1637
1639
|
)
|
|
@@ -1670,7 +1672,7 @@ class SessionResource(SyncAPIResource):
|
|
|
1670
1672
|
extra_body=extra_body,
|
|
1671
1673
|
timeout=timeout,
|
|
1672
1674
|
),
|
|
1673
|
-
item_type=SessionLogItem,
|
|
1675
|
+
item_type="SessionLogItem",
|
|
1674
1676
|
)
|
|
1675
1677
|
|
|
1676
1678
|
def interrupt(
|
|
@@ -1707,7 +1709,7 @@ class SessionResource(SyncAPIResource):
|
|
|
1707
1709
|
extra_body=extra_body,
|
|
1708
1710
|
timeout=timeout,
|
|
1709
1711
|
),
|
|
1710
|
-
response_type=SessionInterruptResponse,
|
|
1712
|
+
response_type="SessionInterruptResponse",
|
|
1711
1713
|
),
|
|
1712
1714
|
)
|
|
1713
1715
|
|
|
@@ -1854,7 +1856,7 @@ class AsyncSessionRevertResource(AsyncAPIResource):
|
|
|
1854
1856
|
extra_body=extra_body,
|
|
1855
1857
|
timeout=timeout,
|
|
1856
1858
|
),
|
|
1857
|
-
response_type=SessionRevert,
|
|
1859
|
+
response_type="SessionRevert",
|
|
1858
1860
|
unwrap=True,
|
|
1859
1861
|
),
|
|
1860
1862
|
)
|
|
@@ -1959,7 +1961,7 @@ class AsyncSessionInboxResource(AsyncAPIResource):
|
|
|
1959
1961
|
extra_body=extra_body,
|
|
1960
1962
|
timeout=timeout,
|
|
1961
1963
|
),
|
|
1962
|
-
response_type=builtins.list[SessionInboxInfo],
|
|
1964
|
+
response_type="builtins.list[SessionInboxInfo]",
|
|
1963
1965
|
unwrap=True,
|
|
1964
1966
|
),
|
|
1965
1967
|
)
|
|
@@ -2071,7 +2073,7 @@ class AsyncSessionInstructionsEntryResource(AsyncAPIResource):
|
|
|
2071
2073
|
extra_body=extra_body,
|
|
2072
2074
|
timeout=timeout,
|
|
2073
2075
|
),
|
|
2074
|
-
response_type=builtins.list[InstructionEntryInfo],
|
|
2076
|
+
response_type="builtins.list[InstructionEntryInfo]",
|
|
2075
2077
|
unwrap=True,
|
|
2076
2078
|
),
|
|
2077
2079
|
)
|
|
@@ -2197,7 +2199,7 @@ class AsyncSessionMessageResource(AsyncAPIResource):
|
|
|
2197
2199
|
extra_body=extra_body,
|
|
2198
2200
|
timeout=timeout,
|
|
2199
2201
|
),
|
|
2200
|
-
response_type=SessionMessageInfo,
|
|
2202
|
+
response_type="SessionMessageInfo",
|
|
2201
2203
|
unwrap=True,
|
|
2202
2204
|
),
|
|
2203
2205
|
)
|
|
@@ -2238,7 +2240,7 @@ class AsyncSessionFormResource(AsyncAPIResource):
|
|
|
2238
2240
|
extra_body=extra_body,
|
|
2239
2241
|
timeout=timeout,
|
|
2240
2242
|
),
|
|
2241
|
-
response_type=builtins.list[FormInfo],
|
|
2243
|
+
response_type="builtins.list[FormInfo]",
|
|
2242
2244
|
unwrap=True,
|
|
2243
2245
|
),
|
|
2244
2246
|
)
|
|
@@ -2281,7 +2283,7 @@ class AsyncSessionFormResource(AsyncAPIResource):
|
|
|
2281
2283
|
extra_body=extra_body,
|
|
2282
2284
|
timeout=timeout,
|
|
2283
2285
|
),
|
|
2284
|
-
response_type=FormInfo,
|
|
2286
|
+
response_type="FormInfo",
|
|
2285
2287
|
unwrap=True,
|
|
2286
2288
|
),
|
|
2287
2289
|
)
|
|
@@ -2320,7 +2322,7 @@ class AsyncSessionFormResource(AsyncAPIResource):
|
|
|
2320
2322
|
extra_body=extra_body,
|
|
2321
2323
|
timeout=timeout,
|
|
2322
2324
|
),
|
|
2323
|
-
response_type=FormDetail,
|
|
2325
|
+
response_type="FormDetail",
|
|
2324
2326
|
unwrap=True,
|
|
2325
2327
|
),
|
|
2326
2328
|
)
|
|
@@ -2403,7 +2405,7 @@ class AsyncSessionFormResource(AsyncAPIResource):
|
|
|
2403
2405
|
)
|
|
2404
2406
|
|
|
2405
2407
|
|
|
2406
|
-
class AsyncSessionResource(
|
|
2408
|
+
class AsyncSessionResource(AsyncSessionHelpers):
|
|
2407
2409
|
"""Operations under ``client.session`` (OpenCode ``session``)."""
|
|
2408
2410
|
|
|
2409
2411
|
@cached_property
|
|
@@ -2485,7 +2487,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
2485
2487
|
extra_body=extra_body,
|
|
2486
2488
|
timeout=timeout,
|
|
2487
2489
|
),
|
|
2488
|
-
response_type=SessionsResponse,
|
|
2490
|
+
response_type="SessionsResponse",
|
|
2489
2491
|
)
|
|
2490
2492
|
|
|
2491
2493
|
async def stats(
|
|
@@ -2525,7 +2527,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
2525
2527
|
extra_body=extra_body,
|
|
2526
2528
|
timeout=timeout,
|
|
2527
2529
|
),
|
|
2528
|
-
response_type=SessionStatsInfo,
|
|
2530
|
+
response_type="SessionStatsInfo",
|
|
2529
2531
|
unwrap=True,
|
|
2530
2532
|
),
|
|
2531
2533
|
)
|
|
@@ -2578,7 +2580,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
2578
2580
|
extra_body=extra_body,
|
|
2579
2581
|
timeout=timeout,
|
|
2580
2582
|
),
|
|
2581
|
-
response_type=SessionInfo,
|
|
2583
|
+
response_type="SessionInfo",
|
|
2582
2584
|
unwrap=True,
|
|
2583
2585
|
),
|
|
2584
2586
|
)
|
|
@@ -2620,7 +2622,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
2620
2622
|
extra_body=extra_body,
|
|
2621
2623
|
timeout=timeout,
|
|
2622
2624
|
),
|
|
2623
|
-
response_type=SessionInfo,
|
|
2625
|
+
response_type="SessionInfo",
|
|
2624
2626
|
unwrap=True,
|
|
2625
2627
|
),
|
|
2626
2628
|
)
|
|
@@ -2661,7 +2663,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
2661
2663
|
extra_body=extra_body,
|
|
2662
2664
|
timeout=timeout,
|
|
2663
2665
|
),
|
|
2664
|
-
response_type=SessionTransferData,
|
|
2666
|
+
response_type="SessionTransferData",
|
|
2665
2667
|
unwrap=True,
|
|
2666
2668
|
),
|
|
2667
2669
|
)
|
|
@@ -2695,7 +2697,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
2695
2697
|
extra_body=extra_body,
|
|
2696
2698
|
timeout=timeout,
|
|
2697
2699
|
),
|
|
2698
|
-
response_type=builtins.dict[str, Any],
|
|
2700
|
+
response_type="builtins.dict[str, Any]",
|
|
2699
2701
|
unwrap=True,
|
|
2700
2702
|
),
|
|
2701
2703
|
)
|
|
@@ -2731,7 +2733,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
2731
2733
|
extra_body=extra_body,
|
|
2732
2734
|
timeout=timeout,
|
|
2733
2735
|
),
|
|
2734
|
-
response_type=SessionInfo,
|
|
2736
|
+
response_type="SessionInfo",
|
|
2735
2737
|
unwrap=True,
|
|
2736
2738
|
),
|
|
2737
2739
|
)
|
|
@@ -2803,7 +2805,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
2803
2805
|
extra_body=extra_body,
|
|
2804
2806
|
timeout=timeout,
|
|
2805
2807
|
),
|
|
2806
|
-
response_type=SessionInfo,
|
|
2808
|
+
response_type="SessionInfo",
|
|
2807
2809
|
unwrap=True,
|
|
2808
2810
|
),
|
|
2809
2811
|
)
|
|
@@ -3005,7 +3007,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
3005
3007
|
extra_body=extra_body,
|
|
3006
3008
|
timeout=timeout,
|
|
3007
3009
|
),
|
|
3008
|
-
response_type=SessionInboxUser,
|
|
3010
|
+
response_type="SessionInboxUser",
|
|
3009
3011
|
unwrap=True,
|
|
3010
3012
|
),
|
|
3011
3013
|
)
|
|
@@ -3145,7 +3147,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
3145
3147
|
extra_body=extra_body,
|
|
3146
3148
|
timeout=timeout,
|
|
3147
3149
|
),
|
|
3148
|
-
response_type=SessionInboxSynthetic,
|
|
3150
|
+
response_type="SessionInboxSynthetic",
|
|
3149
3151
|
unwrap=True,
|
|
3150
3152
|
),
|
|
3151
3153
|
)
|
|
@@ -3222,7 +3224,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
3222
3224
|
extra_body=extra_body,
|
|
3223
3225
|
timeout=timeout,
|
|
3224
3226
|
),
|
|
3225
|
-
response_type=SessionInboxCompaction,
|
|
3227
|
+
response_type="SessionInboxCompaction",
|
|
3226
3228
|
unwrap=True,
|
|
3227
3229
|
),
|
|
3228
3230
|
)
|
|
@@ -3295,7 +3297,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
3295
3297
|
extra_body=extra_body,
|
|
3296
3298
|
timeout=timeout,
|
|
3297
3299
|
),
|
|
3298
|
-
response_type=builtins.list[SessionMessageInfo],
|
|
3300
|
+
response_type="builtins.list[SessionMessageInfo]",
|
|
3299
3301
|
unwrap=True,
|
|
3300
3302
|
),
|
|
3301
3303
|
)
|
|
@@ -3343,7 +3345,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
3343
3345
|
extra_body=extra_body,
|
|
3344
3346
|
timeout=timeout,
|
|
3345
3347
|
),
|
|
3346
|
-
response_type=builtins.list[FileDiffInfo],
|
|
3348
|
+
response_type="builtins.list[FileDiffInfo]",
|
|
3347
3349
|
unwrap=True,
|
|
3348
3350
|
),
|
|
3349
3351
|
)
|
|
@@ -3383,7 +3385,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
3383
3385
|
extra_body=extra_body,
|
|
3384
3386
|
timeout=timeout,
|
|
3385
3387
|
),
|
|
3386
|
-
response_type=SessionGenerateResponseData,
|
|
3388
|
+
response_type="SessionGenerateResponseData",
|
|
3387
3389
|
unwrap=True,
|
|
3388
3390
|
),
|
|
3389
3391
|
)
|
|
@@ -3422,7 +3424,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
3422
3424
|
extra_body=extra_body,
|
|
3423
3425
|
timeout=timeout,
|
|
3424
3426
|
),
|
|
3425
|
-
item_type=SessionLogItem,
|
|
3427
|
+
item_type="SessionLogItem",
|
|
3426
3428
|
)
|
|
3427
3429
|
|
|
3428
3430
|
async def interrupt(
|
|
@@ -3459,7 +3461,7 @@ class AsyncSessionResource(AsyncAPIResource):
|
|
|
3459
3461
|
extra_body=extra_body,
|
|
3460
3462
|
timeout=timeout,
|
|
3461
3463
|
),
|
|
3462
|
-
response_type=SessionInterruptResponse,
|
|
3464
|
+
response_type="SessionInterruptResponse",
|
|
3463
3465
|
),
|
|
3464
3466
|
)
|
|
3465
3467
|
|
opencode/resources/shell.py
CHANGED
|
@@ -6,20 +6,22 @@
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
from collections.abc import Mapping
|
|
9
|
-
from typing import Any, cast
|
|
9
|
+
from typing import TYPE_CHECKING, Any, 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
|
-
|
|
22
|
-
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ..types import (
|
|
18
|
+
Location,
|
|
19
|
+
ShellCreateResponse,
|
|
20
|
+
ShellGetResponse,
|
|
21
|
+
ShellID,
|
|
22
|
+
ShellListResponse,
|
|
23
|
+
ShellOutputResponse,
|
|
24
|
+
)
|
|
23
25
|
|
|
24
26
|
__all__ = ["ShellResource", "AsyncShellResource"]
|
|
25
27
|
|
|
@@ -59,7 +61,7 @@ class ShellResource(SyncAPIResource):
|
|
|
59
61
|
extra_body=extra_body,
|
|
60
62
|
timeout=timeout,
|
|
61
63
|
),
|
|
62
|
-
response_type=ShellListResponse,
|
|
64
|
+
response_type="ShellListResponse",
|
|
63
65
|
),
|
|
64
66
|
)
|
|
65
67
|
|
|
@@ -100,7 +102,7 @@ class ShellResource(SyncAPIResource):
|
|
|
100
102
|
extra_body=extra_body,
|
|
101
103
|
timeout=timeout,
|
|
102
104
|
),
|
|
103
|
-
response_type=ShellCreateResponse,
|
|
105
|
+
response_type="ShellCreateResponse",
|
|
104
106
|
),
|
|
105
107
|
)
|
|
106
108
|
|
|
@@ -138,7 +140,7 @@ class ShellResource(SyncAPIResource):
|
|
|
138
140
|
extra_body=extra_body,
|
|
139
141
|
timeout=timeout,
|
|
140
142
|
),
|
|
141
|
-
response_type=ShellGetResponse,
|
|
143
|
+
response_type="ShellGetResponse",
|
|
142
144
|
),
|
|
143
145
|
)
|
|
144
146
|
|
|
@@ -178,7 +180,7 @@ class ShellResource(SyncAPIResource):
|
|
|
178
180
|
extra_body=extra_body,
|
|
179
181
|
timeout=timeout,
|
|
180
182
|
),
|
|
181
|
-
response_type=ShellOutputResponse,
|
|
183
|
+
response_type="ShellOutputResponse",
|
|
182
184
|
),
|
|
183
185
|
)
|
|
184
186
|
|
|
@@ -252,7 +254,7 @@ class AsyncShellResource(AsyncAPIResource):
|
|
|
252
254
|
extra_body=extra_body,
|
|
253
255
|
timeout=timeout,
|
|
254
256
|
),
|
|
255
|
-
response_type=ShellListResponse,
|
|
257
|
+
response_type="ShellListResponse",
|
|
256
258
|
),
|
|
257
259
|
)
|
|
258
260
|
|
|
@@ -293,7 +295,7 @@ class AsyncShellResource(AsyncAPIResource):
|
|
|
293
295
|
extra_body=extra_body,
|
|
294
296
|
timeout=timeout,
|
|
295
297
|
),
|
|
296
|
-
response_type=ShellCreateResponse,
|
|
298
|
+
response_type="ShellCreateResponse",
|
|
297
299
|
),
|
|
298
300
|
)
|
|
299
301
|
|
|
@@ -331,7 +333,7 @@ class AsyncShellResource(AsyncAPIResource):
|
|
|
331
333
|
extra_body=extra_body,
|
|
332
334
|
timeout=timeout,
|
|
333
335
|
),
|
|
334
|
-
response_type=ShellGetResponse,
|
|
336
|
+
response_type="ShellGetResponse",
|
|
335
337
|
),
|
|
336
338
|
)
|
|
337
339
|
|
|
@@ -371,7 +373,7 @@ class AsyncShellResource(AsyncAPIResource):
|
|
|
371
373
|
extra_body=extra_body,
|
|
372
374
|
timeout=timeout,
|
|
373
375
|
),
|
|
374
|
-
response_type=ShellOutputResponse,
|
|
376
|
+
response_type="ShellOutputResponse",
|
|
375
377
|
),
|
|
376
378
|
)
|
|
377
379
|
|
opencode/resources/skill.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
|
+
SkillListResponse,
|
|
18
|
+
)
|
|
17
19
|
|
|
18
20
|
__all__ = ["SkillResource", "AsyncSkillResource"]
|
|
19
21
|
|
|
@@ -53,7 +55,7 @@ class SkillResource(SyncAPIResource):
|
|
|
53
55
|
extra_body=extra_body,
|
|
54
56
|
timeout=timeout,
|
|
55
57
|
),
|
|
56
|
-
response_type=SkillListResponse,
|
|
58
|
+
response_type="SkillListResponse",
|
|
57
59
|
),
|
|
58
60
|
)
|
|
59
61
|
|
|
@@ -93,6 +95,6 @@ class AsyncSkillResource(AsyncAPIResource):
|
|
|
93
95
|
extra_body=extra_body,
|
|
94
96
|
timeout=timeout,
|
|
95
97
|
),
|
|
96
|
-
response_type=SkillListResponse,
|
|
98
|
+
response_type="SkillListResponse",
|
|
97
99
|
),
|
|
98
100
|
)
|