Documentation
¶
Index ¶
- func FindAgentPath() (string, error)
- type 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
- type FileChange
- type Model
- type 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
- type SessionExport
- type SessionExportCache
- type SessionExportMessage
- type SessionExportMessageInfo
- type SessionExportPart
- type SessionExportState
- type SessionExportTime
- type SessionExportTokens
- type SessionOpts
- type StreamCallback
- type StreamEvent
- type StreamEventTime
- type ToolUseEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAgentPath ¶
Types ¶
type ACPAdapter ¶
type ACPAdapter struct {
// contains filtered or unexported fields
}
func NewACPAdapter ¶
func NewACPAdapter(agent *OpencodeAgent) *ACPAdapter
func (*ACPAdapter) Authenticate ¶
func (a *ACPAdapter) Authenticate(req agentacp.AuthenticateRequest) error
func (*ACPAdapter) CancelSession ¶
func (a *ACPAdapter) CancelSession(req agentacp.CancelSessionRequest) error
func (*ACPAdapter) CloseSession ¶
func (a *ACPAdapter) CloseSession(req agentacp.CloseSessionRequest) error
func (*ACPAdapter) Info ¶
func (a *ACPAdapter) Info() agentacp.AgentInfo
func (*ACPAdapter) ListSessions ¶
func (a *ACPAdapter) ListSessions(req agentacp.ListSessionsRequest) (agentacp.ListSessionsResponse, error)
func (*ACPAdapter) NewSession ¶
func (a *ACPAdapter) NewSession(req agentacp.NewSessionRequest) (agentacp.SessionID, error)
func (*ACPAdapter) Prompt ¶
func (a *ACPAdapter) Prompt(req agentacp.PromptRequest, onUpdate func(agentacp.SessionUpdate)) error
func (*ACPAdapter) ResumeSession ¶
func (a *ACPAdapter) ResumeSession(req agentacp.ResumeSessionRequest) error
type AgentOption ¶
type AgentOption func(*OpencodeAgent)
func WithAgentPath ¶
func WithAgentPath(path string) AgentOption
func WithDisableSubAgents ¶
func WithDisableSubAgents() AgentOption
func WithEnv ¶
func WithEnv(env []string) AgentOption
func WithWorkspace ¶
func WithWorkspace(dir string) AgentOption
type FileChange ¶
type FileChange = run.FileChange
type OpencodeAgent ¶
func NewAgent ¶
func NewAgent(opts ...AgentOption) *OpencodeAgent
func (*OpencodeAgent) BuildEnv ¶
func (a *OpencodeAgent) BuildEnv() []string
func (*OpencodeAgent) ListModels ¶
func (a *OpencodeAgent) ListModels(ctx context.Context) ([]Model, error)
func (*OpencodeAgent) ListSessions ¶
func (a *OpencodeAgent) ListSessions(ctx context.Context) ([]Session, error)
func (*OpencodeAgent) ResolvePath ¶
func (a *OpencodeAgent) ResolvePath() (string, error)
func (*OpencodeAgent) ResumeSession ¶
func (a *OpencodeAgent) ResumeSession(ctx context.Context, sessionID string, prompt string, opts *SessionOpts, onEvent StreamCallback) (string, error)
func (*OpencodeAgent) StartSession ¶
func (a *OpencodeAgent) StartSession(ctx context.Context, prompt string, opts *SessionOpts, onEvent StreamCallback) (string, error)
type SessionExport ¶
type SessionExport struct {
Messages []SessionExportMessage `json:"messages"`
}
type SessionExportCache ¶
type SessionExportMessage ¶
type SessionExportMessage struct {
Info SessionExportMessageInfo `json:"info"`
Parts []SessionExportPart `json:"parts"`
}
type SessionExportMessageInfo ¶
type SessionExportMessageInfo struct {
Role string `json:"role"`
}
type SessionExportPart ¶
type SessionExportPart struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Tool string `json:"tool,omitempty"`
CallID string `json:"callID,omitempty"`
ID string `json:"id,omitempty"`
SessionID string `json:"sessionID,omitempty"`
MessageID string `json:"messageID,omitempty"`
State *SessionExportState `json:"state,omitempty"`
Snapshot string `json:"snapshot,omitempty"`
Reason string `json:"reason,omitempty"`
Hash string `json:"hash,omitempty"`
Files []string `json:"files,omitempty"`
Time *SessionExportTime `json:"time,omitempty"`
Tokens *SessionExportTokens `json:"tokens,omitempty"`
Cost float64 `json:"cost,omitempty"`
}
type SessionExportState ¶
type SessionExportState struct {
Status string `json:"status,omitempty"`
Title string `json:"title,omitempty"`
Output string `json:"output,omitempty"`
Input json.RawMessage `json:"input,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
Time *SessionExportTime `json:"time,omitempty"`
}
type SessionExportTime ¶
type SessionExportTokens ¶
type SessionExportTokens struct {
Total int64 `json:"total"`
Input int64 `json:"input"`
Output int64 `json:"output"`
Reasoning int64 `json:"reasoning"`
Cache *SessionExportCache `json:"cache,omitempty"`
}
type SessionOpts ¶
type SessionOpts = run.SessionOpts
type StreamCallback ¶
type StreamCallback = run.StreamCallback
type StreamEvent ¶
type StreamEvent = run.StreamEvent
type StreamEventTime ¶
type StreamEventTime = run.StreamEventTime
type ToolUseEvent ¶
type ToolUseEvent = run.ToolUseEvent
Click to show internal directories.
Click to hide internal directories.