constants
constants
Section titled “constants”import "github.com/thesimonho/warden/constants"Package constants defines shared values used across Warden’s packages. It has no imports and no logic — any package can depend on it safely.
- Constants
- Variables
- func ModeValue(v string) string
- func TmuxSessionName(worktreeID string) string
- func TmuxShellSessionName(worktreeID string) string
- type AgentType
Constants
Section titled “Constants”ContainerHomeDir is the home directory for ContainerUser inside containers.
const ContainerHomeDir = "/home/" + ContainerUserContainerUser is the non-root user inside project containers. All terminal processes (tmux, the agent, bash) run as this user.
const ContainerUser = "warden"CreateShellScript is the in-container path to the auxiliary bash-shell tmux session bootstrap script, installed by install-warden.sh. It is exported (unlike the agent/disconnect script paths, which live privately in engine/worktrees.go) because both the terminal proxy and the TUI adapter invoke it from outside the engine package.
const CreateShellScript = "/usr/local/bin/create-shell.sh"LabelEphemeral marks a container as a short-lived helper (CLI precache, firewall iptables, network isolation). These are cleaned up on server startup in case a previous run crashed before the defer-based removal ran.
const LabelEphemeral = "app.warden.ephemeral"LabelManaged marks a container as managed by Warden. Used by the Docker events watcher to filter start events and by cleanup routines to identify Warden-owned containers.
const LabelManaged = "app.warden.managed"LabelMode distinguishes containers created by development builds (“dev”) from release builds (“release”). Useful for pruning dev containers without affecting production ones. The value is derived from version.Version at container creation time.
const LabelMode = "app.warden.mode"TmuxSessionPrefix is prepended to worktree IDs to form tmux session names.
const TmuxSessionPrefix = "warden-"TmuxShellSessionPrefix is prepended to worktree IDs to form the name of the auxiliary bash-shell tmux session that backs the Terminal tab in the UI. The shell session is independent from the agent tmux session — it runs a plain bash at the worktree’s working directory and has no agent lifecycle or cost-tracking semantics.
const TmuxShellSessionPrefix = "warden-shell-"Variables
Section titled “Variables”AllAgentTypes lists all supported agent type identifiers in display order.
var AllAgentTypes = []AgentType{AgentClaudeCode, AgentCodex}func ModeValue
Section titled “func ModeValue”func ModeValue(v string) stringModeValue returns “dev” for development builds and “release” for versioned release builds. The input should be version.Version.
func TmuxSessionName
Section titled “func TmuxSessionName”func TmuxSessionName(worktreeID string) stringTmuxSessionName returns the tmux session name for a worktree.
func TmuxShellSessionName
Section titled “func TmuxShellSessionName”func TmuxShellSessionName(worktreeID string) stringTmuxShellSessionName returns the tmux session name for a worktree’s auxiliary bash-shell session (the backing session for the Terminal tab in the webapp and the shell attach action in the TUI). It is distinct from TmuxSessionName so the agent and shell can coexist in the same container.
type AgentType
Section titled “type AgentType”AgentType identifies an AI coding agent supported by Warden. Used as the database column value and WARDEN_AGENT_TYPE env var.
type AgentType stringconst ( // AgentClaudeCode identifies Anthropic's Claude Code CLI. AgentClaudeCode AgentType = "claude-code" // AgentCodex identifies OpenAI's Codex CLI. AgentCodex AgentType = "codex"
// DefaultAgentType is the agent type used when none is specified. DefaultAgentType = AgentClaudeCode)func (AgentType) String
Section titled “func (AgentType) String”func (t AgentType) String() stringString returns the string representation of the agent type.
func (AgentType) Valid
Section titled “func (AgentType) Valid”func (t AgentType) Valid() boolValid reports whether the agent type is a known supported type.
Generated by gomarkdoc