crew

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: 17 Imported by: 0

Documentation

Overview

Package crew provides crew workspace management for overseer workspaces.

Index

Constants

This section is empty.

Variables

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

func NewManager(r *rig.Rig, g *git.Git) *Manager

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) IsRunning

func (m *Manager) IsRunning(name string) (bool, error)

IsRunning checks if a crew member's session is active.

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) Remove

func (m *Manager) Remove(name string, force bool) error

Remove deletes a crew worker.

func (*Manager) Rename

func (m *Manager) Rename(oldName, newName string) error

Rename renames a crew worker from oldName to newName.

func (*Manager) SessionName

func (m *Manager) SessionName(name string) string

SessionName returns the tmux session name for a crew member.

func (*Manager) Start

func (m *Manager) Start(name string, opts StartOptions) error

Start creates and starts a tmux session for a crew member. If the crew member doesn't exist, it will be created first.

func (*Manager) Stop

func (m *Manager) Stop(name string) error

Stop terminates a crew member's tmux session.

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.

type Summary

type Summary struct {
	Name   string `json:"name"`
	Branch string `json:"branch"`
}

Summary provides a concise view of crew worker status.

Jump to

Keyboard shortcuts

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