picker

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package picker provides interactive session selection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentOptions

type AgentOptions struct {
	Available      []string
	DefaultPrimary string
}

AgentOptions configures the agent selectors shown in the create form.

type CreateForm

type CreateForm struct {
	// contains filtered or unexported fields
}

CreateForm handles the new-session creation UI within the picker.

func NewCreateForm

func NewCreateForm(master bool, initialDir string, agentOptions ...AgentOptions) (CreateForm, tea.Cmd)

NewCreateForm creates a form for new session creation. initialDir pre-fills the directory input when available.

func (CreateForm) Update

func (f CreateForm) Update(msg tea.Msg) (CreateForm, tea.Cmd)

Update handles input for the create form.

func (CreateForm) View

func (f CreateForm) View(width, height int) string

View renders the create form.

type CreateStartOptions

type CreateStartOptions struct {
	Master       bool
	Primary      string
	DisplayColor string
	Prompt       string
}

CreateStartOptions captures the role selections from the create form.

type DeleteFunc

type DeleteFunc func(ctx context.Context, sessionID string) error

DeleteFunc deletes a session by ID (typically session.Service.Delete).

type Entry

type Entry struct {
	SessionID    string
	Status       string // "active", "* current", "master (N)", "worker", "worker (orphan)", "resumable"
	Title        string
	Cwd          string
	SessionType  string
	PrimaryAgent string
	IsSep        bool // separator line between active and resumable
}

Entry represents a single row in the picker display.

func BuildEntries

func BuildEntries(ctx context.Context, store *state.Store, client *tmux.Client) ([]Entry, error)

BuildEntries constructs picker rows from discovery and tmux state. Rows are grouped as standalone sessions, masters with workers, orphans, then stale sessions.

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the Bubble Tea model for the interactive session picker.

func NewModel

func NewModel(ctx context.Context, entries []Entry, store *state.Store, client *tmux.Client, deleteFn DeleteFunc, startFn StartFunc, agentOpts AgentOptions) Model

NewModel creates a picker model with the given entries.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Selected

func (m Model) Selected() string

Selected returns the chosen session ID, or empty if cancelled.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type StartFunc

type StartFunc func(ctx context.Context, title, cwd string, opts CreateStartOptions) (string, error)

StartFunc creates a questmaster session and returns its ID.

Jump to

Keyboard shortcuts

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