follow

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 28 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Main

func Main(args []string) int

Main runs `stagent follow` until stdin closes.

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

type SessionAgent struct {
	PID     int
	Harness string
}

SessionAgent is one session to probe: the pid of its program and the harness expected to run in it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL