| 174 | } |
| 175 | |
| 176 | func (m *workspaceModel) createSession(name string) tea.Cmd { |
| 177 | return func() tea.Msg { |
| 178 | res, err := m.client.Session.CreateSession(context.Background(), &api.SessionRequest{ |
| 179 | Name: new(name), |
| 180 | AgentRef: new(m.agentRef), |
| 181 | }) |
| 182 | if err != nil { |
| 183 | return createSessionMsg{session: nil, err: err} |
| 184 | } |
| 185 | return createSessionMsg{session: res.Data, err: nil} |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | func (m *workspaceModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { |
| 190 | // Forward to dialog manager first; if a dialog is open, it captures input |