Documentation
¶
Overview ¶
Package agent defines the interface every coding agent backend implements.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface {
Caps() Caps
// Models lists models to offer in the picker for this conversation.
Models(conv string) []string
// Run executes one user turn. Cancelling ctx stops it.
Run(ctx context.Context, req Request, h Handler) (Result, error)
// Close stops any background processes.
Close()
}
type Decision ¶
Decision answers a Permission. Message is the user's reason for denying, if they typed one.
type Handler ¶
type Handler interface {
Session(id string)
Text(text string) // a complete block of assistant text (Markdown)
Tool(title string, kind Kind)
Permission(ctx context.Context, p Permission) Decision
}
Handler receives what the agent does during a turn.
type MCPServer ¶
MCPServer is an HTTP MCP server the agent should connect to. pocketagent uses it to give agents a send_file tool (and, for Claude, approvals).
type Option ¶
type Option struct {
ID string
Label string
Kind OptionKind
}
func DefaultOptions ¶
func DefaultOptions() []Option
DefaultOptions is used when an agent does not offer its own choices.
type OptionKind ¶
type OptionKind string
const ( AllowOnce OptionKind = "allow_once" AllowAlways OptionKind = "allow_always" RejectOnce OptionKind = "reject_once" RejectAlways OptionKind = "reject_always" )
func (OptionKind) Allows ¶
func (k OptionKind) Allows() bool
type Permission ¶
type Permission struct {
Tool string // display name, e.g. "Bash"
Key string // "always allow" memory key; empty when the agent remembers itself
Kind Kind
Title string
Detail string // plain text: the command, diff or arguments
Options []Option
}
Permission is a request to run a tool call.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package acp drives any agent that speaks the Agent Client Protocol (Gemini CLI, Claude Code and Codex via adapters, Kiro, Goose, Copilot, OpenCode, ...).
|
Package acp drives any agent that speaks the Agent Client Protocol (Gemini CLI, Claude Code and Codex via adapters, Kiro, Goose, Copilot, OpenCode, ...). |
|
Package claude runs the Claude Code CLI headless with stream-json I/O. Approvals arrive through the pocketagent MCP bridge, which Claude Code calls as its --permission-prompt-tool.
|
Package claude runs the Claude Code CLI headless with stream-json I/O. Approvals arrive through the pocketagent MCP bridge, which Claude Code calls as its --permission-prompt-tool. |
|
Package command wraps any CLI that takes a prompt and prints a reply, configured as an argv template.
|
Package command wraps any CLI that takes a prompt and prints a reply, configured as an argv template. |
Click to show internal directories.
Click to hide internal directories.