opencode-python-sdk 0.1.0__py3-none-any.whl → 0.1.1__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 (38) hide show
  1. opencode/_exceptions.py +22 -0
  2. opencode/_server.py +8 -0
  3. opencode/resources/agent.py +14 -14
  4. opencode/resources/command.py +6 -6
  5. opencode/resources/config.py +18 -18
  6. opencode/resources/credential.py +22 -22
  7. opencode/resources/debug.py +10 -8
  8. opencode/resources/event.py +4 -4
  9. opencode/resources/experimental.py +74 -72
  10. opencode/resources/file.py +28 -28
  11. opencode/resources/form.py +6 -6
  12. opencode/resources/generate.py +8 -8
  13. opencode/resources/integration.py +102 -94
  14. opencode/resources/location.py +12 -12
  15. opencode/resources/mcp.py +44 -42
  16. opencode/resources/message.py +10 -10
  17. opencode/resources/migration.py +6 -4
  18. opencode/resources/model.py +16 -16
  19. opencode/resources/permission.py +68 -64
  20. opencode/resources/plugin.py +20 -20
  21. opencode/resources/project.py +14 -14
  22. opencode/resources/provider.py +18 -18
  23. opencode/resources/pty.py +48 -46
  24. opencode/resources/reference.py +6 -6
  25. opencode/resources/rpc.py +10 -10
  26. opencode/resources/server.py +12 -12
  27. opencode/resources/session.py +378 -366
  28. opencode/resources/shell.py +34 -34
  29. opencode/resources/skill.py +6 -6
  30. opencode/resources/vcs.py +48 -46
  31. opencode/resources/voice.py +8 -8
  32. opencode/resources/websearch.py +16 -16
  33. opencode/resources/worktree.py +30 -30
  34. {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.1.dist-info}/METADATA +5 -2
  35. opencode_python_sdk-0.1.1.dist-info/RECORD +55 -0
  36. opencode_python_sdk-0.1.0.dist-info/RECORD +0 -55
  37. {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.1.dist-info}/WHEEL +0 -0
  38. {opencode_python_sdk-0.1.0.dist-info → opencode_python_sdk-0.1.1.dist-info}/licenses/LICENSE +0 -0
opencode/resources/pty.py CHANGED
@@ -46,11 +46,11 @@ class PtyConnectResource(SyncAPIResource):
46
46
  Create a short-lived single-use ticket for opening a PTY WebSocket connection.
47
47
 
48
48
  Raises:
49
- InvalidRequestError
50
- UnauthorizedError
51
- ForbiddenError
52
- PtyNotFoundError
53
- LocationNotFoundError
49
+ InvalidRequestError: The server answered 400.
50
+ UnauthorizedError: The server answered 401.
51
+ ForbiddenError: The server answered 403.
52
+ PtyNotFoundError: The server answered 404.
53
+ LocationNotFoundError: The server answered 404.
54
54
 
55
55
  ``POST /api/pty/:ptyID/connect-token``
56
56
  """
@@ -77,6 +77,7 @@ class PtyResource(SyncAPIResource):
77
77
 
78
78
  @cached_property
79
79
  def connect(self) -> PtyConnectResource:
80
+ """Operations under ``client.pty.connect``."""
80
81
  return PtyConnectResource(self._client)
81
82
 
82
83
  def list(
@@ -93,9 +94,9 @@ class PtyResource(SyncAPIResource):
93
94
  List PTY sessions for a location, including exited sessions retained until removal.
94
95
 
95
96
  Raises:
96
- InvalidRequestError
97
- UnauthorizedError
98
- LocationNotFoundError
97
+ InvalidRequestError: The server answered 400.
98
+ UnauthorizedError: The server answered 401.
99
+ LocationNotFoundError: The server answered 404.
99
100
 
100
101
  ``GET /api/pty``
101
102
  """
@@ -134,9 +135,9 @@ class PtyResource(SyncAPIResource):
134
135
  Create a pseudo-terminal session for a location.
135
136
 
136
137
  Raises:
137
- InvalidRequestError
138
- UnauthorizedError
139
- LocationNotFoundError
138
+ InvalidRequestError: The server answered 400.
139
+ UnauthorizedError: The server answered 401.
140
+ LocationNotFoundError: The server answered 404.
140
141
 
141
142
  ``POST /api/pty``
142
143
  """
@@ -172,10 +173,10 @@ class PtyResource(SyncAPIResource):
172
173
  Get one PTY session, including its exit code once exited.
173
174
 
174
175
  Raises:
175
- InvalidRequestError
176
- UnauthorizedError
177
- PtyNotFoundError
178
- LocationNotFoundError
176
+ InvalidRequestError: The server answered 400.
177
+ UnauthorizedError: The server answered 401.
178
+ PtyNotFoundError: The server answered 404.
179
+ LocationNotFoundError: The server answered 404.
179
180
 
180
181
  ``GET /api/pty/:ptyID``
181
182
  """
@@ -212,10 +213,10 @@ class PtyResource(SyncAPIResource):
212
213
  Update the title or viewport size of one PTY session.
213
214
 
214
215
  Raises:
