Documentation
¶
Index ¶
- func GetAddModelChannel() <-chan struct{}
- func GetApprovalChannel() chan ToolApprovalRequestMsg
- func GetAskUserResponseChannel() <-chan AskUserResponse
- func GetCancelAgentChannel() <-chan struct{}
- func GetChannelActionChannel() <-chan ChannelAction
- func GetCompactChannel() <-chan struct{}
- func GetConfigChannel() <-chan *config.Config
- func GetPendingPromptChannel() <-chan string
- func GetPlanModeChannel() <-chan AgentMode
- func GetPlanResponseChannel() <-chan PlanResponse
- func GetPromptChannel() <-chan string
- func GetResumeChannel() <-chan string
- func GetSSHChannel() <-chan interface{}
- func HeaderView() string
- func RenderCoordinatorPanel(ts *TeamViewState, width int) string
- func RenderTeamStatusPill(count int) string
- func RenderTeammateMessage(from, content, color, summary string) string
- func RenderTeammateViewHeader(identity team.TeammateIdentity) string
- func RunSetupTUI() (bool, error)
- type AddModelMsg
- type AgentDoneMsg
- type AgentMode
- type AgentTextMsg
- type AgentsMdMsg
- type ApprovalMode
- type AskUserQuestionMsg
- type AskUserResponse
- type BgTaskDoneMsg
- type ChannelAction
- type ChannelInboundMsg
- type ChannelQRCodeMsg
- type ChannelStateMsg
- type CompactDoneMsg
- type CompactRequestMsg
- type ConfigUpdatedMsg
- type CopyNoticeMsg
- type CopyNoticeTimeoutMsg
- type ExitTimeoutMsg
- type MCPStatusItem
- type MCPStatusMsg
- type Mode
- type Model
- type ModelOption
- type PlanApprovalMsg
- type PlanApprovedMsg
- type PlanRejectedMsg
- type PlanResponse
- type PromptSubmitMsg
- type ProviderProfile
- type ResumeRequestMsg
- type SSHCancelMsg
- type SSHConnectMsg
- type SSHDirResultsMsg
- type SSHListDirReqMsg
- type SSHStatusMsg
- type SessionEntry
- type SessionResumedMsg
- type SetupDoneMsg
- type SetupModel
- type SetupState
- type SkillSlashInfo
- type SkillSlashMsg
- type SkillsLoadedMsg
- type StatusBarComponent
- type StatusBarState
- type SubagentDoneMsg
- type SubagentProgressMsg
- type SubagentStartMsg
- type SubagentTokenUpdateMsg
- type TeamViewMode
- type TeamViewState
- func (t *TeamViewState) AppendTeammateLine(agentID string, lines ...string)
- func (t *TeamViewState) AppendTeammateText(agentID, text string)
- func (t *TeamViewState) FlushTeammateText(agentID string)
- func (t *TeamViewState) GetTeammateDisplayLines(agentID string) []string
- func (t *TeamViewState) HasTeam() bool
- func (t *TeamViewState) RefreshTeammates()
- type TodoUpdateMsg
- type TokenUpdateMsg
- type ToolApprovalRequestMsg
- type ToolApprovalResponse
- type ToolCallMsg
- type ToolResultMsg
- type UserPromptMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAddModelChannel ¶
func GetAddModelChannel() <-chan struct{}
GetAddModelChannel returns the channel that receives add-model requests.
func GetApprovalChannel ¶
func GetApprovalChannel() chan ToolApprovalRequestMsg
GetApprovalChannel returns the channel that receives tool approval requests.
func GetAskUserResponseChannel ¶
func GetAskUserResponseChannel() <-chan AskUserResponse
GetAskUserResponseChannel returns the channel for ask_user responses.
func GetCancelAgentChannel ¶ added in v0.3.2
func GetCancelAgentChannel() <-chan struct{}
GetCancelAgentChannel returns the channel that receives agent cancellation requests.
func GetChannelActionChannel ¶ added in v0.1.1
func GetChannelActionChannel() <-chan ChannelAction
GetChannelActionChannel returns the channel for channel action events.
func GetCompactChannel ¶
func GetCompactChannel() <-chan struct{}
GetCompactChannel returns the channel that receives compact requests.
func GetConfigChannel ¶
GetConfigChannel returns the channel that receives configuration changes.
func GetPendingPromptChannel ¶
func GetPendingPromptChannel() <-chan string
func GetPlanModeChannel ¶
func GetPlanModeChannel() <-chan AgentMode
GetPlanModeChannel returns the channel that receives plan mode switch events.
func GetPlanResponseChannel ¶
func GetPlanResponseChannel() <-chan PlanResponse
GetPlanResponseChannel returns the channel for plan responses.
func GetPromptChannel ¶
func GetPromptChannel() <-chan string
func GetResumeChannel ¶
func GetResumeChannel() <-chan string
GetResumeChannel returns the channel that receives session resume requests.
func GetSSHChannel ¶
func GetSSHChannel() <-chan interface{}
func HeaderView ¶
func HeaderView() string
func RenderCoordinatorPanel ¶
func RenderCoordinatorPanel(ts *TeamViewState, width int) string
RenderCoordinatorPanel renders the team status panel at the bottom of the screen.
func RenderTeamStatusPill ¶
RenderTeamStatusPill renders a small "N teammates" indicator for the status bar.
func RenderTeammateMessage ¶
RenderTeammateMessage renders a message from a teammate with color and identity.
func RenderTeammateViewHeader ¶
func RenderTeammateViewHeader(identity team.TeammateIdentity) string
RenderTeammateViewHeader renders the header when viewing a teammate's conversation.
func RunSetupTUI ¶
Types ¶
type AddModelMsg ¶
type AddModelMsg struct{}
AddModelMsg signals that the user wants to add a new model via setup wizard
type AgentDoneMsg ¶
type AgentDoneMsg struct{ Err error }
type AgentTextMsg ¶
type AgentTextMsg struct{ Text string }
type AgentsMdMsg ¶
AgentsMdMsg is sent by the main goroutine to notify TUI that agents.md was loaded.
type ApprovalMode ¶
type ApprovalMode int
ApprovalMode represents the approval mode state
const ( ModeManual ApprovalMode = iota // Manual approval mode (default) ModeAuto // Auto-approve mode )
type AskUserQuestionMsg ¶
AskUserQuestionMsg is sent when the agent asks the user a question via ask_user tool.
type AskUserResponse ¶
type AskUserResponse struct {
Answer string
}
AskUserResponse is the user's answer to an ask_user question.
type BgTaskDoneMsg ¶
BgTaskDoneMsg is sent when a background task completes.
type ChannelAction ¶ added in v0.1.1
type ChannelAction struct {
ChannelID string // "wechat"
Action string // "login", "logout", "enable", "disable"
}
ChannelAction represents an action the user wants to perform on a channel.
type ChannelInboundMsg ¶ added in v0.1.1
ChannelInboundMsg is sent when an inbound message arrives from a channel.
type ChannelQRCodeMsg ¶ added in v0.1.1
type ChannelQRCodeMsg struct {
ChannelID string
QRCodeURL string // image data or URL
QRCodeContent string // raw content to encode as terminal QR
Message string
}
ChannelQRCodeMsg is sent when a QR code is available for scanning.
type ChannelStateMsg ¶ added in v0.1.1
type ChannelStateMsg struct {
ChannelID string // "wechat"
State string // "none", "disabled", "enabled"
Message string // status message (e.g. "已连接", "扫码中...")
}
ChannelStateMsg is sent from the main goroutine to update channel state display in TUI.
type CompactDoneMsg ¶
CompactDoneMsg is sent when context compaction completes.
type CompactRequestMsg ¶
type CompactRequestMsg struct{}
CompactRequestMsg is sent when the user requests manual context compaction.
type ConfigUpdatedMsg ¶
ConfigUpdatedMsg is sent when the provider/model configuration is updated via setup wizard
type CopyNoticeMsg ¶
type CopyNoticeMsg struct {
Message string
}
CopyNoticeMsg is sent after text is copied to clipboard
type CopyNoticeTimeoutMsg ¶
type CopyNoticeTimeoutMsg struct{}
CopyNoticeTimeoutMsg clears the copy notice
type ExitTimeoutMsg ¶
type ExitTimeoutMsg struct{}
ExitTimeoutMsg is sent after 5s to clear exit confirmation
type MCPStatusItem ¶
type MCPStatusMsg ¶
type MCPStatusMsg struct {
Statuses []MCPStatusItem
}
type Model ¶
type Model struct {
// OnApprovalModeChange is called when the user toggles approval mode via Ctrl+A.
// It directly updates the backend ApprovalState atomically, bypassing the event loop.
OnApprovalModeChange func(enabled bool)
// contains filtered or unexported fields
}
func (*Model) SetTeamManager ¶
SetTeamManager sets the team manager on the model for TUI integration.
type ModelOption ¶ added in v0.3.2
type ModelOption func(*Model)
ModelOption configures a Model before the BubbleTea program starts.
func WithApprovalModeChange ¶ added in v0.3.2
func WithApprovalModeChange(fn func(bool)) ModelOption
WithApprovalModeChange sets the callback invoked when the user toggles approval mode via Ctrl+A or the approval dialog. The callback directly updates the backend ApprovalState atomically, bypassing the event loop.
type PlanApprovalMsg ¶
PlanApprovalMsg is sent when the agent wants to show a plan for approval.
type PlanApprovedMsg ¶
type PlanApprovedMsg struct{}
PlanApprovedMsg is sent when the user approves a plan.
type PlanRejectedMsg ¶
type PlanRejectedMsg struct {
Feedback string
}
PlanRejectedMsg is sent when the user rejects a plan.
type PlanResponse ¶
PlanResponse is the user's response to a plan approval.
type PromptSubmitMsg ¶
type PromptSubmitMsg struct{ Prompt string }
type ProviderProfile ¶
type ProviderProfile struct {
ID string
Name string
BaseURL string
NeedURL bool // if true, prompt for custom URL
NeedKey bool // if true, prompt for API Key
FromRegistry bool // true if provider exists in models.dev
}
ProviderProfile holds the minimal info needed for the setup wizard flow.
type ResumeRequestMsg ¶
type ResumeRequestMsg struct{ UUID string }
ResumeRequestMsg is sent when the user requests to resume a session by UUID.
type SSHCancelMsg ¶
type SSHCancelMsg struct{}
SSHCancelMsg is sent when user cancels the SSH dir picker via Esc.
type SSHConnectMsg ¶
SSHConnectMsg is sent when user initially requests connection
type SSHDirResultsMsg ¶
SSHDirResultsMsg is sent from main to TUI with directory contents
type SSHListDirReqMsg ¶
type SSHListDirReqMsg struct {
Path string
}
SSHListDirReqMsg is sent when TUI needs to list a directory on the remote machine
type SSHStatusMsg ¶
SSHStatusMsg carries the result of an SSH connection attempt.
type SessionEntry ¶
type SessionEntry struct {
Type string
Content string
Name string
Args string
Output string
Error string
SubagentName string
SubagentType string
}
SessionEntry is a display-ready record from a replayed session.
func ConvertSessionEntries ¶
func ConvertSessionEntries(entries []session.Entry) []SessionEntry
ConvertSessionEntries converts recorded session entries to display-ready SessionEntry values for the TUI session-replay view.
type SessionResumedMsg ¶
type SessionResumedMsg struct {
UUID string
Entries []SessionEntry
}
SessionResumedMsg is sent by the main goroutine to replay a session in the TUI.
type SetupDoneMsg ¶
type SetupDoneMsg struct{}
type SetupModel ¶
type SetupModel struct {
// contains filtered or unexported fields
}
func NewSetupModel ¶
func NewSetupModel() SetupModel
func (SetupModel) Init ¶
func (m SetupModel) Init() tea.Cmd
func (SetupModel) IsDone ¶
func (m SetupModel) IsDone() bool
func (SetupModel) View ¶
func (m SetupModel) View() tea.View
type SetupState ¶
type SetupState int
const ( StateProvider SetupState = iota StateModel StateCustomModel StateURL StateAPIKey )
type SkillSlashInfo ¶
SkillSlashInfo describes a skill's slash command for TUI hint display.
type SkillSlashMsg ¶
type SkillSlashMsg struct {
SkillName string // skill name to load
UserInput string // additional user input after the slash command
}
SkillSlashMsg is sent when a user triggers a slash command mapped to a skill.
type SkillsLoadedMsg ¶
type SkillsLoadedMsg struct {
SlashCommands []SkillSlashInfo
}
SkillsLoadedMsg is sent at startup to inform the TUI about available skill slash commands.
type StatusBarComponent ¶
type StatusBarComponent struct {
}
StatusBarComponent is a stateless-like component in Bubble Tea.
func NewStatusBarComponent ¶
func NewStatusBarComponent() *StatusBarComponent
func (*StatusBarComponent) View ¶
func (s *StatusBarComponent) View(state StatusBarState) string
View returns the rendered status bar.
type StatusBarState ¶
type StatusBarState struct {
Width int
ActiveProvider string
ActiveModel string
AutoApprove bool
TotalTokens int64
ModelContextLimit int
MCPStatuses []MCPStatusItem
Mode AgentMode
BgRunning int
TeammateCount int
CopyNotice string
}
StatusBarState holds the props supplied to the StatusBar component
type SubagentDoneMsg ¶
SubagentDoneMsg is sent when a subagent finishes.
type SubagentProgressMsg ¶
type SubagentProgressMsg struct {
AgentName string
Event string // "tool_call" or "tool_result"
ToolName string
Detail string
}
SubagentProgressMsg is sent for intermediate subagent events (tool calls / results).
type SubagentStartMsg ¶
SubagentStartMsg is sent when a subagent begins executing.
type SubagentTokenUpdateMsg ¶
type SubagentTokenUpdateMsg struct {
TotalTokens int64 // cumulative tokens used by the subagent since it started
}
SubagentTokenUpdateMsg is sent after each model turn to update the subagent's token usage.
type TeamViewMode ¶
type TeamViewMode int
TeamViewMode represents what the user is viewing.
const ( TeamViewLeader TeamViewMode = iota // viewing leader's conversation TeamViewTeammate // viewing a teammate's conversation TeamViewPanel // navigating coordinator panel )
type TeamViewState ¶
type TeamViewState struct {
Manager *team.Manager
ViewingAgent string // agentID of currently viewed teammate ("" = leader)
PanelVisible bool // show coordinator panel
PanelSelected int // selected index in coordinator panel
ViewMode TeamViewMode
Teammates []*team.TeammateState // cached snapshot
// Per-teammate display lines, keyed by agentID.
TeammateLines map[string][]string
TeammateCurrentText map[string]*strings.Builder
}
TeamViewState tracks team-related TUI state.
func (*TeamViewState) AppendTeammateLine ¶
func (t *TeamViewState) AppendTeammateLine(agentID string, lines ...string)
AppendTeammateLine adds a formatted display line for a teammate.
func (*TeamViewState) AppendTeammateText ¶
func (t *TeamViewState) AppendTeammateText(agentID, text string)
AppendTeammateText appends streaming text for a teammate.
func (*TeamViewState) FlushTeammateText ¶
func (t *TeamViewState) FlushTeammateText(agentID string)
FlushTeammateText flushes any buffered streaming text for a teammate into a line.
func (*TeamViewState) GetTeammateDisplayLines ¶
func (t *TeamViewState) GetTeammateDisplayLines(agentID string) []string
GetTeammateDisplayLines returns the accumulated display lines for a teammate.
func (*TeamViewState) HasTeam ¶
func (t *TeamViewState) HasTeam() bool
HasTeam returns true if a team is active.
func (*TeamViewState) RefreshTeammates ¶
func (t *TeamViewState) RefreshTeammates()
RefreshTeammates updates the cached teammate list.
type TodoUpdateMsg ¶
type TodoUpdateMsg struct{}
TodoUpdateMsg signals that the todo store has been updated.
type TokenUpdateMsg ¶
TokenUpdateMsg is sent periodically to update token usage display
type ToolApprovalRequestMsg ¶
type ToolApprovalRequestMsg struct {
Name string
Args string
Resp chan ToolApprovalResponse
IsExternal bool // Whether this is an external path access (for read tool)
WorkerName string // Non-empty when approval is from a teammate (e.g. "@backend")
WorkerColor string // Teammate's color for TUI display
}
ToolApprovalRequestMsg is sent when a tool needs user approval
type ToolApprovalResponse ¶
type ToolApprovalResponse struct {
Approved bool
Mode ApprovalMode // Mode after this response (stay MANUAL or switch to AUTO)
}
ToolApprovalResponse is the user's response to a tool approval request
type ToolCallMsg ¶
type ToolCallMsg struct{ Name, Args string }
type ToolResultMsg ¶
type UserPromptMsg ¶
type UserPromptMsg struct{ Prompt string }