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.19"
".": "0.1.0-alpha.20"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-8792f91dd070f7b4ee671fc86e8a03976dc7fb6ee49f8c99ad989e1597003774.yml
openapi_spec_hash: fe9dc3a074be560de0b97df9b5af2c1b
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-f9a2ce0fd0addc365614ef8c4bb1746f5ba14bc92f3d01f4cd85fb3b33a8d975.yml
openapi_spec_hash: c58dec8e5250d41f216cded6afb763af
config_hash: b7f3d9742335715c458494988498b183
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.20 (2025-07-17)

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

### Features

* **api:** api update ([f48c0d6](https://github.com/sst/opencode-sdk-python/commit/f48c0d6bb1943df3e3758d19b83c70fd1c15e2c2))

## 0.1.0-alpha.19 (2025-07-16)

Full Changelog: [v0.1.0-alpha.18...v0.1.0-alpha.19](https://github.com/sst/opencode-sdk-python/compare/v0.1.0-alpha.18...v0.1.0-alpha.19)
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.19"
version = "0.1.0-alpha.20"
description = "The official Python library for the opencode API"
dynamic = ["readme"]
license = "Apache-2.0"
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.19" # x-release-please-version
__version__ = "0.1.0-alpha.20" # x-release-please-version
20 changes: 12 additions & 8 deletions src/opencode_ai/resources/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ def chat(
self,
id: str,
*,
message_id: str,
mode: str,
model_id: str,
parts: Iterable[session_chat_params.Part],
provider_id: str,
session_id: str,
message_id: str | NotGiven = NOT_GIVEN,
mode: str | 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.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -190,11 +191,12 @@ def chat(
f"/session/{id}/message",
body=maybe_transform(
{
"message_id": message_id,
"mode": mode,
"model_id": model_id,
"parts": parts,
"provider_id": provider_id,
"session_id": session_id,
"message_id": message_id,
"mode": mode,
},
session_chat_params.SessionChatParams,
),
Expand Down Expand Up @@ -524,11 +526,12 @@ async def chat(
self,
id: str,
*,
message_id: str,
mode: str,
model_id: str,
parts: Iterable[session_chat_params.Part],
provider_id: str,
session_id: str,
message_id: str | NotGiven = NOT_GIVEN,
mode: str | 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.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -556,11 +559,12 @@ async def chat(
f"/session/{id}/message",
body=await async_maybe_transform(
{
"message_id": message_id,
"mode": mode,
"model_id": model_id,
"parts": parts,
"provider_id": provider_id,
"session_id": session_id,
"message_id": message_id,
"mode": mode,
},
session_chat_params.SessionChatParams,
),
Expand Down
2 changes: 0 additions & 2 deletions src/opencode_ai/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
from .layout_config import LayoutConfig as LayoutConfig
from .snapshot_part import SnapshotPart as SnapshotPart
from .app_log_params import AppLogParams as AppLogParams
from .file_part_param import FilePartParam as FilePartParam
from .keybinds_config import KeybindsConfig as KeybindsConfig
from .step_start_part import StepStartPart as StepStartPart
from .text_part_param import TextPartParam as TextPartParam
from .app_log_response import AppLogResponse as AppLogResponse
from .file_read_params import FileReadParams as FileReadParams
from .find_text_params import FindTextParams as FindTextParams
Expand Down
6 changes: 3 additions & 3 deletions src/opencode_ai/types/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ class Config(BaseModel):
provider: Optional[Dict[str, Provider]] = None
"""Custom provider configurations and model overrides"""

share: Optional[Literal["auto", "disabled"]] = None
share: Optional[Literal["manual", "auto", "disabled"]] = None
"""
Control sharing behavior: 'auto' enables automatic sharing, 'disabled' disables
all sharing
Control sharing behavior:'manual' allows manual sharing via commands, 'auto'
enables automatic sharing, 'disabled' disables all sharing
"""

theme: Optional[str] = None
Expand Down
25 changes: 0 additions & 25 deletions src/opencode_ai/types/file_part_param.py

This file was deleted.

5 changes: 4 additions & 1 deletion src/opencode_ai/types/keybinds_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ class KeybindsConfig(BaseModel):
"""Unshare current session"""

switch_mode: str
"""Switch mode"""
"""Next mode"""

switch_mode_reverse: str
"""Previous Mode"""

theme_list: str
"""List available themes"""
Expand Down
5 changes: 4 additions & 1 deletion src/opencode_ai/types/mcp_remote_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing import Dict, Optional
from typing_extensions import Literal

from .._models import BaseModel
Expand All @@ -17,3 +17,6 @@ class McpRemoteConfig(BaseModel):

enabled: Optional[bool] = None
"""Enable or disable the MCP server on startup"""

headers: Optional[Dict[str, str]] = None
"""Headers to send with the request"""
48 changes: 39 additions & 9 deletions src/opencode_ai/types/session_chat_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,55 @@
from __future__ import annotations

from typing import Union, Iterable
from typing_extensions import Required, Annotated, TypeAlias, TypedDict
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict

from .._utils import PropertyInfo
from .file_part_param import FilePartParam
from .text_part_param import TextPartParam

__all__ = ["SessionChatParams", "Part"]
__all__ = ["SessionChatParams", "Part", "PartUnionMember0", "PartUnionMember0Time", "PartUnionMember1"]


class SessionChatParams(TypedDict, total=False):
message_id: Required[Annotated[str, PropertyInfo(alias="messageID")]]

mode: Required[str]

model_id: Required[Annotated[str, PropertyInfo(alias="modelID")]]

parts: Required[Iterable[Part]]

provider_id: Required[Annotated[str, PropertyInfo(alias="providerID")]]

session_id: Required[Annotated[str, PropertyInfo(alias="sessionID")]]

message_id: Annotated[str, PropertyInfo(alias="messageID")]

mode: str


class PartUnionMember0Time(TypedDict, total=False):
start: Required[float]

end: float


class PartUnionMember0(TypedDict, total=False):
text: Required[str]

type: Required[Literal["text"]]

id: str

synthetic: bool

time: PartUnionMember0Time


class PartUnionMember1(TypedDict, total=False):
mime: Required[str]

type: Required[Literal["file"]]

url: Required[str]

id: str

filename: str


Part: TypeAlias = Union[FilePartParam, TextPartParam]
Part: TypeAlias = Union[PartUnionMember0, PartUnionMember1]
31 changes: 0 additions & 31 deletions src/opencode_ai/types/text_part_param.py

This file was deleted.

Loading