okami.mom/albedo

git clone https://git.nkp.pet/okami.mom/albedo

nekomimi.pettui: ctrl-click a path in the transcript to open it in an editorcc6ab84

main
3.5 KiB180 linesraw
1package tui
2
3import (
4	"albedo/cli/internal/daemon"
5)
6
7type ChatBackToSessionsMsg struct{}
8
9type ChatQuitMsg struct{}
10
11// ChatEditorFinishedMsg is sent after the external editor process exits.
12type ChatEditorFinishedMsg struct {
13	Err        error
14	SessionID  string
15	Text       string
16	Generation int64
17	Edited     bool
18}
19
20// FileOpenResultMsg is sent after attempting to open a file in an external editor.
21type FileOpenResultMsg struct {
22	SessionID string
23	Target    FileTarget
24	Err       error
25}
26
27// ChatOlderLoadedMsg carries a page of history from before what is shown.
28type ChatOlderLoadedMsg struct {
29	Err        error
30	Page       *daemon.HistoryPage
31	SessionID  string
32	Generation int64
33}
34
35type ChatNewSessionMsg struct{}
36
37type ChatOpenModelPickerMsg struct{}
38
39type ChatOpenExtensionPickerMsg struct{}
40
41type ChatOpenTreePickerMsg struct{}
42
43type ChatOpenQuotaMsg struct{}
44
45type ChatOpenContextInspectorMsg struct{}
46
47type ChatOpenPageMsg struct {
48	Command string
49}
50
51type ChatOpenLoginMsg struct {
52	Name string
53}
54
55type ChatExecuteCommandMsg struct {
56	Name string
57	Args string
58}
59
60type ChatStreamEventMsg struct {
61	SessionID  string
62	Event      daemon.StreamEvent
63	Generation int64
64}
65
66// ChatLiveDrawMsg redraws a growing reply whose last tokens waited.
67type ChatLiveDrawMsg struct {
68	SessionID  string
69	Generation int64
70}
71
72type ChatProgressTickMsg struct {
73	SessionID  string
74	Generation int64
75}
76
77type ChatClearCopyStatusMsg struct {
78	SessionID  string
79	Generation int64
80	Revision   uint64
81}
82
83type ChatStatusMsg struct {
84	Err        error
85	Status     *daemon.AgentStatus
86	Glances    []PageGlance
87	SessionID  string
88	Generation int64
89	Revision   uint64
90}
91
92// ChatHostMsg is the probe of the host a remote workspace is on.
93type ChatHostMsg struct {
94	Err        error
95	SessionID  string
96	Workspace  string
97	Status     daemon.HostStatus
98	Generation int64
99}
100
101// ChatWindowMsg carries the context window for the model a usage event named.
102type ChatWindowMsg struct {
103	Err        error
104	Tokens     *int
105	SessionID  string
106	Model      string
107	Generation int64
108}
109
110// ChatCacheFadeMsg arrives when Usage's cached count reaches its next step.
111type ChatCacheFadeMsg struct {
112	Usage      *daemon.Usage
113	SessionID  string
114	Generation int64
115}
116
117type ChatStatusPollMsg struct {
118	SessionID  string
119	Generation int64
120	Poll       uint64
121}
122
123// ChatStreamResultMsg follows all accepted events from the same subscription.
124type ChatStreamResultMsg struct {
125	SessionID  string
126	Generation int64
127	Err        error
128	Recovering bool
129}
130
131type streamDelivery struct {
132	Event      *daemon.StreamEvent
133	Err        error
134	Recovering bool
135}
136
137type ChatStreamClosedMsg struct {
138	SessionID  string
139	Generation int64
140}
141
142type ChatOperationResolvedMsg struct {
143	SessionID  string
144	Generation int64
145	Handle     *daemon.OperationHandle
146	Receipt    daemon.InputReceipt
147	Err        error
148}
149
150type ChatTurnSentMsg struct {
151	Handle          *daemon.OperationHandle
152	OperationID     string
153	Err             error
154	Images          []daemon.ImageAttachment
155	Pastes          []string
156	SessionID       string
157	Prompt          string
158	Generation      int64
159	Continue        bool
160	OK              bool
161	Queued          bool
162	AcceptanceOrder int64
163}
164
165type ChatInterruptMsg struct {
166	Err         error
167	SessionID   string
168	Generation  int64
169	Interrupted bool
170}
171
172// ChatOpenFolderPickerMsg asks for the folder picker; Retry is the turn a
173// missing workspace refused.
174type ChatOpenFolderPickerMsg struct{ Retry *WorkspaceRetry }
175
176type ChatOperationPollMsg struct {
177	SessionID  string
178	Generation int64
179	Handle     *daemon.OperationHandle
180}