Documentation
¶
Overview ¶
Package paths resolves where stagent keeps its binary, state, sockets and scrollback on the current host. Every other package takes a *Layout rather than computing paths itself, so tests and the load bench can isolate a whole installation by setting STAGENT_HOME.
Index ¶
Constants ¶
const EnvHome = "STAGENT_HOME"
EnvHome overrides the home directory. Tests and the bench point it at a temporary directory; it also namespaces the IPC endpoints so an isolated installation never talks to the real daemon.
Variables ¶
This section is empty.
Functions ¶
func ToolDirs ¶
ToolDirs lists the per-user and common install directories of CLI tools (npm/bun/pnpm globals, version managers, Homebrew, …) that are often only on PATH in interactive or login shells — not in the environment an SSH exec channel starts with. goos and getenv are parameters so callers can fake another platform in tests.
Types ¶
type Layout ¶
type Layout struct {
Home string // user home (or STAGENT_HOME)
Root string // <Home>/.ssh-term/agent
BinDir string // <Root>/bin
Bin string // <BinDir>/stagent[.exe]
Manifest string // <Root>/manifest.json
Config string // <Root>/config.json
StateDir string // <Root>/state
EventLog string // <StateDir>/events.log (segments get a numeric suffix)
Index string // <StateDir>/index.json — conversation list cache
DataDir string // per-session scrollback segments; local disk even when Home is on NFS
LogDir string // <Root>/log — stderr of detached processes
RunDir string // sockets (unix) / lock and pid files (all OSes), 0700
DaemonAddr string // IPC address of the daemon
UploadsDir string // <Home>/.ssh-term/uploads — files sent from the app
// DataOnNetworkFS reports that Home is on a network file system and
// DataDir was moved to local disk.
DataOnNetworkFS bool
// contains filtered or unexported fields
}
Layout is the resolved file-system layout of one installation.
func Resolve ¶
Resolve computes the layout for the current user. It does not create anything; call EnsureDirs for that.
func (*Layout) EnsureDirs ¶
EnsureDirs creates every directory of the layout with owner-only access.
func (*Layout) HolderAddr ¶
HolderAddr is the IPC address a session holder listens on.
func (*Layout) HolderSocketDir ¶
HolderSocketDir is the directory holding holder sockets on unix (empty on Windows, where holders use named pipes). The daemon scans it on start.
func (*Layout) SessionDataDir ¶
SessionDataDir is where one session's scrollback segments live.