Documentation
¶
Index ¶
- type ChatModel
- func (m *ChatModel) AddMessage(role Role, content string)
- func (m *ChatModel) ClearMessages()
- func (m ChatModel) Init() tea.Cmd
- func (m ChatModel) IsWaiting() bool
- func (m ChatModel) Messages() []Message
- func (m *ChatModel) ReceiveResponse(content string) tea.Cmd
- func (m *ChatModel) SetSize(width, height int)
- func (m ChatModel) Update(msg tea.Msg) (ChatModel, tea.Cmd)
- func (m ChatModel) View() string
- type LogLine
- type LogLineType
- type LogStreamModel
- type Message
- type MessageSender
- type ProgressBarModel
- type ResponseMsg
- type Role
- type SlashCommand
- type SlashHandler
- type StreamChunkMsg
- type StreamDoneMsg
- type StreamStartMsg
- type TaskActionMsg
- type TaskListItem
- type TaskListModel
- func (m TaskListModel) CursorID() string
- func (m TaskListModel) Init() tea.Cmd
- func (m TaskListModel) SelectedItem() *TaskListItem
- func (m *TaskListModel) SetCursorByID(id string)
- func (m *TaskListModel) SetItems(items []TaskListItem)
- func (m *TaskListModel) SetSize(w, h int)
- func (m *TaskListModel) ToggleDetail()
- func (m TaskListModel) Update(msg tea.Msg) (TaskListModel, tea.Cmd)
- func (m TaskListModel) View() string
- type TaskSelectedMsg
- type TaskStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatModel ¶
type ChatModel struct {
// contains filtered or unexported fields
}
ChatModel is a reusable chat UI component.
func NewChatModel ¶
func NewChatModel(sender MessageSender, slashHandler SlashHandler) ChatModel
NewChatModel creates a new chat component.
func (*ChatModel) AddMessage ¶
AddMessage adds a message to the chat from outside.
func (*ChatModel) ClearMessages ¶
func (m *ChatModel) ClearMessages()
ClearMessages removes all messages.
func (*ChatModel) ReceiveResponse ¶
ReceiveResponse adds an assistant response to the chat and clears the waiting state. Returns nil. This is used when the parent model intercepts response messages (e.g., to check for plan tags) before forwarding the text to the chat.
type LogLine ¶
type LogLine struct {
Text string
Type LogLineType
}
LogLine is a single line in the task's live log.
type LogLineType ¶
type LogLineType int
LogLineType classifies log line severity/purpose.
const ( LogInfo LogLineType = iota LogSuccess LogError LogWarning LogClaudeChunk )
type LogStreamModel ¶
type LogStreamModel struct {
// contains filtered or unexported fields
}
LogStreamModel is a streaming log viewer that auto-scrolls and shows color-coded lines.
func NewLogStreamModel ¶
func NewLogStreamModel() LogStreamModel
NewLogStreamModel creates a new log stream viewer.
func (*LogStreamModel) AppendLine ¶
func (m *LogStreamModel) AppendLine(line LogLine)
AppendLine adds a new log line and auto-scrolls if following.
func (*LogStreamModel) SetLines ¶
func (m *LogStreamModel) SetLines(lines []LogLine)
SetLines replaces all lines (e.g., when switching to a different task).
func (*LogStreamModel) SetSize ¶
func (m *LogStreamModel) SetSize(w, h int)
SetSize updates the dimensions.
func (LogStreamModel) Update ¶
func (m LogStreamModel) Update(msg tea.Msg) (LogStreamModel, tea.Cmd)
Update handles scroll keys.
type MessageSender ¶
MessageSender is called when the user sends a message. It receives the user's text and returns a tea.Cmd that will eventually produce a ResponseMsg.
type ProgressBarModel ¶
type ProgressBarModel struct {
// contains filtered or unexported fields
}
ProgressBarModel is a simple reusable progress bar.
func NewProgressBarModel ¶
func NewProgressBarModel(total, width int) ProgressBarModel
NewProgressBarModel creates a new progress bar.
func (*ProgressBarModel) SetDone ¶
func (m *ProgressBarModel) SetDone(done int)
SetDone updates the completed count.
func (*ProgressBarModel) SetTotal ¶
func (m *ProgressBarModel) SetTotal(total int)
SetTotal updates the total count.
func (*ProgressBarModel) SetWidth ¶
func (m *ProgressBarModel) SetWidth(width int)
SetWidth updates the bar width.
func (ProgressBarModel) View ¶
func (m ProgressBarModel) View() string
View renders the progress bar.
type ResponseMsg ¶
ResponseMsg is produced by MessageSender when a response arrives.
type SlashCommand ¶
SlashCommand represents a parsed slash command.
func ParseSlashCommand ¶
func ParseSlashCommand(input string) (SlashCommand, bool)
ParseSlashCommand parses a slash command from input. Exported for testing.
type SlashHandler ¶
type SlashHandler func(cmd SlashCommand) (tea.Cmd, bool)
SlashHandler is called when a slash command is detected. Returns a tea.Cmd if the command produces an async action, nil otherwise. Returns a bool indicating if the command was handled.
type StreamChunkMsg ¶
type StreamChunkMsg struct {
Chunk string
}
StreamChunkMsg carries a chunk of text from the streaming response.
type StreamDoneMsg ¶
StreamDoneMsg indicates the stream is complete.
type StreamStartMsg ¶
type StreamStartMsg struct{}
StreamStartMsg indicates a streaming response has begun.
type TaskActionMsg ¶
type TaskActionMsg struct {
Action string // "edit", "delete", "new", "reorder_up", "reorder_down"
TaskID string
}
TaskActionMsg is emitted when the user triggers an action on a task.
type TaskListItem ¶
type TaskListItem struct {
ID string
Title string
Complexity string
Status TaskStatus
Editable bool
Detail string // pre-rendered detail text
}
TaskListItem represents a single item in the task list display.
type TaskListModel ¶
type TaskListModel struct {
// contains filtered or unexported fields
}
TaskListModel is a reusable list component for displaying tasks.
func NewTaskListModel ¶
func NewTaskListModel(items []TaskListItem) TaskListModel
NewTaskListModel creates a new task list component.
func (TaskListModel) CursorID ¶
func (m TaskListModel) CursorID() string
CursorID returns the ID of the currently selected task.
func (TaskListModel) SelectedItem ¶
func (m TaskListModel) SelectedItem() *TaskListItem
SelectedItem returns the currently highlighted item.
func (*TaskListModel) SetCursorByID ¶
func (m *TaskListModel) SetCursorByID(id string)
SetCursorByID moves the cursor to the item with the given ID.
func (*TaskListModel) SetItems ¶
func (m *TaskListModel) SetItems(items []TaskListItem)
SetItems replaces the items (e.g., after delete/reorder).
func (*TaskListModel) SetSize ¶
func (m *TaskListModel) SetSize(w, h int)
SetSize updates the component dimensions.
func (*TaskListModel) ToggleDetail ¶
func (m *TaskListModel) ToggleDetail()
ToggleDetail toggles the expanded detail panel.
func (TaskListModel) Update ¶
func (m TaskListModel) Update(msg tea.Msg) (TaskListModel, tea.Cmd)
Update handles messages for the task list component.
func (TaskListModel) View ¶
func (m TaskListModel) View() string
View renders the task list component.
type TaskSelectedMsg ¶
type TaskSelectedMsg struct {
Item TaskListItem
}
TaskSelectedMsg is emitted when the selected task changes.
type TaskStatus ¶
type TaskStatus string
TaskStatus mirrors state.TaskStatus without importing state.
const ( StatusPending TaskStatus = "pending" StatusInProgress TaskStatus = "in-progress" StatusDone TaskStatus = "done" StatusFailed TaskStatus = "failed" StatusSkipped TaskStatus = "skipped" StatusCancelled TaskStatus = "cancelled" )