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
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.33"
".": "0.1.0-alpha.34"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 26
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-5748199af356c3243a46a466e73b5d0bab7eaa0c56895e1d0f903d637f61d0bb.yml
openapi_spec_hash: c04f6b6be54b05d9b1283c24e870163b
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-e43db0e3b4300d892558381c46238315784de13f980822a3224a956d94dbadb3.yml
openapi_spec_hash: eb2421d12fc2ffb165659b1af40a67e1
config_hash: 1ae82c93499b9f0b9ba828b8919f9cb3
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.1.0-alpha.34 (2025-07-28)

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

### Features

* **api:** api update ([0bc9251](https://github.com/sst/opencode-sdk-python/commit/0bc92517109d280c22e22639ee4ffa58d63d837b))
* **api:** api update ([14ada9d](https://github.com/sst/opencode-sdk-python/commit/14ada9d7d1e93d85f357f417633b691b116c8ad5))

## 0.1.0-alpha.33 (2025-07-25)

Full Changelog: [v0.1.0-alpha.32...v0.1.0-alpha.33](https://github.com/sst/opencode-sdk-python/compare/v0.1.0-alpha.32...v0.1.0-alpha.33)
Expand Down
8 changes: 1 addition & 7 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@ Methods:
Types:

```python
from opencode_ai.types import (
Match,
Symbol,
FindFilesResponse,
FindSymbolsResponse,
FindTextResponse,
)
from opencode_ai.types import Symbol, FindFilesResponse, FindSymbolsResponse, FindTextResponse
```

Methods:
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.33"
version = "0.1.0-alpha.34"
description = "The official Python library for the opencode API"
dynamic = ["readme"]
license = "MIT"
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.33" # x-release-please-version
__version__ = "0.1.0-alpha.34" # x-release-please-version
4 changes: 4 additions & 0 deletions src/opencode_ai/resources/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def chat(
provider_id: str,
message_id: str | NotGiven = NOT_GIVEN,
mode: str | NotGiven = NOT_GIVEN,
system: str | NotGiven = NOT_GIVEN,
tools: Dict[str, bool] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -196,6 +197,7 @@ def chat(
"provider_id": provider_id,
"message_id": message_id,
"mode": mode,
"system": system,
"tools": tools,
},
session_chat_params.SessionChatParams,
Expand Down Expand Up @@ -606,6 +608,7 @@ async def chat(
provider_id: str,
message_id: str | NotGiven = NOT_GIVEN,
mode: str | NotGiven = NOT_GIVEN,
system: str | NotGiven = NOT_GIVEN,
tools: Dict[str, bool] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -639,6 +642,7 @@ async def chat(
"provider_id": provider_id,
"message_id": message_id,
"mode": mode,
"system": system,
"tools": tools,
},
session_chat_params.SessionChatParams,
Expand Down
1 change: 0 additions & 1 deletion src/opencode_ai/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from .file import File as File
from .mode import Mode as Mode
from .part import Part as Part
from .match import Match as Match
from .model import Model as Model
from .config import Config as Config
from .shared import (
Expand Down
25 changes: 25 additions & 0 deletions src/opencode_ai/types/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

__all__ = [
"Config",
"Agent",
"AgentGeneral",
"AgentAgentItem",
"Experimental",
"ExperimentalHook",
"ExperimentalHookFileEdited",
Expand All @@ -28,6 +31,25 @@
]


class AgentGeneral(ModeConfig):
description: str


class AgentAgentItem(ModeConfig):
description: str


class Agent(BaseModel):
general: Optional[AgentGeneral] = None

__pydantic_extra__: Dict[str, AgentAgentItem] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
if TYPE_CHECKING:
# Stub to indicate that arbitrary properties are accepted.
# To access properties that are not valid identifiers you can use `getattr`, e.g.
# `getattr(obj, '$type')`
def __getattr__(self, attr: str) -> AgentAgentItem: ...


class ExperimentalHookFileEdited(BaseModel):
command: List[str]

Expand Down Expand Up @@ -137,6 +159,9 @@ class Config(BaseModel):
schema_: Optional[str] = FieldInfo(alias="$schema", default=None)
"""JSON schema reference for configuration validation"""

agent: Optional[Agent] = None
"""Modes configuration, see https://opencode.ai/docs/modes"""

autoshare: Optional[bool] = None
"""@deprecated Use 'share' field instead.

Expand Down
106 changes: 54 additions & 52 deletions src/opencode_ai/types/event_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@

__all__ = [
"EventListResponse",
"EventLspClientDiagnostics",
"EventLspClientDiagnosticsProperties",
"EventPermissionUpdated",
"EventPermissionUpdatedProperties",
"EventPermissionUpdatedPropertiesTime",
"EventFileEdited",
"EventFileEditedProperties",
"EventInstallationUpdated",
"EventInstallationUpdatedProperties",
"EventLspClientDiagnostics",
"EventLspClientDiagnosticsProperties",
"EventMessageUpdated",
"EventMessageUpdatedProperties",
"EventMessageRemoved",
Expand All @@ -35,6 +30,11 @@
"EventMessagePartRemovedProperties",
"EventStorageWrite",
"EventStorageWriteProperties",
"EventPermissionUpdated",
"EventPermissionUpdatedProperties",
"EventPermissionUpdatedPropertiesTime",
"EventFileEdited",
"EventFileEditedProperties",
"EventSessionUpdated",
"EventSessionUpdatedProperties",
"EventSessionDeleted",
Expand All @@ -52,6 +52,16 @@
]


class EventInstallationUpdatedProperties(BaseModel):
version: str


class EventInstallationUpdated(BaseModel):
properties: EventInstallationUpdatedProperties

type: Literal["installation.updated"]


class EventLspClientDiagnosticsProperties(BaseModel):
path: str

Expand All @@ -64,48 +74,6 @@ class EventLspClientDiagnostics(BaseModel):
type: Literal["lsp.client.diagnostics"]


class EventPermissionUpdatedPropertiesTime(BaseModel):
created: float


class EventPermissionUpdatedProperties(BaseModel):
id: str

metadata: Dict[str, object]

session_id: str = FieldInfo(alias="sessionID")

time: EventPermissionUpdatedPropertiesTime

title: str


class EventPermissionUpdated(BaseModel):
properties: EventPermissionUpdatedProperties

type: Literal["permission.updated"]


class EventFileEditedProperties(BaseModel):
file: str


class EventFileEdited(BaseModel):
properties: EventFileEditedProperties

type: Literal["file.edited"]


class EventInstallationUpdatedProperties(BaseModel):
version: str


class EventInstallationUpdated(BaseModel):
properties: EventInstallationUpdatedProperties

type: Literal["installation.updated"]


class EventMessageUpdatedProperties(BaseModel):
info: Message

Expand Down Expand Up @@ -143,6 +111,8 @@ class EventMessagePartRemovedProperties(BaseModel):

part_id: str = FieldInfo(alias="partID")

session_id: str = FieldInfo(alias="sessionID")


class EventMessagePartRemoved(BaseModel):
properties: EventMessagePartRemovedProperties
Expand All @@ -162,6 +132,38 @@ class EventStorageWrite(BaseModel):
type: Literal["storage.write"]


class EventPermissionUpdatedPropertiesTime(BaseModel):
created: float


class EventPermissionUpdatedProperties(BaseModel):
id: str

metadata: Dict[str, object]

session_id: str = FieldInfo(alias="sessionID")

time: EventPermissionUpdatedPropertiesTime

title: str


class EventPermissionUpdated(BaseModel):
properties: EventPermissionUpdatedProperties

type: Literal["permission.updated"]


class EventFileEditedProperties(BaseModel):
file: str


class EventFileEdited(BaseModel):
properties: EventFileEditedProperties

type: Literal["file.edited"]


class EventSessionUpdatedProperties(BaseModel):
info: Session

Expand Down Expand Up @@ -242,15 +244,15 @@ class EventIdeInstalled(BaseModel):

EventListResponse: TypeAlias = Annotated[
Union[
EventLspClientDiagnostics,
EventPermissionUpdated,
EventFileEdited,
EventInstallationUpdated,
EventLspClientDiagnostics,
EventMessageUpdated,
EventMessageRemoved,
EventMessagePartUpdated,
EventMessagePartRemoved,
EventStorageWrite,
EventPermissionUpdated,
EventFileEdited,
EventSessionUpdated,
EventSessionDeleted,
EventSessionIdle,
Expand Down
46 changes: 43 additions & 3 deletions src/opencode_ai/types/find_text_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,48 @@
from typing import List
from typing_extensions import TypeAlias

from .match import Match
from .._models import BaseModel

__all__ = ["FindTextResponse"]
__all__ = [
"FindTextResponse",
"FindTextResponseItem",
"FindTextResponseItemLines",
"FindTextResponseItemPath",
"FindTextResponseItemSubmatch",
"FindTextResponseItemSubmatchMatch",
]

FindTextResponse: TypeAlias = List[Match]

class FindTextResponseItemLines(BaseModel):
text: str


class FindTextResponseItemPath(BaseModel):
text: str


class FindTextResponseItemSubmatchMatch(BaseModel):
text: str


class FindTextResponseItemSubmatch(BaseModel):
end: float

match: FindTextResponseItemSubmatchMatch

start: float


class FindTextResponseItem(BaseModel):
absolute_offset: float

line_number: float

lines: FindTextResponseItemLines

path: FindTextResponseItemPath

submatches: List[FindTextResponseItemSubmatch]


FindTextResponse: TypeAlias = List[FindTextResponseItem]
39 changes: 0 additions & 39 deletions src/opencode_ai/types/match.py

This file was deleted.

Loading