paths

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 9 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 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

View Source
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

func ToolDirs(goos, home string, getenv func(string) string) []string

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

func Resolve() (*Layout, error)

Resolve computes the layout for the current user. It does not create anything; call EnsureDirs for that.

func (*Layout) EnsureDirs

func (l *Layout) EnsureDirs() error

EnsureDirs creates every directory of the layout with owner-only access.

func (*Layout) HolderAddr

func (l *Layout) HolderAddr(sessionID string) string

HolderAddr is the IPC address a session holder listens on.

func (*Layout) HolderSocketDir

func (l *Layout) HolderSocketDir() string

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

func (l *Layout) SessionDataDir(sessionID string) string

SessionDataDir is where one session's scrollback segments live.

Jump to

Keyboard shortcuts

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