Documentation
¶
Overview ¶
Package follow is `stagent follow`: it finds the coding agent running in the terminal that shares its SSH connection — in the terminal's shell, or in the tmux / zellij / screen / herdr pane that terminal shows — or, with --session, in a stagent session, and streams the agent's transcript to the app as JSON lines on stdout until stdin closes. PROTOCOL.md ("stagent follow") describes the wire format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentProbe ¶ added in v0.4.0
type AgentProbe struct {
// contains filtered or unexported fields
}
AgentProbe tells whether an agent still runs in stagent sessions. It recognizes agents exactly as `stagent follow --session` does: in the process tree of the session's program and in the panes of the multiplexer clients there. The daemon uses it to return a shell session that hooks promoted to an agent once that agent has left.
func NewAgentProbe ¶ added in v0.4.0
func NewAgentProbe() (*AgentProbe, error)
NewAgentProbe returns a probe of this host's process table, trusting the processes of the current user only (see locator.owns).
func (*AgentProbe) Running ¶ added in v0.4.0
func (p *AgentProbe) Running(sessions []SessionAgent) ([]bool, error)
Running reports, for each session, whether an agent of its harness runs in it in front of the user: in the foreground of the session's terminal, or of the pane a multiplexer client in that foreground shows (a suspended or background agent does not count). Every session is judged from one process-table snapshot. Not safe for concurrent use.
type SessionAgent ¶ added in v0.4.0
SessionAgent is one session to probe: the pid of its program and the harness expected to run in it.