215
- InvalidRequestError
216
- UnauthorizedError
217
- PtyNotFoundError
218
- LocationNotFoundError
216
+ InvalidRequestError: The server answered 400.
217
+ UnauthorizedError: The server answered 401.
218
+ PtyNotFoundError: The server answered 404.
219
+ LocationNotFoundError: The server answered 404.
219
220
 
220
221
  ``PUT /api/pty/:ptyID``
221
222
  """
@@ -251,10 +252,10 @@ class PtyResource(SyncAPIResource):
251
252
  Terminate and remove one PTY session.
252
253
 
253
254
  Raises:
254
- InvalidRequestError
255
- UnauthorizedError
256
- PtyNotFoundError
257
- LocationNotFoundError
255
+ InvalidRequestError: The server answered 400.
256
+ UnauthorizedError: The server answered 401.
257
+ PtyNotFoundError: The server answered 404.
258
+ LocationNotFoundError: The server answered 404.
258
259
 
259
260
  ``DELETE /api/pty/:ptyID``
260
261
  """
@@ -291,11 +292,11 @@ class AsyncPtyConnectResource(AsyncAPIResource):
291
292
  Create a short-lived single-use ticket for opening a PTY WebSocket connection.
292
293
 
293
294
  Raises:
294
- InvalidRequestError
295
- UnauthorizedError
296
- ForbiddenError
297
- PtyNotFoundError
298
- LocationNotFoundError
295
+ InvalidRequestError: The server answered 400.
296
+ UnauthorizedError: The server answered 401.
297
+ ForbiddenError: The server answered 403.
298
+ PtyNotFoundError: The server answered 404.
299
+ LocationNotFoundError: The server answered 404.
299
300
 
300
301
  ``POST /api/pty/:ptyID/connect-token``
301
302
  """
@@ -322,6 +323,7 @@ class AsyncPtyResource(AsyncAPIResource):
322
323
 
323
324
  @cached_property
324
325
  def connect(self) -> AsyncPtyConnectResource:
326
+ """Operations under ``client.pty.connect``."""
325
327
  return AsyncPtyConnectResource(self._client)
326
328
 
327
329
  async def list(
@@ -338,9 +340,9 @@ class AsyncPtyResource(AsyncAPIResource):
338
340
  List PTY sessions for a location, including exited sessions retained until removal.
339
341
 
340
342
  Raises:
341
- InvalidRequestError
342
- UnauthorizedError
343
- LocationNotFoundError
343
+ InvalidRequestError: The server answered 400.
344
+ UnauthorizedError: The server answered 401.
345
+ LocationNotFoundError: The server answered 404.
344
346
 
345
347
  ``GET /api/pty``
346
348
  """
@@ -379,9 +381,9 @@ class AsyncPtyResource(AsyncAPIResource):
379
381
  Create a pseudo-terminal session for a location.
380
382
 
381
383
  Raises:
382
- InvalidRequestError
383
- UnauthorizedError
384
- LocationNotFoundError
384
+ InvalidRequestError: The server answered 400.
385
+ UnauthorizedError: The server answered 401.
386
+ LocationNotFoundError: The server answered 404.
385
387
 
386
388
  ``POST /api/pty``
387
389
  """
@@ -417,10 +419,10 @@ class AsyncPtyResource(AsyncAPIResource):
417
419
  Get one PTY session, including its exit code once exited.
418
420
 
419
421
  Raises:
420
- InvalidRequestError
421
- UnauthorizedError
422
- PtyNotFoundError
423
- LocationNotFoundError
422
+ InvalidRequestError: The server answered 400.
423
+ UnauthorizedError: The server answered 401.
424
+ PtyNotFoundError: The server answered 404.
425
+ LocationNotFoundError: The server answered 404.
424
426
 
425
427
  ``GET /api/pty/:ptyID``
426
428
  """
@@ -457,10 +459,10 @@ class AsyncPtyResource(AsyncAPIResource):
457
459
  Update the title or viewport size of one PTY session.
458
460
 
459
461
  Raises:
460
- InvalidRequestError
461
- UnauthorizedError
462
- PtyNotFoundError
463
- LocationNotFoundError
462
+ InvalidRequestError: The server answered 400.
463
+ UnauthorizedError: The server answered 401.
464
+ PtyNotFoundError: The server answered 404.
465
+ LocationNotFoundError: The server answered 404.
464
466
 
465
467
  ``PUT /api/pty/:ptyID``
466
468
  """
@@ -496,10 +498,10 @@ class AsyncPtyResource(AsyncAPIResource):
496
498
  Terminate and remove one PTY session.
497
499
 
498
500
  Raises:
499
- InvalidRequestError
500
- UnauthorizedError
501
- PtyNotFoundError
502
- LocationNotFoundError
501
+ InvalidRequestError: The server answered 400.
502
+ UnauthorizedError: The server answered 401.
503
+ PtyNotFoundError: The server answered 404.
504
+ LocationNotFoundError: The server answered 404.
503
505
 
504
506
  ``DELETE /api/pty/:ptyID``
505
507
  """
@@ -35,9 +35,9 @@ class ReferenceResource(SyncAPIResource):
35
35
  List references available in the requested location.
