{"modulePath":"github.com/OpenSIN-Code/SIN-Code-Bundle","version":"v1.9.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package tui\n\nSPDX-License-Identifier: MIT Purpose: TUI-side adapter for the chat.Input widget. Avoids the \\`\\*chat.Input\\` direct dep in model.go by wrapping it in a local type.\n\nSPDX-License-Identifier: MIT Purpose: render the chat view in the TUI center panel. Shows recent history at the top, chat input at the bottom.\n\nSPDX-License-Identifier: MIT Purpose: Notification banner rendering + keybindings (o=open, d=dismiss, n=next).\n\nSPDX-License-Identifier: MIT Purpose: glue between TUI and the notifications package — converts notification types to the TeaMsg types defined in messages.go.\n\nSPDX-License-Identifier: MIT Purpose: Todos view — list todos with priority badges, live counts.\n\n## Variables\n\n```go\nvar AgentNames = []string{\"Build\", \"Audit\", \"Stats\"}\n```\n\n```go\nvar Themes = []Theme{\n\t{\n\t\tName:       \"default\",\n\t\tAccent:     \"#7D56F4\",\n\t\tAccentDim:  \"#5E40BF\",\n\t\tText:       \"#FFFFFF\",\n\t\tTextDim:    \"#808080\",\n\t\tBackground: \"#1E1E2E\",\n\t\tBorder:     \"#7D56F4\",\n\t\tSuccess:    \"#50FA7B\",\n\t\tWarn:       \"#F1FA8C\",\n\t\tError:      \"#FF5555\",\n\t},\n\t{\n\t\tName:       \"Dracula\",\n\t\tAccent:     \"#FF79C6\",\n\t\tAccentDim:  \"#BD93F9\",\n\t\tText:       \"#F8F8F2\",\n\t\tTextDim:    \"#6272A4\",\n\t\tBackground: \"#282A36\",\n\t\tBorder:     \"#FF79C6\",\n\t\tSuccess:    \"#50FA7B\",\n\t\tWarn:       \"#F1FA8C\",\n\t\tError:      \"#FF5555\",\n\t},\n\t{\n\t\tName:       \"Nord\",\n\t\tAccent:     \"#88C0D0\",\n\t\tAccentDim:  \"#5E81AC\",\n\t\tText:       \"#ECEFF4\",\n\t\tTextDim:    \"#4C566A\",\n\t\tBackground: \"#2E3440\",\n\t\tBorder:     \"#88C0D0\",\n\t\tSuccess:    \"#A3BE8C\",\n\t\tWarn:       \"#EBCB8B\",\n\t\tError:      \"#BF616A\",\n\t},\n\t{\n\t\tName:       \"Solarized\",\n\t\tAccent:     \"#B58900\",\n\t\tAccentDim:  \"#CB4B16\",\n\t\tText:       \"#FDF6E3\",\n\t\tTextDim:    \"#93A1A1\",\n\t\tBackground: \"#002B36\",\n\t\tBorder:     \"#B58900\",\n\t\tSuccess:    \"#859900\",\n\t\tWarn:       \"#B58900\",\n\t\tError:      \"#DC322F\",\n\t},\n\t{\n\t\tName:       \"Monokai\",\n\t\tAccent:     \"#A6E22E\",\n\t\tAccentDim:  \"#66D9EF\",\n\t\tText:       \"#F8F8F2\",\n\t\tTextDim:    \"#75715E\",\n\t\tBackground: \"#272822\",\n\t\tBorder:     \"#A6E22E\",\n\t\tSuccess:    \"#A6E22E\",\n\t\tWarn:       \"#E6DB74\",\n\t\tError:      \"#F92672\",\n\t},\n}\n```\n\n## Functions\n\n```go\nfunc BannerDismissCmd(id string) tea.Cmd\n```\n\n```go\nfunc BannerOpenCmd(id string) tea.Cmd\n```\n\n```go\nfunc ComposeLayout(tabs Tabs, sidebar Sidebar, view ViewKind, content string, right string, footer Footer, styles Styles, width, height int) string\n```\n\n```go\nfunc ListenForNotifications() tea.Cmd\n```\nListenForNotifications returns a tea.Cmd that blocks on the notifications broadcaster channel and emits a NotificationMsg when one arrives. Re-subscribe from Update after each NotificationMsg to keep listening.\n\n```go\nfunc RefreshTodosCmd() tea.Cmd\n```\nRefreshTodosCmd returns a tea.Cmd that re-counts todos.\n\n```go\nfunc RenderCommandPalette(items []string, sel int, query string, styles Styles, width, height int) string\n```\n\n```go\nfunc RenderConfigView(entries []ConfigEntry, selected int, styles Styles, width, height int) string\n```\n\n```go\nfunc RenderEFMView(stacks []EFMStack, styles Styles, width, height int, spinner Spinner) string\n```\n\n```go\nfunc RenderHistoryView(entries []HistoryEntry, selected int, styles Styles, width, height int) string\n```\n\n```go\nfunc RenderRightPanel(sel *ToolSubItem, view ViewKind, styles Styles, width, height int) string\n```\n\n```go\nfunc RenderSessionsView(styles Styles, tabs Tabs, width, height int) string\n```\n\n```go\nfunc RenderSubagentsPopup(styles Styles, width, height int) string\n```\n\n```go\nfunc RenderToolsView(sidebar Sidebar, styles Styles, width, height int) string\n```\n\n## Types\n\n```go\ntype AgentCycleMsg struct {\n\tIndex int\n}\n```\n\n```go\ntype ArgInputState struct {\n\tOpen  bool\n\tCmd   string\n\tValue string\n\tInput textinput.Model\n}\n```\n\n```go\ntype BannerKeyMsg struct {\n\tAction string\n}\n```\n\n```go\ntype ConfigEntry struct {\n\tKey   string\n\tValue string\n\tHint  string\n\tKind  string\n}\n```\n\n```go\nfunc DefaultConfigEntries() []ConfigEntry\n```\n\n```go\ntype CountsMsg struct {\n\tOpen    int\n\tBlocked int\n\tOverdue int\n\tReady   int\n}\n```\nCountsMsg is fired when todo counts are recomputed (open/blocked/overdue).\n\n```go\ntype EFMRefreshMsg struct {\n\tStacks []EFMStack\n}\n```\n\n```go\ntype EFMStack struct {\n\tName      string\n\tStatus    string\n\tURL       string\n\tCreatedAt time.Time\n\tTTL       int\n}\n```\n\n```go\ntype Footer struct {\n\tSelection   string\n\tAgentIndex  int\n\tTokens      int\n\tTokensPct   float64\n\tCost        string\n\tWidth       int\n\tShowHints   bool\n\tHintKeys    []HintPair\n\tLoading     bool\n\tSpinner     Spinner\n\tTodoOpen    int\n\tTodoBlocked int\n\tTodoOverdue int\n\tTodoReady   int\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewFooter(width int) Footer\n```\n\n```go\nfunc (f *Footer) AgentName() string\n```\n\n```go\nfunc (f *Footer) CycleAgent()\n```\n\n```go\nfunc (f Footer) ProgressBar(width int) string\n```\n\n```go\nfunc (f Footer) Render(styles Styles) string\n```\n\n```go\nfunc (f *Footer) SetView(v ViewKind)\n```\n\n```go\nfunc (f *Footer) View() ViewKind\n```\n\n```go\ntype HintPair struct {\n\tKey   string\n\tLabel string\n}\n```\n\n```go\nfunc DefaultHints(view ViewKind) []HintPair\n```\n\n```go\ntype HistoryAppendMsg struct {\n\tEntry HistoryEntry\n}\n```\n\n```go\ntype HistoryEntry struct {\n\tTime    time.Time\n\tView    string\n\tAction  string\n\tDetail  string\n\tSuccess bool\n}\n```\n\n```go\ntype InterruptMsg struct{}\n```\n\n```go\ntype Mode int\n```\n\n```go\nconst (\n\tModeNormal Mode = iota\n\tModePalette\n\tModeSubagents\n\tModeArgInput\n)\n```\n\n```go\ntype Model struct {\n\tWidth    int\n\tHeight   int\n\tThemeIdx int\n\tViewKind ViewKind\n\tMode     Mode\n\tQuitting bool\n\tReady    bool\n\tLoading  bool\n\n\tTabs       Tabs\n\tSidebar    Sidebar\n\tFooter     Footer\n\tSpinner    Spinner\n\tStyles     Styles\n\tRightPanel bool\n\n\tPalette   PaletteState\n\tArgInput  ArgInputState\n\tHistory   []HistoryEntry\n\tEFMStks   []EFMStack\n\tConfig    []ConfigEntry\n\tConfigSel int\n\n\tToolList  list.Model\n\tToolItems []list.Item\n\n\tTodoItems []TodoRow\n\tTodoSel   int\n\n\tNotificationBanner *NotificationItem\n\tNotifications      []NotificationItem\n\n\tChatInput   *chatInput\n\tChatHistory []string\n\n\tOnRun func(name string, args []string) error\n}\n```\n\n```go\nfunc NewModel() *Model\n```\n\n```go\nfunc (m *Model) AppendHistory(view, action, detail string, ok bool)\n```\n\n```go\nfunc (m *Model) ApplyTheme()\n```\n\n```go\nfunc (m *Model) BannerNext()\n```\n\n```go\nfunc (m *Model) CloseArgInput()\n```\n\n```go\nfunc (m *Model) ClosePalette()\n```\n\n```go\nfunc (m *Model) CloseSubagents()\n```\n\n```go\nfunc (m *Model) CycleTheme()\n```\n\n```go\nfunc (m *Model) DismissBanner()\n```\n\n```go\nfunc (m *Model) Init() tea.Cmd\n```\n\n```go\nfunc (m *Model) NextView()\n```\n\n```go\nfunc (m *Model) OpenArgInput(cmd string)\n```\n\n```go\nfunc (m *Model) OpenPalette()\n```\n\n```go\nfunc (m *Model) OpenSubagents()\n```\n\n```go\nfunc (m *Model) PrevView()\n```\n\n```go\nfunc (m *Model) PreviousView()\n```\n\n```go\nfunc (m *Model) RenderBanner(styles Styles, width int) string\n```\n\n```go\nfunc (m *Model) RenderTodos(styles Styles, width, height int) string\n```\n\n```go\nfunc (m *Model) RunSelected()\n```\n\n```go\nfunc (m *Model) SetBanner(n *NotificationItem)\n```\n\n```go\nfunc (m *Model) SwitchView(v ViewKind)\n```\n\n```go\nfunc (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)\n```\n\n```go\nfunc (m *Model) View() string\n```\n\n```go\ntype NotificationItem struct {\n\tID        string\n\tTitle     string\n\tMessage   string\n\tType      string\n\tDismissed bool\n}\n```\n\n```go\nfunc (n NotificationItem) GetID() string\n```\n\n```go\nfunc (n NotificationItem) GetMessage() string\n```\n\n```go\nfunc (n NotificationItem) GetTitle() string\n```\n\n```go\nfunc (n NotificationItem) GetType() string\n```\n\n```go\ntype NotificationMsg struct {\n\tN NotificationSource\n}\n```\nNotificationMsg is fired when the TUI receives a new notification from the sin-code notifications broadcaster.\n\n```go\ntype NotificationSource interface {\n\tGetID() string\n\tGetTitle() string\n\tGetMessage() string\n\tGetType() string\n}\n```\nNotificationSource is the interface used by NotificationMsg to access notification fields. Implemented by \\*notifications.Notification and by test doubles in todos\\_view\\_test.go.\n\n```go\ntype PaletteOpenMsg struct {\n\tOpen bool\n}\n```\n\n```go\ntype PaletteState struct {\n\tOpen   bool\n\tQuery  string\n\tItems  []string\n\tFilter []string\n\tSel    int\n}\n```\n\n```go\ntype Session struct {\n\tName   string\n\tActive bool\n\tDirty  bool\n}\n```\n\n```go\ntype SessionAddMsg struct {\n\tName string\n}\n```\n\n```go\ntype SessionCloseMsg struct {\n\tIndex int\n}\n```\n\n```go\ntype SessionSelectMsg struct {\n\tIndex int\n}\n```\n\n```go\ntype Sidebar struct {\n\tItems        []SidebarItem\n\tSelected     int\n\tWidth        int\n\tCollapsed    bool\n\tToolSubItems []ToolSubItem\n\tToolSel      int\n\n\tTodoOpen    int\n\tTodoBlocked int\n\tTodoOverdue int\n\tTodoReady   int\n}\n```\n\n```go\nfunc NewSidebar() Sidebar\n```\n\n```go\nfunc (s *Sidebar) MoveDown()\n```\n\n```go\nfunc (s *Sidebar) MoveUp()\n```\n\n```go\nfunc (s *Sidebar) SelectedTool() *ToolSubItem\n```\n\n```go\nfunc (s *Sidebar) SelectedView() ViewKind\n```\n\n```go\nfunc (s *Sidebar) SetSelectedView(v ViewKind)\n```\n\n```go\nfunc (s *Sidebar) Toggle()\n```\n\n```go\nfunc (s *Sidebar) ToolMoveDown()\n```\n\n```go\nfunc (s *Sidebar) ToolMoveUp()\n```\n\n```go\nfunc (s Sidebar) View(styles Styles) string\n```\n\n```go\ntype SidebarItem struct {\n\tView     ViewKind\n\tIcon     string\n\tLabel    string\n\tShortcut string\n}\n```\n\n```go\nfunc DefaultSidebarItems() []SidebarItem\n```\n\n```go\ntype SidebarToggleMsg struct{}\n```\n\n```go\ntype Spinner struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSpinner() Spinner\n```\n\n```go\nfunc (s Spinner) Frame() int\n```\n\n```go\nfunc (s Spinner) Init() tea.Cmd\n```\n\n```go\nfunc (s Spinner) Update(msg tea.Msg) (Spinner, tea.Cmd)\n```\n\n```go\nfunc (s Spinner) View(style lipgloss.Style) string\n```\n\n```go\nfunc (s Spinner) ViewPlain() string\n```\n\n```go\ntype SpinnerTickMsg time.Time\n```\n\n```go\ntype Styles struct {\n\tTheme Theme\n\n\tHeader     lipgloss.Style\n\tTabActive  lipgloss.Style\n\tTabIdle    lipgloss.Style\n\tTabAdd     lipgloss.Style\n\tSidebar    lipgloss.Style\n\tSidebarSel lipgloss.Style\n\tSidebarHdr lipgloss.Style\n\tContent    lipgloss.Style\n\tContentHdr lipgloss.Style\n\tFooter     lipgloss.Style\n\tFooterKey  lipgloss.Style\n\tFooterVal  lipgloss.Style\n\tPopup      lipgloss.Style\n\tPopupItem  lipgloss.Style\n\tPopupSel   lipgloss.Style\n\tSpinner    lipgloss.Style\n\tProgress   lipgloss.Style\n\tStatusOK   lipgloss.Style\n\tStatusWarn lipgloss.Style\n\tStatusErr  lipgloss.Style\n\tHint       lipgloss.Style\n\tAccentText lipgloss.Style\n\tBold       lipgloss.Style\n\tMuted      lipgloss.Style\n}\n```\n\n```go\nfunc NewStyles(theme Theme) Styles\n```\n\n```go\nfunc (s Styles) Accent() lipgloss.TerminalColor\n```\n\n```go\nfunc (s Styles) BorderColor() lipgloss.TerminalColor\n```\n\n```go\nfunc (s Styles) Text() lipgloss.TerminalColor\n```\n\n```go\nfunc (s Styles) TextDim() lipgloss.TerminalColor\n```\n\n```go\ntype SubagentsOpenMsg struct {\n\tOpen bool\n}\n```\n\n```go\ntype Tabs struct {\n\tSessions   []Session\n\tActiveIdx  int\n\tMaxVisible int\n\tWidth      int\n}\n```\n\n```go\nfunc NewTabs() Tabs\n```\n\n```go\nfunc (t Tabs) Active() Session\n```\n\n```go\nfunc (t *Tabs) Add(name string)\n```\n\n```go\nfunc (t *Tabs) Close(idx int)\n```\n\n```go\nfunc (t *Tabs) Next()\n```\n\n```go\nfunc (t *Tabs) Prev()\n```\n\n```go\nfunc (t *Tabs) Select(idx int)\n```\n\n```go\nfunc (t Tabs) View(s Styles) string\n```\n\n```go\ntype Theme struct {\n\tName       string\n\tAccent     string\n\tAccentDim  string\n\tText       string\n\tTextDim    string\n\tBackground string\n\tBorder     string\n\tSuccess    string\n\tWarn       string\n\tError      string\n}\n```\n\n```go\ntype ThemeChangedMsg struct {\n\tIndex int\n}\n```\n\n```go\ntype TodoRow struct {\n\tID       string\n\tTitle    string\n\tPriority string\n\tStatus   string\n\tType     string\n\tAssignee string\n}\n```\nTodoRow is a lightweight struct for displaying todos in the TUI.\n\n```go\ntype TodosLoadedMsg struct {\n\tItems []TodoRow\n}\n```\nTodosLoadedMsg is fired when the todo list is reloaded.\n\n```go\ntype ToolRunMsg struct {\n\tName string\n\tArgs []string\n}\n```\n\n```go\ntype ToolSubItem struct {\n\tName        string\n\tDescription string\n\tRunnable    bool\n}\n```\n\n```go\nfunc DefaultToolSubItems() []ToolSubItem\n```\n\n```go\ntype ViewKind int\n```\n\n```go\nconst (\n\tViewTools ViewKind = iota\n\tViewSessions\n\tViewEFM\n\tViewConfig\n\tViewHistory\n\tViewTodos\n\tViewChat\n)\n```\n\n```go\nfunc (v ViewKind) Short() string\n```\n\n```go\nfunc (v ViewKind) String() string\n```\n\n```go\ntype ViewSwitchMsg struct {\n\tView ViewKind\n}\n```\n\n","path":"github.com/OpenSIN-Code/SIN-Code-Bundle/cmd/sin-code/tui","name":"tui","synopsis":"SPDX-License-Identifier: MIT Purpose: TUI-side adapter for the chat.Input widget.","isRedistributable":true}
