Skip to content

Commit ff1e22f

Browse files
authored
Merge pull request #2 from sst/release-please--branches--main--changes--next
release: 0.1.0-alpha.2
2 parents ddb79fc + 51ba45e commit ff1e22f

File tree

111 files changed

+170
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+170
-156
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.1"
2+
".": "0.1.0-alpha.2"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 16
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-3c79948402e96d2aae6e46095db2cf80759750d1b042d6f91281a72c415b14de.yml
33
openapi_spec_hash: f9c2fc5988f0a30397929995c2be2c85
4-
config_hash: fddca9bc092956a3e82f3f3bdba448d1
4+
config_hash: d4c4c71d9a092267df2d4ab61fd89e63

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.1.0-alpha.2 (2025-06-27)
4+
5+
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/sst/opencode-sdk-python/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([a6cf7c5](https://github.com/sst/opencode-sdk-python/commit/a6cf7c5b2a411503294088428ca7918226eca161))
10+
311
## 0.1.0-alpha.1 (2025-06-27)
412

513
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/sst/opencode-sdk-python/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ pip install -r requirements-dev.lock
3636

3737
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
3838
result in merge conflicts between manual patches and changes from the generator. The generator will never
39-
modify the contents of the `src/opencode/lib/` and `examples/` directories.
39+
modify the contents of the `src/opencode_ai/lib/` and `examples/` directories.
4040

4141
## Adding and running examples
4242

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Opencode Python API library
22

3-
[![PyPI version](<https://img.shields.io/pypi/v/opencode.svg?label=pypi%20(stable)>)](https://pypi.org/project/opencode/)
3+
[![PyPI version](<https://img.shields.io/pypi/v/opencode-ai.svg?label=pypi%20(stable)>)](https://pypi.org/project/opencode-ai/)
44

55
The Opencode Python library provides convenient access to the Opencode REST API from any Python 3.8+
66
application. The library includes type definitions for all request params and response fields,
@@ -16,15 +16,15 @@ The REST API documentation can be found on [opencode.ai](https://opencode.ai/doc
1616

1717
```sh
1818
# install from PyPI
19-
pip install --pre opencode
19+
pip install --pre opencode-ai
2020
```
2121

2222
## Usage
2323

2424
The full API of this library can be found in [api.md](api.md).
2525

2626
```python
27-
from opencode import Opencode
27+
from opencode_ai import Opencode
2828

2929
client = Opencode()
3030

@@ -37,7 +37,7 @@ Simply import `AsyncOpencode` instead of `Opencode` and use `await` with each AP
3737

3838
```python
3939
import asyncio
40-
from opencode import AsyncOpencode
40+
from opencode_ai import AsyncOpencode
4141

4242
client = AsyncOpencode()
4343

@@ -59,15 +59,15 @@ You can enable this by installing `aiohttp`:
5959

6060
```sh
6161
# install from PyPI
62-
pip install --pre opencode[aiohttp]
62+
pip install --pre opencode-ai[aiohttp]
6363
```
6464

6565
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
6666

6767
```python
6868
import asyncio
69-
from opencode import DefaultAioHttpClient
70-
from opencode import AsyncOpencode
69+
from opencode_ai import DefaultAioHttpClient
70+
from opencode_ai import AsyncOpencode
7171

7272

7373
async def main() -> None:
@@ -91,27 +91,27 @@ Typed requests and responses provide autocomplete and documentation within your
9191

9292
## Handling errors
9393

94-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `opencode.APIConnectionError` is raised.
94+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `opencode_ai.APIConnectionError` is raised.
9595

9696
When the API returns a non-success status code (that is, 4xx or 5xx
97-
response), a subclass of `opencode.APIStatusError` is raised, containing `status_code` and `response` properties.
97+
response), a subclass of `opencode_ai.APIStatusError` is raised, containing `status_code` and `response` properties.
9898

99-
All errors inherit from `opencode.APIError`.
99+
All errors inherit from `opencode_ai.APIError`.
100100

101101
```python
102-
import opencode
103-
from opencode import Opencode
102+
import opencode_ai
103+
from opencode_ai import Opencode
104104

105105
client = Opencode()
106106

107107
try:
108108
client.event.list()
109-
except opencode.APIConnectionError as e:
109+
except opencode_ai.APIConnectionError as e:
110110
print("The server could not be reached")
111111
print(e.__cause__) # an underlying Exception, likely raised within httpx.
112-
except opencode.RateLimitError as e:
112+
except opencode_ai.RateLimitError as e:
113113
print("A 429 status code was received; we should back off a bit.")
114-
except opencode.APIStatusError as e:
114+
except opencode_ai.APIStatusError as e:
115115
print("Another non-200-range status code was received")
116116
print(e.status_code)
117117
print(e.response)
@@ -139,7 +139,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
139139
You can use the `max_retries` option to configure or disable retry settings:
140140

141141
```python
142-
from opencode import Opencode
142+
from opencode_ai import Opencode
143143

144144
# Configure the default for all requests:
145145
client = Opencode(
@@ -157,7 +157,7 @@ By default requests time out after 1 minute. You can configure this with a `time
157157
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
158158

159159
```python
160-
from opencode import Opencode
160+
from opencode_ai import Opencode
161161

162162
# Configure the default for all requests:
163163
client = Opencode(
@@ -209,7 +209,7 @@ if response.my_field is None:
209209
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
210210

211211
```py
212-
from opencode import Opencode
212+
from opencode_ai import Opencode
213213

214214
client = Opencode()
215215
response = client.event.with_raw_response.list()
@@ -219,9 +219,9 @@ event = response.parse() # get the object that `event.list()` would have return
219219
print(event)
220220
```
221221

222-
These methods return an [`APIResponse`](https://github.com/sst/opencode-sdk-python/tree/main/src/opencode/_response.py) object.
222+
These methods return an [`APIResponse`](https://github.com/sst/opencode-sdk-python/tree/main/src/opencode_ai/_response.py) object.
223223

224-
The async client returns an [`AsyncAPIResponse`](https://github.com/sst/opencode-sdk-python/tree/main/src/opencode/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
224+
The async client returns an [`AsyncAPIResponse`](https://github.com/sst/opencode-sdk-python/tree/main/src/opencode_ai/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
225225

226226
#### `.with_streaming_response`
227227

@@ -283,7 +283,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
283283

284284
```python
285285
import httpx
286-
from opencode import Opencode, DefaultHttpxClient
286+
from opencode_ai import Opencode, DefaultHttpxClient
287287

288288
client = Opencode(
289289
# Or use the `OPENCODE_BASE_URL` env var
@@ -306,7 +306,7 @@ client.with_options(http_client=DefaultHttpxClient(...))
306306
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
307307

308308
```py
309-
from opencode import Opencode
309+
from opencode_ai import Opencode
310310

311311
with Opencode() as client:
312312
# make requests here
@@ -334,8 +334,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
334334
You can determine the version that is being used at runtime with:
335335

336336
```py
337-
import opencode
338-
print(opencode.__version__)
337+
import opencode_ai
338+
print(opencode_ai.__version__)
339339
```
340340

341341
## Requirements

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ or products provided by Opencode, please follow the respective company's securit
2020

2121
### Opencode Terms and Policies
2222

23-
Please contact support@sst.dev for any questions or concerns regarding the security of our services.
23+
Please contact hello@sst.dev for any questions or concerns regarding the security of our services.
2424

2525
---
2626

api.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
# Shared Types
22

33
```python
4-
from opencode.types import ProviderAuthError, UnknownError
4+
from opencode_ai.types import ProviderAuthError, UnknownError
55
```
66

77
# Event
88

99
Types:
1010

1111
```python
12-
from opencode.types import EventListResponse
12+
from opencode_ai.types import EventListResponse
1313
```
1414

1515
Methods:
1616

17-
- <code title="get /event">client.event.<a href="./src/opencode/resources/event.py">list</a>() -> <a href="./src/opencode/types/event_list_response.py">EventListResponse</a></code>
17+
- <code title="get /event">client.event.<a href="./src/opencode_ai/resources/event.py">list</a>() -> <a href="./src/opencode_ai/types/event_list_response.py">EventListResponse</a></code>
1818

1919
# App
2020

2121
Types:
2222

2323
```python
24-
from opencode.types import App, AppInitResponse
24+
from opencode_ai.types import App, AppInitResponse
2525
```
2626

2727
Methods:
2828

29-
- <code title="get /app">client.app.<a href="./src/opencode/resources/app.py">get</a>() -> <a href="./src/opencode/types/app.py">App</a></code>
30-
- <code title="post /app/init">client.app.<a href="./src/opencode/resources/app.py">init</a>() -> <a href="./src/opencode/types/app_init_response.py">AppInitResponse</a></code>
29+
- <code title="get /app">client.app.<a href="./src/opencode_ai/resources/app.py">get</a>() -> <a href="./src/opencode_ai/types/app.py">App</a></code>
30+
- <code title="post /app/init">client.app.<a href="./src/opencode_ai/resources/app.py">init</a>() -> <a href="./src/opencode_ai/types/app_init_response.py">AppInitResponse</a></code>
3131

3232
# File
3333

3434
Types:
3535

3636
```python
37-
from opencode.types import FileSearchResponse
37+
from opencode_ai.types import FileSearchResponse
3838
```
3939

4040
Methods:
4141

42-
- <code title="get /file">client.file.<a href="./src/opencode/resources/file.py">search</a>(\*\*<a href="src/opencode/types/file_search_params.py">params</a>) -> <a href="./src/opencode/types/file_search_response.py">FileSearchResponse</a></code>
42+
- <code title="get /file">client.file.<a href="./src/opencode_ai/resources/file.py">search</a>(\*\*<a href="src/opencode_ai/types/file_search_params.py">params</a>) -> <a href="./src/opencode_ai/types/file_search_response.py">FileSearchResponse</a></code>
4343

4444
# Config
4545

4646
Types:
4747

4848
```python
49-
from opencode.types import (
49+
from opencode_ai.types import (
5050
Config,
5151
Keybinds,
5252
McpLocal,
@@ -59,15 +59,15 @@ from opencode.types import (
5959

6060
Methods:
6161

62-
- <code title="get /config">client.config.<a href="./src/opencode/resources/config.py">get</a>() -> <a href="./src/opencode/types/config.py">Config</a></code>
63-
- <code title="get /config/providers">client.config.<a href="./src/opencode/resources/config.py">providers</a>() -> <a href="./src/opencode/types/config_providers_response.py">ConfigProvidersResponse</a></code>
62+
- <code title="get /config">client.config.<a href="./src/opencode_ai/resources/config.py">get</a>() -> <a href="./src/opencode_ai/types/config.py">Config</a></code>
63+
- <code title="get /config/providers">client.config.<a href="./src/opencode_ai/resources/config.py">providers</a>() -> <a href="./src/opencode_ai/types/config_providers_response.py">ConfigProvidersResponse</a></code>
6464

6565
# Session
6666

6767
Types:
6868

6969
```python
70-
from opencode.types import (
70+
from opencode_ai.types import (
7171
FilePart,
7272
Message,
7373
MessagePart,
@@ -91,13 +91,13 @@ from opencode.types import (
9191

9292
Methods:
9393

94-
- <code title="post /session">client.session.<a href="./src/opencode/resources/session.py">create</a>() -> <a href="./src/opencode/types/session.py">Session</a></code>
95-
- <code title="get /session">client.session.<a href="./src/opencode/resources/session.py">list</a>() -> <a href="./src/opencode/types/session_list_response.py">SessionListResponse</a></code>
96-
- <code title="delete /session/{id}">client.session.<a href="./src/opencode/resources/session.py">delete</a>(id) -> <a href="./src/opencode/types/session_delete_response.py">SessionDeleteResponse</a></code>
97-
- <code title="post /session/{id}/abort">client.session.<a href="./src/opencode/resources/session.py">abort</a>(id) -> <a href="./src/opencode/types/session_abort_response.py">SessionAbortResponse</a></code>
98-
- <code title="post /session/{id}/message">client.session.<a href="./src/opencode/resources/session.py">chat</a>(id, \*\*<a href="src/opencode/types/session_chat_params.py">params</a>) -> <a href="./src/opencode/types/message.py">Message</a></code>
99-
- <code title="post /session/{id}/init">client.session.<a href="./src/opencode/resources/session.py">init</a>(id, \*\*<a href="src/opencode/types/session_init_params.py">params</a>) -> <a href="./src/opencode/types/session_init_response.py">SessionInitResponse</a></code>
100-
- <code title="get /session/{id}/message">client.session.<a href="./src/opencode/resources/session.py">messages</a>(id) -> <a href="./src/opencode/types/session_messages_response.py">SessionMessagesResponse</a></code>
101-
- <code title="post /session/{id}/share">client.session.<a href="./src/opencode/resources/session.py">share</a>(id) -> <a href="./src/opencode/types/session.py">Session</a></code>
102-
- <code title="post /session/{id}/summarize">client.session.<a href="./src/opencode/resources/session.py">summarize</a>(id, \*\*<a href="src/opencode/types/session_summarize_params.py">params</a>) -> <a href="./src/opencode/types/session_summarize_response.py">SessionSummarizeResponse</a></code>
103-
- <code title="delete /session/{id}/share">client.session.<a href="./src/opencode/resources/session.py">unshare</a>(id) -> <a href="./src/opencode/types/session.py">Session</a></code>
94+
- <code title="post /session">client.session.<a href="./src/opencode_ai/resources/session.py">create</a>() -> <a href="./src/opencode_ai/types/session.py">Session</a></code>
95+
- <code title="get /session">client.session.<a href="./src/opencode_ai/resources/session.py">list</a>() -> <a href="./src/opencode_ai/types/session_list_response.py">SessionListResponse</a></code>
96+
- <code title="delete /session/{id}">client.session.<a href="./src/opencode_ai/resources/session.py">delete</a>(id) -> <a href="./src/opencode_ai/types/session_delete_response.py">SessionDeleteResponse</a></code>
97+
- <code title="post /session/{id}/abort">client.session.<a href="./src/opencode_ai/resources/session.py">abort</a>(id) -> <a href="./src/opencode_ai/types/session_abort_response.py">SessionAbortResponse</a></code>
98+
- <code title="post /session/{id}/message">client.session.<a href="./src/opencode_ai/resources/session.py">chat</a>(id, \*\*<a href="src/opencode_ai/types/session_chat_params.py">params</a>) -> <a href="./src/opencode_ai/types/message.py">Message</a></code>
99+
- <code title="post /session/{id}/init">client.session.<a href="./src/opencode_ai/resources/session.py">init</a>(id, \*\*<a href="src/opencode_ai/types/session_init_params.py">params</a>) -> <a href="./src/opencode_ai/types/session_init_response.py">SessionInitResponse</a></code>
100+
- <code title="get /session/{id}/message">client.session.<a href="./src/opencode_ai/resources/session.py">messages</a>(id) -> <a href="./src/opencode_ai/types/session_messages_response.py">SessionMessagesResponse</a></code>
101+
- <code title="post /session/{id}/share">client.session.<a href="./src/opencode_ai/resources/session.py">share</a>(id) -> <a href="./src/opencode_ai/types/session.py">Session</a></code>
102+
- <code title="post /session/{id}/summarize">client.session.<a href="./src/opencode_ai/resources/session.py">summarize</a>(id, \*\*<a href="src/opencode_ai/types/session_summarize_params.py">params</a>) -> <a href="./src/opencode_ai/types/session_summarize_response.py">SessionSummarizeResponse</a></code>
103+
- <code title="delete /session/{id}/share">client.session.<a href="./src/opencode_ai/resources/session.py">unshare</a>(id) -> <a href="./src/opencode_ai/types/session.py">Session</a></code>

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ show_error_codes = True
88
#
99
# We also exclude our `tests` as mypy doesn't always infer
1010
# types correctly and Pyright will still catch any type errors.
11-
exclude = ^(src/opencode/_files\.py|_dev/.*\.py|tests/.*)$
11+
exclude = ^(src/opencode_ai/_files\.py|_dev/.*\.py|tests/.*)$
1212

1313
strict_equality = True
1414
implicit_reexport = True

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
2-
name = "opencode"
3-
version = "0.1.0-alpha.1"
2+
name = "opencode-ai"
3+
version = "0.1.0-alpha.2"
44
description = "The official Python library for the opencode API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
77
authors = [
8-
{ name = "Opencode", email = "support@sst.dev" },
8+
{ name = "Opencode", email = "hello@sst.dev" },
99
]
1010
dependencies = [
1111
"httpx>=0.23.0, <1",
@@ -78,14 +78,14 @@ format = { chain = [
7878
"check:ruff" = "ruff check ."
7979
"fix:ruff" = "ruff check --fix ."
8080

81-
"check:importable" = "python -c 'import opencode'"
81+
"check:importable" = "python -c 'import opencode_ai'"
8282

8383
typecheck = { chain = [
8484
"typecheck:pyright",
8585
"typecheck:mypy"
8686
]}
8787
"typecheck:pyright" = "pyright"
88-
"typecheck:verify-types" = "pyright --verifytypes opencode --ignoreexternal"
88+
"typecheck:verify-types" = "pyright --verifytypes opencode_ai --ignoreexternal"
8989
"typecheck:mypy" = "mypy ."
9090

9191
[build-system]
@@ -98,7 +98,7 @@ include = [
9898
]
9999

100100
[tool.hatch.build.targets.wheel]
101-
packages = ["src/opencode"]
101+
packages = ["src/opencode_ai"]
102102

103103
[tool.hatch.build.targets.sdist]
104104
# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc)
@@ -201,7 +201,7 @@ length-sort = true
201201
length-sort-straight = true
202202
combine-as-imports = true
203203
extra-standard-library = ["typing_extensions"]
204-
known-first-party = ["opencode", "tests"]
204+
known-first-party = ["opencode_ai", "tests"]
205205

206206
[tool.ruff.lint.per-file-ignores]
207207
"bin/**.py" = ["T201", "T203"]

release-please-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@
6161
],
6262
"release-type": "python",
6363
"extra-files": [
64-
"src/opencode/_version.py"
64+
"src/opencode_ai/_version.py"
6565
]
6666
}

0 commit comments

Comments
 (0)