Documentation
¶
Overview ¶
Package daemon is `stagent daemon`: the per-user session registry, event log, hook integration (state, notifications, pending approvals), push notifications, transcript access and scrollback retention. It never sees PTY bytes — holders keep the terminal and report state transitions only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is one running daemon.
func (*Daemon) Done ¶
func (d *Daemon) Done() <-chan struct{}
Done is closed when Shutdown starts (daemon.shutdown, signals).
type Options ¶
type Options struct {
Layout *paths.Layout
// Roots of the harness transcripts (default: transcript.DefaultRoots).
Roots *transcript.Roots
// GoneGrace: a holder connection that drops without holder.ended counts
// as a lost session unless the holder re-registers within this time.
GoneGrace time.Duration
// EndedLinger: how long an ended session stays listed.
EndedLinger time.Duration
// TranscriptPoll: tail interval while a transcript is subscribed.
TranscriptPoll time.Duration
// AgentProbe reports whether the agents of promoted shell sessions
// still run (default: follow.AgentProbe; see probe.go), and
// ProbeInterval how often it is asked.
AgentProbe func([]follow.SessionAgent) ([]bool, error)
ProbeInterval time.Duration
// PushGrace: how long a passthrough session's push waits (default
// 15 s; tests shorten it).
PushGrace time.Duration
// UnwrappedTTL: how long an agent started without a stagent session
// stays listed after its last hook (default 12h; see unwrapped.go).
UnwrappedTTL time.Duration
Logf func(format string, args ...any)
// Bootstrap is what `stagent daemon` found swapping its bootstrap port
// (macOS), reported by daemon.status.
Bootstrap bootstrap.Result
// Guard refuses some methods to coding agents' process trees (ADR
// 0004; default: harness.NewGuard(Layout)).
Guard *harness.Guard
}
Options configures a Daemon. Zero fields take defaults.