sessions

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 15 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 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

func Blocked

func Blocked(root, homeID string) error

Blocked returns the dial error of the first registry endpoint of the home whose socket refuses this process (EPERM or EACCES): Codex's sandbox does that to shell commands, and the router behind it is not dead.

func RouteText

func RouteText(r config.Route) string

RouteText formats a route as the panel does.

func Send

func Send(s Session, cmd route.Command) error

Send sends cmd to the endpoint that listed s.

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

func ForShell(sessions []Session, thread, dir string) []Session

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

func List(socket, root string) ([]Session, error)

List lists the sessions of the endpoint at socket, or, when socket is "", of every endpoint in the registry at root.

func Resolve

func Resolve(sessions []Session, query string) []Session

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.

Jump to

Keyboard shortcuts

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