Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,31 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
build:
if: github.repository == 'stainless-sdks/opencode-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.6"
".": "0.1.0-alpha.7"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 16
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-384a94f70b48c84af9eddcac72bbe12952c3ae3bd7fededfa1c63b203d12d828.yml
openapi_spec_hash: e47ad28d646736d5d79d2dd1086d517d
config_hash: e2d21e779cfc4e26a99b9e4e75de3f50
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-e2f67adede4455c3fe4507ac6f0b2ed1a91ee951ab30e01179555c18765750d4.yml
openapi_spec_hash: 6005bcfff58c025d61739be42030a339
config_hash: 6c8822d278ba83456e5eed6d774ca230
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.1.0-alpha.7 (2025-07-02)

Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/sst/opencode-sdk-python/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)

### Features

* **api:** update via SDK Studio ([84628c0](https://github.com/sst/opencode-sdk-python/commit/84628c0bd3cd508832f04db0fd8a6cd5367dddf3))


### Chores

* **ci:** change upload type ([f3019c9](https://github.com/sst/opencode-sdk-python/commit/f3019c94cb548e436b2d7d884969a90db4649f80))

## 0.1.0-alpha.6 (2025-06-30)

Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/sst/opencode-sdk-python/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
Expand Down
19 changes: 17 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,32 @@ Methods:
- <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>
- <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>

# Find

Types:

```python
from opencode_ai.types import FindFilesResponse, FindSymbolsResponse, FindTextResponse
```

Methods:

- <code title="get /find/file">client.find.<a href="./src/opencode_ai/resources/find.py">files</a>(\*\*<a href="src/opencode_ai/types/find_files_params.py">params</a>) -> <a href="./src/opencode_ai/types/find_files_response.py">FindFilesResponse</a></code>
- <code title="get /find/symbol">client.find.<a href="./src/opencode_ai/resources/find.py">symbols</a>(\*\*<a href="src/opencode_ai/types/find_symbols_params.py">params</a>) -> <a href="./src/opencode_ai/types/find_symbols_response.py">FindSymbolsResponse</a></code>
- <code title="get /find">client.find.<a href="./src/opencode_ai/resources/find.py">text</a>(\*\*<a href="src/opencode_ai/types/find_text_params.py">params</a>) -> <a href="./src/opencode_ai/types/find_text_response.py">FindTextResponse</a></code>

# File

Types:

```python
from opencode_ai.types import FileSearchResponse
from opencode_ai.types import FileReadResponse, FileStatusResponse
```

Methods:

- <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>
- <code title="get /file">client.file.<a href="./src/opencode_ai/resources/file.py">read</a>(\*\*<a href="src/opencode_ai/types/file_read_params.py">params</a>) -> <a href="./src/opencode_ai/types/file_read_response.py">FileReadResponse</a></code>
- <code title="get /file/status">client.file.<a href="./src/opencode_ai/resources/file.py">status</a>() -> <a href="./src/opencode_ai/types/file_status_response.py">FileStatusResponse</a></code>

# Config

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "opencode-ai"
version = "0.1.0-alpha.6"
version = "0.1.0-alpha.7"
description = "The official Python library for the opencode API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
12 changes: 7 additions & 5 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
set -exuo pipefail

RESPONSE=$(curl -X POST "$URL" \
FILENAME=$(basename dist/*.whl)

RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \
-H "Authorization: Bearer $AUTH" \
-H "Content-Type: application/json")

Expand All @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)
UPLOAD_RESPONSE=$(curl -v -X PUT \
-H "Content-Type: binary/octet-stream" \
--data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1)

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
echo -e "\033[32mInstallation: pip install --pre 'https://pkg.stainless.com/s/opencode-python/$SHA'\033[0m"
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/opencode-python/$SHA/$FILENAME'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
Expand Down
10 changes: 9 additions & 1 deletion src/opencode_ai/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
from ._utils import is_given, get_async_library
from ._version import __version__
from .resources import app, file, event, config, session
from .resources import app, file, find, event, config, session
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError
from ._base_client import (
Expand All @@ -45,6 +45,7 @@
class Opencode(SyncAPIClient):
event: event.EventResource
app: app.AppResource
find: find.FindResource
file: file.FileResource
config: config.ConfigResource
session: session.SessionResource
Expand Down Expand Up @@ -96,6 +97,7 @@ def __init__(

self.event = event.EventResource(self)
self.app = app.AppResource(self)
self.find = find.FindResource(self)
self.file = file.FileResource(self)
self.config = config.ConfigResource(self)
self.session = session.SessionResource(self)
Expand Down Expand Up @@ -202,6 +204,7 @@ def _make_status_error(
class AsyncOpencode(AsyncAPIClient):
event: event.AsyncEventResource
app: app.AsyncAppResource
find: find.AsyncFindResource
file: file.AsyncFileResource
config: config.AsyncConfigResource
session: session.AsyncSessionResource
Expand Down Expand Up @@ -253,6 +256,7 @@ def __init__(

self.event = event.AsyncEventResource(self)
self.app = app.AsyncAppResource(self)
self.find = find.AsyncFindResource(self)
self.file = file.AsyncFileResource(self)
self.config = config.AsyncConfigResource(self)
self.session = session.AsyncSessionResource(self)
Expand Down Expand Up @@ -360,6 +364,7 @@ class OpencodeWithRawResponse:
def __init__(self, client: Opencode) -> None:
self.event = event.EventResourceWithRawResponse(client.event)
self.app = app.AppResourceWithRawResponse(client.app)
self.find = find.FindResourceWithRawResponse(client.find)
self.file = file.FileResourceWithRawResponse(client.file)
self.config = config.ConfigResourceWithRawResponse(client.config)
self.session = session.SessionResourceWithRawResponse(client.session)
Expand All @@ -369,6 +374,7 @@ class AsyncOpencodeWithRawResponse:
def __init__(self, client: AsyncOpencode) -> None:
self.event = event.AsyncEventResourceWithRawResponse(client.event)
self.app = app.AsyncAppResourceWithRawResponse(client.app)
self.find = find.AsyncFindResourceWithRawResponse(client.find)
self.file = file.AsyncFileResourceWithRawResponse(client.file)
self.config = config.AsyncConfigResourceWithRawResponse(client.config)
self.session = session.AsyncSessionResourceWithRawResponse(client.session)
Expand All @@ -378,6 +384,7 @@ class OpencodeWithStreamedResponse:
def __init__(self, client: Opencode) -> None:
self.event = event.EventResourceWithStreamingResponse(client.event)
self.app = app.AppResourceWithStreamingResponse(client.app)
self.find = find.FindResourceWithStreamingResponse(client.find)
self.file = file.FileResourceWithStreamingResponse(client.file)
self.config = config.ConfigResourceWithStreamingResponse(client.config)
self.session = session.SessionResourceWithStreamingResponse(client.session)
Expand All @@ -387,6 +394,7 @@ class AsyncOpencodeWithStreamedResponse:
def __init__(self, client: AsyncOpencode) -> None:
self.event = event.AsyncEventResourceWithStreamingResponse(client.event)
self.app = app.AsyncAppResourceWithStreamingResponse(client.app)
self.find = find.AsyncFindResourceWithStreamingResponse(client.find)
self.file = file.AsyncFileResourceWithStreamingResponse(client.file)
self.config = config.AsyncConfigResourceWithStreamingResponse(client.config)
self.session = session.AsyncSessionResourceWithStreamingResponse(client.session)
Expand Down
2 changes: 1 addition & 1 deletion src/opencode_ai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "opencode_ai"
__version__ = "0.1.0-alpha.6" # x-release-please-version
__version__ = "0.1.0-alpha.7" # x-release-please-version
14 changes: 14 additions & 0 deletions src/opencode_ai/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
FileResourceWithStreamingResponse,
AsyncFileResourceWithStreamingResponse,
)
from .find import (
FindResource,
AsyncFindResource,
FindResourceWithRawResponse,
AsyncFindResourceWithRawResponse,
FindResourceWithStreamingResponse,
AsyncFindResourceWithStreamingResponse,
)
from .event import (
EventResource,
AsyncEventResource,
Expand Down Expand Up @@ -54,6 +62,12 @@
"AsyncAppResourceWithRawResponse",
"AppResourceWithStreamingResponse",
"AsyncAppResourceWithStreamingResponse",
"FindResource",
"AsyncFindResource",
"FindResourceWithRawResponse",
"AsyncFindResourceWithRawResponse",
"FindResourceWithStreamingResponse",
"AsyncFindResourceWithStreamingResponse",
"FileResource",
"AsyncFileResource",
"FileResourceWithRawResponse",
Expand Down
Loading