opencode-python-sdk 0.2.0__py3-none-any.whl → 0.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. opencode/__init__.py +14 -0
  2. opencode/_aiohttp.py +44 -0
  3. opencode/_base_client.py +237 -11
  4. opencode/_client.py +115 -3
  5. opencode/_logs.py +29 -0
  6. opencode/_pagination.py +14 -0
  7. opencode/_response.py +316 -0
  8. opencode/_service.py +1018 -0
  9. opencode/resources/agent.py +63 -0
  10. opencode/resources/command.py +59 -0
  11. opencode/resources/config.py +93 -20
  12. opencode/resources/credential.py +149 -56
  13. opencode/resources/debug.py +156 -20
  14. opencode/resources/event.py +59 -0
  15. opencode/resources/experimental.py +210 -36
  16. opencode/resources/file.py +71 -0
  17. opencode/resources/form.py +59 -0
  18. opencode/resources/generate.py +59 -0
  19. opencode/resources/integration.py +538 -128
  20. opencode/resources/location.py +87 -18
  21. opencode/resources/mcp.py +252 -82
  22. opencode/resources/message.py +59 -0
  23. opencode/resources/migration.py +126 -0
  24. opencode/resources/model.py +63 -0
  25. opencode/resources/permission.py +272 -38
  26. opencode/resources/plugin.py +95 -22
  27. opencode/resources/project.py +63 -0
  28. opencode/resources/provider.py +63 -0
  29. opencode/resources/pty.py +172 -20
  30. opencode/resources/reference.py +59 -0
  31. opencode/resources/rpc.py +59 -0
  32. opencode/resources/server.py +67 -0
  33. opencode/resources/session.py +1159 -405
  34. opencode/resources/shell.py +101 -20
  35. opencode/resources/skill.py +59 -0
  36. opencode/resources/vcs.py +172 -20
  37. opencode/resources/voice.py +59 -0
  38. opencode/resources/websearch.py +63 -0
  39. opencode/resources/worktree.py +123 -40
  40. opencode/service.py +50 -0
  41. {opencode_python_sdk-0.2.0.dist-info → opencode_python_sdk-0.2.3.dist-info}/METADATA +111 -2
  42. opencode_python_sdk-0.2.3.dist-info/RECORD +67 -0
  43. opencode_python_sdk-0.2.0.dist-info/RECORD +0 -62
  44. {opencode_python_sdk-0.2.0.dist-info → opencode_python_sdk-0.2.3.dist-info}/WHEEL +0 -0
  45. {opencode_python_sdk-0.2.0.dist-info → opencode_python_sdk-0.2.3.dist-info}/licenses/LICENSE +0 -0
@@ -11,6 +11,12 @@ from typing import TYPE_CHECKING, cast
11
11
 
12
12
  from .._base_client import RequestOptions
13
13
  from .._resource import AsyncAPIResource, SyncAPIResource
14
+ from .._response import (
15
+ async_to_raw_response_wrapper,
16
+ async_to_streamed_response_wrapper,
17
+ to_raw_response_wrapper,
18
+ to_streamed_response_wrapper,
19
+ )
14
20
  from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
15
21
 
16
22
  if TYPE_CHECKING:
@@ -25,6 +31,16 @@ __all__ = ["DebugResource", "AsyncDebugResource"]
25
31
  class DebugLocationResource(SyncAPIResource):
26
32
  """Operations under ``client.debug.location`` (OpenCode ``debug.location``)."""
27
33
 
