Documentation
¶
Index ¶
- func New() engine.Plugin
- type Adapter
- func (a *Adapter) OnApprovalResponse(handler func(ui.ApprovalResponseMessage))
- func (a *Adapter) OnCancel(handler func())
- func (a *Adapter) OnExit(handler func())
- func (a *Adapter) OnInput(handler func(ui.InputMessage))
- func (a *Adapter) OnResume(handler func())
- func (a *Adapter) RequestApproval(msg ui.ApprovalRequestMessage) (ui.ApprovalResponseMessage, error)
- func (a *Adapter) RequestHumanInput(msg ui.HITLRequestMessage) (ui.HITLResponseMessage, error)
- func (a *Adapter) SendCancelComplete(turnID string, resumable bool) error
- func (a *Adapter) SendCodeExecStdout(msg ui.CodeExecStdoutMessage) error
- func (a *Adapter) SendFileChanged(path, action string) error
- func (a *Adapter) SendOutput(msg ui.OutputMessage) error
- func (a *Adapter) SendPlanDisplay(msg ui.PlanDisplayMessage) error
- func (a *Adapter) SendPlanStepStatus(msg planStepStatusMsg) error
- func (a *Adapter) SendPlanUpdate(turnID string, steps []planUpdateStep) error
- func (a *Adapter) SendStatus(msg ui.StatusMessage) error
- func (a *Adapter) SendStreamChunk(msg ui.StreamChunkMessage) error
- func (a *Adapter) SendStreamEnd(msg ui.StreamEndMessage) error
- func (a *Adapter) SendStreamHold(msg ui.StreamHoldMessage) error
- func (a *Adapter) SendStreamRetract(msg ui.StreamRetractMessage) error
- func (a *Adapter) SendThinking(msg ui.ThinkingMessage) error
- func (a *Adapter) SendWorkflowStatus(msg ui.WorkflowStatusMessage) error
- func (a *Adapter) Sessions() []ui.SessionInfo
- func (a *Adapter) Start(ctx context.Context) error
- func (a *Adapter) Stop(_ context.Context) error
- func (a *Adapter) Wait()
- type Plugin
- func (p *Plugin) Capabilities() []engine.Capability
- func (p *Plugin) Dependencies() []string
- func (p *Plugin) Emissions() []string
- func (p *Plugin) ID() string
- func (p *Plugin) Init(ctx engine.PluginContext) error
- func (p *Plugin) Name() string
- func (p *Plugin) Ready() error
- func (p *Plugin) Requires() []engine.Requirement
- func (p *Plugin) Shutdown(ctx context.Context) error
- func (p *Plugin) Subscriptions() []engine.EventSubscription
- func (p *Plugin) Version() string
- type Styles
- type Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements ui.UIAdapter using a BubbleTea program.
func NewAdapter ¶
func NewAdapter(session *engine.SessionWorkspace, capabilities map[string][]string) *Adapter
NewAdapter creates a TUI adapter backed by BubbleTea. capabilities is the boot-time capability → provider-IDs map so the TUI can enable affordances (e.g. cancel) by capability rather than by specific plugin ID.
func (*Adapter) OnApprovalResponse ¶
func (a *Adapter) OnApprovalResponse(handler func(ui.ApprovalResponseMessage))
OnApprovalResponse registers the callback for approval responses.
func (*Adapter) OnCancel ¶
func (a *Adapter) OnCancel(handler func())
OnCancel registers the callback for cancel requests.
func (*Adapter) OnExit ¶ added in v0.31.0
func (a *Adapter) OnExit(handler func())
OnExit registers the callback run when the user quits the TUI (the program exits for any reason other than Stop).
func (*Adapter) OnInput ¶
func (a *Adapter) OnInput(handler func(ui.InputMessage))
OnInput registers the callback for user input.
func (*Adapter) OnResume ¶
func (a *Adapter) OnResume(handler func())
OnResume registers the callback for resume requests.
func (*Adapter) RequestApproval ¶
func (a *Adapter) RequestApproval(msg ui.ApprovalRequestMessage) (ui.ApprovalResponseMessage, error)
RequestApproval sends an approval request and blocks until the user responds.
func (*Adapter) RequestHumanInput ¶
func (a *Adapter) RequestHumanInput(msg ui.HITLRequestMessage) (ui.HITLResponseMessage, error)
RequestHumanInput sends a hitl request to the user and blocks until they respond. The TUI renders Prompt and (when present) Choices; the returned HITLResponseMessage carries the picked ChoiceID and/or FreeText answer.
func (*Adapter) SendCancelComplete ¶
SendCancelComplete notifies the TUI that a cancellation completed.
func (*Adapter) SendCodeExecStdout ¶
func (a *Adapter) SendCodeExecStdout(msg ui.CodeExecStdoutMessage) error
SendCodeExecStdout streams a chunk of run_code script stdout to the TUI.
func (*Adapter) SendFileChanged ¶
SendFileChanged notifies the TUI that a session file changed.
func (*Adapter) SendOutput ¶
func (a *Adapter) SendOutput(msg ui.OutputMessage) error
SendOutput sends a complete output message to the TUI.
func (*Adapter) SendPlanDisplay ¶
func (a *Adapter) SendPlanDisplay(msg ui.PlanDisplayMessage) error
SendPlanDisplay sends a plan display to the TUI.
func (*Adapter) SendPlanStepStatus ¶
SendPlanStepStatus sends a single-step status delta to the TUI, the shape emitted by plan.progress. Right rail matches by StepID.
func (*Adapter) SendPlanUpdate ¶
SendPlanUpdate sends an updated plan with step statuses to the TUI.
func (*Adapter) SendStatus ¶
func (a *Adapter) SendStatus(msg ui.StatusMessage) error
SendStatus sends a status update to the TUI.
func (*Adapter) SendStreamChunk ¶
func (a *Adapter) SendStreamChunk(msg ui.StreamChunkMessage) error
SendStreamChunk sends a streaming chunk to the TUI.
func (*Adapter) SendStreamEnd ¶
func (a *Adapter) SendStreamEnd(msg ui.StreamEndMessage) error
SendStreamEnd signals the end of a stream.
func (*Adapter) SendStreamHold ¶
func (a *Adapter) SendStreamHold(msg ui.StreamHoldMessage) error
SendStreamHold tells the TUI a gate suspended or released the stream.
func (*Adapter) SendStreamRetract ¶
func (a *Adapter) SendStreamRetract(msg ui.StreamRetractMessage) error
SendStreamRetract tells the TUI to erase the text rendered for a blocked turn.
func (*Adapter) SendThinking ¶
func (a *Adapter) SendThinking(msg ui.ThinkingMessage) error
SendThinking sends a thinking step to the TUI.
func (*Adapter) SendWorkflowStatus ¶
func (a *Adapter) SendWorkflowStatus(msg ui.WorkflowStatusMessage) error
SendWorkflowStatus sends a structured workflow progress update to the TUI. The TUI renders the message as a dedicated workflow status panel in the right rail and as a one-line status indicator in the chat header.
func (*Adapter) Sessions ¶
func (a *Adapter) Sessions() []ui.SessionInfo
Sessions returns info about the current terminal session.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is the terminal IO plugin that bridges a BubbleTea TUI to the event bus.
func (*Plugin) Capabilities ¶
func (p *Plugin) Capabilities() []engine.Capability
func (*Plugin) Dependencies ¶
func (*Plugin) Init ¶
func (p *Plugin) Init(ctx engine.PluginContext) error
Init creates the adapter and wires callbacks to the event bus.
func (*Plugin) Requires ¶
func (p *Plugin) Requires() []engine.Requirement
func (*Plugin) Subscriptions ¶
func (p *Plugin) Subscriptions() []engine.EventSubscription
type Styles ¶
type Styles struct {
Theme Theme
// Layout
Sidebar lipgloss.Style
MainPanel lipgloss.Style
RightRail lipgloss.Style
StatusBar lipgloss.Style
InputArea lipgloss.Style
SidebarHeader lipgloss.Style
// Chat bubbles
UserBubble lipgloss.Style
AssistantBubble lipgloss.Style
SystemBubble lipgloss.Style
ToolBubble lipgloss.Style
ErrorBubble lipgloss.Style
// Labels
UserLabel lipgloss.Style
AssistantLabel lipgloss.Style
SystemLabel lipgloss.Style
ToolLabel lipgloss.Style
ErrorLabel lipgloss.Style
// Components
TabActive lipgloss.Style
TabInactive lipgloss.Style
FileItem lipgloss.Style
PluginItem lipgloss.Style
PlanStep lipgloss.Style
ThinkStep lipgloss.Style
ApprovalBox lipgloss.Style
RiskHigh lipgloss.Style
RiskNormal lipgloss.Style
// Misc
Logo lipgloss.Style
Dim lipgloss.Style
Bold lipgloss.Style
Spinner lipgloss.Style
Accent lipgloss.Style
Selected lipgloss.Style
}
Styles holds computed lipgloss styles derived from a theme.
type Theme ¶
type Theme struct {
Name string
// Base colors
Primary lipgloss.Color
Background lipgloss.Color
Surface lipgloss.Color
Border lipgloss.Color
Text lipgloss.Color
TextDim lipgloss.Color
// Role colors
Assistant lipgloss.Color
User lipgloss.Color
System lipgloss.Color
Tool lipgloss.Color
Error lipgloss.Color
// Semantic
Success lipgloss.Color
Warning lipgloss.Color
Danger lipgloss.Color
}
Theme holds all lipgloss styles for the TUI.