Versions in this module Expand all Collapse all v0 v0.0.7 May 30, 2026 v0.0.6 May 29, 2026 Changes in this version + func FindAgentPath() (string, error) + type ACPAdapter struct + func NewACPAdapter(agent *OpencodeAgent) *ACPAdapter + func (a *ACPAdapter) Authenticate(req agentacp.AuthenticateRequest) error + func (a *ACPAdapter) CancelSession(req agentacp.CancelSessionRequest) error + func (a *ACPAdapter) CloseSession(req agentacp.CloseSessionRequest) error + func (a *ACPAdapter) Info() agentacp.AgentInfo + func (a *ACPAdapter) ListSessions(req agentacp.ListSessionsRequest) (agentacp.ListSessionsResponse, error) + func (a *ACPAdapter) NewSession(req agentacp.NewSessionRequest) (agentacp.SessionID, error) + func (a *ACPAdapter) Prompt(req agentacp.PromptRequest, onUpdate func(agentacp.SessionUpdate)) error + func (a *ACPAdapter) ResumeSession(req agentacp.ResumeSessionRequest) error + type AgentOption func(*OpencodeAgent) + func WithAgentPath(path string) AgentOption + func WithDisableSubAgents() AgentOption + func WithEnv(env []string) AgentOption + func WithWorkspace(dir string) AgentOption + type FileChange struct + Path string + Status string + type Model struct + ID string + Name string + ProviderID string + type OpencodeAgent struct + AgentPath string + DisableSubAgents bool + Env []string + Workspace string + func NewAgent(opts ...AgentOption) *OpencodeAgent + func (a *OpencodeAgent) BuildEnv() []string + func (a *OpencodeAgent) ListModels(ctx context.Context) ([]Model, error) + func (a *OpencodeAgent) ListSessions(ctx context.Context) ([]Session, error) + func (a *OpencodeAgent) ResolvePath() (string, error) + func (a *OpencodeAgent) ResumeSession(ctx context.Context, sessionID string, prompt string, opts *SessionOpts, ...) (string, error) + func (a *OpencodeAgent) StartSession(ctx context.Context, prompt string, opts *SessionOpts, onEvent StreamCallback) (string, error) + type Session struct + Created time.Time + Directory string + ID string + ProjectID string + Title string + Updated time.Time + type SessionExport struct + Messages []SessionExportMessage + type SessionExportCache struct + Read int64 + Write int64 + type SessionExportMessage struct + Info SessionExportMessageInfo + Parts []SessionExportPart + type SessionExportMessageInfo struct + Role string + type SessionExportPart struct + CallID string + Cost float64 + Files []string + Hash string + ID string + MessageID string + Reason string + SessionID string + Snapshot string + State *SessionExportState + Text string + Time *SessionExportTime + Tokens *SessionExportTokens + Tool string + Type string + type SessionExportState struct + Input json.RawMessage + Metadata json.RawMessage + Output string + Status string + Time *SessionExportTime + Title string + type SessionExportTime struct + End int64 + Start int64 + type SessionExportTokens struct + Cache *SessionExportCache + Input int64 + Output int64 + Reasoning int64 + Total int64 + type SessionOpts struct + Agent string + Command string + Dir string + File []string + Model string + NoSubAgents bool + Thinking bool + Variant string + type StreamCallback func(event StreamEvent) + type StreamEvent struct + Done bool + Error string + File *FileChange + Reasoning string + ReasoningTime *StreamEventTime + SessionID string + Text string + Timestamp int64 + ToolUse *ToolUseEvent + Type string + type StreamEventTime struct + End int64 + Start int64 + type ToolUseEvent struct + Error string + ID string + Output string + Status string + Summary string + Tool string