Files
gastown/internal/session/names.go
Steve Yegge 975626c11b Add session name helper functions (gt-atqr8)
Create helper functions in internal/session/names.go for consistent
session name construction across Gas Town agents:
- MayorSessionName()
- DeaconSessionName()
- WitnessSessionName(rig)
- RefinerySessionName(rig)
- CrewSessionName(rig, name)
- PolecatSessionName(rig, name)

Includes comprehensive unit tests in names_test.go.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:14:26 -08:00

38 lines
1.1 KiB
Go

// Package session provides polecat session lifecycle management.
package session
import "fmt"
// Prefix is the common prefix for all Gas Town tmux session names.
const Prefix = "gt-"
// MayorSessionName returns the session name for the Mayor agent.
func MayorSessionName() string {
return Prefix + "mayor"
}
// DeaconSessionName returns the session name for the Deacon agent.
func DeaconSessionName() string {
return Prefix + "deacon"
}
// WitnessSessionName returns the session name for a rig's Witness agent.
func WitnessSessionName(rig string) string {
return fmt.Sprintf("%s%s-witness", Prefix, rig)
}
// RefinerySessionName returns the session name for a rig's Refinery agent.
func RefinerySessionName(rig string) string {
return fmt.Sprintf("%s%s-refinery", Prefix, rig)
}
// CrewSessionName returns the session name for a crew worker in a rig.
func CrewSessionName(rig, name string) string {
return fmt.Sprintf("%s%s-crew-%s", Prefix, rig, name)
}
// PolecatSessionName returns the session name for a polecat in a rig.
func PolecatSessionName(rig, name string) string {
return fmt.Sprintf("%s%s-%s", Prefix, rig, name)
}