components

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderMarkdown

func RenderMarkdown(content string, width int, dark bool) string

RenderMarkdown renders markdown content to styled terminal output. Falls back to raw content if rendering fails.

Types

type AutocompleteModel

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

AutocompleteModel manages the autocomplete dropdown state.

func NewAutocomplete

func NewAutocomplete() AutocompleteModel

NewAutocomplete creates an autocomplete model with all known commands.

func (AutocompleteModel) SetFilter

func (m AutocompleteModel) SetFilter(input string) AutocompleteModel

SetFilter updates the autocomplete based on current input text.

func (AutocompleteModel) SetHeight

func (m AutocompleteModel) SetHeight(h int) AutocompleteModel

SetHeight sets the available height so View() can cap the dropdown size.

func (AutocompleteModel) Update

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

Update handles keyboard input when the autocomplete is visible.

func (AutocompleteModel) View

func (m AutocompleteModel) View(t theme.Theme, width int) string

View renders the autocomplete dropdown, capped at maxVisibleItems rows.

func (AutocompleteModel) Visible

func (m AutocompleteModel) Visible() bool

Visible returns whether the autocomplete dropdown is showing.

type AutocompleteSelectedMsg

type AutocompleteSelectedMsg struct {
	Command string
}

AutocompleteSelectedMsg is sent when a command is selected from the dropdown.

type CommandEntry

type CommandEntry struct {
	Name string
	Desc string
}

CommandEntry represents a slash command for autocomplete.

type FleetPanel

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

FleetPanel displays the active fleet workers in a table.

func NewFleetPanel

func NewFleetPanel() FleetPanel

NewFleetPanel creates an empty FleetPanel.

func (FleetPanel) SetFleetStatus

func (f FleetPanel) SetFleetStatus(fs *pb.FleetStatus) FleetPanel

SetFleetStatus replaces the current fleet data.

func (FleetPanel) SetSize

func (f FleetPanel) SetSize(w, h int) FleetPanel

SetSize updates the panel dimensions.

func (FleetPanel) Update

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

Update handles key events for the fleet panel.

func (FleetPanel) View

func (f FleetPanel) View(t theme.Theme) string

View renders the fleet panel.

type FleetStatusUpdatedMsg

type FleetStatusUpdatedMsg struct {
	Status *pb.FleetStatus
}

FleetStatusUpdatedMsg carries a new FleetStatus from the daemon.

type FleetWorkerKillMsg

type FleetWorkerKillMsg struct {
	FleetID  string
	WorkerID string
}

FleetWorkerKillMsg is sent when the user kills a fleet worker.

type InputModel

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

func NewInput

func NewInput(t theme.Theme) InputModel

func (InputModel) Focused

func (m InputModel) Focused() bool

func (InputModel) Height

func (m InputModel) Height() int

Height returns the current content-driven height of the input.

func (InputModel) Init

func (m InputModel) Init() tea.Cmd

func (*InputModel) SetValue

func (m *InputModel) SetValue(s string)

SetValue replaces the input text content.

func (*InputModel) SetWidth

func (m *InputModel) SetWidth(w int)

func (InputModel) Update

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

func (InputModel) Value

func (m InputModel) Value() string

Value returns the current text content of the input.

func (InputModel) View

func (m InputModel) View(t theme.Theme, width int) string

type InputResizedMsg

type InputResizedMsg struct {
	Height int
}

InputResizedMsg is sent when the input height changes due to content.

type JobKillMsg

type JobKillMsg struct{ JobID string }

JobKillMsg is sent when the user requests to kill the selected job.

type JobListRefreshedMsg

type JobListRefreshedMsg struct{ Jobs []*pb.Job }

JobListRefreshedMsg carries a fresh job list from the daemon.

type JobPanel

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

JobPanel displays active jobs from all managers in a table.

func NewJobPanel

func NewJobPanel(c *client.Client) JobPanel

NewJobPanel creates a JobPanel backed by the given daemon client.

func (JobPanel) Init

func (jp JobPanel) Init() tea.Cmd

Init returns a command that immediately triggers the first refresh tick.

func (JobPanel) SetSize

func (jp JobPanel) SetSize(w, h int) JobPanel

SetSize updates the panel dimensions.

func (JobPanel) Update

func (jp JobPanel) Update(msg tea.Msg) (JobPanel, tea.Cmd)

Update handles key events and refresh messages.

func (JobPanel) View

func (jp JobPanel) View(t theme.Theme) string

View renders the job panel.

type JobPauseMsg

type JobPauseMsg struct{ JobID string }

JobPauseMsg is sent when the user requests to pause the selected job.

type JobTickMsg

type JobTickMsg struct{}

JobTickMsg triggers a periodic refresh.

type Message

type Message struct {
	Role    MessageRole
	Content string
	Sender  string // model name or "You"
}

func (Message) Render

func (m Message) Render(t theme.Theme, width int, dark bool) string

Render returns a styled string for the message.

type MessageRole

type MessageRole string
const (
	RoleUser      MessageRole = "user"
	RoleAssistant MessageRole = "assistant"
	RoleTool      MessageRole = "tool"
	RoleSystem    MessageRole = "system"
)

type PermissionPrompt

type PermissionPrompt struct {
	RequestID string
	ToolName  string
	ArgsJSON  string
	Desc      string
	// contains filtered or unexported fields
}

PermissionPrompt displays an inline permission request, blocking until resolved.

func NewPermissionPrompt

func NewPermissionPrompt(requestID, toolName, argsJSON, desc string) PermissionPrompt

func (PermissionPrompt) Resolved

func (p PermissionPrompt) Resolved() bool

func (PermissionPrompt) Update

func (p PermissionPrompt) Update(msg tea.Msg) (PermissionPrompt, tea.Cmd)

