Documentation
¶
Index ¶
- func CheckTmux() error
- func CurrentTmuxSessionName() string
- func ProbeSession(sessionName string) (status string, active bool)
- func SessionNameFor(repoRoot, branch, worktreePath string) string
- type Agent
- func (a *Agent) Kill()
- func (a *Agent) Reconnect(workdir, branch, repoRoot, tmuxPrefix string) bool
- func (a *Agent) Reset()
- func (a *Agent) Send(text string)
- func (a *Agent) SessionName() string
- func (a *Agent) SetIdleTimeout(secs int)
- func (a *Agent) SetOnChange(cb func())
- func (a *Agent) Snapshot() string
- func (a *Agent) Start(workdir, command, branch, repoRoot, tmuxPrefix string) error
- func (a *Agent) Status() Status
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentTmuxSessionName ¶ added in v0.6.1
func CurrentTmuxSessionName() string
CurrentTmuxSessionName returns the tmux session name for the current pane, or empty string when not running inside tmux or when it cannot be resolved.
func ProbeSession ¶ added in v0.4.0
ProbeSession checks whether a tmux session exists and determines its status without instantiating a full Agent. Returns the status string and whether the session is active. This is used by the `canopy status --json` subcommand.
func SessionNameFor ¶ added in v0.4.0
SessionNameFor derives a deterministic, tmux-safe session name. A repo-root hash prefix prevents collisions across repos with the same branch name. Exported for use by the status subcommand and nvim plugin.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent manages an AI coding process via a dedicated tmux session.
func (*Agent) Reconnect ¶
Reconnect checks whether a tmux session for this worktree already exists (e.g. from a previous canopy instance) and resumes polling if so. Returns true if an existing session was found.
func (*Agent) SessionName ¶
SessionName returns the active tmux session name, or empty string when idle.
func (*Agent) SetIdleTimeout ¶
SetIdleTimeout configures the agent-agnostic idle timeout. When the tmux pane snapshot has not changed for secs seconds, a Running status is overridden to Waiting. Set to 0 to disable.
func (*Agent) SetOnChange ¶ added in v0.3.0
func (a *Agent) SetOnChange(cb func())
SetOnChange registers a callback fired when status or snapshot changes.