Documentation
¶
Overview ¶
Package tui style tokens: single source of truth for visual language. Direction: cool chrome, warm content — colour alone distinguishes UI from output.
Package tui theme: single source of truth for colour. v2 has no AdaptiveColor; palette is resolved once from background.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewModelPicker ¶ added in v0.2.0
Caller frames with modalOverlayStyle, so no border here.
func Run ¶
func Run( ctx context.Context, registry *provider.Registry, session *agent.Session, toolRegistry *tools.Registry, approval *tools.ApprovalGate, version string, workspaceRoot string, guardCfg agent.LoopGuardConfig, maxContextTokens int, plan *tools.PlanStore, scratchpad *tools.ScratchpadStore, verifyCommand string, verifyTimeout time.Duration, ) error
Run starts the Bubble Tea interface; agent behaviour lives in agent.AgentLoop.
Types ¶
type ApprovalBridge ¶
type ApprovalBridge struct {
RequestCh chan ApprovalRequest
}
func NewApprovalBridge ¶
func NewApprovalBridge() *ApprovalBridge
func (*ApprovalBridge) RequestApproval ¶
func (b *ApprovalBridge) RequestApproval(toolName string, args json.RawMessage, preview string) (bool, error)
RequestApproval is the legacy yes/no request. Grant and read-only choices still approve the pending call; only the additional scope is dropped.
func (*ApprovalBridge) RequestApprovalChoice ¶ added in v0.7.4
func (b *ApprovalBridge) RequestApprovalChoice(toolName string, args json.RawMessage, preview string) (tools.ApprovalChoice, error)
RequestApprovalChoice asks the TUI for a full decision. The gate installs this as OnPresentChoice so grants and the per-turn read-only flag can be expressed from the modal.
Limitation: the TUI has no argument editor, so ApprovalChoice.ApprovalEdit is never produced here. The plain loop wires tools.ApprovalGate.EditArgs; the TUI deliberately offers only y/a/r/n to avoid claiming parity.
type ApprovalRequest ¶
type ApprovalRequest struct {
ToolName string
Args json.RawMessage
Preview string
// ReplyCh carries the legacy yes/no answer. It is nil when the requester
// made a choice-aware request.
ReplyCh chan bool
// ChoiceCh carries the full decision for choice-aware requesters.
ChoiceCh chan tools.ApprovalChoice
}
type ChatMessage ¶
type ModelItem ¶ added in v0.2.0
ModelItem is a selectable model in the fuzzy picker.