func (PermissionPrompt) View

func (p PermissionPrompt) View(t theme.Theme, width int) string

type PermissionResponse

type PermissionResponse struct {
	RequestID string
	Allowed   bool
	Scope     string // "once", "session", "always"
}

PermissionResponse is sent when the user resolves a permission request.

type PlanApproveMsg

type PlanApproveMsg struct {
	PlanID    string
	SkipSteps []string
}

PlanApproveMsg is dispatched when the user approves the plan.

type PlanRejectMsg

type PlanRejectMsg struct {
	PlanID string
}

PlanRejectMsg is dispatched when the user rejects the plan.

type PlanView

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

PlanView renders a proposed plan as a numbered task list with status indicators and keyboard navigation.

Enter  → approve (with any toggled skip steps)
Esc    → reject
space  → toggle skip on the cursor step
↑/k, ↓/j → navigate steps

func NewPlanView

func NewPlanView() PlanView

func (PlanView) Active

func (v PlanView) Active() bool

Active reports whether the plan view is currently showing a plan.

func (PlanView) SetPlan

func (v PlanView) SetPlan(p *pb.Plan) PlanView

SetPlan replaces the displayed plan and resets cursor/skip state.

func (PlanView) SetSize

func (v PlanView) SetSize(width int) PlanView

SetSize updates the rendering width.

func (PlanView) Update

func (v PlanView) Update(msg tea.Msg) (PlanView, tea.Cmd)

func (PlanView) View

func (v PlanView) View(t theme.Theme) string

type SessionKillMsg

type SessionKillMsg struct{ SessionID string }

SessionKillMsg is sent when the user kills a session from the sidebar.

type SessionSelectedMsg

type SessionSelectedMsg struct{ SessionID string }

SessionSelectedMsg is sent when the user switches to a session.

type SidebarModel

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

SidebarModel displays a list of sessions and allows switching or killing.

func NewSidebar

func NewSidebar(sessions []*pb.Session, currentID string) SidebarModel

func (SidebarModel) SetSize

func (s SidebarModel) SetSize(w, h int) SidebarModel

func (SidebarModel) Update

func (s SidebarModel) Update(msg tea.Msg) (SidebarModel, tea.Cmd)

func (SidebarModel) View

func (s SidebarModel) View(t theme.Theme) string

type StatusBar

type StatusBar struct {
	WorkingDir      string
	Provider        string
	Model           string
	SessionStart    time.Time
	InputTokens     int
	OutputTokens    int
	ActiveAgents    int
	BackgroundTasks int
	Width           int
}

func NewStatusBar

func NewStatusBar() StatusBar

func (StatusBar) View

func (s StatusBar) View(t theme.Theme) string

type SubmitMsg

type SubmitMsg struct {
	Content string
}

SubmitMsg is sent when the user submits input.

type ThinkingPanel

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

ThinkingPanel displays a collapsible panel for model reasoning traces. It auto-starts expanded and can be toggled with Ctrl+H.

func NewThinkingPanel

func NewThinkingPanel(width int) ThinkingPanel

NewThinkingPanel creates a new thinking panel.

func (ThinkingPanel) AppendContent

func (p ThinkingPanel) AppendContent(text string) ThinkingPanel

AppendContent adds text to the thinking panel.

func (ThinkingPanel) Collapsed

func (p ThinkingPanel) Collapsed() bool

Collapsed returns true if the panel is currently collapsed.

func (ThinkingPanel) HasContent

func (p ThinkingPanel) HasContent() bool

HasContent returns true if the panel has any content.

func (ThinkingPanel) Reset

func (p ThinkingPanel) Reset() ThinkingPanel

Reset clears the content and resets to expanded state.

func (ThinkingPanel) SetCollapsed

func (p ThinkingPanel) SetCollapsed(collapsed bool) ThinkingPanel

SetCollapsed sets the collapsed state.

func (ThinkingPanel) SetWidth

func (p ThinkingPanel) SetWidth(w int) ThinkingPanel

SetWidth updates the panel width.

func (ThinkingPanel) ToggleCollapsed

func (p ThinkingPanel) ToggleCollapsed() ThinkingPanel

ToggleCollapsed flips the collapsed state.

func (ThinkingPanel) View

func (p ThinkingPanel) View() string

View renders the panel. Returns empty string if no content.

type ToggleMsg

type ToggleMsg struct{ CallID string }

ToggleMsg is sent when a tool call card is toggled.

type ToolCallCard

type ToolCallCard struct {
	CallID     string
	ToolName   string
	ArgsJSON   string
	ResultJSON string
	Status     ToolCallStatus
	Expanded   bool
	Summary    string // one-line summary set on completion
}

ToolCallCard renders a collapsible tool call with status icon.

func (ToolCallCard) Render

func (tc ToolCallCard) Render(t theme.Theme, width int) string

func (*ToolCallCard) SetResult

func (tc *ToolCallCard) SetResult(resultJSON string, success bool)

type ToolCallListModel

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

ToolCallListModel manages a list of tool call cards.

func NewToolCallList

func NewToolCallList() ToolCallListModel

func (*ToolCallListModel) AddCard

func (m *ToolCallListModel) AddCard(callID, toolName, argsJSON string)

func (ToolCallListModel) Update

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

func (*ToolCallListModel) UpdateResult

func (m *ToolCallListModel) UpdateResult(callID, resultJSON string, success bool)

func (ToolCallListModel) View

func (m ToolCallListModel) View(t theme.Theme, width int) string

type ToolCallStatus

type ToolCallStatus int
const (
	ToolCallPending ToolCallStatus = iota
	ToolCallRunning
	ToolCallSuccess
	ToolCallFailed
)

Jump to

Keyboard shortcuts

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