36
36
 
37
37
  Raises:
38
- InvalidRequestError
39
- UnauthorizedError
40
- LocationNotFoundError
38
+ InvalidRequestError: The server answered 400.
39
+ UnauthorizedError: The server answered 401.
40
+ LocationNotFoundError: The server answered 404.
41
41
 
42
42
  ``GET /api/reference``
43
43
  """
@@ -75,9 +75,9 @@ class AsyncReferenceResource(AsyncAPIResource):
75
75
  List references available in the requested location.
76
76
 
77
77
  Raises:
78
- InvalidRequestError
79
- UnauthorizedError
80
- LocationNotFoundError
78
+ InvalidRequestError: The server answered 400.
79
+ UnauthorizedError: The server answered 401.
80
+ LocationNotFoundError: The server answered 404.
81
81
 
82
82
  ``GET /api/reference``
83
83
  """
opencode/resources/rpc.py CHANGED
@@ -39,11 +39,11 @@ class RpcResource(SyncAPIResource):
39
39
  Dispatch a method to the currently registered RPC at the requested location.
40
40
 
41
41
  Raises:
42
- RpcError
43
- InvalidRequestError
44
- UnauthorizedError
45
- LocationNotFoundError
46
- RpcInternalError
42
+ RpcError: The server answered 400.
43
+ InvalidRequestError: The server answered 400.
44
+ UnauthorizedError: The server answered 401.
45
+ LocationNotFoundError: The server answered 404.
46
+ RpcInternalError: The server answered 500.
47
47
 
48
48
  ``POST /api/rpc/:rpcID/:method``
49
49
  """
@@ -85,11 +85,11 @@ class AsyncRpcResource(AsyncAPIResource):
85
85
  Dispatch a method to the currently registered RPC at the requested location.
86
86
 
87
87
  Raises:
88
- RpcError
89
- InvalidRequestError
90
- UnauthorizedError
91
- LocationNotFoundError
92
- RpcInternalError
88
+ RpcError: The server answered 400.
89
+ InvalidRequestError: The server answered 400.
90
+ UnauthorizedError: The server answered 401.
91
+ LocationNotFoundError: The server answered 404.
92
+ RpcInternalError: The server answered 500.
93
93
 
94
94
  ``POST /api/rpc/:rpcID/:method``
95
95
  """
@@ -36,8 +36,8 @@ class ServerResource(SyncAPIResource):
36
36
  Return the server identity, connection URLs, paths, and readiness status.
37
37
 
38
38
  Raises:
39
- InvalidRequestError
40
- UnauthorizedError
39
+ InvalidRequestError: The server answered 400.
40
+ UnauthorizedError: The server answered 401.
41
41
 
42
42
  ``GET /api/info``
43
43
  """
@@ -69,8 +69,8 @@ class ServerResource(SyncAPIResource):
69
69
  Create a short-lived, single-use code for a /auth/connect/:code pairing link.
70
70
 
71
71
  Raises:
72
- InvalidRequestError
73
- UnauthorizedError
72
+ InvalidRequestError: The server answered 400.
73
+ UnauthorizedError: The server answered 401.
74
74
 
75
75
  ``POST /api/pair``
76
76
  """
@@ -103,8 +103,8 @@ class ServerResource(SyncAPIResource):
103
103
  Redeem a pairing code. Browsers receive a session cookie and a redirect to the web app; requests that accept JSON receive a session token to use as the password.
104
104
 
105
105
  Raises:
106
- InvalidRequestError
107
- UnauthorizedError
106
+ InvalidRequestError: The server answered 400.
107
+ UnauthorizedError: The server answered 401.
108
108
 
109
109
  ``GET /auth/connect/:code``
110
110
  """
@@ -140,8 +140,8 @@ class AsyncServerResource(AsyncAPIResource):
140
140
  Return the server identity, connection URLs, paths, and readiness status.
141
141
 
142
142
  Raises:
143
- InvalidRequestError
144
- UnauthorizedError
143
+ InvalidRequestError: The server answered 400.
144
+ UnauthorizedError: The server answered 401.
145
145
 
146
146
  ``GET /api/info``
147
147
  """
@@ -173,8 +173,8 @@ class AsyncServerResource(AsyncAPIResource):
173
173
  Create a short-lived, single-use code for a /auth/connect/:code pairing link.
174
174
 
175
175
  Raises:
176
- InvalidRequestError
177
- UnauthorizedError
176
+ InvalidRequestError: The server answered 400.
177
+ UnauthorizedError: The server answered 401.
178
178
 
179
179
  ``POST /api/pair``
180
180
  """
@@ -207,8 +207,8 @@ class AsyncServerResource(AsyncAPIResource):
207
207
  Redeem a pairing code. Browsers receive a session cookie and a redirect to the web app; requests that accept JSON receive a session token to use as the password.
208
208
 
209
209
  Raises:
210
- InvalidRequestError
211
- UnauthorizedError
210
+ InvalidRequestError: The server answered 400.
211
+ UnauthorizedError: The server answered 401.
212
212
 
213
213
  ``GET /auth/connect/:code``
214
214
  """