34
+ @cached_property
35
+ def with_raw_response(self) -> DebugLocationResourceWithRawResponse:
36
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
37
+ return DebugLocationResourceWithRawResponse(self)
38
+
39
+ @cached_property
40
+ def with_streaming_response(self) -> DebugLocationResourceWithStreamingResponse:
41
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
42
+ return DebugLocationResourceWithStreamingResponse(self)
43
+
28
44
  def list(
29
45
  self,
30
46
  *,
@@ -77,20 +93,41 @@ class DebugLocationResource(SyncAPIResource):
77
93
 
78
94
  ``DELETE /api/debug/location``
79
95
  """
80
- self._client.request(
81
- RequestOptions(
82
- method="DELETE",
83
- path="/api/debug/location",
84
- query={"location": self._location(location)},
85
- extra_headers=extra_headers,
86
- extra_query=extra_query,
87
- extra_body=extra_body,
88
- timeout=timeout,
96
+ return cast(
97
+ "None",
98
+ self._client.request(
99
+ RequestOptions(
100
+ method="DELETE",
101
+ path="/api/debug/location",
102
+ query={"location": self._location(location)},
103
+ extra_headers=extra_headers,
104
+ extra_query=extra_query,
105
+ extra_body=extra_body,
106
+ timeout=timeout,
107
+ ),
108
+ kind="void",
89
109
  ),
90
- kind="void",
91
110
  )
92
111
 
93
112
 
113
+ class DebugLocationResourceWithRawResponse:
114
+ """``client.debug.location.with_raw_response``."""
115
+
116
+ def __init__(self, resource: DebugLocationResource) -> None:
117
+ self._resource = resource
118
+ self.list = to_raw_response_wrapper(resource.list)
119
+ self.evict = to_raw_response_wrapper(resource.evict)
120
+
121
+
122
+ class DebugLocationResourceWithStreamingResponse:
123
+ """``client.debug.location.with_streaming_response``."""
124
+
125
+ def __init__(self, resource: DebugLocationResource) -> None:
126
+ self._resource = resource
127
+ self.list = to_streamed_response_wrapper(resource.list)
128
+ self.evict = to_streamed_response_wrapper(resource.evict)
129
+
130
+
94
131
  class DebugResource(SyncAPIResource):
95
132
  """Operations under ``client.debug`` (OpenCode ``debug``)."""
96
133
 
@@ -99,10 +136,54 @@ class DebugResource(SyncAPIResource):
99
136
  """Operations under ``client.debug.location``."""
100
137
  return DebugLocationResource(self._client)
101
138
 
139
+ @cached_property
140
+ def with_raw_response(self) -> DebugResourceWithRawResponse:
141
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
142
+ return DebugResourceWithRawResponse(self)
143
+
144
+ @cached_property
145
+ def with_streaming_response(self) -> DebugResourceWithStreamingResponse:
146
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
147
+ return DebugResourceWithStreamingResponse(self)
148
+
149
+
150
+ class DebugResourceWithRawResponse:
151
+ """``client.debug.with_raw_response``."""
152
+
153
+ def __init__(self, resource: DebugResource) -> None:
154
+ self._resource = resource
155
+
156
+ @cached_property
157
+ def location(self) -> DebugLocationResourceWithRawResponse:
158
+ """``client.debug.location.with_raw_response``."""
159
+ return DebugLocationResourceWithRawResponse(self._resource.location)
160
+
161
+
162
+ class DebugResourceWithStreamingResponse:
163
+ """``client.debug.with_streaming_response``."""
164
+
165
+ def __init__(self, resource: DebugResource) -> None:
166
+ self._resource = resource
167
+
168
+ @cached_property
169
+ def location(self) -> DebugLocationResourceWithStreamingResponse:
170
+ """``client.debug.location.with_streaming_response``."""
171
+ return DebugLocationResourceWithStreamingResponse(self._resource.location)
172
+
102
173
 
103
174
  class AsyncDebugLocationResource(AsyncAPIResource):
104
175
  """Operations under ``client.debug.location`` (OpenCode ``debug.location``)."""
105
176
 
177
+ @cached_property
178
+ def with_raw_response(self) -> AsyncDebugLocationResourceWithRawResponse:
179
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
180
+ return AsyncDebugLocationResourceWithRawResponse(self)
181
+
182
+ @cached_property
183
+ def with_streaming_response(self) -> AsyncDebugLocationResourceWithStreamingResponse:
184
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
185
+ return AsyncDebugLocationResourceWithStreamingResponse(self)
186
+
106
187
  async def list(
107
188
  self,
108
189
  *,
@@ -155,20 +236,41 @@ class AsyncDebugLocationResource(AsyncAPIResource):
155
236
 
156
237
  ``DELETE /api/debug/location``
157
238
  """
158
- await self._client.request(
159
- RequestOptions(
160
- method="DELETE",
161
- path="/api/debug/location",
162
- query={"location": self._location(location)},
163
- extra_headers=extra_headers,
164
- extra_query=extra_query,
165
- extra_body=extra_body,
166
- timeout=timeout,
239
+ return cast(
240
+ "None",
241
+ await self._client.request(
242
+ RequestOptions(
243
+ method="DELETE",
244
+ path="/api/debug/location",
245
+ query={"location": self._location(location)},
246
+ extra_headers=extra_headers,
247
+ extra_query=extra_query,
248
+ extra_body=extra_body,
249
+ timeout=timeout,
250
+ ),
251
+ kind="void",
167
252
  ),
168
- kind="void",
169
253
  )
170
254
 
171
255
 
256
+ class AsyncDebugLocationResourceWithRawResponse:
257
+ """``client.debug.location.with_raw_response``."""
258
+
259
+ def __init__(self, resource: AsyncDebugLocationResource) -> None:
260
+ self._resource = resource
261
+ self.list = async_to_raw_response_wrapper(resource.list)
262
+ self.evict = async_to_raw_response_wrapper(resource.evict)
263
+
264
+
265
+ class AsyncDebugLocationResourceWithStreamingResponse:
266
+ """``client.debug.location.with_streaming_response``."""
267
+
268
+ def __init__(self, resource: AsyncDebugLocationResource) -> None:
269
+ self._resource = resource
270
+ self.list = async_to_streamed_response_wrapper(resource.list)
271
+ self.evict = async_to_streamed_response_wrapper(resource.evict)
272
+
273
+
172
274
  class AsyncDebugResource(AsyncAPIResource):
173
275
  """Operations under ``client.debug`` (OpenCode ``debug``)."""
174
276
 
@@ -176,3 +278,37 @@ class AsyncDebugResource(AsyncAPIResource):
176
278
  def location(self) -> AsyncDebugLocationResource:
177
279
  """Operations under ``client.debug.location``."""
178
280
  return AsyncDebugLocationResource(self._client)
281
+
282
+ @cached_property
283
+ def with_raw_response(self) -> AsyncDebugResourceWithRawResponse:
284
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
285
+ return AsyncDebugResourceWithRawResponse(self)
286
+
287
+ @cached_property
288
+ def with_streaming_response(self) -> AsyncDebugResourceWithStreamingResponse:
289
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
290
+ return AsyncDebugResourceWithStreamingResponse(self)
291
+
292
+
293
+ class AsyncDebugResourceWithRawResponse:
294
+ """``client.debug.with_raw_response``."""
295
+
296
+ def __init__(self, resource: AsyncDebugResource) -> None:
297
+ self._resource = resource
298
+
299
+ @cached_property
300
+ def location(self) -> AsyncDebugLocationResourceWithRawResponse:
301
+ """``client.debug.location.with_raw_response``."""
302
+ return AsyncDebugLocationResourceWithRawResponse(self._resource.location)
303
+
304
+
305
+ class AsyncDebugResourceWithStreamingResponse:
306
+ """``client.debug.with_streaming_response``."""
307
+
308
+ def __init__(self, resource: AsyncDebugResource) -> None:
309
+ self._resource = resource
310
+
311
+ @cached_property
312
+ def location(self) -> AsyncDebugLocationResourceWithStreamingResponse:
313
+ """``client.debug.location.with_streaming_response``."""
314
+ return AsyncDebugLocationResourceWithStreamingResponse(self._resource.location)
@@ -5,10 +5,17 @@
5
5
 
6
6
  from __future__ import annotations
7
7
 
8
+ from functools import cached_property
8
9
  from typing import TYPE_CHECKING
9
10
 
10
11
  from .._base_client import RequestOptions
11
12
  from .._resource import AsyncAPIResource, SyncAPIResource
13
+ from .._response import (
14
+ async_to_raw_response_wrapper,
15
+ async_to_streamed_response_wrapper,
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ )
12
19
  from .._streaming import AsyncStream, Stream
13
20
  from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
14
21
 
@@ -23,6 +30,16 @@ __all__ = ["EventResource", "AsyncEventResource"]
23
30
  class EventResource(SyncAPIResource):
24
31
  """Operations under ``client.event`` (OpenCode ``event``)."""
25
32
 
33
+ @cached_property
34
+ def with_raw_response(self) -> EventResourceWithRawResponse:
35
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
36
+ return EventResourceWithRawResponse(self)
37
+
38
+ @cached_property
39
+ def with_streaming_response(self) -> EventResourceWithStreamingResponse:
40
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
41
+ return EventResourceWithStreamingResponse(self)
42
+
26
43
  def subscribe(
27
44
  self,
28
45
  *,
@@ -54,9 +71,35 @@ class EventResource(SyncAPIResource):
54
71
  )
55
72
 
56
73
 
74
+ class EventResourceWithRawResponse:
75
+ """``client.event.with_raw_response``."""
76
+
77
+ def __init__(self, resource: EventResource) -> None:
78
+ self._resource = resource
79
+ self.subscribe = to_raw_response_wrapper(resource.subscribe)
80
+
81
+
82
+ class EventResourceWithStreamingResponse:
83
+ """``client.event.with_streaming_response``."""
84
+
85
+ def __init__(self, resource: EventResource) -> None:
86
+ self._resource = resource
87
+ self.subscribe = to_streamed_response_wrapper(resource.subscribe)
88
+
89
+
57
90
  class AsyncEventResource(AsyncAPIResource):
58
91
  """Operations under ``client.event`` (OpenCode ``event``)."""
59
92
 
93
+ @cached_property
94
+ def with_raw_response(self) -> AsyncEventResourceWithRawResponse:
95
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
96
+ return AsyncEventResourceWithRawResponse(self)
97
+
98
+ @cached_property
99
+ def with_streaming_response(self) -> AsyncEventResourceWithStreamingResponse:
100
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
101
+ return AsyncEventResourceWithStreamingResponse(self)
102
+
60
103
  async def subscribe(
61
104
  self,
62
105
  *,
@@ -86,3 +129,19 @@ class AsyncEventResource(AsyncAPIResource):
86
129
  ),
87
130
  item_type="Event",
88
131
  )
132
+
133
+
134
+ class AsyncEventResourceWithRawResponse:
135
+ """``client.event.with_raw_response``."""
136
+
137
+ def __init__(self, resource: AsyncEventResource) -> None:
138
+ self._resource = resource
139
+ self.subscribe = async_to_raw_response_wrapper(resource.subscribe)
140
+
141
+
142
+ class AsyncEventResourceWithStreamingResponse:
143
+ """``client.event.with_streaming_response``."""
144
+
145
+ def __init__(self, resource: AsyncEventResource) -> None:
146
+ self._resource = resource
147
+ self.subscribe = async_to_streamed_response_wrapper(resource.subscribe)
@@ -14,6 +14,12 @@ 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
+ from .._response import (
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ to_raw_response_wrapper,
21
+ to_streamed_response_wrapper,
22
+ )
17
23
  from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
18
24
 
19
25
  if TYPE_CHECKING:
@@ -36,6 +42,16 @@ __all__ = ["ExperimentalResource", "AsyncExperimentalResource"]
36
42
  class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
37
43
  """Operations under ``client.experimental.persistent_pty`` (OpenCode ``experimental.persistentPty``)."""
38
44
 
45
+ @cached_property
46
+ def with_raw_response(self) -> ExperimentalPersistentPtyResourceWithRawResponse:
47
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
48
+ return ExperimentalPersistentPtyResourceWithRawResponse(self)
49
+
50
+ @cached_property
51
+ def with_streaming_response(self) -> ExperimentalPersistentPtyResourceWithStreamingResponse:
52
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
53
+ return ExperimentalPersistentPtyResourceWithStreamingResponse(self)
54
+
39
55
  def read(
40
56
  self,
41
57
  session_id: SessionID,
@@ -168,16 +184,19 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
168
184
 
169
185
  ``POST /api/experimental/persistent-pty/shutdown``
170
186
  """
171
- self._client.request(
172
- RequestOptions(
173
- method="POST",
174
- path="/api/experimental/persistent-pty/shutdown",
175
- extra_headers=extra_headers,
176
- extra_query=extra_query,
177
- extra_body=extra_body,
178
- timeout=timeout,
187
+ return cast(
188
+ "None",
189
+ self._client.request(
190
+ RequestOptions(
191
+ method="POST",
192
+ path="/api/experimental/persistent-pty/shutdown",
193
+ extra_headers=extra_headers,
194
+ extra_query=extra_query,
195
+ extra_body=extra_body,
196
+ timeout=timeout,
197
+ ),
198
+ kind="void",
179
199
  ),
180
- kind="void",
181
200
  )
182
201
 
183
202
  def handoff(
@@ -339,16 +358,19 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
339
358
 
340
359
  ``DELETE /api/experimental/persistent-pty/:ptyID``
341
360
  """
342
- self._client.request(
343
- RequestOptions(
344
- method="DELETE",
345
- path=f"/api/experimental/persistent-pty/{encode_path_segment(pty_id)}",
346
- extra_headers=extra_headers,
347
- extra_query=extra_query,
348
- extra_body=extra_body,
349
- timeout=timeout,
361
+ return cast(
362
+ "None",
363
+ self._client.request(
364
+ RequestOptions(
365
+ method="DELETE",
366
+ path=f"/api/experimental/persistent-pty/{encode_path_segment(pty_id)}",
367
+ extra_headers=extra_headers,
368
+ extra_query=extra_query,
369
+ extra_body=extra_body,
370
+ timeout=timeout,
371
+ ),
372
+ kind="void",
350
373
  ),
351
- kind="void",
352
374
  )
353
375
 
354
376
  def connect_token(
@@ -390,6 +412,40 @@ class ExperimentalPersistentPtyResource(PersistentPtyAttachMixin):
390
412
  )
391
413
 
392
414
 
415
+ class ExperimentalPersistentPtyResourceWithRawResponse:
416
+ """``client.experimental.persistent_pty.with_raw_response``."""
417
+
418
+ def __init__(self, resource: ExperimentalPersistentPtyResource) -> None:
419
+ self._resource = resource
420
+ self.read = to_raw_response_wrapper(resource.read)
421
+ self.list = to_raw_response_wrapper(resource.list)
422
+ self.create = to_raw_response_wrapper(resource.create)
423
+ self.shutdown = to_raw_response_wrapper(resource.shutdown)
424
+ self.handoff = to_raw_response_wrapper(resource.handoff)
425
+ self.get = to_raw_response_wrapper(resource.get)
426
+ self.update = to_raw_response_wrapper(resource.update)
427
+ self.snapshot = to_raw_response_wrapper(resource.snapshot)
428
+ self.remove = to_raw_response_wrapper(resource.remove)
429
+ self.connect_token = to_raw_response_wrapper(resource.connect_token)
430
+
431
+
432
+ class ExperimentalPersistentPtyResourceWithStreamingResponse:
433
+ """``client.experimental.persistent_pty.with_streaming_response``."""
434
+
435
+ def __init__(self, resource: ExperimentalPersistentPtyResource) -> None:
436
+ self._resource = resource
437
+ self.read = to_streamed_response_wrapper(resource.read)
438
+ self.list = to_streamed_response_wrapper(resource.list)
439
+ self.create = to_streamed_response_wrapper(resource.create)
440
+ self.shutdown = to_streamed_response_wrapper(resource.shutdown)
441
+ self.handoff = to_streamed_response_wrapper(resource.handoff)
442
+ self.get = to_streamed_response_wrapper(resource.get)
443
+ self.update = to_streamed_response_wrapper(resource.update)
444
+ self.snapshot = to_streamed_response_wrapper(resource.snapshot)
445
+ self.remove = to_streamed_response_wrapper(resource.remove)
446
+ self.connect_token = to_streamed_response_wrapper(resource.connect_token)
447
+
448
+
393
449
  class ExperimentalResource(SyncAPIResource):
394
450
  """Operations under ``client.experimental`` (OpenCode ``experimental``)."""
395
451
 
@@ -398,10 +454,54 @@ class ExperimentalResource(SyncAPIResource):
398
454
  """Operations under ``client.experimental.persistent_pty``."""
399
455
  return ExperimentalPersistentPtyResource(self._client)
400
456
 
457
+ @cached_property
458
+ def with_raw_response(self) -> ExperimentalResourceWithRawResponse:
459
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
460
+ return ExperimentalResourceWithRawResponse(self)
461
+
462
+ @cached_property
463
+ def with_streaming_response(self) -> ExperimentalResourceWithStreamingResponse:
464
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
465
+ return ExperimentalResourceWithStreamingResponse(self)
466
+
467
+
468
+ class ExperimentalResourceWithRawResponse:
469
+ """``client.experimental.with_raw_response``."""
470
+
471
+ def __init__(self, resource: ExperimentalResource) -> None:
472
+ self._resource = resource
473
+
474
+ @cached_property
475
+ def persistent_pty(self) -> ExperimentalPersistentPtyResourceWithRawResponse:
476
+ """``client.experimental.persistent_pty.with_raw_response``."""
477
+ return ExperimentalPersistentPtyResourceWithRawResponse(self._resource.persistent_pty)
478
+
479
+
480
+ class ExperimentalResourceWithStreamingResponse:
481
+ """``client.experimental.with_streaming_response``."""
482
+
483
+ def __init__(self, resource: ExperimentalResource) -> None:
484
+ self._resource = resource
485
+
486
+ @cached_property
487
+ def persistent_pty(self) -> ExperimentalPersistentPtyResourceWithStreamingResponse:
488
+ """``client.experimental.persistent_pty.with_streaming_response``."""
489
+ return ExperimentalPersistentPtyResourceWithStreamingResponse(self._resource.persistent_pty)
490
+
401
491
 
402
492
  class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
403
493
  """Operations under ``client.experimental.persistent_pty`` (OpenCode ``experimental.persistentPty``)."""
404
494
 
495
+ @cached_property
496
+ def with_raw_response(self) -> AsyncExperimentalPersistentPtyResourceWithRawResponse:
497
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
498
+ return AsyncExperimentalPersistentPtyResourceWithRawResponse(self)
499
+
500
+ @cached_property
501
+ def with_streaming_response(self) -> AsyncExperimentalPersistentPtyResourceWithStreamingResponse:
502
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
503
+ return AsyncExperimentalPersistentPtyResourceWithStreamingResponse(self)
504
+
405
505
  async def read(
406
506
  self,
407
507
  session_id: SessionID,
@@ -534,16 +634,19 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
534
634
 
535
635
  ``POST /api/experimental/persistent-pty/shutdown``
536
636
  """
537
- await self._client.request(
538
- RequestOptions(
539
- method="POST",
540
- path="/api/experimental/persistent-pty/shutdown",
541
- extra_headers=extra_headers,
542
- extra_query=extra_query,
543
- extra_body=extra_body,
544
- timeout=timeout,
637
+ return cast(
638
+ "None",
639
+ await self._client.request(
640
+ RequestOptions(
641
+ method="POST",
642
+ path="/api/experimental/persistent-pty/shutdown",
643
+ extra_headers=extra_headers,
644
+ extra_query=extra_query,
645
+ extra_body=extra_body,
646
+ timeout=timeout,
647
+ ),
648
+ kind="void",
545
649
  ),
546
- kind="void",
547
650
  )
548
651
 
549
652
  async def handoff(
@@ -705,16 +808,19 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
705
808
 
706
809
  ``DELETE /api/experimental/persistent-pty/:ptyID``
707
810
  """
708
- await self._client.request(
709
- RequestOptions(
710
- method="DELETE",
711
- path=f"/api/experimental/persistent-pty/{encode_path_segment(pty_id)}",
712
- extra_headers=extra_headers,
713
- extra_query=extra_query,
714
- extra_body=extra_body,
715
- timeout=timeout,
811
+ return cast(
812
+ "None",
813
+ await self._client.request(
814
+ RequestOptions(
815
+ method="DELETE",
816
+ path=f"/api/experimental/persistent-pty/{encode_path_segment(pty_id)}",
817
+ extra_headers=extra_headers,
818
+ extra_query=extra_query,
819
+ extra_body=extra_body,
820
+ timeout=timeout,
821
+ ),
822
+ kind="void",
716
823
  ),
717
- kind="void",
718
824
  )
719
825
 
720
826
  async def connect_token(
@@ -756,6 +862,40 @@ class AsyncExperimentalPersistentPtyResource(AsyncPersistentPtyAttachMixin):
756
862
  )
757
863
 
758
864
 
865
+ class AsyncExperimentalPersistentPtyResourceWithRawResponse:
866
+ """``client.experimental.persistent_pty.with_raw_response``."""
867
+
868
+ def __init__(self, resource: AsyncExperimentalPersistentPtyResource) -> None:
869
+ self._resource = resource
870
+ self.read = async_to_raw_response_wrapper(resource.read)
871
+ self.list = async_to_raw_response_wrapper(resource.list)
872
+ self.create = async_to_raw_response_wrapper(resource.create)
873
+ self.shutdown = async_to_raw_response_wrapper(resource.shutdown)
874
+ self.handoff = async_to_raw_response_wrapper(resource.handoff)
875
+ self.get = async_to_raw_response_wrapper(resource.get)
876
+ self.update = async_to_raw_response_wrapper(resource.update)
877
+ self.snapshot = async_to_raw_response_wrapper(resource.snapshot)
878
+ self.remove = async_to_raw_response_wrapper(resource.remove)
879
+ self.connect_token = async_to_raw_response_wrapper(resource.connect_token)
880
+
881
+
882
+ class AsyncExperimentalPersistentPtyResourceWithStreamingResponse:
883
+ """``client.experimental.persistent_pty.with_streaming_response``."""
884
+
885
+ def __init__(self, resource: AsyncExperimentalPersistentPtyResource) -> None:
886
+ self._resource = resource
887
+ self.read = async_to_streamed_response_wrapper(resource.read)
888
+ self.list = async_to_streamed_response_wrapper(resource.list)
889
+ self.create = async_to_streamed_response_wrapper(resource.create)
890
+ self.shutdown = async_to_streamed_response_wrapper(resource.shutdown)
891
+ self.handoff = async_to_streamed_response_wrapper(resource.handoff)
892
+ self.get = async_to_streamed_response_wrapper(resource.get)
893
+ self.update = async_to_streamed_response_wrapper(resource.update)
894
+ self.snapshot = async_to_streamed_response_wrapper(resource.snapshot)
895
+ self.remove = async_to_streamed_response_wrapper(resource.remove)
896
+ self.connect_token = async_to_streamed_response_wrapper(resource.connect_token)
897
+
898
+
759
899
  class AsyncExperimentalResource(AsyncAPIResource):
760
900
  """Operations under ``client.experimental`` (OpenCode ``experimental``)."""
761
901
 
@@ -763,3 +903,37 @@ class AsyncExperimentalResource(AsyncAPIResource):
763
903
  def persistent_pty(self) -> AsyncExperimentalPersistentPtyResource:
764
904
  """Operations under ``client.experimental.persistent_pty``."""
765
905
  return AsyncExperimentalPersistentPtyResource(self._client)
906
+
907
+ @cached_property
908
+ def with_raw_response(self) -> AsyncExperimentalResourceWithRawResponse:
909
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
910
+ return AsyncExperimentalResourceWithRawResponse(self)
911
+
912
+ @cached_property
913
+ def with_streaming_response(self) -> AsyncExperimentalResourceWithStreamingResponse:
914
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
915
+ return AsyncExperimentalResourceWithStreamingResponse(self)
916
+
917
+
918
+ class AsyncExperimentalResourceWithRawResponse:
919
+ """``client.experimental.with_raw_response``."""
920
+
921
+ def __init__(self, resource: AsyncExperimentalResource) -> None:
922
+ self._resource = resource
923
+
924
+ @cached_property
925
+ def persistent_pty(self) -> AsyncExperimentalPersistentPtyResourceWithRawResponse:
926
+ """``client.experimental.persistent_pty.with_raw_response``."""
927
+ return AsyncExperimentalPersistentPtyResourceWithRawResponse(self._resource.persistent_pty)
928
+
929
+
930
+ class AsyncExperimentalResourceWithStreamingResponse:
931
+ """``client.experimental.with_streaming_response``."""
932
+
933
+ def __init__(self, resource: AsyncExperimentalResource) -> None:
934
+ self._resource = resource
935
+
936
+ @cached_property
937
+ def persistent_pty(self) -> AsyncExperimentalPersistentPtyResourceWithStreamingResponse:
938
+ """``client.experimental.persistent_pty.with_streaming_response``."""
939
+ return AsyncExperimentalPersistentPtyResourceWithStreamingResponse(self._resource.persistent_pty)