From c2181c02870aa2fa62c10a911314904999c296f1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 03:35:30 +0000 Subject: [PATCH] chore(internal): codegen related update --- src/opencode_ai/_types.py | 5 +++-- src/opencode_ai/types/config.py | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/opencode_ai/_types.py b/src/opencode_ai/_types.py index 97c5da7..3a1e658 100644 --- a/src/opencode_ai/_types.py +++ b/src/opencode_ai/_types.py @@ -243,6 +243,9 @@ _T_co = TypeVar("_T_co", covariant=True) if TYPE_CHECKING: # This works because str.__contains__ does not accept object (either in typeshed or at runtime) # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + # + # Note: index() and count() methods are intentionally omitted to allow pyright to properly + # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr. class SequenceNotStr(Protocol[_T_co]): @overload def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... @@ -251,8 +254,6 @@ if TYPE_CHECKING: def __contains__(self, value: object, /) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T_co]: ... - def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... - def count(self, value: Any, /) -> int: ... def __reversed__(self) -> Iterator[_T_co]: ... else: # just point this to a normal `Sequence` at runtime to avoid having to special case diff --git a/src/opencode_ai/types/config.py b/src/opencode_ai/types/config.py index 5be481d..c9bcec8 100644 --- a/src/opencode_ai/types/config.py +++ b/src/opencode_ai/types/config.py @@ -214,6 +214,8 @@ class AgentAgentItem(BaseModel): class Agent(BaseModel): + """Agent configuration, see https://opencode.ai/docs/agent""" + build: Optional[AgentBuild] = None general: Optional[AgentGeneral] = None @@ -420,6 +422,8 @@ class ModeModeItem(BaseModel): class Mode(BaseModel): + """@deprecated Use `agent` field instead.""" + build: Optional[ModeBuild] = None plan: Optional[ModePlan] = None @@ -524,6 +528,8 @@ class Provider(BaseModel): class Tui(BaseModel): + """TUI specific settings""" + scroll_speed: float """TUI scroll speed"""