from opencode_ai.types import MessageAbortedError, ProviderAuthError, UnknownErrorExpanded definitions (top-level types; referenced subtypes link to source)
class MessageAbortedError(BaseModel):
data: object
name: Literal['MessageAbortedError']class ProviderAuthError(BaseModel):
data: Data
name: Literal['ProviderAuthError']class UnknownError(BaseModel):
data: Data
name: Literal['UnknownError']Types:
from opencode_ai.types import EventListResponseExpanded definitions (top-level types; referenced subtypes link to source)
EventListResponse: TypeAlias = Union[
EventUnknown,
EventPluginAdded,
EventCatalogModelUpdated,
EventSessionCreated,
EventSessionUpdated,
EventSessionDeleted,
EventMessageUpdated,
EventMessageRemoved,
EventMessagePartUpdated,
EventMessagePartRemoved,
EventModelsDevRefreshed,
EventSessionNextAgentSwitched,
EventSessionNextModelSwitched,
EventSessionNextMoved,
EventSessionNextPrompted,
EventSessionNextPromptAdmitted,
EventSessionNextPromptPromoted,
EventSessionNextContextUpdated,
EventSessionNextSynthetic,
EventSessionNextShellStarted,
EventSessionNextShellEnded,
EventSessionNextStepStarted,
EventSessionNextStepEnded,
EventSessionNextStepFailed,
EventSessionNextTextStarted,
EventSessionNextTextDelta,
EventSessionNextTextEnded,
EventSessionNextReasoningStarted,
EventSessionNextReasoningDelta,
EventSessionNextReasoningEnded,
EventSessionNextToolInputStarted,
EventSessionNextToolInputDelta,
EventSessionNextToolInputEnded,
EventSessionNextToolCalled,
EventSessionNextToolProgress,
EventSessionNextToolSuccess,
EventSessionNextToolFailed,
EventSessionNextRetried,
EventSessionNextCompactionStarted,
EventSessionNextCompactionDelta,
EventSessionNextCompactionEnded,
EventPermissionV2Asked,
EventPermissionV2Replied,
EventAccountAdded,
EventAccountRemoved,
EventAccountSwitched,
EventPermissionAsked,
EventPermissionReplied,
EventMessagePartDelta,
EventSessionDiff,
EventSessionError,
EventLspUpdated,
EventFileWatcherUpdated,
EventFileEdited,
EventPtyCreated,
EventPtyUpdated,
EventPtyExited,
EventPtyDeleted,
EventQuestionV2Asked,
EventQuestionV2Replied,
EventQuestionV2Rejected,
EventTodoUpdated,
EventInstallationUpdated,
EventInstallationUpdateAvailable,
EventTuiPromptAppend,
EventTuiCommandExecute,
EventTuiToastShow,
EventTuiSessionSelect,
EventMcpToolsChanged,
EventMcpBrowserOpenFailed,
EventQuestionAsked,
EventQuestionReplied,
EventQuestionRejected,
EventCommandExecuted,
EventSessionStatus,
EventSessionIdle,
EventSessionCompacted,
EventProjectDirectoriesUpdated,
EventProjectUpdated,
EventVcsBranchUpdated,
EventWorkspaceReady,
EventWorkspaceFailed,
EventWorkspaceStatus,
EventWorktreeReady,
EventWorktreeFailed,
EventServerConnected,
EventGlobalDisposed,
EventServerInstanceDisposed,
] # discriminated by "type"Methods:
client.event.list() -> EventListResponse
Types:
from opencode_ai.types import (
Model,
Provider,
AppAgentsResponse,
AppLogResponse,
AppProvidersResponse,
AppSkillsResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
class Model(BaseModel):
id: str
attachment: bool
cost: Cost
limit: Limit
name: str
options: Dict[str, object]
reasoning: bool
release_date: str
temperature: bool
tool_call: boolclass Provider(BaseModel):
api: Optional[str]
blacklist: Optional[List[str]]
env: Optional[List[str]]
id: Optional[str]
models: Optional[Dict[str, ProviderModels]]
name: Optional[str]
npm: Optional[str]
options: Optional[ProviderOptions]
whitelist: Optional[List[str]]AppAgentsResponse: TypeAlias = List[Agent]AppLogResponse: TypeAlias = boolclass AppProvidersResponse(BaseModel):
default: Dict[str, str]
providers: List[Provider]AppSkillsResponse: TypeAlias = List[Skill]Methods:
client.app.agents() -> AppAgentsResponseclient.app.log(**params) -> AppLogResponseclient.app.providers() -> AppProvidersResponseclient.app.skills() -> AppSkillsResponse
Types:
from opencode_ai.types import Symbol, FindFilesResponse, FindSymbolsResponse, FindTextResponseExpanded definitions (top-level types; referenced subtypes link to source)
class Symbol(BaseModel):
kind: float
location: Location
name: strFindFilesResponse: TypeAlias = List[str]FindSymbolsResponse: TypeAlias = List[Symbol]FindTextResponse: TypeAlias = List[FindTextResponseItem]Methods:
client.find.files(**params) -> FindFilesResponseclient.find.symbols(**params) -> FindSymbolsResponseclient.find.text(**params) -> FindTextResponse
Types:
from opencode_ai.types import File, FileListResponse, FileContentResponse, FileStatusResponseExpanded definitions (top-level types; referenced subtypes link to source)
class File(BaseModel):
added: int
path: str
removed: int
status: Literal['added', 'deleted', 'modified']FileListResponse: TypeAlias = List[FileNode]class FileContentResponse(BaseModel):
content: str
type: Literal['text', 'binary']
diff: Optional[str]
encoding: Optional[Literal['base64']]
mime_type: Optional[str] # wire name: "mimeType"
patch: Optional[object]FileStatusResponse: TypeAlias = List[File]Methods:
client.file.list(**params) -> FileListResponseclient.file.content(**params) -> FileContentResponseclient.file.status() -> FileStatusResponse
Types:
from opencode_ai.types import (
AgentConfig,
Config,
McpLocalConfig,
McpRemoteConfig,
PermissionActionConfig,
PermissionConfig,
PermissionConfigObject,
PermissionRuleConfig,
)Expanded definitions (top-level types; referenced subtypes link to source)
class AgentConfig(BaseModel):
color: Optional[str]
description: Optional[str]
disable: Optional[bool]
hidden: Optional[bool]
max_steps: Optional[int] # wire name: "maxSteps"
mode: Optional[Literal['subagent', 'primary', 'all']]
model: Optional[str]
options: Optional[object]
permission: Optional[PermissionConfig]
prompt: Optional[str]
steps: Optional[int]
temperature: Optional[float]
tools: Optional[Dict[str, bool]]
top_p: Optional[float]
variant: Optional[str]class Config(BaseModel):
schema_: Optional[str] # wire name: "$schema"
agent: Optional[Agent]
attachment: Optional[Attachment]
autoshare: Optional[bool]
autoupdate: Optional[Union[bool, Literal['notify']]]
command: Optional[Dict[str, CommandConfig]]
compaction: Optional[Compaction]
default_agent: Optional[str]
disabled_providers: Optional[List[str]]
enabled_providers: Optional[List[str]]
enterprise: Optional[Enterprise]
experimental: Optional[Experimental]
formatter: Optional[Union[bool, Dict[str, FormatterConfig]]]
instructions: Optional[List[str]]
layout: Optional[Literal['auto', 'stretch']]
log_level: Optional[Literal['DEBUG', 'INFO', 'WARN', 'ERROR']] # wire name: "logLevel"
lsp: Optional[Union[bool, Dict[str, LspConfig]]]
mcp: Optional[Dict[str, Mcp]]
mode: Optional[Mode]
model: Optional[str]
permission: Optional[PermissionConfig]
plugin: Optional[List[Union[str, Tuple[str, object]]]]
provider: Optional[Dict[str, Provider]]
reference: Optional[Dict[str, ReferenceConfigEntry]]
server: Optional[Server]
share: Optional[Literal['manual', 'auto', 'disabled']]
shell: Optional[str]
skills: Optional[Skills]
small_model: Optional[str]
snapshot: Optional[bool]
tool_output: Optional[ToolOutput]
tools: Optional[Dict[str, bool]]
username: Optional[str]
watcher: Optional[Watcher]class McpLocalConfig(BaseModel):
command: List[str]
type: Literal['local']
enabled: Optional[bool]
environment: Optional[Dict[str, str]]
timeout: Optional[int]class McpRemoteConfig(BaseModel):
type: Literal['remote']
url: str
enabled: Optional[bool]
headers: Optional[Dict[str, str]]
oauth: Optional[OAuth]
timeout: Optional[int]PermissionActionConfig: TypeAlias = Literal['ask', 'allow', 'deny']PermissionConfig: TypeAlias = Union[
PermissionActionConfig,
PermissionConfigObject,
]class PermissionConfigObject(BaseModel):
bash: Optional[PermissionRuleConfig]
doom_loop: Optional[PermissionActionConfig]
edit: Optional[PermissionRuleConfig]
external_directory: Optional[PermissionRuleConfig]
glob: Optional[PermissionRuleConfig]
grep: Optional[PermissionRuleConfig]
list: Optional[PermissionRuleConfig]
lsp: Optional[PermissionRuleConfig]
question: Optional[PermissionActionConfig]
read: Optional[PermissionRuleConfig]
skill: Optional[PermissionRuleConfig]
task: Optional[PermissionRuleConfig]
todowrite: Optional[PermissionActionConfig]
webfetch: Optional[PermissionActionConfig]
websearch: Optional[PermissionActionConfig]
__pydantic_extra__: Dict[str, PermissionRuleConfig]PermissionRuleConfig: TypeAlias = Union[
PermissionActionConfig,
Dict[str, PermissionActionConfig],
]Methods:
Types:
from opencode_ai.types import (
AgentPart,
AssistantMessage,
CompactionPart,
FilePart,
FilePartInputParam,
FilePartSource,
FilePartSourceText,
FileSource,
Message,
Part,
PartUnknown,
PatchPart,
ReasoningPart,
ResourceSource,
RetryPart,
Session,
SnapshotPart,
StepFinishPart,
StepStartPart,
SubtaskPart,
SymbolSource,
TextPart,
TextPartInputParam,
ToolPart,
ToolStateCompleted,
ToolStateError,
ToolStatePending,
ToolStateRunning,
Todo,
UserMessage,
SessionListResponse,
SessionDeleteResponse,
SessionAbortResponse,
SessionInitResponse,
SessionMessagesResponse,
SessionPromptResponse,
SessionSummarizeResponse,
SessionChildrenResponse,
SessionCommandResponse,
SessionDeleteMessageResponse,
SessionDeletePartResponse,
SessionDiffResponse,
SessionMessagesResponseItem,
SessionRespondPermissionResponse,
SessionShellResponse,
SessionStatusResponse,
SessionTodoResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
class AgentPart(BaseModel):
id: str
message_id: str # wire name: "messageID"
name: str
session_id: str # wire name: "sessionID"
type: Literal['agent']
source: Optional[AgentPartSource]class AssistantMessage(BaseModel):
id: str
agent: str
cost: float
mode: str
api_model_id: str # wire name: "modelID"
parent_id: str # wire name: "parentID"
path: Path
provider_id: str # wire name: "providerID"
role: Literal['assistant']
session_id: str # wire name: "sessionID"
time: Time
tokens: Tokens
error: Optional[Error]
finish: Optional[str]
structured: Optional[object]
summary: Optional[bool]
variant: Optional[str]class CompactionPart(BaseModel):
id: str
auto: bool
message_id: str # wire name: "messageID"
session_id: str # wire name: "sessionID"
type: Literal['compaction']
overflow: Optional[bool]
tail_start_id: Optional[str]class FilePart(BaseModel):
id: str
message_id: str # wire name: "messageID"
mime: str
session_id: str # wire name: "sessionID"
type: Literal['file']
url: str
filename: Optional[str]
source: Optional[FilePartSource]class FilePartInputParam(TypedDict):
mime: Required[str]
type: Required[Literal['file']]
url: Required[str]
id: str
filename: str
source: FilePartSourceParamFilePartSource: TypeAlias = Union[
FileSource,
SymbolSource,
ResourceSource,
] # discriminated by "type"class FilePartSourceText(BaseModel):
end: int
start: int
value: strclass FileSource(BaseModel):
path: str
text: FilePartSourceText
type: Literal['file']Message: TypeAlias = Union[
UserMessage,
AssistantMessage,
] # discriminated by "role"Part: TypeAlias = Union[
PartUnknown,
TextPart,
SubtaskPart,
ReasoningPart,
FilePart,
ToolPart,
StepStartPart,
StepFinishPart,
SnapshotPart,
PatchPart,
AgentPart,
RetryPart,
CompactionPart,
] # discriminated by "type"class PartUnknown(BaseModel):
"""Permissive fallback for `Part` `type` values not yet enumerated by this SDK.
The server's part union may grow beyond the variants modeled here. Rather
than raising when an unrecognized `type` is encountered, unmatched parts
deserialize into this open-ended model so message/session responses keep
working as the server adds new part kinds. See `EventUnknown` in
`event_list_response.py` for the sibling pattern and the ordering rationale
reproduced below."""
type: strclass PatchPart(BaseModel):
id: str
files: List[str]
hash: str
message_id: str # wire name: "messageID"
session_id: str # wire name: "sessionID"
type: Literal['patch']class ReasoningPart(BaseModel):
id: str
message_id: str # wire name: "messageID"
session_id: str # wire name: "sessionID"
text: str
time: ReasoningPartTime
type: Literal['reasoning']
metadata: Optional[object]class ResourceSource(BaseModel):
client_name: str # wire name: "clientName"
text: FilePartSourceText
type: Literal['resource']
uri: strclass RetryPart(BaseModel):
id: str
attempt: int
error: APIError
message_id: str # wire name: "messageID"
session_id: str # wire name: "sessionID"
time: RetryPartTime
type: Literal['retry']class Session(BaseModel):
id: str
directory: str
project_id: str # wire name: "projectID"
slug: str
time: Time
title: str
version: str
agent: Optional[str]
cost: Optional[float]
metadata: Optional[object]
model: Optional[Model]
parent_id: Optional[str] # wire name: "parentID"
path: Optional[str]
permission: Optional[List[PermissionRule]]
revert: Optional[Revert]
share: Optional[Share]
summary: Optional[Summary]
tokens: Optional[Tokens]
workspace_id: Optional[str] # wire name: "workspaceID"class SnapshotPart(BaseModel):
id: str
message_id: str # wire name: "messageID"
session_id: str # wire name: "sessionID"
snapshot: str
type: Literal['snapshot']class StepFinishPart(BaseModel):
id: str
cost: float
message_id: str # wire name: "messageID"
reason: str
session_id: str # wire name: "sessionID"
tokens: StepFinishPartTokens
type: Literal['step-finish']
snapshot: Optional[str]class StepStartPart(BaseModel):
id: str
message_id: str # wire name: "messageID"
session_id: str # wire name: "sessionID"
type: Literal['step-start']
snapshot: Optional[str]class SubtaskPart(BaseModel):
id: str
agent: str
description: str
message_id: str # wire name: "messageID"
prompt: str
session_id: str # wire name: "sessionID"
type: Literal['subtask']
command: Optional[str]
model: Optional[SubtaskPartModel]class SymbolSource(BaseModel):
kind: int
name: str
path: str
range: Range
text: FilePartSourceText
type: Literal['symbol']class TextPart(BaseModel):
id: str
message_id: str # wire name: "messageID"
session_id: str # wire name: "sessionID"
text: str
type: Literal['text']
ignored: Optional[bool]
metadata: Optional[object]
synthetic: Optional[bool]
time: Optional[TextPartTime]class TextPartInputParam(TypedDict):
text: Required[str]
type: Required[Literal['text']]
id: str
synthetic: bool
time: Timeclass ToolPart(BaseModel):
id: str
call_id: str # wire name: "callID"
message_id: str # wire name: "messageID"
session_id: str # wire name: "sessionID"
state: ToolPartState
tool: str
type: Literal['tool']
metadata: Optional[object]class ToolStateCompleted(BaseModel):
input: Dict[str, object]
metadata: Dict[str, object]
output: str
status: Literal['completed']
time: Time
title: strclass ToolStateError(BaseModel):
error: str
input: Dict[str, object]
status: Literal['error']
time: Timeclass ToolStatePending(BaseModel):
status: Literal['pending']class ToolStateRunning(BaseModel):
status: Literal['running']
time: Time
input: Optional[object]
metadata: Optional[Dict[str, object]]
title: Optional[str]class Todo(BaseModel):
content: str
status: str
priority: strclass UserMessage(BaseModel):
id: str
agent: str
model: Model
role: Literal['user']
session_id: str # wire name: "sessionID"
time: Time
format: Optional[object]
summary: Optional[object]
system: Optional[str]
tools: Optional[Dict[str, bool]]SessionListResponse: TypeAlias = List[Session]SessionDeleteResponse: TypeAlias = boolSessionAbortResponse: TypeAlias = boolSessionInitResponse: TypeAlias = boolSessionMessagesResponse: TypeAlias = List[SessionMessagesResponseItem]class SessionPromptResponse(BaseModel):
info: AssistantMessage
parts: List[Part]SessionSummarizeResponse: TypeAlias = boolSessionChildrenResponse: TypeAlias = List[Session]class SessionCommandResponse(BaseModel):
info: AssistantMessage
parts: List[Part]SessionDeleteMessageResponse: TypeAlias = boolSessionDeletePartResponse: TypeAlias = boolSessionDiffResponse: TypeAlias = List[SnapshotFileDiff]SessionRespondPermissionResponse: TypeAlias = boolSessionStatusResponse: TypeAlias = Dict[str, SessionStatus]SessionTodoResponse: TypeAlias = List[Todo]Methods:
client.session.create() -> Sessionclient.session.list(**params) -> SessionListResponseclient.session.get(id) -> Sessionclient.session.update(id, **params) -> Sessionclient.session.delete(id) -> SessionDeleteResponseclient.session.abort(id) -> SessionAbortResponseclient.session.children(id) -> SessionChildrenResponseclient.session.command(id, **params) -> SessionCommandResponseclient.session.delete_message(id, *, message_id) -> SessionDeleteMessageResponseclient.session.delete_part(id, *, message_id, part_id) -> SessionDeletePartResponseclient.session.diff(id, **params) -> SessionDiffResponseclient.session.fork(id, **params) -> Sessionclient.session.get_message(id, *, message_id) -> SessionMessagesResponseItemclient.session.prompt(id, **params) -> SessionPromptResponseclient.session.prompt_async(id, **params) -> Noneclient.session.respond_permission(id, *, permission_id, **params) -> SessionRespondPermissionResponseclient.session.init(id, **params) -> SessionInitResponseclient.session.messages(id, **params) -> SessionMessagesResponseclient.session.revert(id, **params) -> Sessionclient.session.share(id) -> Sessionclient.session.shell(id, **params) -> SessionShellResponseclient.session.status() -> SessionStatusResponseclient.session.summarize(id, **params) -> SessionSummarizeResponseclient.session.todo(id) -> SessionTodoResponseclient.session.unrevert(id) -> Sessionclient.session.unshare(id) -> Sessionclient.session.update_part(id, *, message_id, part_id, **params) -> Part
Types:
from opencode_ai.types import Project, ProjectListResponse, ProjectDirectoriesResponseExpanded definitions (top-level types; referenced subtypes link to source)
class Project(BaseModel):
id: str
sandboxes: List[str]
time: Time
worktree: str
commands: Optional[Commands]
icon: Optional[Icon]
name: Optional[str]
vcs: Optional[Literal['git']]ProjectListResponse: TypeAlias = List[Project]ProjectDirectoriesResponse: TypeAlias = List[str]Methods:
client.project.list() -> ProjectListResponseclient.project.update(project_id, **params) -> Projectclient.project.current() -> Projectclient.project.directories(project_id) -> ProjectDirectoriesResponseclient.project.init_git() -> Project
Types:
from opencode_ai.types import (
ProviderAuthMethod,
ProviderListResponse,
ProviderAuthResponse,
ProviderAuthAuthorization,
ProviderOAuthCallbackResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
class ProviderAuthMethod(BaseModel):
label: str
type: Literal['oauth', 'api']
prompts: Optional[List[Prompt]]class ProviderListResponse(BaseModel):
all: List[ProviderListResponseProvider]
connected: List[str]
default: Dict[str, str]ProviderAuthResponse: TypeAlias = Dict[str, List[ProviderAuthMethod]]class ProviderAuthAuthorization(BaseModel):
instructions: str
method: Literal['auto', 'code']
url: strProviderOAuthCallbackResponse: TypeAlias = boolMethods:
client.provider.list() -> ProviderListResponseclient.provider.auth() -> ProviderAuthResponseclient.provider.oauth_authorize(provider_id, **params) -> ProviderAuthAuthorizationclient.provider.oauth_callback(provider_id, **params) -> ProviderOAuthCallbackResponse
Types:
from opencode_ai.types import (
SyncHistoryListResponse,
SyncReplayResponse,
SyncStartResponse,
SyncStealResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
SyncHistoryListResponse: TypeAlias = List[SyncHistoryListResponseItem]class SyncReplayResponse(BaseModel):
session_id: str # wire name: "sessionID"SyncStartResponse: TypeAlias = boolclass SyncStealResponse(BaseModel):
session_id: str # wire name: "sessionID"Methods:
client.sync.history_list(**params) -> SyncHistoryListResponseclient.sync.replay(**params) -> SyncReplayResponseclient.sync.start() -> SyncStartResponseclient.sync.steal(**params) -> SyncStealResponse
Types:
from opencode_ai.types import (
MCPStatus,
MCPStatusConnected,
MCPStatusDisabled,
MCPStatusFailed,
MCPStatusNeedsAuth,
MCPStatusNeedsClientRegistration,
McpLocalConfig,
McpRemoteConfig,
McpAddResponse,
McpAuthRemoveResponse,
McpAuthStartResponse,
McpConnectResponse,
McpDisconnectResponse,
McpStatusResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
MCPStatus: TypeAlias = Union[
MCPStatusConnected,
MCPStatusDisabled,
MCPStatusFailed,
MCPStatusNeedsAuth,
MCPStatusNeedsClientRegistration,
] # discriminated by "status"class MCPStatusConnected(BaseModel):
status: Literal['connected']class MCPStatusDisabled(BaseModel):
status: Literal['disabled']class MCPStatusFailed(BaseModel):
error: str
status: Literal['failed']class MCPStatusNeedsAuth(BaseModel):
status: Literal['needs_auth']class MCPStatusNeedsClientRegistration(BaseModel):
error: str
status: Literal['needs_client_registration']class McpLocalConfig(BaseModel):
command: List[str]
type: Literal['local']
enabled: Optional[bool]
environment: Optional[Dict[str, str]]
timeout: Optional[int]class McpRemoteConfig(BaseModel):
type: Literal['remote']
url: str
enabled: Optional[bool]
headers: Optional[Dict[str, str]]
oauth: Optional[OAuth]
timeout: Optional[int]McpAddResponse: TypeAlias = Dict[str, MCPStatus]class McpAuthRemoveResponse(BaseModel):
success: Literal[True]class McpAuthStartResponse(BaseModel):
authorization_url: str # wire name: "authorizationUrl"
oauth_state: str # wire name: "oauthState"McpConnectResponse: TypeAlias = boolMcpDisconnectResponse: TypeAlias = boolMcpStatusResponse: TypeAlias = Dict[str, MCPStatus]Methods:
client.mcp.status() -> McpStatusResponseclient.mcp.add(**params) -> McpAddResponseclient.mcp.auth_start(name) -> McpAuthStartResponseclient.mcp.auth_remove(name) -> McpAuthRemoveResponseclient.mcp.auth_callback(name, **params) -> MCPStatusclient.mcp.auth_authenticate(name) -> MCPStatusclient.mcp.connect(name) -> McpConnectResponseclient.mcp.disconnect(name) -> McpDisconnectResponse
Types:
from opencode_ai.types import (
Pty,
PtyListResponse,
PtyConnectResponse,
PtyConnectTokenResponse,
PtyDeleteResponse,
PtyShellsResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
class Pty(BaseModel):
id: str
args: List[str]
command: str
cwd: str
pid: int
status: Literal['running', 'exited']
title: strPtyListResponse: TypeAlias = List[Pty]PtyConnectResponse: TypeAlias = boolclass PtyConnectTokenResponse(BaseModel):
expires_in: int
ticket: strPtyDeleteResponse: TypeAlias = boolPtyShellsResponse: TypeAlias = List[PtyShellsResponseItem]Methods:
client.pty.list() -> PtyListResponseclient.pty.create(**params) -> Ptyclient.pty.retrieve(pty_id) -> Ptyclient.pty.update(pty_id, **params) -> Ptyclient.pty.delete(pty_id) -> PtyDeleteResponseclient.pty.connect(pty_id, **params) -> PtyConnectResponseclient.pty.connect_token(pty_id) -> PtyConnectTokenResponseclient.pty.shells() -> PtyShellsResponse
Types:
from opencode_ai.types import (
TuiAppendPromptResponse,
TuiOpenHelpResponse,
TuiOpenSessionsResponse,
TuiOpenThemesResponse,
TuiOpenModelsResponse,
TuiSubmitPromptResponse,
TuiClearPromptResponse,
TuiExecuteCommandResponse,
TuiShowToastResponse,
TuiPublishResponse,
TuiSelectSessionResponse,
TuiControlNextResponse,
TuiControlResponseResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
TuiAppendPromptResponse: TypeAlias = boolTuiOpenHelpResponse: TypeAlias = boolTuiOpenSessionsResponse: TypeAlias = boolTuiOpenThemesResponse: TypeAlias = boolTuiOpenModelsResponse: TypeAlias = boolTuiSubmitPromptResponse: TypeAlias = boolTuiClearPromptResponse: TypeAlias = boolTuiExecuteCommandResponse: TypeAlias = boolTuiShowToastResponse: TypeAlias = boolTuiPublishResponse: TypeAlias = boolTuiSelectSessionResponse: TypeAlias = boolclass TuiControlNextResponse(BaseModel):
path: str
body: objectTuiControlResponseResponse: TypeAlias = boolMethods:
client.tui.append_prompt(**params) -> TuiAppendPromptResponseclient.tui.open_help() -> TuiOpenHelpResponseclient.tui.open_sessions() -> TuiOpenSessionsResponseclient.tui.open_themes() -> TuiOpenThemesResponseclient.tui.open_models() -> TuiOpenModelsResponseclient.tui.submit_prompt() -> TuiSubmitPromptResponseclient.tui.clear_prompt() -> TuiClearPromptResponseclient.tui.execute_command(**params) -> TuiExecuteCommandResponseclient.tui.show_toast(**params) -> TuiShowToastResponseclient.tui.publish(**params) -> TuiPublishResponseclient.tui.select_session(**params) -> TuiSelectSessionResponseclient.tui.control_next() -> TuiControlNextResponseclient.tui.control_response(**params) -> TuiControlResponseResponse
Types:
from opencode_ai.types import (
QuestionInfo,
QuestionOption,
QuestionRequest,
QuestionTool,
QuestionListResponse,
QuestionRejectResponse,
QuestionReplyResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
class QuestionInfo(BaseModel):
header: str
options: List[QuestionOption]
question: str
custom: Optional[bool]
multiple: Optional[bool]class QuestionOption(BaseModel):
description: str
label: strclass QuestionRequest(BaseModel):
id: str
questions: List[QuestionInfo]
session_id: str # wire name: "sessionID"
tool: Optional[QuestionTool]class QuestionTool(BaseModel):
call_id: str # wire name: "callID"
message_id: str # wire name: "messageID"QuestionListResponse: TypeAlias = List[QuestionRequest]QuestionRejectResponse: TypeAlias = boolQuestionReplyResponse: TypeAlias = boolMethods:
client.question.list() -> QuestionListResponseclient.question.reject(request_id) -> QuestionRejectResponseclient.question.reply(request_id, **params) -> QuestionReplyResponse
Types:
from opencode_ai.types import (
PermissionRequest,
PermissionListResponse,
PermissionReplyResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
class PermissionRequest(BaseModel):
id: str
always: List[str]
metadata: object
patterns: List[str]
permission: str
session_id: str # wire name: "sessionID"
tool: Optional[PermissionRequestTool]PermissionListResponse: TypeAlias = List[PermissionRequest]PermissionReplyResponse: TypeAlias = boolMethods:
client.permission.list() -> PermissionListResponseclient.permission.reply(request_id, **params) -> PermissionReplyResponse
Types:
from opencode_ai.types import PathExpanded definitions (top-level types; referenced subtypes link to source)
class Path(BaseModel):
cwd: str
root: strMethods:
Types:
from opencode_ai.types import (
VcsInfo,
VcsFileStatus,
VcsFileDiff,
VcsStatusResponse,
VcsDiffResponse,
VcsApplyResponse,
)Expanded definitions (top-level types; referenced subtypes link to source)
class VcsInfo(BaseModel):
branch: Optional[str]
default_branch: Optional[str]class VcsFileStatus(BaseModel):
additions: float
deletions: float
file: str
status: Literal['added', 'deleted', 'modified']class VcsFileDiff(BaseModel):
additions: float
deletions: float
file: str
patch: Optional[str]
status: Optional[Literal['added', 'deleted', 'modified']]VcsStatusResponse: TypeAlias = List[VcsFileStatus]VcsDiffResponse: TypeAlias = List[VcsFileDiff]class VcsApplyResponse(BaseModel):
applied: boolMethods:
client.vcs.get() -> VcsInfoclient.vcs.apply(**params) -> VcsApplyResponseclient.vcs.diff(**params) -> VcsDiffResponseclient.vcs.diff_raw() -> strclient.vcs.status() -> VcsStatusResponse
Types:
from opencode_ai.types import Command, CommandListResponseExpanded definitions (top-level types; referenced subtypes link to source)
class Command(BaseModel):
hints: List[str]
name: str
template: str
agent: Optional[str]
description: Optional[str]
model: Optional[str]
source: Optional[Literal['command', 'mcp', 'skill']]
subtask: Optional[bool]CommandListResponse: TypeAlias = List[Command]Methods:
client.command.list() -> CommandListResponse
Types:
from opencode_ai.types import LSPStatus, LspStatusResponseExpanded definitions (top-level types; referenced subtypes link to source)
class LSPStatus(BaseModel):
id: str
name: str
root: str
status: Literal['connected', 'error']LspStatusResponse: TypeAlias = List[LSPStatus]Methods:
client.lsp.status() -> LspStatusResponse
Types:
from opencode_ai.types import FormatterStatus, FormatterStatusResponseExpanded definitions (top-level types; referenced subtypes link to source)
class FormatterStatus(BaseModel):
enabled: bool
extensions: List[str]
name: strFormatterStatusResponse: TypeAlias = List[FormatterStatus]Methods:
client.formatter.status() -> FormatterStatusResponse
Types:
from opencode_ai.types import InstanceDisposeResponseExpanded definitions (top-level types; referenced subtypes link to source)
InstanceDisposeResponse: TypeAlias = boolMethods:
client.instance.dispose() -> bool
Types:
from opencode_ai.types import AuthSetResponse, AuthRemoveResponseExpanded definitions (top-level types; referenced subtypes link to source)
AuthSetResponse: TypeAlias = boolAuthRemoveResponse: TypeAlias = boolMethods: