Documentation
¶
Overview ¶
Package crew provides crew workspace management for overseer workspaces.
Index ¶
- Variables
- type CrewWorker
- type Manager
- func (m *Manager) Add(name string, createBranch bool) (*CrewWorker, error)
- func (m *Manager) Get(name string) (*CrewWorker, error)
- func (m *Manager) IsRunning(name string) (bool, error)
- func (m *Manager) List() ([]*CrewWorker, error)
- func (m *Manager) Pristine(name string) (*PristineResult, error)
- func (m *Manager) Remove(name string, force bool) error
- func (m *Manager) Rename(oldName, newName string) error
- func (m *Manager) SessionName(name string) string
- func (m *Manager) Start(name string, opts StartOptions) error
- func (m *Manager) Stop(name string) error
- type PristineResult
- type StartOptions
- type Summary
Constants ¶
This section is empty.
Variables ¶
var ( ErrCrewExists = errors.New("crew worker already exists") ErrCrewNotFound = errors.New("crew worker not found") ErrHasChanges = errors.New("crew worker has uncommitted changes") ErrInvalidCrewName = errors.New("invalid crew name") ErrSessionRunning = errors.New("session already running") ErrSessionNotFound = errors.New("session not found") )
Common errors
Functions ¶
This section is empty.
Types ¶
type CrewWorker ¶
type CrewWorker struct {
// Name is the crew worker identifier.
Name string `json:"name"`
// Rig is the rig this crew worker belongs to.
Rig string `json:"rig"`
// ClonePath is the path to the crew worker's clone of the rig.
ClonePath string `json:"clone_path"`
// Branch is the current git branch.
Branch string `json:"branch"`
// CreatedAt is when the crew worker was created.
CreatedAt time.Time `json:"created_at"`
// UpdatedAt is when the crew worker was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
CrewWorker represents a user-managed workspace in a rig.
func (*CrewWorker) Summary ¶
func (c *CrewWorker) Summary() Summary
Summary returns a Summary for this crew worker.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles crew worker lifecycle.
func NewManager ¶
NewManager creates a new crew manager.
func (*Manager) Add ¶
func (m *Manager) Add(name string, createBranch bool) (*CrewWorker, error)
Add creates a new crew worker with a clone of the rig.
func (*Manager) Get ¶
func (m *Manager) Get(name string) (*CrewWorker, error)
Get returns a specific crew worker by name.
func (*Manager) List ¶
func (m *Manager) List() ([]*CrewWorker, error)
List returns all crew workers in the rig.
func (*Manager) Pristine ¶
func (m *Manager) Pristine(name string) (*PristineResult, error)
Pristine ensures a crew worker is up-to-date with remote. It runs git pull --rebase and bd sync.
func (*Manager) SessionName ¶
SessionName returns the tmux session name for a crew member.
type PristineResult ¶
type PristineResult struct {
Name string `json:"name"`
HadChanges bool `json:"had_changes"`
Pulled bool `json:"pulled"`
PullError string `json:"pull_error,omitempty"`
Synced bool `json:"synced"`
SyncError string `json:"sync_error,omitempty"`
}
PristineResult captures the results of a pristine operation.
type StartOptions ¶
type StartOptions struct {
// Account specifies the account handle to use (overrides default).
Account string
// CursorConfigDir is resolved CURSOR_CONFIG_DIR for the account.
// If set, this is injected as an environment variable.
CursorConfigDir string
// KillExisting kills any existing session before starting (for restart operations).
// If false and a session is running, Start() returns ErrSessionRunning.
KillExisting bool
// Topic is the startup nudge topic (e.g., "start", "restart", "refresh").
// Defaults to "start" if empty.
Topic string
// Interactive removes --dangerously-skip-permissions for interactive/refresh mode.
Interactive bool
}
StartOptions configures crew session startup.