actions.go

 1package dialog
 2
 3import (
 4	tea "charm.land/bubbletea/v2"
 5	"github.com/charmbracelet/crush/internal/config"
 6	"github.com/charmbracelet/crush/internal/session"
 7)
 8
 9// ActionClose is a message to close the current dialog.
10type ActionClose struct{}
11
12// ActionQuit is a message to quit the application.
13type ActionQuit = tea.QuitMsg
14
15// ActionOpenDialog is a message to open a dialog.
16type ActionOpenDialog struct {
17	DialogID string
18}
19
20// ActionSelectSession is a message indicating a session has been selected.
21type ActionSelectSession struct {
22	Session session.Session
23}
24
25// ActionSelectModel is a message indicating a model has been selected.
26type ActionSelectModel struct {
27	Model     config.SelectedModel
28	ModelType config.SelectedModelType
29}
30
31// Messages for commands
32type (
33	ActionNewSession        struct{}
34	ActionToggleHelp        struct{}
35	ActionToggleCompactMode struct{}
36	ActionToggleThinking    struct{}
37	ActionExternalEditor    struct{}
38	ActionToggleYoloMode    struct{}
39	ActionSummarize         struct {
40		SessionID string
41	}
42)
43
44// ActionCmd represents an action that carries a [tea.Cmd] to be passed to the
45// Bubble Tea program loop.
46type ActionCmd struct {
47	Cmd tea.Cmd
48}