Documentation
¶
Index ¶
- func Run(ctx context.Context, out *Printer, cfg Config, rt runtime.Runtime, ...) error
- type Config
- type ConfirmationResult
- type Printer
- func (p *Printer) Print(a ...any)
- func (p *Printer) PrintAgentName(agentName string)
- func (p *Printer) PrintError(err error)
- func (p *Printer) PrintToolCall(toolCall tools.ToolCall)
- func (p *Printer) PrintToolCallResponse(toolCall tools.ToolCall, response string)
- func (p *Printer) PrintToolCallWithConfirmation(ctx context.Context, toolCall tools.ToolCall, rd io.Reader) ConfirmationResult
- func (p *Printer) PrintWelcomeMessage(appName string)
- func (p *Printer) Printf(format string, a ...any)
- func (p *Printer) Println(a ...any)
- func (p *Printer) PromptMaxIterationsContinue(ctx context.Context, maxIterations int) ConfirmationResult
- func (p *Printer) PromptOAuthAuthorization(ctx context.Context, serverURL string) ConfirmationResult
- type RuntimeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
AppName string
AttachmentPath string
AutoApprove bool
HideToolCalls bool
OutputJSON bool
}
Config holds configuration for running an agent in CLI mode
type ConfirmationResult ¶
type ConfirmationResult string
ConfirmationResult represents the result of a user confirmation prompt
const ( ConfirmationApprove ConfirmationResult = "approve" ConfirmationApproveSession ConfirmationResult = "approve_session" ConfirmationReject ConfirmationResult = "reject" ConfirmationAbort ConfirmationResult = "abort" )
type Printer ¶ added in v1.9.8
type Printer struct {
// contains filtered or unexported fields
}
func NewPrinter ¶ added in v1.9.8
func (*Printer) PrintAgentName ¶ added in v1.9.8
PrintAgentName prints the agent name header
func (*Printer) PrintError ¶ added in v1.9.8
PrintError prints an error message
func (*Printer) PrintToolCall ¶ added in v1.9.8
PrintToolCall prints a tool call
func (*Printer) PrintToolCallResponse ¶ added in v1.9.8
PrintToolCallResponse prints a tool call response
func (*Printer) PrintToolCallWithConfirmation ¶ added in v1.9.8
func (p *Printer) PrintToolCallWithConfirmation(ctx context.Context, toolCall tools.ToolCall, rd io.Reader) ConfirmationResult
PrintToolCallWithConfirmation prints a tool call and prompts for confirmation
func (*Printer) PrintWelcomeMessage ¶ added in v1.9.8
PrintWelcomeMessage prints the welcome message
func (*Printer) PromptMaxIterationsContinue ¶ added in v1.9.8
func (p *Printer) PromptMaxIterationsContinue(ctx context.Context, maxIterations int) ConfirmationResult
PromptMaxIterationsContinue prompts the user to continue after max iterations
func (*Printer) PromptOAuthAuthorization ¶ added in v1.9.8
func (p *Printer) PromptOAuthAuthorization(ctx context.Context, serverURL string) ConfirmationResult
PromptOAuthAuthorization prompts the user for OAuth authorization
type RuntimeError ¶
type RuntimeError struct {
Err error
}
RuntimeError wraps runtime errors to distinguish them from usage errors
func (RuntimeError) Error ¶
func (e RuntimeError) Error() string
func (RuntimeError) Unwrap ¶
func (e RuntimeError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.