1package proto
2
3// Session represents a session in the proto layer.
4//
5// IsBusy is computed on read (it is not persisted with the session) and
6// reflects whether an agent run is currently in flight for this session.
7// It is populated by REST handlers in internal/server/proto.go from the
8// workspace's AgentCoordinator. The Session SSE event path does not set
9// it, since SSE consumers can compute presence from other agent signals.
10type Session struct {
11 ID string `json:"id"`
12 ParentSessionID string `json:"parent_session_id"`
13 Title string `json:"title"`
14 MessageCount int64 `json:"message_count"`
15 PromptTokens int64 `json:"prompt_tokens"`
16 CompletionTokens int64 `json:"completion_tokens"`
17 SummaryMessageID string `json:"summary_message_id"`
18 Cost float64 `json:"cost"`
19 Todos []Todo `json:"todos,omitempty"`
20 CreatedAt int64 `json:"created_at"`
21 UpdatedAt int64 `json:"updated_at"`
22 IsBusy bool `json:"is_busy"`
23}
24
25// Todo represents a single todo entry on a session in the proto layer.
26type Todo struct {
27 Content string `json:"content"`
28 Status string `json:"status"`
29 ActiveForm string `json:"active_form"`
30}