Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasIncompleteTodos ¶
HasIncompleteTodos returns true if there are any non-completed todos.
func MarshalTodos ¶
MarshalTodos / UnmarshalTodos helpers used by workspace adapter.
Types ¶
type Service ¶
type Service interface {
pubsub.Subscriber[Session]
Create(ctx context.Context, title string) (Session, error)
CreateTitleSession(ctx context.Context, parentSessionID string) (Session, error)
CreateTaskSession(ctx context.Context, toolCallID, parentSessionID, title string) (Session, error)
Get(ctx context.Context, id string) (Session, error)
GetLast(ctx context.Context) (Session, error)
List(ctx context.Context) ([]Session, error)
Save(ctx context.Context, session Session) (Session, error)
UpdateTitleAndUsage(ctx context.Context, sessionID, title string, promptTokens, completionTokens int64, cost float64) error
Rename(ctx context.Context, id string, title string) error
Delete(ctx context.Context, id string) error
// Agent tool session management
CreateAgentToolSessionID(messageID, toolCallID string) string
ParseAgentToolSessionID(sessionID string) (messageID string, toolCallID string, ok bool)
IsAgentToolSession(sessionID string) bool
}
type Session ¶
type Session struct {
ID string
ParentSessionID string
Title string
MessageCount int64
PromptTokens int64
CompletionTokens int64
EstimatedUsage bool
SummaryMessageID string
Cost float64
Todos []Todo
// Notice is a transient line about the live turn, such as "rate limited (429),
// retrying in 12s". The workspace sets it while the runtime waits and clears it
// when the response resumes; it is never stored.
Notice string
CreatedAt int64
UpdatedAt int64
}
type Todo ¶
type Todo struct {
ID string `json:"id,omitempty"`
Content string `json:"content"`
Description string `json:"description,omitempty"`
Status TodoStatus `json:"status"`
ActiveForm string `json:"active_form"`
Owner string `json:"owner,omitempty"`
}
func UnmarshalTodos ¶
type TodoStatus ¶
type TodoStatus string
const ( TodoStatusPending TodoStatus = "pending" TodoStatusInProgress TodoStatus = "in_progress" TodoStatusCompleted TodoStatus = "completed" )
Click to show internal directories.
Click to hide internal directories.