Documentation
¶
Index ¶
- Constants
- func Bool(value bool) param.Field[bool]
- func DefaultClientOptions() []option.RequestOption
- func F[T any](value T) param.Field[T]
- func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]
- func Float(value float64) param.Field[float64]
- func Int(value int64) param.Field[int64]
- func Null[T any]() param.Field[T]
- func Raw[T any](value any) param.Field[T]
- func String(value string) param.Field[string]
- type App
- type AppLogParams
- type AppLogParamsLevel
- type AppPath
- type AppProvidersResponse
- type AppService
- func (r *AppService) Get(ctx context.Context, opts ...option.RequestOption) (res *App, err error)
- func (r *AppService) Init(ctx context.Context, opts ...option.RequestOption) (res *bool, err error)
- func (r *AppService) Log(ctx context.Context, body AppLogParams, opts ...option.RequestOption) (res *bool, err error)
- func (r *AppService) Modes(ctx context.Context, opts ...option.RequestOption) (res *[]Mode, err error)
- func (r *AppService) Providers(ctx context.Context, opts ...option.RequestOption) (res *AppProvidersResponse, err error)
- type AppTime
- type AssistantMessage
- type AssistantMessageError
- type AssistantMessageErrorMessageOutputLengthError
- type AssistantMessageErrorMessageOutputLengthErrorName
- type AssistantMessageErrorName
- type AssistantMessageErrorUnion
- type AssistantMessagePath
- type AssistantMessageRole
- type AssistantMessageTime
- type AssistantMessageTokens
- type AssistantMessageTokensCache
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, ...) error
- func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- type Config
- type ConfigAgent
- type ConfigAgentGeneral
- type ConfigExperimental
- type ConfigExperimentalHook
- type ConfigExperimentalHookFileEdited
- type ConfigExperimentalHookSessionCompleted
- type ConfigLayout
- type ConfigMcp
- type ConfigMcpType
- type ConfigMcpUnion
- type ConfigMode
- type ConfigProvider
- type ConfigProviderModel
- type ConfigProviderModelsCost
- type ConfigProviderModelsLimit
- type ConfigProviderOptions
- type ConfigService
- type ConfigShare
- type Error
- type EventListResponse
- type EventListResponseEventFileEdited
- type EventListResponseEventFileEditedProperties
- type EventListResponseEventFileEditedType
- type EventListResponseEventFileWatcherUpdated
- type EventListResponseEventFileWatcherUpdatedProperties
- type EventListResponseEventFileWatcherUpdatedPropertiesEvent
- type EventListResponseEventFileWatcherUpdatedType
- type EventListResponseEventIdeInstalled
- type EventListResponseEventIdeInstalledProperties
- type EventListResponseEventIdeInstalledType
- type EventListResponseEventInstallationUpdated
- type EventListResponseEventInstallationUpdatedProperties
- type EventListResponseEventInstallationUpdatedType
- type EventListResponseEventLspClientDiagnostics
- type EventListResponseEventLspClientDiagnosticsProperties
- type EventListResponseEventLspClientDiagnosticsType
- type EventListResponseEventMessagePartRemoved
- type EventListResponseEventMessagePartRemovedProperties
- type EventListResponseEventMessagePartRemovedType
- type EventListResponseEventMessagePartUpdated
- type EventListResponseEventMessagePartUpdatedProperties
- type EventListResponseEventMessagePartUpdatedType
- type EventListResponseEventMessageRemoved
- type EventListResponseEventMessageRemovedProperties
- type EventListResponseEventMessageRemovedType
- type EventListResponseEventMessageUpdated
- type EventListResponseEventMessageUpdatedProperties
- type EventListResponseEventMessageUpdatedType
- type EventListResponseEventPermissionUpdated
- type EventListResponseEventPermissionUpdatedProperties
- type EventListResponseEventPermissionUpdatedPropertiesTime
- type EventListResponseEventPermissionUpdatedType
- type EventListResponseEventServerConnected
- type EventListResponseEventServerConnectedType
- type EventListResponseEventSessionDeleted
- type EventListResponseEventSessionDeletedProperties
- type EventListResponseEventSessionDeletedType
- type EventListResponseEventSessionError
- type EventListResponseEventSessionErrorProperties
- type EventListResponseEventSessionErrorPropertiesError
- type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError
- type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName
- type EventListResponseEventSessionErrorPropertiesErrorName
- type EventListResponseEventSessionErrorPropertiesErrorUnion
- type EventListResponseEventSessionErrorType
- type EventListResponseEventSessionIdle
- type EventListResponseEventSessionIdleProperties
- type EventListResponseEventSessionIdleType
- type EventListResponseEventSessionUpdated
- type EventListResponseEventSessionUpdatedProperties
- type EventListResponseEventSessionUpdatedType
- type EventListResponseEventStorageWrite
- type EventListResponseEventStorageWriteProperties
- type EventListResponseEventStorageWriteType
- type EventListResponseType
- type EventListResponseUnion
- type EventService
- type File
- type FilePart
- type FilePartInputParam
- type FilePartInputType
- type FilePartSource
- type FilePartSourceParam
- type FilePartSourceText
- type FilePartSourceTextParam
- type FilePartSourceType
- type FilePartSourceUnion
- type FilePartSourceUnionParam
- type FilePartType
- type FileReadParams
- type FileReadResponse
- type FileReadResponseType
- type FileService
- type FileSource
- type FileSourceParam
- type FileSourceType
- type FileStatus
- type FindFilesParams
- type FindService
- func (r *FindService) Files(ctx context.Context, query FindFilesParams, opts ...option.RequestOption) (res *[]string, err error)
- func (r *FindService) Symbols(ctx context.Context, query FindSymbolsParams, opts ...option.RequestOption) (res *[]Symbol, err error)
- func (r *FindService) Text(ctx context.Context, query FindTextParams, opts ...option.RequestOption) (res *[]FindTextResponse, err error)
- type FindSymbolsParams
- type FindTextParams
- type FindTextResponse
- type FindTextResponseLines
- type FindTextResponsePath
- type FindTextResponseSubmatch
- type FindTextResponseSubmatchesMatch
- type KeybindsConfig
- type McpLocalConfig
- type McpLocalConfigType
- type McpRemoteConfig
- type McpRemoteConfigType
- type Message
- type MessageAbortedError
- type MessageAbortedErrorName
- type MessageRole
- type MessageUnion
- type Mode
- type ModeConfig
- type ModeModel
- type Model
- type ModelCost
- type ModelLimit
- type Part
- type PartPatchPart
- type PartPatchPartType
- type PartType
- type PartUnion
- type Provider
- type ProviderAuthError
- type ProviderAuthErrorData
- type ProviderAuthErrorName
- type Session
- type SessionChatParams
- type SessionChatParamsPart
- type SessionChatParamsPartUnion
- type SessionChatParamsPartsType
- type SessionInitParams
- type SessionMessagesResponse
- type SessionRevert
- type SessionRevertParams
- type SessionService
- func (r *SessionService) Abort(ctx context.Context, id string, opts ...option.RequestOption) (res *bool, err error)
- func (r *SessionService) Chat(ctx context.Context, id string, body SessionChatParams, ...) (res *AssistantMessage, err error)
- func (r *SessionService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *bool, err error)
- func (r *SessionService) Init(ctx context.Context, id string, body SessionInitParams, ...) (res *bool, err error)
- func (r *SessionService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Session, err error)
- func (r *SessionService) Messages(ctx context.Context, id string, opts ...option.RequestOption) (res *[]SessionMessagesResponse, err error)
- func (r *SessionService) New(ctx context.Context, opts ...option.RequestOption) (res *Session, err error)
- func (r *SessionService) Revert(ctx context.Context, id string, body SessionRevertParams, ...) (res *Session, err error)
- func (r *SessionService) Share(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
- func (r *SessionService) Summarize(ctx context.Context, id string, body SessionSummarizeParams, ...) (res *bool, err error)
- func (r *SessionService) Unrevert(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
- func (r *SessionService) Unshare(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
- type SessionShare
- type SessionSummarizeParams
- type SessionTime
- type SnapshotPart
- type SnapshotPartType
- type StepFinishPart
- type StepFinishPartTokens
- type StepFinishPartTokensCache
- type StepFinishPartType
- type StepStartPart
- type StepStartPartType
- type Symbol
- type SymbolLocation
- type SymbolLocationRange
- type SymbolLocationRangeEnd
- type SymbolLocationRangeStart
- type SymbolSource
- type SymbolSourceParam
- type SymbolSourceRange
- type SymbolSourceRangeEnd
- type SymbolSourceRangeEndParam
- type SymbolSourceRangeParam
- type SymbolSourceRangeStart
- type SymbolSourceRangeStartParam
- type SymbolSourceType
- type TextPart
- type TextPartInputParam
- type TextPartInputTimeParam
- type TextPartInputType
- type TextPartTime
- type TextPartType
- type ToolPart
- type ToolPartState
- type ToolPartStateStatus
- type ToolPartStateUnion
- type ToolPartType
- type ToolStateCompleted
- type ToolStateCompletedStatus
- type ToolStateCompletedTime
- type ToolStateError
- type ToolStateErrorStatus
- type ToolStateErrorTime
- type ToolStatePending
- type ToolStatePendingStatus
- type ToolStateRunning
- type ToolStateRunningStatus
- type ToolStateRunningTime
- type TuiAppendPromptParams
- type TuiService
- type UnknownError
- type UnknownErrorData
- type UnknownErrorName
- type UserMessage
- type UserMessageRole
- type UserMessageTime
Constants ¶
const MessageAbortedErrorNameMessageAbortedError = shared.MessageAbortedErrorNameMessageAbortedError
This is an alias to an internal value.
const ProviderAuthErrorNameProviderAuthError = shared.ProviderAuthErrorNameProviderAuthError
This is an alias to an internal value.
const UnknownErrorNameUnknownError = shared.UnknownErrorNameUnknownError
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (OPENCODE_BASE_URL). This should be used to initialize new clients.
func F ¶
F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.
func Int ¶
Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.
func Raw ¶
Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).
Types ¶
type App ¶
type App struct {
Git bool `json:"git,required"`
Hostname string `json:"hostname,required"`
Path AppPath `json:"path,required"`
Time AppTime `json:"time,required"`
JSON appJSON `json:"-"`
}
func (*App) UnmarshalJSON ¶
type AppLogParams ¶ added in v0.2.0
type AppLogParams struct {
// Log level
Level param.Field[AppLogParamsLevel] `json:"level,required"`
// Log message
Message param.Field[string] `json:"message,required"`
// Service name for the log entry
Service param.Field[string] `json:"service,required"`
// Additional metadata for the log entry
Extra param.Field[map[string]interface{}] `json:"extra"`
}
func (AppLogParams) MarshalJSON ¶ added in v0.2.0
func (r AppLogParams) MarshalJSON() (data []byte, err error)
type AppLogParamsLevel ¶ added in v0.2.0
type AppLogParamsLevel string
Log level
const ( AppLogParamsLevelDebug AppLogParamsLevel = "debug" AppLogParamsLevelInfo AppLogParamsLevel = "info" AppLogParamsLevelError AppLogParamsLevel = "error" AppLogParamsLevelWarn AppLogParamsLevel = "warn" )
func (AppLogParamsLevel) IsKnown ¶ added in v0.2.0
func (r AppLogParamsLevel) IsKnown() bool
type AppPath ¶
type AppPath struct {
Config string `json:"config,required"`
Cwd string `json:"cwd,required"`
Data string `json:"data,required"`
Root string `json:"root,required"`
State string `json:"state,required"`
JSON appPathJSON `json:"-"`
}
func (*AppPath) UnmarshalJSON ¶
type AppProvidersResponse ¶ added in v0.2.0
type AppProvidersResponse struct {
Default map[string]string `json:"default,required"`
Providers []Provider `json:"providers,required"`
JSON appProvidersResponseJSON `json:"-"`
}
func (*AppProvidersResponse) UnmarshalJSON ¶ added in v0.2.0
func (r *AppProvidersResponse) UnmarshalJSON(data []byte) (err error)
type AppService ¶ added in v0.2.0
type AppService struct {
Options []option.RequestOption
}
AppService contains methods and other services that help with interacting with the opencode API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAppService method instead.
func NewAppService ¶ added in v0.2.0
func NewAppService(opts ...option.RequestOption) (r *AppService)
NewAppService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AppService) Get ¶
func (r *AppService) Get(ctx context.Context, opts ...option.RequestOption) (res *App, err error)
Get app info
func (*AppService) Init ¶
func (r *AppService) Init(ctx context.Context, opts ...option.RequestOption) (res *bool, err error)
Initialize the app
func (*AppService) Log ¶ added in v0.2.0
func (r *AppService) Log(ctx context.Context, body AppLogParams, opts ...option.RequestOption) (res *bool, err error)
Write a log entry to the server logs
func (*AppService) Modes ¶
func (r *AppService) Modes(ctx context.Context, opts ...option.RequestOption) (res *[]Mode, err error)
List all modes
func (*AppService) Providers ¶ added in v0.2.0
func (r *AppService) Providers(ctx context.Context, opts ...option.RequestOption) (res *AppProvidersResponse, err error)
List all providers
type AppTime ¶
type AppTime struct {
Initialized float64 `json:"initialized"`
JSON appTimeJSON `json:"-"`
}
func (*AppTime) UnmarshalJSON ¶
type AssistantMessage ¶
type AssistantMessage struct {
ID string `json:"id,required"`
Cost float64 `json:"cost,required"`
Mode string `json:"mode,required"`
ModelID string `json:"modelID,required"`
Path AssistantMessagePath `json:"path,required"`
ProviderID string `json:"providerID,required"`
Role AssistantMessageRole `json:"role,required"`
SessionID string `json:"sessionID,required"`
System []string `json:"system,required"`
Time AssistantMessageTime `json:"time,required"`
Tokens AssistantMessageTokens `json:"tokens,required"`
Error AssistantMessageError `json:"error"`
Summary bool `json:"summary"`
JSON assistantMessageJSON `json:"-"`
}
func (*AssistantMessage) UnmarshalJSON ¶
func (r *AssistantMessage) UnmarshalJSON(data []byte) (err error)
type AssistantMessageError ¶
type AssistantMessageError struct {
// This field can have the runtime type of [shared.ProviderAuthErrorData],
// [shared.UnknownErrorData], [interface{}].
Data interface{} `json:"data,required"`
Name AssistantMessageErrorName `json:"name,required"`
JSON assistantMessageErrorJSON `json:"-"`
// contains filtered or unexported fields
}
func (AssistantMessageError) AsUnion ¶
func (r AssistantMessageError) AsUnion() AssistantMessageErrorUnion
AsUnion returns a AssistantMessageErrorUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.ProviderAuthError, shared.UnknownError, AssistantMessageErrorMessageOutputLengthError, shared.MessageAbortedError.
func (*AssistantMessageError) UnmarshalJSON ¶
func (r *AssistantMessageError) UnmarshalJSON(data []byte) (err error)
type AssistantMessageErrorMessageOutputLengthError ¶
type AssistantMessageErrorMessageOutputLengthError struct {
Data interface{} `json:"data,required"`
Name AssistantMessageErrorMessageOutputLengthErrorName `json:"name,required"`
JSON assistantMessageErrorMessageOutputLengthErrorJSON `json:"-"`
}
func (AssistantMessageErrorMessageOutputLengthError) ImplementsAssistantMessageError ¶
func (r AssistantMessageErrorMessageOutputLengthError) ImplementsAssistantMessageError()
func (*AssistantMessageErrorMessageOutputLengthError) UnmarshalJSON ¶
func (r *AssistantMessageErrorMessageOutputLengthError) UnmarshalJSON(data []byte) (err error)
type AssistantMessageErrorMessageOutputLengthErrorName ¶
type AssistantMessageErrorMessageOutputLengthErrorName string
const (
AssistantMessageErrorMessageOutputLengthErrorNameMessageOutputLengthError AssistantMessageErrorMessageOutputLengthErrorName = "MessageOutputLengthError"
)
func (AssistantMessageErrorMessageOutputLengthErrorName) IsKnown ¶
func (r AssistantMessageErrorMessageOutputLengthErrorName) IsKnown() bool
type AssistantMessageErrorName ¶
type AssistantMessageErrorName string
const ( AssistantMessageErrorNameProviderAuthError AssistantMessageErrorName = "ProviderAuthError" AssistantMessageErrorNameUnknownError AssistantMessageErrorName = "UnknownError" AssistantMessageErrorNameMessageOutputLengthError AssistantMessageErrorName = "MessageOutputLengthError" AssistantMessageErrorNameMessageAbortedError AssistantMessageErrorName = "MessageAbortedError" )
func (AssistantMessageErrorName) IsKnown ¶
func (r AssistantMessageErrorName) IsKnown() bool
type AssistantMessageErrorUnion ¶
type AssistantMessageErrorUnion interface {
ImplementsAssistantMessageError()
}
Union satisfied by shared.ProviderAuthError, shared.UnknownError, AssistantMessageErrorMessageOutputLengthError or shared.MessageAbortedError.
type AssistantMessagePath ¶
type AssistantMessagePath struct {
Cwd string `json:"cwd,required"`
Root string `json:"root,required"`
JSON assistantMessagePathJSON `json:"-"`
}
func (*AssistantMessagePath) UnmarshalJSON ¶
func (r *AssistantMessagePath) UnmarshalJSON(data []byte) (err error)
type AssistantMessageRole ¶
type AssistantMessageRole string
const (
AssistantMessageRoleAssistant AssistantMessageRole = "assistant"
)
func (AssistantMessageRole) IsKnown ¶
func (r AssistantMessageRole) IsKnown() bool
type AssistantMessageTime ¶
type AssistantMessageTime struct {
Created float64 `json:"created,required"`
Completed float64 `json:"completed"`
JSON assistantMessageTimeJSON `json:"-"`
}
func (*AssistantMessageTime) UnmarshalJSON ¶
func (r *AssistantMessageTime) UnmarshalJSON(data []byte) (err error)
type AssistantMessageTokens ¶
type AssistantMessageTokens struct {
Cache AssistantMessageTokensCache `json:"cache,required"`
Input float64 `json:"input,required"`
Output float64 `json:"output,required"`
Reasoning float64 `json:"reasoning,required"`
JSON assistantMessageTokensJSON `json:"-"`
}
func (*AssistantMessageTokens) UnmarshalJSON ¶
func (r *AssistantMessageTokens) UnmarshalJSON(data []byte) (err error)
type AssistantMessageTokensCache ¶
type AssistantMessageTokensCache struct {
Read float64 `json:"read,required"`
Write float64 `json:"write,required"`
JSON assistantMessageTokensCacheJSON `json:"-"`
}
func (*AssistantMessageTokensCache) UnmarshalJSON ¶
func (r *AssistantMessageTokensCache) UnmarshalJSON(data []byte) (err error)
type Client ¶
type Client struct {
Options []option.RequestOption
Event *EventService
App *AppService
Find *FindService
File *FileService
Config *ConfigService
Session *SessionService
Tui *TuiService
}
Client creates a struct with services and top level methods that help with interacting with the opencode API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r *Client)
NewClient generates a new client with the default option read from the environment (OPENCODE_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Post ¶
func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type Config ¶
type Config struct {
// JSON schema reference for configuration validation
Schema string `json:"$schema"`
// Modes configuration, see https://opencode.ai/docs/modes
Agent ConfigAgent `json:"agent"`
// automatically
Autoshare bool `json:"autoshare"`
// Automatically update to the latest version
Autoupdate bool `json:"autoupdate"`
// Disable providers that are loaded automatically
DisabledProviders []string `json:"disabled_providers"`
Experimental ConfigExperimental `json:"experimental"`
// Additional instruction files or patterns to include
Instructions []string `json:"instructions"`
// Custom keybind configurations
Keybinds KeybindsConfig `json:"keybinds"`
// @deprecated Always uses stretch layout.
Layout ConfigLayout `json:"layout"`
// MCP (Model Context Protocol) server configurations
Mcp map[string]ConfigMcp `json:"mcp"`
// Modes configuration, see https://opencode.ai/docs/modes
Mode ConfigMode `json:"mode"`
// Model to use in the format of provider/model, eg anthropic/claude-2
Model string `json:"model"`
// Custom provider configurations and model overrides
Provider map[string]ConfigProvider `json:"provider"`
// enables automatic sharing, 'disabled' disables all sharing
Share ConfigShare `json:"share"`
// Small model to use for tasks like summarization and title generation in the
// format of provider/model
SmallModel string `json:"small_model"`
// Theme name to use for the interface
Theme string `json:"theme"`
// Custom username to display in conversations instead of system username
Username string `json:"username"`
JSON configJSON `json:"-"`
}
func (*Config) UnmarshalJSON ¶
type ConfigAgent ¶
type ConfigAgent struct {
General ConfigAgentGeneral `json:"general"`
ExtraFields map[string]ConfigAgent `json:"-,extras"`
JSON configAgentJSON `json:"-"`
}
Modes configuration, see https://opencode.ai/docs/modes
func (*ConfigAgent) UnmarshalJSON ¶
func (r *ConfigAgent) UnmarshalJSON(data []byte) (err error)
type ConfigAgentGeneral ¶ added in v0.2.0
type ConfigAgentGeneral struct {
Description string `json:"description,required"`
JSON configAgentGeneralJSON `json:"-"`
ModeConfig
}
func (*ConfigAgentGeneral) UnmarshalJSON ¶ added in v0.2.0
func (r *ConfigAgentGeneral) UnmarshalJSON(data []byte) (err error)
type ConfigExperimental ¶
type ConfigExperimental struct {
Hook ConfigExperimentalHook `json:"hook"`
JSON configExperimentalJSON `json:"-"`
}
func (*ConfigExperimental) UnmarshalJSON ¶
func (r *ConfigExperimental) UnmarshalJSON(data []byte) (err error)
type ConfigExperimentalHook ¶
type ConfigExperimentalHook struct {
FileEdited map[string][]ConfigExperimentalHookFileEdited `json:"file_edited"`
SessionCompleted []ConfigExperimentalHookSessionCompleted `json:"session_completed"`
JSON configExperimentalHookJSON `json:"-"`
}
func (*ConfigExperimentalHook) UnmarshalJSON ¶
func (r *ConfigExperimentalHook) UnmarshalJSON(data []byte) (err error)
type ConfigExperimentalHookFileEdited ¶
type ConfigExperimentalHookFileEdited struct {
Command []string `json:"command,required"`
Environment map[string]string `json:"environment"`
JSON configExperimentalHookFileEditedJSON `json:"-"`
}
func (*ConfigExperimentalHookFileEdited) UnmarshalJSON ¶
func (r *ConfigExperimentalHookFileEdited) UnmarshalJSON(data []byte) (err error)
type ConfigExperimentalHookSessionCompleted ¶
type ConfigExperimentalHookSessionCompleted struct {
Command []string `json:"command,required"`
Environment map[string]string `json:"environment"`
JSON configExperimentalHookSessionCompletedJSON `json:"-"`
}
func (*ConfigExperimentalHookSessionCompleted) UnmarshalJSON ¶
func (r *ConfigExperimentalHookSessionCompleted) UnmarshalJSON(data []byte) (err error)
type ConfigLayout ¶
type ConfigLayout string
@deprecated Always uses stretch layout.
const ( ConfigLayoutAuto ConfigLayout = "auto" ConfigLayoutStretch ConfigLayout = "stretch" )
func (ConfigLayout) IsKnown ¶
func (r ConfigLayout) IsKnown() bool
type ConfigMcp ¶
type ConfigMcp struct {
// Type of MCP server connection
Type ConfigMcpType `json:"type,required"`
// This field can have the runtime type of [[]string].
Command interface{} `json:"command"`
// Enable or disable the MCP server on startup
Enabled bool `json:"enabled"`
// This field can have the runtime type of [map[string]string].
Environment interface{} `json:"environment"`
// This field can have the runtime type of [map[string]string].
Headers interface{} `json:"headers"`
// URL of the remote MCP server
URL string `json:"url"`
JSON configMcpJSON `json:"-"`
// contains filtered or unexported fields
}
func (ConfigMcp) AsUnion ¶
func (r ConfigMcp) AsUnion() ConfigMcpUnion
AsUnion returns a ConfigMcpUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are McpLocalConfig, McpRemoteConfig.
func (*ConfigMcp) UnmarshalJSON ¶
type ConfigMcpType ¶
type ConfigMcpType string
Type of MCP server connection
const ( ConfigMcpTypeLocal ConfigMcpType = "local" ConfigMcpTypeRemote ConfigMcpType = "remote" )
func (ConfigMcpType) IsKnown ¶
func (r ConfigMcpType) IsKnown() bool
type ConfigMcpUnion ¶
type ConfigMcpUnion interface {
// contains filtered or unexported methods
}
Union satisfied by McpLocalConfig or McpRemoteConfig.
type ConfigMode ¶
type ConfigMode struct {
Build ModeConfig `json:"build"`
Plan ModeConfig `json:"plan"`
ExtraFields map[string]ModeConfig `json:"-,extras"`
JSON configModeJSON `json:"-"`
}
Modes configuration, see https://opencode.ai/docs/modes
func (*ConfigMode) UnmarshalJSON ¶
func (r *ConfigMode) UnmarshalJSON(data []byte) (err error)
type ConfigProvider ¶
type ConfigProvider struct {
Models map[string]ConfigProviderModel `json:"models,required"`
ID string `json:"id"`
API string `json:"api"`
Env []string `json:"env"`
Name string `json:"name"`
Npm string `json:"npm"`
Options ConfigProviderOptions `json:"options"`
JSON configProviderJSON `json:"-"`
}
func (*ConfigProvider) UnmarshalJSON ¶
func (r *ConfigProvider) UnmarshalJSON(data []byte) (err error)
type ConfigProviderModel ¶
type ConfigProviderModel struct {
ID string `json:"id"`
Attachment bool `json:"attachment"`
Cost ConfigProviderModelsCost `json:"cost"`
Limit ConfigProviderModelsLimit `json:"limit"`
Name string `json:"name"`
Options map[string]interface{} `json:"options"`
Reasoning bool `json:"reasoning"`
ReleaseDate string `json:"release_date"`
Temperature bool `json:"temperature"`
ToolCall bool `json:"tool_call"`
JSON configProviderModelJSON `json:"-"`
}
func (*ConfigProviderModel) UnmarshalJSON ¶
func (r *ConfigProviderModel) UnmarshalJSON(data []byte) (err error)
type ConfigProviderModelsCost ¶
type ConfigProviderModelsCost struct {
Input float64 `json:"input,required"`
Output float64 `json:"output,required"`
CacheRead float64 `json:"cache_read"`
CacheWrite float64 `json:"cache_write"`
JSON configProviderModelsCostJSON `json:"-"`
}
func (*ConfigProviderModelsCost) UnmarshalJSON ¶
func (r *ConfigProviderModelsCost) UnmarshalJSON(data []byte) (err error)
type ConfigProviderModelsLimit ¶
type ConfigProviderModelsLimit struct {
Context float64 `json:"context,required"`
Output float64 `json:"output,required"`
JSON configProviderModelsLimitJSON `json:"-"`
}
func (*ConfigProviderModelsLimit) UnmarshalJSON ¶
func (r *ConfigProviderModelsLimit) UnmarshalJSON(data []byte) (err error)
type ConfigProviderOptions ¶
type ConfigProviderOptions struct {
APIKey string `json:"apiKey"`
BaseURL string `json:"baseURL"`
ExtraFields map[string]interface{} `json:"-,extras"`
JSON configProviderOptionsJSON `json:"-"`
}
func (*ConfigProviderOptions) UnmarshalJSON ¶
func (r *ConfigProviderOptions) UnmarshalJSON(data []byte) (err error)
type ConfigService ¶
type ConfigService struct {
Options []option.RequestOption
}
ConfigService contains methods and other services that help with interacting with the opencode API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewConfigService method instead.
func NewConfigService ¶
func NewConfigService(opts ...option.RequestOption) (r *ConfigService)
NewConfigService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ConfigService) Get ¶
func (r *ConfigService) Get(ctx context.Context, opts ...option.RequestOption) (res *Config, err error)
Get config info
type ConfigShare ¶
type ConfigShare string
Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing
const ( )
func (ConfigShare) IsKnown ¶
func (r ConfigShare) IsKnown() bool
type EventListResponse ¶
type EventListResponse struct {
// This field can have the runtime type of
// [EventListResponseEventInstallationUpdatedProperties],
// [EventListResponseEventLspClientDiagnosticsProperties],
// [EventListResponseEventMessageUpdatedProperties],
// [EventListResponseEventMessageRemovedProperties],
// [EventListResponseEventMessagePartUpdatedProperties],
// [EventListResponseEventMessagePartRemovedProperties],
// [EventListResponseEventStorageWriteProperties],
// [EventListResponseEventPermissionUpdatedProperties],
// [EventListResponseEventFileEditedProperties],
// [EventListResponseEventSessionUpdatedProperties],
// [EventListResponseEventSessionDeletedProperties],
// [EventListResponseEventSessionIdleProperties],
// [EventListResponseEventSessionErrorProperties], [interface{}],
// [EventListResponseEventFileWatcherUpdatedProperties],
// [EventListResponseEventIdeInstalledProperties].
Properties interface{} `json:"properties,required"`
Type EventListResponseType `json:"type,required"`
JSON eventListResponseJSON `json:"-"`
// contains filtered or unexported fields
}
func (EventListResponse) AsUnion ¶
func (r EventListResponse) AsUnion() EventListResponseUnion
AsUnion returns a EventListResponseUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are EventListResponseEventInstallationUpdated, EventListResponseEventLspClientDiagnostics, EventListResponseEventMessageUpdated, EventListResponseEventMessageRemoved, EventListResponseEventMessagePartUpdated, EventListResponseEventMessagePartRemoved, EventListResponseEventStorageWrite, EventListResponseEventPermissionUpdated, EventListResponseEventFileEdited, EventListResponseEventSessionUpdated, EventListResponseEventSessionDeleted, EventListResponseEventSessionIdle, EventListResponseEventSessionError, EventListResponseEventServerConnected, EventListResponseEventFileWatcherUpdated, EventListResponseEventIdeInstalled.
func (*EventListResponse) UnmarshalJSON ¶
func (r *EventListResponse) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileEdited ¶
type EventListResponseEventFileEdited struct {
Properties EventListResponseEventFileEditedProperties `json:"properties,required"`
Type EventListResponseEventFileEditedType `json:"type,required"`
JSON eventListResponseEventFileEditedJSON `json:"-"`
}
func (*EventListResponseEventFileEdited) UnmarshalJSON ¶
func (r *EventListResponseEventFileEdited) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileEditedProperties ¶
type EventListResponseEventFileEditedProperties struct {
File string `json:"file,required"`
JSON eventListResponseEventFileEditedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventFileEditedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventFileEditedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileEditedType ¶
type EventListResponseEventFileEditedType string
const (
EventListResponseEventFileEditedTypeFileEdited EventListResponseEventFileEditedType = "file.edited"
)
func (EventListResponseEventFileEditedType) IsKnown ¶
func (r EventListResponseEventFileEditedType) IsKnown() bool
type EventListResponseEventFileWatcherUpdated ¶ added in v0.16.0
type EventListResponseEventFileWatcherUpdated struct {
Properties EventListResponseEventFileWatcherUpdatedProperties `json:"properties,required"`
Type EventListResponseEventFileWatcherUpdatedType `json:"type,required"`
JSON eventListResponseEventFileWatcherUpdatedJSON `json:"-"`
}
func (*EventListResponseEventFileWatcherUpdated) UnmarshalJSON ¶ added in v0.16.0
func (r *EventListResponseEventFileWatcherUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileWatcherUpdatedProperties ¶ added in v0.16.0
type EventListResponseEventFileWatcherUpdatedProperties struct {
Event EventListResponseEventFileWatcherUpdatedPropertiesEvent `json:"event,required"`
File string `json:"file,required"`
JSON eventListResponseEventFileWatcherUpdatedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventFileWatcherUpdatedProperties) UnmarshalJSON ¶ added in v0.16.0
func (r *EventListResponseEventFileWatcherUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileWatcherUpdatedPropertiesEvent ¶ added in v0.16.0
type EventListResponseEventFileWatcherUpdatedPropertiesEvent string
const ( EventListResponseEventFileWatcherUpdatedPropertiesEventRename EventListResponseEventFileWatcherUpdatedPropertiesEvent = "rename" EventListResponseEventFileWatcherUpdatedPropertiesEventChange EventListResponseEventFileWatcherUpdatedPropertiesEvent = "change" )
func (EventListResponseEventFileWatcherUpdatedPropertiesEvent) IsKnown ¶ added in v0.16.0
func (r EventListResponseEventFileWatcherUpdatedPropertiesEvent) IsKnown() bool
type EventListResponseEventFileWatcherUpdatedType ¶ added in v0.16.0
type EventListResponseEventFileWatcherUpdatedType string
const (
EventListResponseEventFileWatcherUpdatedTypeFileWatcherUpdated EventListResponseEventFileWatcherUpdatedType = "file.watcher.updated"
)
func (EventListResponseEventFileWatcherUpdatedType) IsKnown ¶ added in v0.16.0
func (r EventListResponseEventFileWatcherUpdatedType) IsKnown() bool
type EventListResponseEventIdeInstalled ¶ added in v0.16.0
type EventListResponseEventIdeInstalled struct {
Properties EventListResponseEventIdeInstalledProperties `json:"properties,required"`
Type EventListResponseEventIdeInstalledType `json:"type,required"`
JSON eventListResponseEventIdeInstalledJSON `json:"-"`
}
func (*EventListResponseEventIdeInstalled) UnmarshalJSON ¶ added in v0.16.0
func (r *EventListResponseEventIdeInstalled) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventIdeInstalledProperties ¶ added in v0.16.0
type EventListResponseEventIdeInstalledProperties struct {
Ide string `json:"ide,required"`
JSON eventListResponseEventIdeInstalledPropertiesJSON `json:"-"`
}
func (*EventListResponseEventIdeInstalledProperties) UnmarshalJSON ¶ added in v0.16.0
func (r *EventListResponseEventIdeInstalledProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventIdeInstalledType ¶ added in v0.16.0
type EventListResponseEventIdeInstalledType string
const (
EventListResponseEventIdeInstalledTypeIdeInstalled EventListResponseEventIdeInstalledType = "ide.installed"
)
func (EventListResponseEventIdeInstalledType) IsKnown ¶ added in v0.16.0
func (r EventListResponseEventIdeInstalledType) IsKnown() bool
type EventListResponseEventInstallationUpdated ¶
type EventListResponseEventInstallationUpdated struct {
Properties EventListResponseEventInstallationUpdatedProperties `json:"properties,required"`
Type EventListResponseEventInstallationUpdatedType `json:"type,required"`
JSON eventListResponseEventInstallationUpdatedJSON `json:"-"`
}
func (*EventListResponseEventInstallationUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventInstallationUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventInstallationUpdatedProperties ¶
type EventListResponseEventInstallationUpdatedProperties struct {
Version string `json:"version,required"`
JSON eventListResponseEventInstallationUpdatedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventInstallationUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventInstallationUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventInstallationUpdatedType ¶
type EventListResponseEventInstallationUpdatedType string
const (
EventListResponseEventInstallationUpdatedTypeInstallationUpdated EventListResponseEventInstallationUpdatedType = "installation.updated"
)
func (EventListResponseEventInstallationUpdatedType) IsKnown ¶
func (r EventListResponseEventInstallationUpdatedType) IsKnown() bool
type EventListResponseEventLspClientDiagnostics ¶
type EventListResponseEventLspClientDiagnostics struct {
Properties EventListResponseEventLspClientDiagnosticsProperties `json:"properties,required"`
Type EventListResponseEventLspClientDiagnosticsType `json:"type,required"`
JSON eventListResponseEventLspClientDiagnosticsJSON `json:"-"`
}
func (*EventListResponseEventLspClientDiagnostics) UnmarshalJSON ¶
func (r *EventListResponseEventLspClientDiagnostics) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventLspClientDiagnosticsProperties ¶
type EventListResponseEventLspClientDiagnosticsProperties struct {
Path string `json:"path,required"`
ServerID string `json:"serverID,required"`
JSON eventListResponseEventLspClientDiagnosticsPropertiesJSON `json:"-"`
}
func (*EventListResponseEventLspClientDiagnosticsProperties) UnmarshalJSON ¶
func (r *EventListResponseEventLspClientDiagnosticsProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventLspClientDiagnosticsType ¶
type EventListResponseEventLspClientDiagnosticsType string
const (
EventListResponseEventLspClientDiagnosticsTypeLspClientDiagnostics EventListResponseEventLspClientDiagnosticsType = "lsp.client.diagnostics"
)
func (EventListResponseEventLspClientDiagnosticsType) IsKnown ¶
func (r EventListResponseEventLspClientDiagnosticsType) IsKnown() bool
type EventListResponseEventMessagePartRemoved ¶
type EventListResponseEventMessagePartRemoved struct {
Properties EventListResponseEventMessagePartRemovedProperties `json:"properties,required"`
Type EventListResponseEventMessagePartRemovedType `json:"type,required"`
JSON eventListResponseEventMessagePartRemovedJSON `json:"-"`
}
func (*EventListResponseEventMessagePartRemoved) UnmarshalJSON ¶
func (r *EventListResponseEventMessagePartRemoved) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessagePartRemovedProperties ¶
type EventListResponseEventMessagePartRemovedProperties struct {
MessageID string `json:"messageID,required"`
PartID string `json:"partID,required"`
SessionID string `json:"sessionID,required"`
JSON eventListResponseEventMessagePartRemovedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventMessagePartRemovedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventMessagePartRemovedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessagePartRemovedType ¶
type EventListResponseEventMessagePartRemovedType string
const (
EventListResponseEventMessagePartRemovedTypeMessagePartRemoved EventListResponseEventMessagePartRemovedType = "message.part.removed"
)
func (EventListResponseEventMessagePartRemovedType) IsKnown ¶
func (r EventListResponseEventMessagePartRemovedType) IsKnown() bool
type EventListResponseEventMessagePartUpdated ¶
type EventListResponseEventMessagePartUpdated struct {
Properties EventListResponseEventMessagePartUpdatedProperties `json:"properties,required"`
Type EventListResponseEventMessagePartUpdatedType `json:"type,required"`
JSON eventListResponseEventMessagePartUpdatedJSON `json:"-"`
}
func (*EventListResponseEventMessagePartUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventMessagePartUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessagePartUpdatedProperties ¶
type EventListResponseEventMessagePartUpdatedProperties struct {
Part Part `json:"part,required"`
JSON eventListResponseEventMessagePartUpdatedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventMessagePartUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventMessagePartUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessagePartUpdatedType ¶
type EventListResponseEventMessagePartUpdatedType string
const (
EventListResponseEventMessagePartUpdatedTypeMessagePartUpdated EventListResponseEventMessagePartUpdatedType = "message.part.updated"
)
func (EventListResponseEventMessagePartUpdatedType) IsKnown ¶
func (r EventListResponseEventMessagePartUpdatedType) IsKnown() bool
type EventListResponseEventMessageRemoved ¶
type EventListResponseEventMessageRemoved struct {
Properties EventListResponseEventMessageRemovedProperties `json:"properties,required"`
Type EventListResponseEventMessageRemovedType `json:"type,required"`
JSON eventListResponseEventMessageRemovedJSON `json:"-"`
}
func (*EventListResponseEventMessageRemoved) UnmarshalJSON ¶
func (r *EventListResponseEventMessageRemoved) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessageRemovedProperties ¶
type EventListResponseEventMessageRemovedProperties struct {
MessageID string `json:"messageID,required"`
SessionID string `json:"sessionID,required"`
JSON eventListResponseEventMessageRemovedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventMessageRemovedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventMessageRemovedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessageRemovedType ¶
type EventListResponseEventMessageRemovedType string
const (
EventListResponseEventMessageRemovedTypeMessageRemoved EventListResponseEventMessageRemovedType = "message.removed"
)
func (EventListResponseEventMessageRemovedType) IsKnown ¶
func (r EventListResponseEventMessageRemovedType) IsKnown() bool
type EventListResponseEventMessageUpdated ¶
type EventListResponseEventMessageUpdated struct {
Properties EventListResponseEventMessageUpdatedProperties `json:"properties,required"`
Type EventListResponseEventMessageUpdatedType `json:"type,required"`
JSON eventListResponseEventMessageUpdatedJSON `json:"-"`
}
func (*EventListResponseEventMessageUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventMessageUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessageUpdatedProperties ¶
type EventListResponseEventMessageUpdatedProperties struct {
Info Message `json:"info,required"`
JSON eventListResponseEventMessageUpdatedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventMessageUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventMessageUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessageUpdatedType ¶
type EventListResponseEventMessageUpdatedType string
const (
EventListResponseEventMessageUpdatedTypeMessageUpdated EventListResponseEventMessageUpdatedType = "message.updated"
)
func (EventListResponseEventMessageUpdatedType) IsKnown ¶
func (r EventListResponseEventMessageUpdatedType) IsKnown() bool
type EventListResponseEventPermissionUpdated ¶
type EventListResponseEventPermissionUpdated struct {
Properties EventListResponseEventPermissionUpdatedProperties `json:"properties,required"`
Type EventListResponseEventPermissionUpdatedType `json:"type,required"`
JSON eventListResponseEventPermissionUpdatedJSON `json:"-"`
}
func (*EventListResponseEventPermissionUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventPermissionUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventPermissionUpdatedProperties ¶
type EventListResponseEventPermissionUpdatedProperties struct {
ID string `json:"id,required"`
Metadata map[string]interface{} `json:"metadata,required"`
SessionID string `json:"sessionID,required"`
Time EventListResponseEventPermissionUpdatedPropertiesTime `json:"time,required"`
Title string `json:"title,required"`
JSON eventListResponseEventPermissionUpdatedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventPermissionUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventPermissionUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventPermissionUpdatedPropertiesTime ¶
type EventListResponseEventPermissionUpdatedPropertiesTime struct {
Created float64 `json:"created,required"`
JSON eventListResponseEventPermissionUpdatedPropertiesTimeJSON `json:"-"`
}
func (*EventListResponseEventPermissionUpdatedPropertiesTime) UnmarshalJSON ¶
func (r *EventListResponseEventPermissionUpdatedPropertiesTime) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventPermissionUpdatedType ¶
type EventListResponseEventPermissionUpdatedType string
const (
EventListResponseEventPermissionUpdatedTypePermissionUpdated EventListResponseEventPermissionUpdatedType = "permission.updated"
)
func (EventListResponseEventPermissionUpdatedType) IsKnown ¶
func (r EventListResponseEventPermissionUpdatedType) IsKnown() bool
type EventListResponseEventServerConnected ¶
type EventListResponseEventServerConnected struct {
Properties interface{} `json:"properties,required"`
Type EventListResponseEventServerConnectedType `json:"type,required"`
JSON eventListResponseEventServerConnectedJSON `json:"-"`
}
func (*EventListResponseEventServerConnected) UnmarshalJSON ¶
func (r *EventListResponseEventServerConnected) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventServerConnectedType ¶
type EventListResponseEventServerConnectedType string
const (
EventListResponseEventServerConnectedTypeServerConnected EventListResponseEventServerConnectedType = "server.connected"
)
func (EventListResponseEventServerConnectedType) IsKnown ¶
func (r EventListResponseEventServerConnectedType) IsKnown() bool
type EventListResponseEventSessionDeleted ¶
type EventListResponseEventSessionDeleted struct {
Properties EventListResponseEventSessionDeletedProperties `json:"properties,required"`
Type EventListResponseEventSessionDeletedType `json:"type,required"`
JSON eventListResponseEventSessionDeletedJSON `json:"-"`
}
func (*EventListResponseEventSessionDeleted) UnmarshalJSON ¶
func (r *EventListResponseEventSessionDeleted) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionDeletedProperties ¶
type EventListResponseEventSessionDeletedProperties struct {
Info Session `json:"info,required"`
JSON eventListResponseEventSessionDeletedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventSessionDeletedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventSessionDeletedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionDeletedType ¶
type EventListResponseEventSessionDeletedType string
const (
EventListResponseEventSessionDeletedTypeSessionDeleted EventListResponseEventSessionDeletedType = "session.deleted"
)
func (EventListResponseEventSessionDeletedType) IsKnown ¶
func (r EventListResponseEventSessionDeletedType) IsKnown() bool
type EventListResponseEventSessionError ¶
type EventListResponseEventSessionError struct {
Properties EventListResponseEventSessionErrorProperties `json:"properties,required"`
Type EventListResponseEventSessionErrorType `json:"type,required"`
JSON eventListResponseEventSessionErrorJSON `json:"-"`
}
func (*EventListResponseEventSessionError) UnmarshalJSON ¶
func (r *EventListResponseEventSessionError) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionErrorProperties ¶
type EventListResponseEventSessionErrorProperties struct {
Error EventListResponseEventSessionErrorPropertiesError `json:"error"`
SessionID string `json:"sessionID"`
JSON eventListResponseEventSessionErrorPropertiesJSON `json:"-"`
}
func (*EventListResponseEventSessionErrorProperties) UnmarshalJSON ¶
func (r *EventListResponseEventSessionErrorProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionErrorPropertiesError ¶
type EventListResponseEventSessionErrorPropertiesError struct {
// This field can have the runtime type of [shared.ProviderAuthErrorData],
// [shared.UnknownErrorData], [interface{}].
Data interface{} `json:"data,required"`
Name EventListResponseEventSessionErrorPropertiesErrorName `json:"name,required"`
JSON eventListResponseEventSessionErrorPropertiesErrorJSON `json:"-"`
// contains filtered or unexported fields
}
func (EventListResponseEventSessionErrorPropertiesError) AsUnion ¶
func (r EventListResponseEventSessionErrorPropertiesError) AsUnion() EventListResponseEventSessionErrorPropertiesErrorUnion
AsUnion returns a EventListResponseEventSessionErrorPropertiesErrorUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.ProviderAuthError, shared.UnknownError, EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError, shared.MessageAbortedError.
func (*EventListResponseEventSessionErrorPropertiesError) UnmarshalJSON ¶
func (r *EventListResponseEventSessionErrorPropertiesError) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError ¶
type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError struct {
Data interface{} `json:"data,required"`
Name EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName `json:"name,required"`
JSON eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON `json:"-"`
}
func (EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) ImplementsEventListResponseEventSessionErrorPropertiesError ¶
func (r EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) ImplementsEventListResponseEventSessionErrorPropertiesError()
func (*EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) UnmarshalJSON ¶
func (r *EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName ¶
type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName string
const (
EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorNameMessageOutputLengthError EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName = "MessageOutputLengthError"
)
type EventListResponseEventSessionErrorPropertiesErrorName ¶
type EventListResponseEventSessionErrorPropertiesErrorName string
const ( EventListResponseEventSessionErrorPropertiesErrorNameProviderAuthError EventListResponseEventSessionErrorPropertiesErrorName = "ProviderAuthError" EventListResponseEventSessionErrorPropertiesErrorNameUnknownError EventListResponseEventSessionErrorPropertiesErrorName = "UnknownError" EventListResponseEventSessionErrorPropertiesErrorNameMessageOutputLengthError EventListResponseEventSessionErrorPropertiesErrorName = "MessageOutputLengthError" EventListResponseEventSessionErrorPropertiesErrorNameMessageAbortedError EventListResponseEventSessionErrorPropertiesErrorName = "MessageAbortedError" )
func (EventListResponseEventSessionErrorPropertiesErrorName) IsKnown ¶
func (r EventListResponseEventSessionErrorPropertiesErrorName) IsKnown() bool
type EventListResponseEventSessionErrorPropertiesErrorUnion ¶
type EventListResponseEventSessionErrorPropertiesErrorUnion interface {
ImplementsEventListResponseEventSessionErrorPropertiesError()
}
Union satisfied by shared.ProviderAuthError, shared.UnknownError, EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError or shared.MessageAbortedError.
type EventListResponseEventSessionErrorType ¶
type EventListResponseEventSessionErrorType string
const (
EventListResponseEventSessionErrorTypeSessionError EventListResponseEventSessionErrorType = "session.error"
)
func (EventListResponseEventSessionErrorType) IsKnown ¶
func (r EventListResponseEventSessionErrorType) IsKnown() bool
type EventListResponseEventSessionIdle ¶
type EventListResponseEventSessionIdle struct {
Properties EventListResponseEventSessionIdleProperties `json:"properties,required"`
Type EventListResponseEventSessionIdleType `json:"type,required"`
JSON eventListResponseEventSessionIdleJSON `json:"-"`
}
func (*EventListResponseEventSessionIdle) UnmarshalJSON ¶
func (r *EventListResponseEventSessionIdle) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionIdleProperties ¶
type EventListResponseEventSessionIdleProperties struct {
SessionID string `json:"sessionID,required"`
JSON eventListResponseEventSessionIdlePropertiesJSON `json:"-"`
}
func (*EventListResponseEventSessionIdleProperties) UnmarshalJSON ¶
func (r *EventListResponseEventSessionIdleProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionIdleType ¶
type EventListResponseEventSessionIdleType string
const (
EventListResponseEventSessionIdleTypeSessionIdle EventListResponseEventSessionIdleType = "session.idle"
)
func (EventListResponseEventSessionIdleType) IsKnown ¶
func (r EventListResponseEventSessionIdleType) IsKnown() bool
type EventListResponseEventSessionUpdated ¶
type EventListResponseEventSessionUpdated struct {
Properties EventListResponseEventSessionUpdatedProperties `json:"properties,required"`
Type EventListResponseEventSessionUpdatedType `json:"type,required"`
JSON eventListResponseEventSessionUpdatedJSON `json:"-"`
}
func (*EventListResponseEventSessionUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventSessionUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionUpdatedProperties ¶
type EventListResponseEventSessionUpdatedProperties struct {
Info Session `json:"info,required"`
JSON eventListResponseEventSessionUpdatedPropertiesJSON `json:"-"`
}
func (*EventListResponseEventSessionUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventSessionUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionUpdatedType ¶
type EventListResponseEventSessionUpdatedType string
const (
EventListResponseEventSessionUpdatedTypeSessionUpdated EventListResponseEventSessionUpdatedType = "session.updated"
)
func (EventListResponseEventSessionUpdatedType) IsKnown ¶
func (r EventListResponseEventSessionUpdatedType) IsKnown() bool
type EventListResponseEventStorageWrite ¶
type EventListResponseEventStorageWrite struct {
Properties EventListResponseEventStorageWriteProperties `json:"properties,required"`
Type EventListResponseEventStorageWriteType `json:"type,required"`
JSON eventListResponseEventStorageWriteJSON `json:"-"`
}
func (*EventListResponseEventStorageWrite) UnmarshalJSON ¶
func (r *EventListResponseEventStorageWrite) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventStorageWriteProperties ¶
type EventListResponseEventStorageWriteProperties struct {
Key string `json:"key,required"`
Content interface{} `json:"content"`
JSON eventListResponseEventStorageWritePropertiesJSON `json:"-"`
}
func (*EventListResponseEventStorageWriteProperties) UnmarshalJSON ¶
func (r *EventListResponseEventStorageWriteProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventStorageWriteType ¶
type EventListResponseEventStorageWriteType string
const (
EventListResponseEventStorageWriteTypeStorageWrite EventListResponseEventStorageWriteType = "storage.write"
)
func (EventListResponseEventStorageWriteType) IsKnown ¶
func (r EventListResponseEventStorageWriteType) IsKnown() bool
type EventListResponseType ¶
type EventListResponseType string
const ( EventListResponseTypeInstallationUpdated EventListResponseType = "installation.updated" EventListResponseTypeLspClientDiagnostics EventListResponseType = "lsp.client.diagnostics" EventListResponseTypeMessageUpdated EventListResponseType = "message.updated" EventListResponseTypeMessageRemoved EventListResponseType = "message.removed" EventListResponseTypeMessagePartUpdated EventListResponseType = "message.part.updated" EventListResponseTypeMessagePartRemoved EventListResponseType = "message.part.removed" EventListResponseTypeStorageWrite EventListResponseType = "storage.write" EventListResponseTypePermissionUpdated EventListResponseType = "permission.updated" EventListResponseTypeFileEdited EventListResponseType = "file.edited" EventListResponseTypeSessionUpdated EventListResponseType = "session.updated" EventListResponseTypeSessionDeleted EventListResponseType = "session.deleted" EventListResponseTypeSessionIdle EventListResponseType = "session.idle" EventListResponseTypeSessionError EventListResponseType = "session.error" EventListResponseTypeServerConnected EventListResponseType = "server.connected" EventListResponseTypeFileWatcherUpdated EventListResponseType = "file.watcher.updated" EventListResponseTypeIdeInstalled EventListResponseType = "ide.installed" )
func (EventListResponseType) IsKnown ¶
func (r EventListResponseType) IsKnown() bool
type EventListResponseUnion ¶
type EventListResponseUnion interface {
// contains filtered or unexported methods
}
Union satisfied by EventListResponseEventInstallationUpdated, EventListResponseEventLspClientDiagnostics, EventListResponseEventMessageUpdated, EventListResponseEventMessageRemoved, EventListResponseEventMessagePartUpdated, EventListResponseEventMessagePartRemoved, EventListResponseEventStorageWrite, EventListResponseEventPermissionUpdated, EventListResponseEventFileEdited, EventListResponseEventSessionUpdated, EventListResponseEventSessionDeleted, EventListResponseEventSessionIdle, EventListResponseEventSessionError, EventListResponseEventServerConnected, EventListResponseEventFileWatcherUpdated or EventListResponseEventIdeInstalled.
type EventService ¶
type EventService struct {
Options []option.RequestOption
}
EventService contains methods and other services that help with interacting with the opencode API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEventService method instead.
func NewEventService ¶
func NewEventService(opts ...option.RequestOption) (r *EventService)
NewEventService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EventService) ListStreaming ¶
func (r *EventService) ListStreaming(ctx context.Context, opts ...option.RequestOption) (stream *ssestream.Stream[EventListResponse])
Get events
type File ¶
type File struct {
Added int64 `json:"added,required"`
Path string `json:"path,required"`
Removed int64 `json:"removed,required"`
Status FileStatus `json:"status,required"`
JSON fileJSON `json:"-"`
}
func (*File) UnmarshalJSON ¶
type FilePart ¶
type FilePart struct {
ID string `json:"id,required"`
MessageID string `json:"messageID,required"`
Mime string `json:"mime,required"`
SessionID string `json:"sessionID,required"`
Type FilePartType `json:"type,required"`
URL string `json:"url,required"`
Filename string `json:"filename"`
Source FilePartSource `json:"source"`
JSON filePartJSON `json:"-"`
}
func (*FilePart) UnmarshalJSON ¶
type FilePartInputParam ¶
type FilePartInputParam struct {
Mime param.Field[string] `json:"mime,required"`
Type param.Field[FilePartInputType] `json:"type,required"`
URL param.Field[string] `json:"url,required"`
ID param.Field[string] `json:"id"`
Filename param.Field[string] `json:"filename"`
Source param.Field[FilePartSourceUnionParam] `json:"source"`
}
func (FilePartInputParam) MarshalJSON ¶
func (r FilePartInputParam) MarshalJSON() (data []byte, err error)
type FilePartInputType ¶
type FilePartInputType string
const (
FilePartInputTypeFile FilePartInputType = "file"
)
func (FilePartInputType) IsKnown ¶
func (r FilePartInputType) IsKnown() bool
type FilePartSource ¶
type FilePartSource struct {
Path string `json:"path,required"`
Text FilePartSourceText `json:"text,required"`
Type FilePartSourceType `json:"type,required"`
Kind int64 `json:"kind"`
Name string `json:"name"`
// This field can have the runtime type of [SymbolSourceRange].
Range interface{} `json:"range"`
JSON filePartSourceJSON `json:"-"`
// contains filtered or unexported fields
}
func (FilePartSource) AsUnion ¶
func (r FilePartSource) AsUnion() FilePartSourceUnion
AsUnion returns a FilePartSourceUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are FileSource, SymbolSource.
func (*FilePartSource) UnmarshalJSON ¶
func (r *FilePartSource) UnmarshalJSON(data []byte) (err error)
type FilePartSourceParam ¶
type FilePartSourceParam struct {
Path param.Field[string] `json:"path,required"`
Text param.Field[FilePartSourceTextParam] `json:"text,required"`
Type param.Field[FilePartSourceType] `json:"type,required"`
Kind param.Field[int64] `json:"kind"`
Name param.Field[string] `json:"name"`
Range param.Field[interface{}] `json:"range"`
}
func (FilePartSourceParam) MarshalJSON ¶
func (r FilePartSourceParam) MarshalJSON() (data []byte, err error)
type FilePartSourceText ¶
type FilePartSourceText struct {
End int64 `json:"end,required"`
Start int64 `json:"start,required"`
Value string `json:"value,required"`
JSON filePartSourceTextJSON `json:"-"`
}
func (*FilePartSourceText) UnmarshalJSON ¶
func (r *FilePartSourceText) UnmarshalJSON(data []byte) (err error)
type FilePartSourceTextParam ¶
type FilePartSourceTextParam struct {
End param.Field[int64] `json:"end,required"`
Start param.Field[int64] `json:"start,required"`
Value param.Field[string] `json:"value,required"`
}
func (FilePartSourceTextParam) MarshalJSON ¶
func (r FilePartSourceTextParam) MarshalJSON() (data []byte, err error)
type FilePartSourceType ¶
type FilePartSourceType string
const ( FilePartSourceTypeFile FilePartSourceType = "file" FilePartSourceTypeSymbol FilePartSourceType = "symbol" )
func (FilePartSourceType) IsKnown ¶
func (r FilePartSourceType) IsKnown() bool
type FilePartSourceUnion ¶
type FilePartSourceUnion interface {
// contains filtered or unexported methods
}
Union satisfied by FileSource or SymbolSource.
type FilePartSourceUnionParam ¶
type FilePartSourceUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by FileSourceParam, SymbolSourceParam, FilePartSourceParam.
type FilePartType ¶
type FilePartType string
const (
FilePartTypeFile FilePartType = "file"
)
func (FilePartType) IsKnown ¶
func (r FilePartType) IsKnown() bool
type FileReadParams ¶
func (FileReadParams) URLQuery ¶
func (r FileReadParams) URLQuery() (v url.Values)
URLQuery serializes FileReadParams's query parameters as `url.Values`.
type FileReadResponse ¶
type FileReadResponse struct {
Content string `json:"content,required"`
Type FileReadResponseType `json:"type,required"`
JSON fileReadResponseJSON `json:"-"`
}
func (*FileReadResponse) UnmarshalJSON ¶
func (r *FileReadResponse) UnmarshalJSON(data []byte) (err error)
type FileReadResponseType ¶
type FileReadResponseType string
const ( FileReadResponseTypeRaw FileReadResponseType = "raw" FileReadResponseTypePatch FileReadResponseType = "patch" )
func (FileReadResponseType) IsKnown ¶
func (r FileReadResponseType) IsKnown() bool
type FileService ¶
type FileService struct {
Options []option.RequestOption
}
FileService contains methods and other services that help with interacting with the opencode API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileService method instead.
func NewFileService ¶
func NewFileService(opts ...option.RequestOption) (r *FileService)
NewFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FileService) Read ¶
func (r *FileService) Read(ctx context.Context, query FileReadParams, opts ...option.RequestOption) (res *FileReadResponse, err error)
Read a file
func (*FileService) Status ¶
func (r *FileService) Status(ctx context.Context, opts ...option.RequestOption) (res *[]File, err error)
Get file status
type FileSource ¶
type FileSource struct {
Path string `json:"path,required"`
Text FilePartSourceText `json:"text,required"`
Type FileSourceType `json:"type,required"`
JSON fileSourceJSON `json:"-"`
}
func (*FileSource) UnmarshalJSON ¶
func (r *FileSource) UnmarshalJSON(data []byte) (err error)
type FileSourceParam ¶
type FileSourceParam struct {
Path param.Field[string] `json:"path,required"`
Text param.Field[FilePartSourceTextParam] `json:"text,required"`
Type param.Field[FileSourceType] `json:"type,required"`
}
func (FileSourceParam) MarshalJSON ¶
func (r FileSourceParam) MarshalJSON() (data []byte, err error)
type FileSourceType ¶
type FileSourceType string
const (
FileSourceTypeFile FileSourceType = "file"
)
func (FileSourceType) IsKnown ¶
func (r FileSourceType) IsKnown() bool
type FileStatus ¶
type FileStatus string
const ( FileStatusAdded FileStatus = "added" FileStatusDeleted FileStatus = "deleted" FileStatusModified FileStatus = "modified" )
func (FileStatus) IsKnown ¶
func (r FileStatus) IsKnown() bool
type FindFilesParams ¶
func (FindFilesParams) URLQuery ¶
func (r FindFilesParams) URLQuery() (v url.Values)
URLQuery serializes FindFilesParams's query parameters as `url.Values`.
type FindService ¶
type FindService struct {
Options []option.RequestOption
}
FindService contains methods and other services that help with interacting with the opencode API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFindService method instead.
func NewFindService ¶
func NewFindService(opts ...option.RequestOption) (r *FindService)
NewFindService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FindService) Files ¶
func (r *FindService) Files(ctx context.Context, query FindFilesParams, opts ...option.RequestOption) (res *[]string, err error)
Find files
func (*FindService) Symbols ¶
func (r *FindService) Symbols(ctx context.Context, query FindSymbolsParams, opts ...option.RequestOption) (res *[]Symbol, err error)
Find workspace symbols
func (*FindService) Text ¶
func (r *FindService) Text(ctx context.Context, query FindTextParams, opts ...option.RequestOption) (res *[]FindTextResponse, err error)
Find text in files
type FindSymbolsParams ¶
func (FindSymbolsParams) URLQuery ¶
func (r FindSymbolsParams) URLQuery() (v url.Values)
URLQuery serializes FindSymbolsParams's query parameters as `url.Values`.
type FindTextParams ¶
func (FindTextParams) URLQuery ¶
func (r FindTextParams) URLQuery() (v url.Values)
URLQuery serializes FindTextParams's query parameters as `url.Values`.
type FindTextResponse ¶
type FindTextResponse struct {
AbsoluteOffset float64 `json:"absolute_offset,required"`
LineNumber float64 `json:"line_number,required"`
Lines FindTextResponseLines `json:"lines,required"`
Path FindTextResponsePath `json:"path,required"`
Submatches []FindTextResponseSubmatch `json:"submatches,required"`
JSON findTextResponseJSON `json:"-"`
}
func (*FindTextResponse) UnmarshalJSON ¶
func (r *FindTextResponse) UnmarshalJSON(data []byte) (err error)
type FindTextResponseLines ¶
type FindTextResponseLines struct {
Text string `json:"text,required"`
JSON findTextResponseLinesJSON `json:"-"`
}
func (*FindTextResponseLines) UnmarshalJSON ¶
func (r *FindTextResponseLines) UnmarshalJSON(data []byte) (err error)
type FindTextResponsePath ¶
type FindTextResponsePath struct {
Text string `json:"text,required"`
JSON findTextResponsePathJSON `json:"-"`
}
func (*FindTextResponsePath) UnmarshalJSON ¶
func (r *FindTextResponsePath) UnmarshalJSON(data []byte) (err error)
type FindTextResponseSubmatch ¶
type FindTextResponseSubmatch struct {
End float64 `json:"end,required"`
Match FindTextResponseSubmatchesMatch `json:"match,required"`
Start float64 `json:"start,required"`
JSON findTextResponseSubmatchJSON `json:"-"`
}
func (*FindTextResponseSubmatch) UnmarshalJSON ¶
func (r *FindTextResponseSubmatch) UnmarshalJSON(data []byte) (err error)
type FindTextResponseSubmatchesMatch ¶
type FindTextResponseSubmatchesMatch struct {
Text string `json:"text,required"`
JSON findTextResponseSubmatchesMatchJSON `json:"-"`
}
func (*FindTextResponseSubmatchesMatch) UnmarshalJSON ¶
func (r *FindTextResponseSubmatchesMatch) UnmarshalJSON(data []byte) (err error)
type KeybindsConfig ¶
type KeybindsConfig struct {
// Exit the application
AppExit string `json:"app_exit,required"`
// Show help dialog
AppHelp string `json:"app_help,required"`
// Open external editor
EditorOpen string `json:"editor_open,required"`
// Close file
FileClose string `json:"file_close,required"`
// Split/unified diff
FileDiffToggle string `json:"file_diff_toggle,required"`
// List files
FileList string `json:"file_list,required"`
// Search file
FileSearch string `json:"file_search,required"`
// Clear input field
InputClear string `json:"input_clear,required"`
// Insert newline in input
InputNewline string `json:"input_newline,required"`
// Paste from clipboard
InputPaste string `json:"input_paste,required"`
// Submit input
InputSubmit string `json:"input_submit,required"`
// Leader key for keybind combinations
Leader string `json:"leader,required"`
// Copy message
MessagesCopy string `json:"messages_copy,required"`
// Navigate to first message
MessagesFirst string `json:"messages_first,required"`
// Scroll messages down by half page
MessagesHalfPageDown string `json:"messages_half_page_down,required"`
// Scroll messages up by half page
MessagesHalfPageUp string `json:"messages_half_page_up,required"`
// Navigate to last message
MessagesLast string `json:"messages_last,required"`
// Toggle layout
MessagesLayoutToggle string `json:"messages_layout_toggle,required"`
// Navigate to next message
MessagesNext string `json:"messages_next,required"`
// Scroll messages down by one page
MessagesPageDown string `json:"messages_page_down,required"`
// Scroll messages up by one page
MessagesPageUp string `json:"messages_page_up,required"`
// Navigate to previous message
MessagesPrevious string `json:"messages_previous,required"`
// Redo message
MessagesRedo string `json:"messages_redo,required"`
// @deprecated use messages_undo. Revert message
MessagesRevert string `json:"messages_revert,required"`
// Undo message
MessagesUndo string `json:"messages_undo,required"`
// List available models
ModelList string `json:"model_list,required"`
// Create/update AGENTS.md
ProjectInit string `json:"project_init,required"`
// Compact the session
SessionCompact string `json:"session_compact,required"`
// Export session to editor
SessionExport string `json:"session_export,required"`
// Interrupt current session
SessionInterrupt string `json:"session_interrupt,required"`
// List all sessions
SessionList string `json:"session_list,required"`
// Create a new session
SessionNew string `json:"session_new,required"`
SessionShare string `json:"session_share,required"`
SessionUnshare string `json:"session_unshare,required"`
// Next mode
SwitchMode string `json:"switch_mode,required"`
// Previous Mode
SwitchModeReverse string `json:"switch_mode_reverse,required"`
// List available themes
ThemeList string `json:"theme_list,required"`
// Toggle tool details
ToolDetails string `json:"tool_details,required"`
JSON keybindsConfigJSON `json:"-"`
}
func (*KeybindsConfig) UnmarshalJSON ¶
func (r *KeybindsConfig) UnmarshalJSON(data []byte) (err error)
type McpLocalConfig ¶
type McpLocalConfig struct {
// Command and arguments to run the MCP server
Command []string `json:"command,required"`
// Type of MCP server connection
Type McpLocalConfigType `json:"type,required"`
// Enable or disable the MCP server on startup
Enabled bool `json:"enabled"`
// Environment variables to set when running the MCP server
Environment map[string]string `json:"environment"`
JSON mcpLocalConfigJSON `json:"-"`
}
func (*McpLocalConfig) UnmarshalJSON ¶
func (r *McpLocalConfig) UnmarshalJSON(data []byte) (err error)
type McpLocalConfigType ¶
type McpLocalConfigType string
Type of MCP server connection
const (
McpLocalConfigTypeLocal McpLocalConfigType = "local"
)
func (McpLocalConfigType) IsKnown ¶
func (r McpLocalConfigType) IsKnown() bool
type McpRemoteConfig ¶
type McpRemoteConfig struct {
// Type of MCP server connection
Type McpRemoteConfigType `json:"type,required"`
// URL of the remote MCP server
URL string `json:"url,required"`
// Enable or disable the MCP server on startup
Enabled bool `json:"enabled"`
// Headers to send with the request
Headers map[string]string `json:"headers"`
JSON mcpRemoteConfigJSON `json:"-"`
}
func (*McpRemoteConfig) UnmarshalJSON ¶
func (r *McpRemoteConfig) UnmarshalJSON(data []byte) (err error)
type McpRemoteConfigType ¶
type McpRemoteConfigType string
Type of MCP server connection
const (
McpRemoteConfigTypeRemote McpRemoteConfigType = "remote"
)
func (McpRemoteConfigType) IsKnown ¶
func (r McpRemoteConfigType) IsKnown() bool
type Message ¶
type Message struct {
ID string `json:"id,required"`
Role MessageRole `json:"role,required"`
SessionID string `json:"sessionID,required"`
// This field can have the runtime type of [UserMessageTime],
// [AssistantMessageTime].
Time interface{} `json:"time,required"`
Cost float64 `json:"cost"`
// This field can have the runtime type of [AssistantMessageError].
Error interface{} `json:"error"`
Mode string `json:"mode"`
ModelID string `json:"modelID"`
// This field can have the runtime type of [AssistantMessagePath].
Path interface{} `json:"path"`
ProviderID string `json:"providerID"`
Summary bool `json:"summary"`
// This field can have the runtime type of [[]string].
System interface{} `json:"system"`
// This field can have the runtime type of [AssistantMessageTokens].
Tokens interface{} `json:"tokens"`
JSON messageJSON `json:"-"`
// contains filtered or unexported fields
}
func (Message) AsUnion ¶
func (r Message) AsUnion() MessageUnion
AsUnion returns a MessageUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are UserMessage, AssistantMessage.
func (*Message) UnmarshalJSON ¶
type MessageAbortedError ¶
type MessageAbortedError = shared.MessageAbortedError
This is an alias to an internal type.
type MessageAbortedErrorName ¶
type MessageAbortedErrorName = shared.MessageAbortedErrorName
This is an alias to an internal type.
type MessageRole ¶
type MessageRole string
const ( MessageRoleUser MessageRole = "user" MessageRoleAssistant MessageRole = "assistant" )
func (MessageRole) IsKnown ¶
func (r MessageRole) IsKnown() bool
type MessageUnion ¶
type MessageUnion interface {
// contains filtered or unexported methods
}
Union satisfied by UserMessage or AssistantMessage.
type Mode ¶
type Mode struct {
Name string `json:"name,required"`
Tools map[string]bool `json:"tools,required"`
Model ModeModel `json:"model"`
Prompt string `json:"prompt"`
Temperature float64 `json:"temperature"`
JSON modeJSON `json:"-"`
}
func (*Mode) UnmarshalJSON ¶
type ModeConfig ¶
type ModeConfig struct {
Disable bool `json:"disable"`
Model string `json:"model"`
Prompt string `json:"prompt"`
Temperature float64 `json:"temperature"`
Tools map[string]bool `json:"tools"`
JSON modeConfigJSON `json:"-"`
}
func (*ModeConfig) UnmarshalJSON ¶
func (r *ModeConfig) UnmarshalJSON(data []byte) (err error)
type ModeModel ¶
type ModeModel struct {
ModelID string `json:"modelID,required"`
ProviderID string `json:"providerID,required"`
JSON modeModelJSON `json:"-"`
}
func (*ModeModel) UnmarshalJSON ¶
type Model ¶ added in v0.2.0
type Model struct {
ID string `json:"id,required"`
Attachment bool `json:"attachment,required"`
Cost ModelCost `json:"cost,required"`
Limit ModelLimit `json:"limit,required"`
Name string `json:"name,required"`
Options map[string]interface{} `json:"options,required"`
Reasoning bool `json:"reasoning,required"`
ReleaseDate string `json:"release_date,required"`
Temperature bool `json:"temperature,required"`
ToolCall bool `json:"tool_call,required"`
JSON modelJSON `json:"-"`
}
func (*Model) UnmarshalJSON ¶ added in v0.2.0
type ModelCost ¶ added in v0.2.0
type ModelCost struct {
Input float64 `json:"input,required"`
Output float64 `json:"output,required"`
CacheRead float64 `json:"cache_read"`
CacheWrite float64 `json:"cache_write"`
JSON modelCostJSON `json:"-"`
}
func (*ModelCost) UnmarshalJSON ¶ added in v0.2.0
type ModelLimit ¶ added in v0.2.0
type ModelLimit struct {
Context float64 `json:"context,required"`
Output float64 `json:"output,required"`
JSON modelLimitJSON `json:"-"`
}
func (*ModelLimit) UnmarshalJSON ¶ added in v0.2.0
func (r *ModelLimit) UnmarshalJSON(data []byte) (err error)
type Part ¶
type Part struct {
ID string `json:"id,required"`
MessageID string `json:"messageID,required"`
SessionID string `json:"sessionID,required"`
Type PartType `json:"type,required"`
CallID string `json:"callID"`
Cost float64 `json:"cost"`
Filename string `json:"filename"`
// This field can have the runtime type of [[]string].
Files interface{} `json:"files"`
Hash string `json:"hash"`
Mime string `json:"mime"`
Snapshot string `json:"snapshot"`
Source FilePartSource `json:"source"`
// This field can have the runtime type of [ToolPartState].
State interface{} `json:"state"`
Synthetic bool `json:"synthetic"`
Text string `json:"text"`
// This field can have the runtime type of [TextPartTime].
Time interface{} `json:"time"`
// This field can have the runtime type of [StepFinishPartTokens].
Tokens interface{} `json:"tokens"`
Tool string `json:"tool"`
URL string `json:"url"`
JSON partJSON `json:"-"`
// contains filtered or unexported fields
}
func (Part) AsUnion ¶
AsUnion returns a PartUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are TextPart, FilePart, ToolPart, StepStartPart, StepFinishPart, SnapshotPart, PartPatchPart.
func (*Part) UnmarshalJSON ¶
type PartPatchPart ¶
type PartPatchPart struct {
ID string `json:"id,required"`
Files []string `json:"files,required"`
Hash string `json:"hash,required"`
MessageID string `json:"messageID,required"`
SessionID string `json:"sessionID,required"`
Type PartPatchPartType `json:"type,required"`
JSON partPatchPartJSON `json:"-"`
}
func (*PartPatchPart) UnmarshalJSON ¶
func (r *PartPatchPart) UnmarshalJSON(data []byte) (err error)
type PartPatchPartType ¶
type PartPatchPartType string
const (
PartPatchPartTypePatch PartPatchPartType = "patch"
)
func (PartPatchPartType) IsKnown ¶
func (r PartPatchPartType) IsKnown() bool
type PartUnion ¶
type PartUnion interface {
// contains filtered or unexported methods
}
Union satisfied by TextPart, FilePart, ToolPart, StepStartPart, StepFinishPart, SnapshotPart or PartPatchPart.
type Provider ¶ added in v0.2.0
type Provider struct {
ID string `json:"id,required"`
Env []string `json:"env,required"`
Models map[string]Model `json:"models,required"`
Name string `json:"name,required"`
API string `json:"api"`
Npm string `json:"npm"`
JSON providerJSON `json:"-"`
}
func (*Provider) UnmarshalJSON ¶ added in v0.2.0
type ProviderAuthError ¶
type ProviderAuthError = shared.ProviderAuthError
This is an alias to an internal type.
type ProviderAuthErrorData ¶
type ProviderAuthErrorData = shared.ProviderAuthErrorData
This is an alias to an internal type.
type ProviderAuthErrorName ¶
type ProviderAuthErrorName = shared.ProviderAuthErrorName
This is an alias to an internal type.
type Session ¶
type Session struct {
ID string `json:"id,required"`
Time SessionTime `json:"time,required"`
Title string `json:"title,required"`
Version string `json:"version,required"`
ParentID string `json:"parentID"`
Revert SessionRevert `json:"revert"`
JSON sessionJSON `json:"-"`
}
func (*Session) UnmarshalJSON ¶
type SessionChatParams ¶
type SessionChatParams struct {
ModelID param.Field[string] `json:"modelID,required"`
Parts param.Field[[]SessionChatParamsPartUnion] `json:"parts,required"`
ProviderID param.Field[string] `json:"providerID,required"`
MessageID param.Field[string] `json:"messageID"`
Mode param.Field[string] `json:"mode"`
System param.Field[string] `json:"system"`
Tools param.Field[map[string]bool] `json:"tools"`
}
func (SessionChatParams) MarshalJSON ¶
func (r SessionChatParams) MarshalJSON() (data []byte, err error)
type SessionChatParamsPart ¶
type SessionChatParamsPart struct {
Type param.Field[SessionChatParamsPartsType] `json:"type,required"`
ID param.Field[string] `json:"id"`
Filename param.Field[string] `json:"filename"`
Mime param.Field[string] `json:"mime"`
Source param.Field[FilePartSourceUnionParam] `json:"source"`
Synthetic param.Field[bool] `json:"synthetic"`
Text param.Field[string] `json:"text"`
Time param.Field[interface{}] `json:"time"`
URL param.Field[string] `json:"url"`
}
func (SessionChatParamsPart) MarshalJSON ¶
func (r SessionChatParamsPart) MarshalJSON() (data []byte, err error)
type SessionChatParamsPartUnion ¶
type SessionChatParamsPartUnion interface {
// contains filtered or unexported methods
}
Satisfied by TextPartInputParam, FilePartInputParam, SessionChatParamsPart.
type SessionChatParamsPartsType ¶
type SessionChatParamsPartsType string
const ( SessionChatParamsPartsTypeText SessionChatParamsPartsType = "text" SessionChatParamsPartsTypeFile SessionChatParamsPartsType = "file" )
func (SessionChatParamsPartsType) IsKnown ¶
func (r SessionChatParamsPartsType) IsKnown() bool
type SessionInitParams ¶
type SessionInitParams struct {
MessageID param.Field[string] `json:"messageID,required"`
ModelID param.Field[string] `json:"modelID,required"`
ProviderID param.Field[string] `json:"providerID,required"`
}
func (SessionInitParams) MarshalJSON ¶
func (r SessionInitParams) MarshalJSON() (data []byte, err error)
type SessionMessagesResponse ¶
type SessionMessagesResponse struct {
Info Message `json:"info,required"`
Parts []Part `json:"parts,required"`
JSON sessionMessagesResponseJSON `json:"-"`
}
func (*SessionMessagesResponse) UnmarshalJSON ¶
func (r *SessionMessagesResponse) UnmarshalJSON(data []byte) (err error)
type SessionRevert ¶
type SessionRevert struct {
MessageID string `json:"messageID,required"`
Diff string `json:"diff"`
PartID string `json:"partID"`
Snapshot string `json:"snapshot"`
JSON sessionRevertJSON `json:"-"`
}
func (*SessionRevert) UnmarshalJSON ¶
func (r *SessionRevert) UnmarshalJSON(data []byte) (err error)
type SessionRevertParams ¶
type SessionRevertParams struct {
MessageID param.Field[string] `json:"messageID,required"`
PartID param.Field[string] `json:"partID"`
}
func (SessionRevertParams) MarshalJSON ¶
func (r SessionRevertParams) MarshalJSON() (data []byte, err error)
type SessionService ¶
type SessionService struct {
Options []option.RequestOption
}
SessionService contains methods and other services that help with interacting with the opencode API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSessionService method instead.
func NewSessionService ¶
func NewSessionService(opts ...option.RequestOption) (r *SessionService)
NewSessionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SessionService) Abort ¶
func (r *SessionService) Abort(ctx context.Context, id string, opts ...option.RequestOption) (res *bool, err error)
Abort a session
func (*SessionService) Chat ¶
func (r *SessionService) Chat(ctx context.Context, id string, body SessionChatParams, opts ...option.RequestOption) (res *AssistantMessage, err error)
Create and send a new message to a session
func (*SessionService) Delete ¶
func (r *SessionService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *bool, err error)
Delete a session and all its data
func (*SessionService) Init ¶
func (r *SessionService) Init(ctx context.Context, id string, body SessionInitParams, opts ...option.RequestOption) (res *bool, err error)
Analyze the app and create an AGENTS.md file
func (*SessionService) List ¶
func (r *SessionService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Session, err error)
List all sessions
func (*SessionService) Messages ¶
func (r *SessionService) Messages(ctx context.Context, id string, opts ...option.RequestOption) (res *[]SessionMessagesResponse, err error)
List messages for a session
func (*SessionService) New ¶
func (r *SessionService) New(ctx context.Context, opts ...option.RequestOption) (res *Session, err error)
Create a new session
func (*SessionService) Revert ¶
func (r *SessionService) Revert(ctx context.Context, id string, body SessionRevertParams, opts ...option.RequestOption) (res *Session, err error)
Revert a message
func (*SessionService) Share ¶
func (r *SessionService) Share(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
Share a session
func (*SessionService) Summarize ¶
func (r *SessionService) Summarize(ctx context.Context, id string, body SessionSummarizeParams, opts ...option.RequestOption) (res *bool, err error)
Summarize the session
func (*SessionService) Unrevert ¶
func (r *SessionService) Unrevert(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
Restore all reverted messages
func (*SessionService) Unshare ¶
func (r *SessionService) Unshare(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
Unshare the session
type SessionShare ¶
type SessionShare struct {
}
func (*SessionShare) UnmarshalJSON ¶
func (r *SessionShare) UnmarshalJSON(data []byte) (err error)
type SessionSummarizeParams ¶
type SessionSummarizeParams struct {
ModelID param.Field[string] `json:"modelID,required"`
ProviderID param.Field[string] `json:"providerID,required"`
}
func (SessionSummarizeParams) MarshalJSON ¶
func (r SessionSummarizeParams) MarshalJSON() (data []byte, err error)
type SessionTime ¶
type SessionTime struct {
Created float64 `json:"created,required"`
Updated float64 `json:"updated,required"`
JSON sessionTimeJSON `json:"-"`
}
func (*SessionTime) UnmarshalJSON ¶
func (r *SessionTime) UnmarshalJSON(data []byte) (err error)
type SnapshotPart ¶
type SnapshotPart struct {
ID string `json:"id,required"`
MessageID string `json:"messageID,required"`
SessionID string `json:"sessionID,required"`
Snapshot string `json:"snapshot,required"`
Type SnapshotPartType `json:"type,required"`
JSON snapshotPartJSON `json:"-"`
}
func (*SnapshotPart) UnmarshalJSON ¶
func (r *SnapshotPart) UnmarshalJSON(data []byte) (err error)
type SnapshotPartType ¶
type SnapshotPartType string
const (
SnapshotPartTypeSnapshot SnapshotPartType = "snapshot"
)
func (SnapshotPartType) IsKnown ¶
func (r SnapshotPartType) IsKnown() bool
type StepFinishPart ¶
type StepFinishPart struct {
ID string `json:"id,required"`
Cost float64 `json:"cost,required"`
MessageID string `json:"messageID,required"`
SessionID string `json:"sessionID,required"`
Tokens StepFinishPartTokens `json:"tokens,required"`
Type StepFinishPartType `json:"type,required"`
JSON stepFinishPartJSON `json:"-"`
}
func (*StepFinishPart) UnmarshalJSON ¶
func (r *StepFinishPart) UnmarshalJSON(data []byte) (err error)
type StepFinishPartTokens ¶
type StepFinishPartTokens struct {
Cache StepFinishPartTokensCache `json:"cache,required"`
Input float64 `json:"input,required"`
Output float64 `json:"output,required"`
Reasoning float64 `json:"reasoning,required"`
JSON stepFinishPartTokensJSON `json:"-"`
}
func (*StepFinishPartTokens) UnmarshalJSON ¶
func (r *StepFinishPartTokens) UnmarshalJSON(data []byte) (err error)
type StepFinishPartTokensCache ¶
type StepFinishPartTokensCache struct {
Read float64 `json:"read,required"`
Write float64 `json:"write,required"`
JSON stepFinishPartTokensCacheJSON `json:"-"`
}
func (*StepFinishPartTokensCache) UnmarshalJSON ¶
func (r *StepFinishPartTokensCache) UnmarshalJSON(data []byte) (err error)
type StepFinishPartType ¶
type StepFinishPartType string
const (
StepFinishPartTypeStepFinish StepFinishPartType = "step-finish"
)
func (StepFinishPartType) IsKnown ¶
func (r StepFinishPartType) IsKnown() bool
type StepStartPart ¶
type StepStartPart struct {
ID string `json:"id,required"`
MessageID string `json:"messageID,required"`
SessionID string `json:"sessionID,required"`
Type StepStartPartType `json:"type,required"`
JSON stepStartPartJSON `json:"-"`
}
func (*StepStartPart) UnmarshalJSON ¶
func (r *StepStartPart) UnmarshalJSON(data []byte) (err error)
type StepStartPartType ¶
type StepStartPartType string
const (
StepStartPartTypeStepStart StepStartPartType = "step-start"
)
func (StepStartPartType) IsKnown ¶
func (r StepStartPartType) IsKnown() bool
type Symbol ¶
type Symbol struct {
Kind float64 `json:"kind,required"`
Location SymbolLocation `json:"location,required"`
Name string `json:"name,required"`
JSON symbolJSON `json:"-"`
}
func (*Symbol) UnmarshalJSON ¶
type SymbolLocation ¶
type SymbolLocation struct {
Range SymbolLocationRange `json:"range,required"`
Uri string `json:"uri,required"`
JSON symbolLocationJSON `json:"-"`
}
func (*SymbolLocation) UnmarshalJSON ¶
func (r *SymbolLocation) UnmarshalJSON(data []byte) (err error)
type SymbolLocationRange ¶
type SymbolLocationRange struct {
End SymbolLocationRangeEnd `json:"end,required"`
Start SymbolLocationRangeStart `json:"start,required"`
JSON symbolLocationRangeJSON `json:"-"`
}
func (*SymbolLocationRange) UnmarshalJSON ¶
func (r *SymbolLocationRange) UnmarshalJSON(data []byte) (err error)
type SymbolLocationRangeEnd ¶
type SymbolLocationRangeEnd struct {
Character float64 `json:"character,required"`
Line float64 `json:"line,required"`
JSON symbolLocationRangeEndJSON `json:"-"`
}
func (*SymbolLocationRangeEnd) UnmarshalJSON ¶
func (r *SymbolLocationRangeEnd) UnmarshalJSON(data []byte) (err error)
type SymbolLocationRangeStart ¶
type SymbolLocationRangeStart struct {
Character float64 `json:"character,required"`
Line float64 `json:"line,required"`
JSON symbolLocationRangeStartJSON `json:"-"`
}
func (*SymbolLocationRangeStart) UnmarshalJSON ¶
func (r *SymbolLocationRangeStart) UnmarshalJSON(data []byte) (err error)
type SymbolSource ¶
type SymbolSource struct {
Kind int64 `json:"kind,required"`
Name string `json:"name,required"`
Path string `json:"path,required"`
Range SymbolSourceRange `json:"range,required"`
Text FilePartSourceText `json:"text,required"`
Type SymbolSourceType `json:"type,required"`
JSON symbolSourceJSON `json:"-"`
}
func (*SymbolSource) UnmarshalJSON ¶
func (r *SymbolSource) UnmarshalJSON(data []byte) (err error)
type SymbolSourceParam ¶
type SymbolSourceParam struct {
Kind param.Field[int64] `json:"kind,required"`
Name param.Field[string] `json:"name,required"`
Path param.Field[string] `json:"path,required"`
Range param.Field[SymbolSourceRangeParam] `json:"range,required"`
Text param.Field[FilePartSourceTextParam] `json:"text,required"`
Type param.Field[SymbolSourceType] `json:"type,required"`
}
func (SymbolSourceParam) MarshalJSON ¶
func (r SymbolSourceParam) MarshalJSON() (data []byte, err error)
type SymbolSourceRange ¶
type SymbolSourceRange struct {
End SymbolSourceRangeEnd `json:"end,required"`
Start SymbolSourceRangeStart `json:"start,required"`
JSON symbolSourceRangeJSON `json:"-"`
}
func (*SymbolSourceRange) UnmarshalJSON ¶
func (r *SymbolSourceRange) UnmarshalJSON(data []byte) (err error)
type SymbolSourceRangeEnd ¶
type SymbolSourceRangeEnd struct {
Character float64 `json:"character,required"`
Line float64 `json:"line,required"`
JSON symbolSourceRangeEndJSON `json:"-"`
}
func (*SymbolSourceRangeEnd) UnmarshalJSON ¶
func (r *SymbolSourceRangeEnd) UnmarshalJSON(data []byte) (err error)
type SymbolSourceRangeEndParam ¶
type SymbolSourceRangeEndParam struct {
Character param.Field[float64] `json:"character,required"`
Line param.Field[float64] `json:"line,required"`
}
func (SymbolSourceRangeEndParam) MarshalJSON ¶
func (r SymbolSourceRangeEndParam) MarshalJSON() (data []byte, err error)
type SymbolSourceRangeParam ¶
type SymbolSourceRangeParam struct {
End param.Field[SymbolSourceRangeEndParam] `json:"end,required"`
Start param.Field[SymbolSourceRangeStartParam] `json:"start,required"`
}
func (SymbolSourceRangeParam) MarshalJSON ¶
func (r SymbolSourceRangeParam) MarshalJSON() (data []byte, err error)
type SymbolSourceRangeStart ¶
type SymbolSourceRangeStart struct {
Character float64 `json:"character,required"`
Line float64 `json:"line,required"`
JSON symbolSourceRangeStartJSON `json:"-"`
}
func (*SymbolSourceRangeStart) UnmarshalJSON ¶
func (r *SymbolSourceRangeStart) UnmarshalJSON(data []byte) (err error)
type SymbolSourceRangeStartParam ¶
type SymbolSourceRangeStartParam struct {
Character param.Field[float64] `json:"character,required"`
Line param.Field[float64] `json:"line,required"`
}
func (SymbolSourceRangeStartParam) MarshalJSON ¶
func (r SymbolSourceRangeStartParam) MarshalJSON() (data []byte, err error)
type SymbolSourceType ¶
type SymbolSourceType string
const (
SymbolSourceTypeSymbol SymbolSourceType = "symbol"
)
func (SymbolSourceType) IsKnown ¶
func (r SymbolSourceType) IsKnown() bool
type TextPart ¶
type TextPart struct {
ID string `json:"id,required"`
MessageID string `json:"messageID,required"`
SessionID string `json:"sessionID,required"`
Text string `json:"text,required"`
Type TextPartType `json:"type,required"`
Synthetic bool `json:"synthetic"`
Time TextPartTime `json:"time"`
JSON textPartJSON `json:"-"`
}
func (*TextPart) UnmarshalJSON ¶
type TextPartInputParam ¶
type TextPartInputParam struct {
Text param.Field[string] `json:"text,required"`
Type param.Field[TextPartInputType] `json:"type,required"`
ID param.Field[string] `json:"id"`
Synthetic param.Field[bool] `json:"synthetic"`
Time param.Field[TextPartInputTimeParam] `json:"time"`
}
func (TextPartInputParam) MarshalJSON ¶
func (r TextPartInputParam) MarshalJSON() (data []byte, err error)
type TextPartInputTimeParam ¶
type TextPartInputTimeParam struct {
Start param.Field[float64] `json:"start,required"`
End param.Field[float64] `json:"end"`
}
func (TextPartInputTimeParam) MarshalJSON ¶
func (r TextPartInputTimeParam) MarshalJSON() (data []byte, err error)
type TextPartInputType ¶
type TextPartInputType string
const (
TextPartInputTypeText TextPartInputType = "text"
)
func (TextPartInputType) IsKnown ¶
func (r TextPartInputType) IsKnown() bool
type TextPartTime ¶
type TextPartTime struct {
Start float64 `json:"start,required"`
End float64 `json:"end"`
JSON textPartTimeJSON `json:"-"`
}
func (*TextPartTime) UnmarshalJSON ¶
func (r *TextPartTime) UnmarshalJSON(data []byte) (err error)
type TextPartType ¶
type TextPartType string
const (
TextPartTypeText TextPartType = "text"
)
func (TextPartType) IsKnown ¶
func (r TextPartType) IsKnown() bool
type ToolPart ¶
type ToolPart struct {
ID string `json:"id,required"`
CallID string `json:"callID,required"`
MessageID string `json:"messageID,required"`
SessionID string `json:"sessionID,required"`
State ToolPartState `json:"state,required"`
Tool string `json:"tool,required"`
Type ToolPartType `json:"type,required"`
JSON toolPartJSON `json:"-"`
}
func (*ToolPart) UnmarshalJSON ¶
type ToolPartState ¶
type ToolPartState struct {
Status ToolPartStateStatus `json:"status,required"`
Error string `json:"error"`
// This field can have the runtime type of [interface{}], [map[string]interface{}].
Input interface{} `json:"input"`
// This field can have the runtime type of [map[string]interface{}].
Metadata interface{} `json:"metadata"`
Output string `json:"output"`
// This field can have the runtime type of [ToolStateRunningTime],
// [ToolStateCompletedTime], [ToolStateErrorTime].
Time interface{} `json:"time"`
Title string `json:"title"`
JSON toolPartStateJSON `json:"-"`
// contains filtered or unexported fields
}
func (ToolPartState) AsUnion ¶
func (r ToolPartState) AsUnion() ToolPartStateUnion
AsUnion returns a ToolPartStateUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are ToolStatePending, ToolStateRunning, ToolStateCompleted, ToolStateError.
func (*ToolPartState) UnmarshalJSON ¶
func (r *ToolPartState) UnmarshalJSON(data []byte) (err error)
type ToolPartStateStatus ¶
type ToolPartStateStatus string
const ( ToolPartStateStatusPending ToolPartStateStatus = "pending" ToolPartStateStatusRunning ToolPartStateStatus = "running" ToolPartStateStatusCompleted ToolPartStateStatus = "completed" ToolPartStateStatusError ToolPartStateStatus = "error" )
func (ToolPartStateStatus) IsKnown ¶
func (r ToolPartStateStatus) IsKnown() bool
type ToolPartStateUnion ¶
type ToolPartStateUnion interface {
// contains filtered or unexported methods
}
Union satisfied by ToolStatePending, ToolStateRunning, ToolStateCompleted or ToolStateError.
type ToolPartType ¶
type ToolPartType string
const (
ToolPartTypeTool ToolPartType = "tool"
)
func (ToolPartType) IsKnown ¶
func (r ToolPartType) IsKnown() bool
type ToolStateCompleted ¶
type ToolStateCompleted struct {
Input map[string]interface{} `json:"input,required"`
Metadata map[string]interface{} `json:"metadata,required"`
Output string `json:"output,required"`
Status ToolStateCompletedStatus `json:"status,required"`
Time ToolStateCompletedTime `json:"time,required"`
Title string `json:"title,required"`
JSON toolStateCompletedJSON `json:"-"`
}
func (*ToolStateCompleted) UnmarshalJSON ¶
func (r *ToolStateCompleted) UnmarshalJSON(data []byte) (err error)
type ToolStateCompletedStatus ¶
type ToolStateCompletedStatus string
const (
ToolStateCompletedStatusCompleted ToolStateCompletedStatus = "completed"
)
func (ToolStateCompletedStatus) IsKnown ¶
func (r ToolStateCompletedStatus) IsKnown() bool
type ToolStateCompletedTime ¶
type ToolStateCompletedTime struct {
End float64 `json:"end,required"`
Start float64 `json:"start,required"`
JSON toolStateCompletedTimeJSON `json:"-"`
}
func (*ToolStateCompletedTime) UnmarshalJSON ¶
func (r *ToolStateCompletedTime) UnmarshalJSON(data []byte) (err error)
type ToolStateError ¶
type ToolStateError struct {
Error string `json:"error,required"`
Input map[string]interface{} `json:"input,required"`
Status ToolStateErrorStatus `json:"status,required"`
Time ToolStateErrorTime `json:"time,required"`
JSON toolStateErrorJSON `json:"-"`
}
func (*ToolStateError) UnmarshalJSON ¶
func (r *ToolStateError) UnmarshalJSON(data []byte) (err error)
type ToolStateErrorStatus ¶
type ToolStateErrorStatus string
const (
ToolStateErrorStatusError ToolStateErrorStatus = "error"
)
func (ToolStateErrorStatus) IsKnown ¶
func (r ToolStateErrorStatus) IsKnown() bool
type ToolStateErrorTime ¶
type ToolStateErrorTime struct {
End float64 `json:"end,required"`
Start float64 `json:"start,required"`
JSON toolStateErrorTimeJSON `json:"-"`
}
func (*ToolStateErrorTime) UnmarshalJSON ¶
func (r *ToolStateErrorTime) UnmarshalJSON(data []byte) (err error)
type ToolStatePending ¶
type ToolStatePending struct {
Status ToolStatePendingStatus `json:"status,required"`
JSON toolStatePendingJSON `json:"-"`
}
func (*ToolStatePending) UnmarshalJSON ¶
func (r *ToolStatePending) UnmarshalJSON(data []byte) (err error)
type ToolStatePendingStatus ¶
type ToolStatePendingStatus string
const (
ToolStatePendingStatusPending ToolStatePendingStatus = "pending"
)
func (ToolStatePendingStatus) IsKnown ¶
func (r ToolStatePendingStatus) IsKnown() bool
type ToolStateRunning ¶
type ToolStateRunning struct {
Status ToolStateRunningStatus `json:"status,required"`
Time ToolStateRunningTime `json:"time,required"`
Input interface{} `json:"input"`
Metadata map[string]interface{} `json:"metadata"`
Title string `json:"title"`
JSON toolStateRunningJSON `json:"-"`
}
func (*ToolStateRunning) UnmarshalJSON ¶
func (r *ToolStateRunning) UnmarshalJSON(data []byte) (err error)
type ToolStateRunningStatus ¶
type ToolStateRunningStatus string
const (
ToolStateRunningStatusRunning ToolStateRunningStatus = "running"
)
func (ToolStateRunningStatus) IsKnown ¶
func (r ToolStateRunningStatus) IsKnown() bool
type ToolStateRunningTime ¶
type ToolStateRunningTime struct {
Start float64 `json:"start,required"`
JSON toolStateRunningTimeJSON `json:"-"`
}
func (*ToolStateRunningTime) UnmarshalJSON ¶
func (r *ToolStateRunningTime) UnmarshalJSON(data []byte) (err error)
type TuiAppendPromptParams ¶
func (TuiAppendPromptParams) MarshalJSON ¶
func (r TuiAppendPromptParams) MarshalJSON() (data []byte, err error)
type TuiService ¶
type TuiService struct {
Options []option.RequestOption
}
TuiService contains methods and other services that help with interacting with the opencode API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTuiService method instead.
func NewTuiService ¶
func NewTuiService(opts ...option.RequestOption) (r *TuiService)
NewTuiService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TuiService) AppendPrompt ¶
func (r *TuiService) AppendPrompt(ctx context.Context, body TuiAppendPromptParams, opts ...option.RequestOption) (res *bool, err error)
Append prompt to the TUI
func (*TuiService) OpenHelp ¶
func (r *TuiService) OpenHelp(ctx context.Context, opts ...option.RequestOption) (res *bool, err error)
Open the help dialog
type UnknownErrorData ¶
type UnknownErrorData = shared.UnknownErrorData
This is an alias to an internal type.
type UnknownErrorName ¶
type UnknownErrorName = shared.UnknownErrorName
This is an alias to an internal type.
type UserMessage ¶
type UserMessage struct {
ID string `json:"id,required"`
Role UserMessageRole `json:"role,required"`
SessionID string `json:"sessionID,required"`
Time UserMessageTime `json:"time,required"`
JSON userMessageJSON `json:"-"`
}
func (*UserMessage) UnmarshalJSON ¶
func (r *UserMessage) UnmarshalJSON(data []byte) (err error)
type UserMessageRole ¶
type UserMessageRole string
const (
UserMessageRoleUser UserMessageRole = "user"
)
func (UserMessageRole) IsKnown ¶
func (r UserMessageRole) IsKnown() bool
type UserMessageTime ¶
type UserMessageTime struct {
Created float64 `json:"created,required"`
JSON userMessageTimeJSON `json:"-"`
}
func (*UserMessageTime) UnmarshalJSON ¶
func (r *UserMessageTime) UnmarshalJSON(data []byte) (err error)