Documentation
¶
Overview ¶
Package sessions finds the running sessions of every router in the registry, or of one control socket, and picks one: by id or label for the panel, by thread id or working dir for a shell command. It also sends a command to the endpoint that listed a session, and tells a router a sandbox hides from a dead one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Session ¶
type Session struct {
route.SessionInfo
Endpoint string `json:"endpoint_id"`
HomeName string `json:"-"`
// contains filtered or unexported fields
}
Session is one running session with the endpoint serving it, as sessions --json prints it.
func ForShell ¶
ForShell returns the session of thread when one is listed, else the sessions whose cwd is the deepest one equal to or containing dir. Paths are compared with symlinks resolved: a shell may see /tmp where Codex reports /private/tmp.
func List ¶
List lists the sessions of the endpoint at socket, or, when socket is "", of every endpoint in the registry at root.
func Resolve ¶
Resolve returns the sessions query names under the first rule that matches any: an exact session or thread id; a session or thread id prefix; an exact label; a label suffix starting at a separator; a label prefix ending at a separator, such as the home name. Label rules try the shown label and the one before disambiguation, so a label that several sessions share names all of them. One match resolves; several are ambiguous.