Documentation
¶
Index ¶
- type ConfigChangedMsg
- type ConfirmActionMsg
- type ConsensusChunkMsg
- type Exchange
- type Model
- func (m Model) Init() tea.Cmd
- func (m Model) SendConsensusChunk(delta string, done bool, err error) tea.Cmd
- func (m Model) SendProviderChunk(name, delta string, done bool, err error) tea.Cmd
- func (m *Model) SetConfig(cfg *config.Config)
- func (m *Model) SetConfigChangeHandler(handler func(*config.Config))
- func (m *Model) SetSubmitHandler(handler func(prompt string))
- func (m *Model) SetTestProviderHandler(handler func(providerName string))
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type ProviderChunkMsg
- type ProviderPanel
- type ProviderStatus
- type QueryDoneMsg
- type QueryStartMsg
- type Styles
- type TestResultMsg
- type TokenUpdateMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigChangedMsg ¶
ConfigChangedMsg is sent when the config has been modified by the settings screens. The app layer handles this by rebuilding the registry and pipeline.
type ConfirmActionMsg ¶
type ConfirmActionMsg struct {
Description string
OnConfirm func()
OnReject func()
}
ConfirmActionMsg asks the user to confirm an action.
type ConsensusChunkMsg ¶
ConsensusChunkMsg delivers a streaming chunk from the consensus synthesis.
type Exchange ¶
type Exchange struct {
Prompt string
ConsensusResponse string
IndividualResponse map[string]string // provider name → response
}
Exchange represents a completed prompt/response pair in history.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the main Bubble Tea model for the polycode TUI.
func (Model) SendConsensusChunk ¶
func (Model) SendProviderChunk ¶
func (*Model) SetConfig ¶
SetConfig sets the config reference on the model so settings screens can perform CRUD operations.
func (*Model) SetConfigChangeHandler ¶
SetConfigChangeHandler sets the callback invoked when the config changes from the settings screen (add/edit/delete provider). The app layer uses this to rebuild the registry and pipeline.
func (*Model) SetSubmitHandler ¶
SetSubmitHandler sets the callback for when the user submits a prompt.
func (*Model) SetTestProviderHandler ¶
SetTestProviderHandler sets the callback invoked when the user presses 't' in the settings screen to test a provider connection.
type ProviderChunkMsg ¶
ProviderChunkMsg delivers a streaming chunk from a provider.
type ProviderPanel ¶
type ProviderPanel struct {
Name string
IsPrimary bool
Status ProviderStatus
Content strings.Builder
Viewport viewport.Model
}
ProviderPanel holds the state for one provider's response panel.
type ProviderStatus ¶
type ProviderStatus int
ProviderStatus tracks the state of a single provider's response.
const ( StatusIdle ProviderStatus = iota StatusLoading StatusDone StatusFailed StatusTimedOut )
type QueryDoneMsg ¶
type QueryDoneMsg struct{}
QueryDoneMsg signals that the full pipeline (fan-out + consensus) is complete.
type Styles ¶
type Styles struct {
App lipgloss.Style
StatusBar lipgloss.Style
StatusHealthy lipgloss.Style
StatusUnhealthy lipgloss.Style
StatusPrimary lipgloss.Style
PanelBorder lipgloss.Style
ConsensusBorder lipgloss.Style
InputBorder lipgloss.Style
Title lipgloss.Style
Prompt lipgloss.Style
Dimmed lipgloss.Style
}
Styles holds all lipgloss styles for the TUI.
type TestResultMsg ¶
TestResultMsg is sent when a provider connection test completes.
type TokenUpdateMsg ¶
type TokenUpdateMsg struct {
Usage []tokens.ProviderUsage
}
TokenUpdateMsg delivers a snapshot of token usage for all providers.