Documentation
¶
Overview ¶
Package constants defines shared constant values used throughout Gas Town. Centralizing these magic strings improves maintainability and consistency.
Index ¶
- Constants
- Variables
- func MayorAccountsPath(townRoot string) string
- func MayorConfigPath(townRoot string) string
- func MayorRigsPath(townRoot string) string
- func MayorTownPath(townRoot string) string
- func RigBeadsPath(rigPath string) string
- func RigCrewPath(rigPath string) string
- func RigMayorPath(rigPath string) string
- func RigPolecatsPath(rigPath string) string
- func RigRuntimePath(rigPath string) string
- func RigSettingsPath(rigPath string) string
- func RoleIcon(role string) string
- func TownRuntimePath(townRoot string) string
Constants ¶
const ( // ShutdownNotifyDelay is the pause after sending shutdown notification. ShutdownNotifyDelay = 500 * time.Millisecond // CursorStartTimeout is how long to wait for Cursor to start in a session. // Increased to 60s because Cursor can take 30s+ on slower machines. CursorStartTimeout = 60 * time.Second // ShellReadyTimeout is how long to wait for shell prompt after command. ShellReadyTimeout = 5 * time.Second // DefaultDebounceMs is the default debounce for SendKeys operations. // 500ms is required for Cursor to reliably process paste before Enter. // See NudgeSession comment: "Wait 500ms for paste to complete (tested, required)" DefaultDebounceMs = 500 // DefaultDisplayMs is the default duration for tmux display-message. DefaultDisplayMs = 5000 // PollInterval is the default polling interval for wait loops. PollInterval = 100 * time.Millisecond // TmuxCommandTimeout bounds tmux subprocess execution time. TmuxCommandTimeout = 5 * time.Second )
Timing constants for session management and tmux operations.
const ( // DirMayor is the directory containing mayor configuration and state. DirMayor = "mayor" // DirPolecats is the directory containing polecat worktrees. DirPolecats = "polecats" // DirCrew is the directory containing crew workspaces. DirCrew = "crew" // DirRefinery is the directory containing the refinery clone. DirRefinery = "refinery" // DirWitness is the directory containing witness state. DirWitness = "witness" // DirRig is the subdirectory containing the actual git clone. DirRig = "rig" // DirBeads is the beads database directory. DirBeads = ".beads" // DirRuntime is the runtime state directory (gitignored). DirRuntime = ".runtime" // DirSettings is the rig settings directory (git-tracked). DirSettings = "settings" )
Directory names within a Gas Town workspace.
const ( // FileRigsJSON is the rig registry file in mayor/. FileRigsJSON = "rigs.json" // FileTownJSON is the town configuration file in mayor/. FileTownJSON = "town.json" // FileConfigJSON is the general config file. FileConfigJSON = "config.json" // FileAccountsJSON is the accounts configuration file in mayor/. FileAccountsJSON = "accounts.json" )
File names for configuration and state.
const ( // BranchMain is the default main branch name. BranchMain = "main" // BranchBeadsSync is the branch used for beads synchronization. BranchBeadsSync = "beads-sync" // BranchPolecatPrefix is the prefix for polecat work branches. BranchPolecatPrefix = "polecat/" // BranchIntegrationPrefix is the prefix for integration branches. BranchIntegrationPrefix = "integration/" )
Git branch names.
const ( // SessionPrefix is the prefix for rig-level Gas Town tmux sessions. SessionPrefix = "gt-" // HQSessionPrefix is the prefix for town-level services (Mayor, Deacon). HQSessionPrefix = "hq-" )
Tmux session names. Mayor and Deacon use hq- prefix: hq-mayor, hq-deacon (town-level, one per machine). Rig-level services use gt- prefix: gt-<rig>-witness, gt-<rig>-refinery, etc. Use session.MayorSessionName() and session.DeaconSessionName().
const ( // RoleMayor is the mayor agent role. RoleMayor = "mayor" // RoleWitness is the witness agent role. RoleWitness = "witness" // RoleRefinery is the refinery agent role. RoleRefinery = "refinery" // RolePolecat is the polecat agent role. RolePolecat = "polecat" // RoleCrew is the crew agent role. RoleCrew = "crew" // RoleDeacon is the deacon agent role. RoleDeacon = "deacon" )
Agent role names.
const ( // IconMayor is the mayor icon (fox conductor). IconMayor = "🦊" // IconDeacon is the deacon icon (wolf in the engine room). IconDeacon = "🐺" // IconWitness is the witness icon (watchful owl). IconWitness = "🦉" // IconRefinery is the refinery icon (industrial). IconRefinery = "⚙️" // IconCrew is the crew icon (established worker). IconCrew = "👷" // IconPolecat is the polecat icon (transient worker). IconPolecat = "🐾" )
Role icons - centralized for easy customization. These match the Gas Town visual identity (see ~/Desktop/Gas Town/ prompts). Using Unicode symbols for clean status bar display.
Variables ¶
var SupportedShells = []string{"bash", "zsh", "sh", "fish", "tcsh", "ksh"}
SupportedShells lists shell binaries that Gas Town can detect and work with. Used to identify if a tmux pane is at a shell prompt vs running a command.
Functions ¶
func MayorAccountsPath ¶
MayorAccountsPath returns the path to mayor/accounts.json within a town root.
func MayorConfigPath ¶
MayorConfigPath returns the path to mayor/config.json within a town root.
func MayorRigsPath ¶
MayorRigsPath returns the path to rigs.json within a town root.
func MayorTownPath ¶
MayorTownPath returns the path to town.json within a town root.
func RigBeadsPath ¶
RigBeadsPath returns the path to mayor/rig/.beads within a rig.
func RigCrewPath ¶
RigCrewPath returns the path to crew/ within a rig.
func RigMayorPath ¶
RigMayorPath returns the path to mayor/rig within a rig.
func RigPolecatsPath ¶
RigPolecatsPath returns the path to polecats/ within a rig.
func RigRuntimePath ¶
RigRuntimePath returns the path to .runtime/ within a rig.
func RigSettingsPath ¶
RigSettingsPath returns the path to settings/ within a rig.
func TownRuntimePath ¶
TownRuntimePath returns the path to .runtime/ at the town root.
Types ¶
This section is empty.