Documentation
¶
Index ¶
- Constants
- func New(config v1.Config) v1.Tool
- type ConfigTemplateInput
- type Event
- type EventListResponse
- type Model
- type Opencode
- func (in *Opencode) BabysitRun(ctx context.Context, bCtx *v1.BabysitContext) bool
- func (in *Opencode) Configure(consoleURL, consoleToken, deployToken string) error
- func (in *Opencode) ConfigureBabysitRun() error
- func (in *Opencode) OnMessage(f func(message *console.AgentMessageAttributes))
- func (in *Opencode) Run(ctx context.Context, options ...exec.Option)
- type Provider
- type StreamError
- type StreamErrorData
- type StreamPart
- type StreamPartType
- type StreamTokens
- type StreamToolState
- type StreamToolStatus
Constants ¶
View Source
const (
ConfigFileName = "opencode.json"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigTemplateInput ¶
type ConfigTemplateInput struct {
ConsoleURL string
ConsoleToken string
DeployToken string
AgentRunID string
// Provider is the AI provider to use.
Provider Provider
// Endpoint is the AI provider API endpoint.
Endpoint string
// Model is the AI model to use.
Model string
// Token is the API token for the AI provider.
Token string
// Mode is the agent run mode.
Mode console.AgentRunMode
// ExaMcpConfigs holds additional external MCP server configurations.
ExaMcpConfigs []agentrunv1.ExaMcpServerConfig
}
type Event ¶
type Event struct {
ID string
Message *console.AgentMessageAttributes
Done bool
// contains filtered or unexported fields
}
func (*Event) FromEventResponse ¶
func (in *Event) FromEventResponse(e EventListResponse)
type EventListResponse ¶
type EventListResponse struct {
Timestamp int64 `json:"timestamp"`
SessionID string `json:"sessionID"`
Part *StreamPart `json:"part,omitempty"`
Error *StreamError `json:"error,omitempty"`
}
type Opencode ¶
type Opencode struct {
toolv1.DefaultTool
// contains filtered or unexported fields
}
Opencode implements toolv1.Tool interface.
func (*Opencode) BabysitRun ¶
func (*Opencode) ConfigureBabysitRun ¶
func (*Opencode) OnMessage ¶
func (in *Opencode) OnMessage(f func(message *console.AgentMessageAttributes))
type StreamError ¶
type StreamError struct {
Name string `json:"name"`
Data *StreamErrorData `json:"data,omitempty"`
}
type StreamErrorData ¶
type StreamErrorData struct {
Message string `json:"message"`
}
type StreamPart ¶
type StreamPart struct {
ID string `json:"id"`
SessionID string `json:"sessionID"`
MessageID string `json:"messageID"`
CallID string `json:"callID,omitempty"`
Type StreamPartType `json:"type"`
Text string `json:"text,omitempty"`
Tool string `json:"tool,omitempty"`
Cost float64 `json:"cost,omitempty"`
Tokens *StreamTokens `json:"tokens,omitempty"`
State *StreamToolState `json:"state,omitempty"`
}
type StreamPartType ¶
type StreamPartType string
const ( StreamPartTypeText StreamPartType = "text" StreamPartTypeTool StreamPartType = "tool" StreamPartTypeStepStart StreamPartType = "step-start" StreamPartTypeStepFinish StreamPartType = "step-finish" )
type StreamTokens ¶
type StreamToolState ¶
type StreamToolState struct {
Status StreamToolStatus `json:"status"`
Input json.RawMessage `json:"input,omitempty"`
Output string `json:"output,omitempty"`
}
type StreamToolStatus ¶
type StreamToolStatus string
const ( StreamToolStatusRunning StreamToolStatus = "running" StreamToolStatusCompleted StreamToolStatus = "completed" StreamToolStatusPending StreamToolStatus = "pending" StreamToolStatusError StreamToolStatus = "error" )
Click to show internal directories.
Click to hide internal directories.