Versions in this module Expand all Collapse all v0 v0.0.4 Nov 26, 2026 Changes in this version + var ErrBlobNotFound = journal.ErrBlobNotFound + var ErrCapabilityMismatch = errors.New("session: model lacks required session capabilities") + var ErrEmptyMessage = errors.New("session: message content must not be empty") + var ErrEmptySessionID = errors.New("session: session ID must not be empty") + var ErrEntryNotFound = journal.ErrEntryNotFound + var ErrInvalidConfig = errors.New("session: invalid configuration") + var ErrInvalidDecision = errors.New("session: invalid permission decision") + var ErrInvalidPlanReview = errors.New("session: invalid plan review decision") + var ErrInvalidQuestion = errors.New("session: invalid question response") + var ErrInvalidSessionID = errors.New("session: session ID must be a canonical lowercase UUIDv7") + var ErrJournalNotFound = journal.ErrNotFound + var ErrNilMessage = errors.New("session: message must not be nil") + var ErrNoPendingPermissions = errors.New("session: no pending permissions") + var ErrNoPendingPlanReviews = errors.New("session: no pending plan reviews") + var ErrNoPendingQuestions = errors.New("session: no pending questions") + var ErrPermissionNotFound = errors.New("session: permission request not found") + var ErrPlanReviewNotFound = errors.New("session: plan review request not found") + var ErrQuestionNotFound = errors.New("session: question request not found") + var ErrRevertConflict = journal.ErrRevertConflict + var ErrSessionConflict = errors.New("session: session already exists with different parameters") + var ErrSessionNotFound = errors.New("session: session not found") + var ErrSessionRunning = errors.New("session: session already has an active turn") + var ErrUnknownCommand = errors.New("session: unknown slash command") + func FromAPIBlock(b api.Block) (message.Block, bool) + func Migrate(ctx context.Context, db *sql.DB) error + func Preview(ctx context.Context, ws *workspace.Workspace, catalog *models.Catalog, ...) (api.SessionConfig, models.Model, []api.SessionDiagnostic, bool, error) + func SessionDir(workspaceRoot, sessionID string) (string, error) + func ToAPIBlock(b message.Block) (api.Block, bool) + func ToAPIMessage(msg message.Message) (*api.Message, error) + func ToAPIQuestionResponse(r api.QuestionResponse, questions []api.Question) api.QuestionResponse + func ToAPISession(sess *Session) api.Session + func ToAPITimelineEntry(entry timeline.Entry) (api.TimelineEntry, error) + type CapabilityMismatchError struct + MissingModalities []string + Model string + func (e *CapabilityMismatchError) Error() string + func (e *CapabilityMismatchError) Unwrap() error + type Config struct + Catalog func() *models.Catalog + CommandDelegated bool + Context context.Context + DB *sql.DB + Gateway func() gateway.Gateway + ID string + InitialPermissions api.Permissions + Logger log.Interface + MCPCaller func() tools.MCPCaller + Metrics metrics.Service + OnUpdate func(ctx context.Context, s *Session) error + Parent *Session + ParentID string + Permissions permissions.Manager + Publisher Publisher + ReloadLock *sync.RWMutex + SandboxSettings sandboxcfg.Manager + Session api.SessionConfig + Title string + WaitGroup *sync.WaitGroup + WorkDir string + Workspace *workspace.Workspace + func (c Config) Validate() error + type LatestFilter struct + IncludeEmptyWorkDir bool + WorkDir string + type ListFilter struct + ParentID *string + type Publisher interface + DeleteTopic func(topic string) + Publish func(topic string, event broker.Event) + type Session struct + Config api.SessionConfig + CreatedAt time.Time + Diagnostics []api.SessionDiagnostic + FileIndex *std.FileIndex + ForkedFrom string + Harness harness.Harness + ID string + Journal journal.Journal + ParentID string + PermManager permissions.SessionManager + Permissions api.Permissions + Root string + Sandbox sandbox.Sandbox + Std *std.Std + Tasks tasks.Store + Timeline timeline.Timeline + Title string + Tools tools.Container + UpdatedAt time.Time + WorkDir string + func New(ctx context.Context, cfg Config) (*Session, error) + func Open(ctx context.Context, dbSess *Session, cfg Config) (*Session, error) + func (s *Session) AddChild(child *Session) + func (s *Session) Cancel(ctx context.Context) error + func (s *Session) CheckpointTo(ctx context.Context, store Store) error + func (s *Session) Child(id string) (*Session, bool) + func (s *Session) Children() []*Session + func (s *Session) Clone() *Session + func (s *Session) Close() error + func (s *Session) CurrentMode() api.PermissionMode + func (s *Session) Enqueue(msg message.Message) + func (s *Session) EnterPlanMode(ctx context.Context) (bool, string, error) + func (s *Session) ExitPlanMode(ctx context.Context, _ string, nextMode api.PermissionMode) (api.PermissionMode, error) + func (s *Session) Fork(ctx context.Context, title string) (*Session, error) + func (s *Session) GetFileIndex() (*std.FileIndex, error) + func (s *Session) HasItems() bool + func (s *Session) HasLeadingCommand() bool + func (s *Session) InvokeSubagent(ctx context.Context, in api.InvokeAgentInput) (api.InvokeAgentOutput, error) + func (s *Session) IsClosing() bool + func (s *Session) IsCommandDelegated() bool + func (s *Session) ManageSubagents(ctx context.Context, in api.ManageAgentsInput) (api.ManageAgentsOutput, error) + func (s *Session) Matches(req api.CreateSessionRequest) error + func (s *Session) Parent() *Session + func (s *Session) PlansDir() string + func (s *Session) PopCommand() (id, command string, ok bool) + func (s *Session) PopMessages() []message.Message + func (s *Session) Refresh(ctx context.Context) + func (s *Session) RemoveChild(id string) + func (s *Session) ResolvedModel() (models.Model, *api.ThinkingSetting, bool) + func (s *Session) Send(ctx context.Context, req api.SendRequest) error + func (s *Session) SetParent(parent *Session) + func (s *Session) Update(ctx context.Context, req api.UpdateSessionRequest) error + func (s *Session) UploadMedia(ctx context.Context, mimeType, filename string, data []byte) (*api.Media, error) + func (s *Session) VisibleQueue() []api.QueueItem + func (s *Session) Wait(ctx context.Context) error + func (s *Session) Workspace() *workspace.Workspace + type State struct + Activity string + Context api.ContextState + Error string + FinishedAt time.Time + PendingPermissions []api.PermissionRequest + PendingPlanReviews []api.PlanReviewRequest + PendingQuestions []api.QuestionRequest + Running bool + StartedAt time.Time + Status api.SessionStatus + Tasks []api.Task + Todos []api.TodoItem + func NewState() *State + func (s *State) Clone() *State + type Store interface + Delete func(ctx context.Context, id string) error + Get func(ctx context.Context, id string) (*Session, error) + Latest func(ctx context.Context, filter LatestFilter) (*Session, error) + List func(ctx context.Context, filter ListFilter) ([]*Session, error) + Save func(ctx context.Context, sess *Session) error + func NewStore(ctx context.Context, db *sql.DB) (Store, error)