Documentation
¶
Index ¶
- func CleanupOrphanedSessions(liveSessions map[string]bool) int
- func ContainerName(provider, dir string) string
- func KillTmuxSession(name string)
- func Launch(cmd *exec.Cmd, providerName, dir, sessionMgr, shell, envPrefix string) error
- func LaunchInContainer(cmd *exec.Cmd, providerName, dir, shell, envPrefix string, opts ContainerOpts) error
- func ListAimuxTmuxSessions() []string
- func TmuxSessionName(provider, dir string) string
- type ContainerOpts
- type LaunchOpts
- type LaunchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupOrphanedSessions ¶ added in v0.12.0
CleanupOrphanedSessions kills aimux tmux sessions whose agent process is no longer running. liveSessions is the set of tmux session names with a known live agent. Any aimux-* session not in that set is killed.
func ContainerName ¶ added in v0.11.0
ContainerName returns the container name for a given provider and directory.
func KillTmuxSession ¶ added in v0.12.0
func KillTmuxSession(name string)
KillTmuxSession kills a single tmux session by name. No-op if the session doesn't exist.
func Launch ¶
Launch runs a pre-built exec.Cmd in the specified session manager (tmux or iTerm2). The provider name and directory are used to derive the tmux session name. The shell parameter specifies the login shell to use (e.g., "/bin/zsh"); use config.ResolveShell(). The envPrefix is prepended to the command (e.g., OTEL env vars).
func LaunchInContainer ¶ added in v0.11.0
func LaunchInContainer(cmd *exec.Cmd, providerName, dir, shell, envPrefix string, opts ContainerOpts) error
LaunchInContainer creates a container, then launches the agent inside it via tmux. The container runs `sleep infinity` and the agent command is executed inside it via `podman exec`. The tmux session wraps the podman exec so the user can attach/detach normally.
Flow: podman create → podman start → tmux new-session "podman exec ... agent"
func ListAimuxTmuxSessions ¶ added in v0.12.0
func ListAimuxTmuxSessions() []string
ListAimuxTmuxSessions returns the names of all tmux sessions with the "aimux-" prefix. Returns nil (not an error) when tmux is not installed or no sessions exist.
func TmuxSessionName ¶
TmuxSessionName returns the tmux session name for a given provider and directory. Format: aimux-<provider>-<basename(dir)> with spaces replaced by hyphens.
Types ¶
type ContainerOpts ¶ added in v0.11.0
type ContainerOpts struct {
Engine string // "podman" or "docker", defaults to "podman"
Image string // container image, defaults to "fedora:41"
}
ContainerOpts configures container-based agent launch.
type LaunchOpts ¶ added in v0.11.0
type LaunchOpts struct {
Provider string // which agent: claude, codex, gemini
Dir string // working directory
Model string // model override
Mode string // permission mode
Prompt string // initial prompt
Runtime string // "local" or "container"
Execution string // "local" or "hybrid"
Shell string // e.g. "/bin/zsh"
SessionManager string // "tmux" or "direct"
OTELEnabled bool // whether to inject OTEL env vars
OTELEndpoint string // for building env prefix
ContainerOpts ContainerOpts // container engine/image if Runtime == "container"
}
LaunchOpts carries all axes needed to launch an agent session. Zero values for new fields default to safe values: Runtime="local", Execution="local", Shell=$SHELL, SessionManager="tmux".
type LaunchResult ¶ added in v0.11.0
type LaunchResult struct {
TmuxSession string `json:"tmux_session,omitempty"`
PID int `json:"pid,omitempty"`
}
LaunchResult carries information about a successfully launched session.