constants

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package constants defines shared constant values used throughout Gas Town. Centralizing these magic strings improves maintainability and consistency.

Index

Constants

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

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

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

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

View Source
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().

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

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

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

func MayorAccountsPath(townRoot string) string

MayorAccountsPath returns the path to mayor/accounts.json within a town root.

func MayorConfigPath

func MayorConfigPath(townRoot string) string

MayorConfigPath returns the path to mayor/config.json within a town root.

func MayorRigsPath

func MayorRigsPath(townRoot string) string

MayorRigsPath returns the path to rigs.json within a town root.

func MayorTownPath

func MayorTownPath(townRoot string) string

MayorTownPath returns the path to town.json within a town root.

func RigBeadsPath

func RigBeadsPath(rigPath string) string

RigBeadsPath returns the path to mayor/rig/.beads within a rig.

func RigCrewPath

func RigCrewPath(rigPath string) string

RigCrewPath returns the path to crew/ within a rig.

func RigMayorPath

func RigMayorPath(rigPath string) string

RigMayorPath returns the path to mayor/rig within a rig.

func RigPolecatsPath

func RigPolecatsPath(rigPath string) string

RigPolecatsPath returns the path to polecats/ within a rig.

func RigRuntimePath

func RigRuntimePath(rigPath string) string

RigRuntimePath returns the path to .runtime/ within a rig.

func RigSettingsPath

func RigSettingsPath(rigPath string) string

RigSettingsPath returns the path to settings/ within a rig.

func RoleIcon

func RoleIcon(role string) string

RoleIcon returns the icon for a given role name.

func TownRuntimePath

func TownRuntimePath(townRoot string) string

TownRuntimePath returns the path to .runtime/ at the town root.

Types

This section is empty.

Jump to

Keyboard shortcuts

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