backend

package
v0.2.85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 71 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	GoalStatusActive          = "active"
	GoalStatusProgress        = "progress"
	GoalStatusComplete        = "complete"
	GoalStatusBlocked         = "blocked"
	GoalStatusStopped         = "stopped"
	GoalStatusBudgetExhausted = "budget_exhausted"
)

Variables

View Source
var (
	ErrInvalidRevertMessage = errors.New("invalid revert message ID")
	ErrRevertMessageGone    = errors.New("revert message is no longer in the session")
)
View Source
var (
	ErrNotChat     = errors.New("only Web chats and Slack threads can be deleted")
	ErrSessionBusy = errors.New("this session has a running turn, queued or stashed work, a Background Job, or a scheduled message; stop or clear it first")
)
View Source
var ErrRestartRequested = errors.New("restart requested")
View Source
var ErrSpaceRejected = errors.New("another space has that name, pages left under that name share a path with this space's, or it is the last space")
View Source
var ErrTagNotAllowed = errors.New("the session's agent does not allow this tag")

Functions

func AddOpenCodeSessionBridge added in v0.2.44

func AddOpenCodeSessionBridge(ctx context.Context, cfg *config.LockedConfig, name, session string) error

func DecideOrigin added in v0.1.27

func DecideOrigin(facts *ChatOriginFacts) (origin any, text string)

func ExternalMCPAgentsIn

func ExternalMCPAgentsIn(cfg *config.LockedConfig, runtimeDir string) ([]string, error)

func GenerateOneShot added in v0.2.63

func GenerateOneShot(ctx context.Context, locked *config.LockedConfig, agent, instructions, transcript string) (reply string, err error)

func GenerateTitle added in v0.2.44

func GenerateTitle(ctx context.Context, cfg *config.Config, request, recent string) (string, error)

func LoadRuntimeAgents added in v0.2.58

func LoadRuntimeAgents(cfg *config.LockedConfig, runtimeDir string) (agents harness.Agents, err error)

func LoadRuntimeDefinitions

func LoadRuntimeDefinitions(cfg *config.LockedConfig, runtimeDir string) (harness.Agents, harness.Skills, error)

func PromptPrincipal added in v0.1.40

func PromptPrincipal(header string) string

func ReplayInputMessageRoleText added in v0.1.0

func ReplayInputMessageRoleText(item *responses.ResponseInputItemUnionParam, raw json.RawMessage) (role, text string, ok bool, err error)

func RoutineStem added in v0.2.77

func RoutineStem(path string) string

func Run

func Run(ctx context.Context, cfg *config.Config, pool *pgxpool.Pool, logger *slog.Logger, logLevel *slog.LevelVar, assemble FrontendAssembler, sandboxes sandboxPreparer) error

func SetLogLevel added in v0.2.41

func SetLogLevel(level *slog.LevelVar, text string)

func TabConversation added in v0.2.9

func TabConversation(path string) string

func TestDecisionModel added in v0.2.70

func TestDecisionModel(ctx context.Context, cfg *config.Config, ref string) (time.Duration, error)

func TestModel added in v0.2.41

func TestModel(ctx context.Context, cfg *config.Config, ref string) (time.Duration, error)

func UploadDir added in v0.2.77

func UploadDir(cfg *config.Config, conversationID string) string

func WithWebPromptAcceptance added in v0.2.72

func WithWebPromptAcceptance(ctx context.Context, acceptance webPromptAcceptance) context.Context

Types

type Attention added in v0.2.31

type Attention struct {
	Path          string
	UnreadAt      time.Time
	Quiet, Parked bool
	Unfollowed    bool
	Until         time.Time
	UntilDone     bool
	Note          string
}

type AttentionAction added in v0.2.31

type AttentionAction string
const (
	AttentionRead          AttentionAction = "read"
	AttentionUnread        AttentionAction = "unread"
	AttentionPark          AttentionAction = "park"
	AttentionParkUntilDone AttentionAction = "park_done"
	AttentionUnpark        AttentionAction = "unpark"
	AttentionAutoPark      AttentionAction = "auto_park"
	AttentionNoAutoPark    AttentionAction = "no_auto_park"
	AttentionFollow        AttentionAction = "follow"
	AttentionUnfollow      AttentionAction = "unfollow"
	AttentionSent          AttentionAction = "sent"
)

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

func NewConversation

func NewConversation(cfg *config.LockedConfig, publisher protocol.OutboundPublisher, bridgeCfg *Config, logger *slog.Logger) *Bridge

func (*Bridge) AppendChildEntry added in v0.1.44

func (b *Bridge) AppendChildEntry(ctx context.Context, key harness.ChildKey, entry *harness.SessionEntry) error

func (*Bridge) AwaitSubagent added in v0.1.44

func (b *Bridge) AwaitSubagent(ctx context.Context, key, callKey string) (string, harness.ReplayAttribution, error)

func (*Bridge) ContinueGoal added in v0.2.79

func (b *Bridge) ContinueGoal(ctx context.Context, reply *protocol.SlackReplyTarget, completion *turnCompletion) (bool, error)

func (*Bridge) Drain added in v0.1.33

func (b *Bridge) Drain(ctx context.Context, responseID string, phase harness.TurnPhase, applied []string) ([]harness.PromptInput, error)

func (*Bridge) InterruptActiveTurn

func (b *Bridge) InterruptActiveTurn() *protocol.InboundMessage

func (*Bridge) PickLaterWork

func (b *Bridge) PickLaterWork(ctx context.Context) error

func (*Bridge) ResetScheduledMessages

func (b *Bridge) ResetScheduledMessages(origin *protocol.InboundMessage) error

func (*Bridge) Run added in v0.1.14

func (b *Bridge) Run(ctx context.Context) error

func (*Bridge) ScheduleMessage

func (b *Bridge) ScheduleMessage(origin *protocol.InboundMessage, delay time.Duration, message string, recurring bool) error

func (*Bridge) Stop

func (b *Bridge) Stop()

func (*Bridge) Submit

func (b *Bridge) Submit(ctx context.Context, msg *protocol.InboundMessage) error

func (*Bridge) SwitchAgent

func (b *Bridge) SwitchAgent(agent string)

func (*Bridge) WriteSubagent added in v0.1.44

func (b *Bridge) WriteSubagent(ctx context.Context, write *harness.SubagentWrite) (bool, error)

type ChatOriginFacts added in v0.1.14

type ChatOriginFacts struct {
	ConversationID         string
	CreatedBy              ThreadCreator
	ExternalConversationID string
	Binding                ExternalMCPSessionState
	CreatingSource         string
	ProducerAgent          string
	Run                    *protocol.RoutineRun
}

type Config

type Config struct {
	ConversationID, Agent string
	RequestRestart        runtimeRestarter
	RequestReload         runtimeReloader
	UserQuestionAsker     protocol.UserQuestionAsker
	SessionService        *SessionService
	Secrets               config.SecretFetcher
}

type ConversationKind added in v0.2.0

type ConversationKind string
const (
	KindWebChat          ConversationKind = "web_chat"
	KindSlackThread      ConversationKind = "slack_thread"
	KindRoutineRun       ConversationKind = "routine_run"
	KindOneOffRoutineRun ConversationKind = "one_off_routine_run"
	KindExternalMCPRun   ConversationKind = "external_mcp_run"
	KindSubagent         ConversationKind = "subagent"
	KindReview           ConversationKind = "review"
	KindShadow           ConversationKind = "shadow"
	KindRemote           ConversationKind = "remote"
)

type Delegation added in v0.2.0

type Delegation struct {
	ID, Parent, CallID string
	Kind               ConversationKind
}

type ExternalMCPSessionState

type ExternalMCPSessionState struct {
	Agent                 string            `json:"agent,omitempty"`
	PrivateConversationID string            `json:"private_conversation_id,omitempty"`
	ManagedConversationID string            `json:"managed_conversation_id,omitempty"`
	OriginPairs           map[string]string `json:"origin_pairs,omitempty"`
}

type FrontendAssembler added in v0.1.0

type FrontendAssembler interface {
	Gate(context.Context, *config.Config, *slog.Logger) (func() error, error)
	Assemble(*Runtime) (<-chan struct{}, []func(context.Context) error, error)
}

type GoalCheckResult added in v0.2.79

type GoalCheckResult string
const (
	GoalCheckPassed GoalCheckResult = "passed"
	GoalCheckFailed GoalCheckResult = "failed"
)

type GoalEvent added in v0.2.79

type GoalEvent struct {
	ID          int64
	Kind        GoalEventKind
	Turn        int
	Status      string
	Note        string
	Check       GoalCheckResult
	CheckOutput string
	EntryID     int64
	Principal   string
	At          time.Time
}

type GoalEventKind added in v0.2.79

type GoalEventKind string
const (
	GoalEventUpdate GoalEventKind = "update"
	GoalEventTurn   GoalEventKind = "turn"
)

type GoalState

type GoalState struct {
	Objective      string    `json:"objective,omitempty"`
	MaxTurns       int       `json:"max_turns,omitempty"`
	TurnsUsed      int       `json:"turns_used,omitempty"`
	Status         string    `json:"status,omitempty"`
	Note           string    `json:"note,omitempty"`
	CreatedAt      time.Time `json:"created_at,omitzero"`
	UpdatedAt      time.Time `json:"updated_at,omitzero"`
	PrincipalName  string    `json:"principal_name,omitempty"`
	PrincipalEmail string    `json:"principal_email,omitempty"`
	Origin         string    `json:"origin,omitempty"`
	Check          string    `json:"check,omitempty"`
	Force          bool      `json:"force,omitempty"`
}

type HistoryInventory added in v0.1.17

type HistoryInventory struct {
	ConversationID string            `json:"conversation_id"`
	Source         string            `json:"source"`
	Entries        map[string]string `json:"entries"`
	From           int64             `json:"from,omitempty"`
	Oldest         int64             `json:"oldest,omitempty"`
	Marker         string            `json:"revert_message_id,omitempty"`
	Shadows        string            `json:"shadows,omitempty"`
}

type HistorySnapshot added in v0.1.17

type HistorySnapshot struct {
	Inventory   HistoryInventory
	Entries     []ObservedSessionEntry
	Delegations []Delegation
	Lineage     []SidebarSession
	Shadows     []protocol.ShadowBinding
	Eligible    bool
	Predecessor string
	Floor       string
	Reset       bool
}

type KeyedConversationLocks

type KeyedConversationLocks struct {
	// contains filtered or unexported fields
}

func NewKeyedConversationLocks

func NewKeyedConversationLocks() *KeyedConversationLocks

func (*KeyedConversationLocks) Lock

func (l *KeyedConversationLocks) Lock(key string) func()

type ListTab added in v0.2.74

type ListTab struct {
	List                TabList
	Server, Path, Space string
}

type MessageSearchHit added in v0.1.24

type MessageSearchHit struct {
	ConversationID, Role, Text string
	MessageID                  string
}

type MessageTreeNode added in v0.2.63

type MessageTreeNode struct {
	ID, Parent, Role, Text, Branch                         string
	Outside, Pickable, Through, OnPath, Current, Deletable bool
	// contains filtered or unexported fields
}

type ObservedSessionEntry

type ObservedSessionEntry struct {
	ID                   int64
	Entry                harness.SessionEntry
	Key                  string
	Revision             string
	SourceConversationID string
	Synced               bool
	Active               bool
	Terminal             protocol.Terminal
}

type Page added in v0.1.52

type Page struct {
	Space       string
	Kind        PageKind
	Name        string
	ContentType string
	Body        []byte
	Size        int
	UpdatedAt   time.Time
}

type PageKind added in v0.1.52

type PageKind string
const (
	PageFile PageKind = "file"
	PageData PageKind = "data"
)

type PruneStateStats

type PruneStateStats struct {
	Threads, ExternalMCPSessions int
	SessionRows                  int64
}

type QuestionNotPendingError added in v0.1.27

type QuestionNotPendingError struct{ ConversationID, QuestionID string }

func (*QuestionNotPendingError) Error added in v0.1.27

func (e *QuestionNotPendingError) Error() string

type RoutineRunProgress added in v0.2.77

type RoutineRunProgress struct {
	ConversationID  string
	Run             *protocol.RoutineRun
	SyncDestination string
	Routine         *protocol.RoutineMessage
}

type RoutineRunSource added in v0.2.77

type RoutineRunSource struct {
	ConversationID       string
	SourceConversationID string
	Run                  protocol.RoutineRun
}

type RoutineScheduleState added in v0.2.77

type RoutineScheduleState struct {
	ScheduleID   string
	RelativePath string
	NextDue      time.Time
}

type Runtime

type Runtime struct {
	Cfg *config.LockedConfig
	Log *slog.Logger

	RunCtx            context.Context
	Sessions          *SessionService
	ExternalMCPAgents runtimeRefresher
	Routines          runtimeRefresher

	TextRouter protocol.PrimaryTextRouter
	// contains filtered or unexported fields
}

func (*Runtime) AnswerQuestion added in v0.1.27

func (r *Runtime) AnswerQuestion(ctx context.Context, conversationID, questionID string, answer protocol.AskUserQuestionAnswer) error

func (*Runtime) AttachSlack

func (r *Runtime) AttachSlack(slack slackLookup)

func (*Runtime) BackgroundJobs added in v0.1.19

func (r *Runtime) BackgroundJobs(ctx context.Context, conversationID string) ([]protocol.BackgroundJob, bool, error)

func (*Runtime) ContinueRun added in v0.2.0

func (r *Runtime) ContinueRun(ctx context.Context, run, conversationID string, shared bool) (string, error)

func (*Runtime) CreateConversation added in v0.1.0

func (r *Runtime) CreateConversation(ctx context.Context, conversation protocol.Conversation) error

func (*Runtime) DeleteBranch added in v0.2.63

func (r *Runtime) DeleteBranch(ctx context.Context, conversationID, messageID string, dryRun bool) (protocol.BranchDeletion, error)

func (*Runtime) DeleteQueueItem added in v0.1.0

func (r *Runtime) DeleteQueueItem(ctx context.Context, conversationID, id string) (bool, error)

func (*Runtime) EditQueueItem added in v0.1.63

func (r *Runtime) EditQueueItem(ctx context.Context, conversationID, id, text, principal, username string) (bool, error)

func (*Runtime) MoveToBackground added in v0.1.19

func (r *Runtime) MoveToBackground(ctx context.Context, conversationID string) (bool, error)

func (*Runtime) OpenCodeMCP added in v0.2.11

func (r *Runtime) OpenCodeMCP() http.Handler

func (*Runtime) PendingQuestions added in v0.1.27

func (r *Runtime) PendingQuestions(ctx context.Context, conversationID string) ([]protocol.AskUserQuestionRequest, error)

func (*Runtime) PopQueueItem added in v0.1.0

func (r *Runtime) PopQueueItem(ctx context.Context, conversationID, id string) (bool, error)

func (*Runtime) PromoteQueueItem added in v0.1.0

func (r *Runtime) PromoteQueueItem(ctx context.Context, conversationID, id string) (bool, error)

func (*Runtime) PublishOutbound added in v0.1.0

func (r *Runtime) PublishOutbound(ctx context.Context, message *protocol.OutboundMessage) error

func (*Runtime) QueueItems added in v0.1.0

func (r *Runtime) QueueItems(conversationID string) ([]protocol.ThreadQueueItem, error)

func (*Runtime) Reload

func (r *Runtime) Reload(reason string) (string, error)

func (*Runtime) ReorderQueueItems added in v0.1.0

func (r *Runtime) ReorderQueueItems(ctx context.Context, conversationID string, ids []string) error

func (*Runtime) Restart

func (r *Runtime) Restart(reason string) string

func (*Runtime) ResumeGoal added in v0.2.79

func (r *Runtime) ResumeGoal(ctx context.Context, conversationID, principal string) (bool, error)

func (*Runtime) RunTurn added in v0.1.0

func (r *Runtime) RunTurn(ctx context.Context, inbound *protocol.InboundMessage) error

func (*Runtime) RunningAgent added in v0.2.26

func (r *Runtime) RunningAgent(conversationID string) string

func (*Runtime) SandboxError added in v0.2.24

func (r *Runtime) SandboxError() string

func (*Runtime) SaveBehavior added in v0.2.41

func (r *Runtime) SaveBehavior(behavior *config.Behavior) error

func (*Runtime) SaveMCPServer added in v0.2.85

func (r *Runtime) SaveMCPServer(ctx context.Context, name string, server json.RawMessage, create bool) error

func (*Runtime) SlackWarning added in v0.2.48

func (r *Runtime) SlackWarning() string

func (*Runtime) StageRevert added in v0.1.17

func (r *Runtime) StageRevert(ctx context.Context, conversationID, target string, boundary protocol.RevertBoundary) (marker, prompt string, err error)

func (*Runtime) StartGoal added in v0.1.12

func (r *Runtime) StartGoal(ctx context.Context, inbound *protocol.InboundMessage, goal protocol.GoalRequest) error

func (*Runtime) StashQueueItem added in v0.1.0

func (r *Runtime) StashQueueItem(ctx context.Context, conversationID string, item *protocol.ThreadQueueItem) error

func (*Runtime) StopBackgroundJob added in v0.1.19

func (r *Runtime) StopBackgroundJob(ctx context.Context, conversationID, jobID string) (bool, error)

func (*Runtime) StopGoal added in v0.2.79

func (r *Runtime) StopGoal(ctx context.Context, conversationID string) (bool, error)

func (*Runtime) Subscribe added in v0.1.0

func (r *Runtime) Subscribe(ctx context.Context) iter.Seq[protocol.Event]

func (*Runtime) SwitchConversationAgent added in v0.1.0

func (r *Runtime) SwitchConversationAgent(conversationID, agent string) (bool, error)

type SavedSearch added in v0.2.31

type SavedSearch struct {
	ID    string `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
	Query string `json:"query,omitempty"`
}

type SearchKey added in v0.1.27

type SearchKey string

type SearchPage added in v0.2.31

type SearchPage struct {
	Name     string        `json:"name,omitempty"`
	Active   string        `json:"active,omitempty"`
	Searches []SavedSearch `json:"searches,omitempty"`
}

func (*SearchPage) Scan added in v0.2.31

func (p *SearchPage) Scan(src any) error

type SearchScope added in v0.1.62

type SearchScope int
const (
	SearchFields SearchScope = iota
	SearchMessages
	SearchFilters
)

type SearchTerm added in v0.1.27

type SearchTerm struct {
	Key         SearchKey
	Text, Value string
	Start, End  int
}

type SessionField added in v0.1.27

type SessionField string

type SessionMatch added in v0.1.27

type SessionMatch struct {
	Chat  SidebarChat
	Field SessionField
	Text  string
}

type SessionSearch added in v0.1.27

type SessionSearch struct {
	Terms        []SearchTerm
	Text, Needle string
	Matches      []SessionMatch
	Hits         []MessageSearchHit
	MentionIDs   []string
	Principals   []string
}

type SessionService

type SessionService struct {
	// contains filtered or unexported fields
}

func NewSessionService added in v0.2.85

func NewSessionService(cfg *config.LockedConfig, db stateStoreDB, transactions stateTransactions, transcriptConfig *pgx.ConnConfig, attachments attachmentStorage, logger *slog.Logger) *SessionService

func (*SessionService) AddToList added in v0.2.74

func (s *SessionService) AddToList(ctx context.Context, username string, tab ListTab) error

func (*SessionService) AgentOrigin added in v0.2.59

func (s *SessionService) AgentOrigin(name string) (string, error)

func (*SessionService) AppendBranchSummary added in v0.2.63

func (s *SessionService) AppendBranchSummary(ctx context.Context, conversationID, branchID, summary string) (bool, error)

func (*SessionService) AppendEntryID

func (s *SessionService) AppendEntryID(ctx context.Context, conversationID string, entry *harness.SessionEntry) (int64, error)

func (*SessionService) AttachmentMetadata added in v0.1.0

func (s *SessionService) AttachmentMetadata(ctx context.Context, conversationID, id string, uploadOnly bool) (protocol.OutboundAttachment, error)

func (*SessionService) AutoParkAll added in v0.2.31

func (s *SessionService) AutoParkAll(ctx context.Context, username string) (bool, error)

func (*SessionService) BeginGoal

func (s *SessionService) BeginGoal(conversationID string, goal *GoalState) error

func (*SessionService) BranchEntries added in v0.2.63

func (s *SessionService) BranchEntries(ctx context.Context, conversationID, branchID string) ([]ObservedSessionEntry, error)

func (*SessionService) ChangeAttention added in v0.2.31

func (s *SessionService) ChangeAttention(ctx context.Context, username string, paths []string, action AttentionAction, until *time.Time, admitted int64) error

func (*SessionService) Changes added in v0.1.12

func (s *SessionService) Changes(ctx context.Context, conversationID string) iter.Seq2[protocol.ConversationChange, error]

func (*SessionService) ChannelFact added in v0.1.0

func (s *SessionService) ChannelFact(ctx context.Context, workspaceID, channelID string) (name string, found bool, err error)

func (*SessionService) ChatOriginFacts added in v0.1.14

func (s *SessionService) ChatOriginFacts(ctx context.Context, id string) iter.Seq2[ChatOriginFacts, error]

func (*SessionService) ClaimRoutineSchedule added in v0.2.77

func (s *SessionService) ClaimRoutineSchedule(due RoutineScheduleState, nextDue, now time.Time) (bool, error)

func (*SessionService) ClaimScheduledMessage

func (s *SessionService) ClaimScheduledMessage(id, conversationID string, dueAt, now time.Time) (message protocol.ScheduledMessageState, claimed bool, err error)

func (*SessionService) ClosedTabs added in v0.2.25

func (s *SessionService) ClosedTabs(ctx context.Context, username string) ([]Tab, error)

func (*SessionService) CompletionNotes added in v0.2.85

func (s *SessionService) CompletionNotes(ctx context.Context, history string, jobIDs []string) ([]protocol.BackgroundJob, error)

func (*SessionService) ConversationKind added in v0.2.0

func (s *SessionService) ConversationKind(ctx context.Context, id string) (kind ConversationKind, err error)

func (*SessionService) CreateLimitSpaces added in v0.2.26

func (s *SessionService) CreateLimitSpaces(ctx context.Context, names []string) error

func (*SessionService) CreateOpenCodeSession added in v0.1.47

func (s *SessionService) CreateOpenCodeSession(ctx context.Context, name string, server config.OpenCodeConfig, directory, spaceID string) (string, error)

func (*SessionService) CreateSpace added in v0.1.53

func (s *SessionService) CreateSpace(ctx context.Context, name string) error

func (*SessionService) CreateStickyConversation added in v0.2.30

func (s *SessionService) CreateStickyConversation(ctx context.Context, conversation protocol.Conversation, sticky harness.AgentSticky) (id string, resumed bool, err error)

func (*SessionService) Delegations added in v0.1.11

func (s *SessionService) Delegations(ctx context.Context, conversationID, sourceConversationID string, from, before int64) ([]Delegation, error)

func (*SessionService) DeleteChat added in v0.2.44

func (s *SessionService) DeleteChat(ctx context.Context, conversationID string) error

func (*SessionService) DeletePage added in v0.1.52

func (s *SessionService) DeletePage(ctx context.Context, space string, kind PageKind, name string) (bool, error)

func (*SessionService) DeleteSpace added in v0.1.53

func (s *SessionService) DeleteSpace(ctx context.Context, id string) error

func (*SessionService) DeleteThreadQueueItem

func (s *SessionService) DeleteThreadQueueItem(ctx context.Context, conversationID, id string) (removed bool, owner string, err error)

func (*SessionService) DueRoutineSchedules added in v0.2.77

func (s *SessionService) DueRoutineSchedules(now time.Time) ([]RoutineScheduleState, error)

func (*SessionService) EditSharedSearch added in v0.2.14

func (s *SessionService) EditSharedSearch(ctx context.Context, space, path string, base, search *SearchPage) (bool, error)

func (*SessionService) ExternalMCPSession

func (s *SessionService) ExternalMCPSession(externalConversationID string) (ExternalMCPSessionState, bool, error)

func (*SessionService) ExternalMCPSessionByConversationID

func (s *SessionService) ExternalMCPSessionByConversationID(conversationID string) (externalConversationID string, session ExternalMCPSessionState, ok bool, err error)

func (*SessionService) FindWebLogin added in v0.2.72

func (s *SessionService) FindWebLogin(ctx context.Context, email string) (string, error)

func (*SessionService) ForgetFromList added in v0.2.74

func (s *SessionService) ForgetFromList(ctx context.Context, username string, tab ListTab) error

func (*SessionService) ForkConversation added in v0.1.3

func (s *SessionService) ForkConversation(ctx context.Context, source string, destination protocol.Conversation, before string) (string, error)

func (*SessionService) ForkOpenCodeSession added in v0.2.8

func (s *SessionService) ForkOpenCodeSession(ctx context.Context, name string, server config.OpenCodeConfig, source, before string) (string, error)

func (*SessionService) Goal

func (s *SessionService) Goal(conversationID string) (GoalState, bool, error)

func (*SessionService) GoalEvents added in v0.2.79

func (s *SessionService) GoalEvents(ctx context.Context, conversationID string) ([]GoalEvent, error)

func (*SessionService) HasActiveTurn added in v0.1.14

func (s *SessionService) HasActiveTurn(ctx context.Context, conversationID string) (bool, error)

func (*SessionService) InputAttachments added in v0.1.24

func (s *SessionService) InputAttachments(ctx context.Context, producer, text string) (string, []protocol.OutboundAttachment, error)

func (*SessionService) LoadAttachment added in v0.1.0

func (s *SessionService) LoadAttachment(ctx context.Context, conversationID, id string, uploadOnly bool) (protocol.OutboundAttachment, error)

func (*SessionService) LoadTurnStep added in v0.1.14

func (s *SessionService) LoadTurnStep(ctx context.Context, conversationID, key string) (value json.RawMessage, found bool, err error)

func (*SessionService) MarkSearchFinished added in v0.2.31

func (s *SessionService) MarkSearchFinished(ctx context.Context, username, path string) error

func (*SessionService) MessageTree added in v0.2.63

func (s *SessionService) MessageTree(ctx context.Context, conversationID string) ([]MessageTreeNode, error)

func (*SessionService) MoveConversation added in v0.2.56

func (s *SessionService) MoveConversation(ctx context.Context, conversationID, spaceID string) error

func (*SessionService) NameGenerated added in v0.2.70

func (s *SessionService) NameGenerated(ctx context.Context, conversationID, title string, judged *string) (name string, renamed bool, err error)

func (*SessionService) ObserveEntries

func (s *SessionService) ObserveEntries(ctx context.Context, conversationID string) ([]ObservedSessionEntry, error)

func (*SessionService) ObserveHistory added in v0.1.17

func (s *SessionService) ObserveHistory(ctx context.Context, id, source string, from, before int64, limit int, prior *HistoryInventory) (view HistorySnapshot, err error)

func (*SessionService) OrderList added in v0.2.74

func (s *SessionService) OrderList(ctx context.Context, username string, list TabList, order []ListTab) error

func (*SessionService) Page added in v0.1.52

func (s *SessionService) Page(ctx context.Context, space string, kind PageKind, name string) (Page, bool, error)

func (*SessionService) Pages added in v0.1.52

func (s *SessionService) Pages(ctx context.Context, space string) ([]Page, error)

func (*SessionService) PollAttention added in v0.2.31

func (s *SessionService) PollAttention(ctx context.Context, username, path string, hold bool) (revision int64, navigation string, err error)

func (*SessionService) PruneStateBefore

func (s *SessionService) PruneStateBefore(ctx context.Context, cutoff time.Time, pace time.Duration) (PruneStateStats, error)

func (*SessionService) PutPage added in v0.1.52

func (s *SessionService) PutPage(ctx context.Context, page *Page, conversation, fallback string) error

func (*SessionService) PutScheduledMessage

func (s *SessionService) PutScheduledMessage(id string, message *protocol.ScheduledMessageState) error

func (*SessionService) PutThreadQueueItem

func (s *SessionService) PutThreadQueueItem(id string, item *protocol.ThreadQueueItem) error

func (*SessionService) RecordChannelFact added in v0.1.0

func (s *SessionService) RecordChannelFact(ctx context.Context, workspaceID, channelID, name string, observedAt time.Time) error

func (*SessionService) RecordGoalUpdate added in v0.2.79

func (s *SessionService) RecordGoalUpdate(conversationID string, event *GoalEvent) error

func (*SessionService) RegisterExternalMCPConversation

func (s *SessionService) RegisterExternalMCPConversation(externalConversationID, managedAgent string, session *ExternalMCPSessionState) error

func (*SessionService) RemoveExternalMCPConversation

func (s *SessionService) RemoveExternalMCPConversation(externalConversationID string) error

func (*SessionService) RenameSpace added in v0.1.53

func (s *SessionService) RenameSpace(ctx context.Context, id, name string) error

func (*SessionService) ReplayAttachments added in v0.1.0

func (s *SessionService) ReplayAttachments(ctx context.Context, conversationID string, raw json.RawMessage, calls map[[2]string]bool) ([]protocol.OutboundAttachment, error)

func (*SessionService) ResetRoutineSchedules added in v0.2.77

func (s *SessionService) ResetRoutineSchedules() error

func (*SessionService) ResetScheduledMessages

func (s *SessionService) ResetScheduledMessages(conversationID string) error

func (*SessionService) ResumeGoal added in v0.2.79

func (s *SessionService) ResumeGoal(ctx context.Context, conversationID, principal string) (bool, error)

func (*SessionService) RevertAttachmentMetadata added in v0.1.17

func (s *SessionService) RevertAttachmentMetadata(ctx context.Context, conversationID, id string) (protocol.OutboundAttachment, error)

func (*SessionService) RevertState added in v0.1.17

func (s *SessionService) RevertState(ctx context.Context, conversationID string) (marker string, eligible bool, predecessor string, err error)

func (*SessionService) RoutineRun added in v0.2.77

func (s *SessionService) RoutineRun(ctx context.Context, conversationID string) (path string, run bool, err error)

func (*SessionService) RoutineRunSources added in v0.2.77

func (s *SessionService) RoutineRunSources(ctx context.Context) ([]RoutineRunSource, error)

func (*SessionService) SaveAttachment added in v0.1.0

func (s *SessionService) SaveAttachment(ctx context.Context, conversationID, turnID string, attachment *protocol.OutboundAttachment, upload bool) error

func (*SessionService) SaveStripLayout added in v0.2.44

func (s *SessionService) SaveStripLayout(ctx context.Context, username string, layout *StripLayout) error

func (*SessionService) SaveTabState added in v0.1.53

func (s *SessionService) SaveTabState(ctx context.Context, username string, state *TabState, revision int64) (bool, error)

func (*SessionService) SaveTurnStep added in v0.1.14

func (s *SessionService) SaveTurnStep(ctx context.Context, conversationID, key string, value json.RawMessage) error

func (*SessionService) SaveUpload added in v0.2.59

func (s *SessionService) SaveUpload(ctx context.Context, conversationID string, attachment *protocol.OutboundAttachment, body io.Reader) (err error)

func (*SessionService) ScheduledMessagesForConversation

func (s *SessionService) ScheduledMessagesForConversation(conversationID string) (map[string]protocol.ScheduledMessageState, error)

func (*SessionService) SearchMessages added in v0.1.24

func (s *SessionService) SearchMessages(ctx context.Context, needle string, tagPrefixes []string) ([]MessageSearchHit, error)

func (*SessionService) SearchMessagesMentioning added in v0.1.27

func (s *SessionService) SearchMessagesMentioning(ctx context.Context, needle string, slack slackLookup) (hits []MessageSearchHit, mentions map[string]string, err error)

func (*SessionService) SearchSessions added in v0.1.27

func (s *SessionService) SearchSessions(ctx context.Context, username, query string, scope SearchScope, slack slackLookup) (*SessionSearch, error)

func (*SessionService) SetAutoParkAll added in v0.2.31

func (s *SessionService) SetAutoParkAll(ctx context.Context, username string, on bool) error

func (*SessionService) SetThreadAgentIfExists

func (s *SessionService) SetThreadAgentIfExists(conversationID, agent string) (bool, error)

func (*SessionService) ShadowParent added in v0.1.33

func (s *SessionService) ShadowParent(ctx context.Context, id string) (string, error)

func (*SessionService) ShareTab added in v0.2.9

func (s *SessionService) ShareTab(ctx context.Context, space, path string, search *SearchPage) error

func (*SessionService) SharedTabs added in v0.2.9

func (s *SessionService) SharedTabs(ctx context.Context) ([]Tab, error)

func (*SessionService) SidebarChats added in v0.1.27

func (s *SessionService) SidebarChats(ctx context.Context, username string, slack slackLookup, chats []string) iter.Seq2[SidebarChat, error]

func (*SessionService) SlackChannelIDs added in v0.1.0

func (s *SessionService) SlackChannelIDs(ctx context.Context) ([]string, error)

func (*SessionService) SlackThread added in v0.2.0

func (s *SessionService) SlackThread(ctx context.Context, conversationID string) (channelID, threadTS string, channelSession bool, err error)

func (*SessionService) SpaceLimitFor added in v0.2.26

func (s *SessionService) SpaceLimitFor(ctx context.Context, spaces []string) (SpaceLimit, error)

func (*SessionService) Spaces added in v0.1.53

func (s *SessionService) Spaces(ctx context.Context) ([]Space, error)

func (*SessionService) StickySessions added in v0.2.30

func (s *SessionService) StickySessions(ctx context.Context, username string, agents harness.Agents) (map[string]string, error)

func (*SessionService) StopGoal

func (s *SessionService) StopGoal(conversationID string) error

func (*SessionService) StripLayout added in v0.2.44

func (s *SessionService) StripLayout(ctx context.Context, username string) (StripLayout, error)

func (*SessionService) SyncOpenCode added in v0.1.47

func (s *SessionService) SyncOpenCode(ctx context.Context, cfg *config.LockedConfig)

func (*SessionService) SyncRoutineSchedules added in v0.2.77

func (s *SessionService) SyncRoutineSchedules(schedules []RoutineScheduleState) error

func (*SessionService) TabAttention added in v0.2.31

func (s *SessionService) TabAttention(ctx context.Context, username string) ([]Attention, error)

func (*SessionService) TabLists added in v0.2.74

func (s *SessionService) TabLists(ctx context.Context, username string) ([]ListTab, error)

func (*SessionService) TabState added in v0.1.53

func (s *SessionService) TabState(ctx context.Context, username string) (TabState, int64, error)

func (*SessionService) Thread

func (s *SessionService) Thread(conversationID string) (ThreadState, bool, error)

func (*SessionService) ThreadQueueForConversation

func (s *SessionService) ThreadQueueForConversation(conversationID string) ([]protocol.ThreadQueueItem, error)

func (*SessionService) ToggleManualTag added in v0.1.47

func (s *SessionService) ToggleManualTag(ctx context.Context, agents harness.Agents, id, tag string) error

func (*SessionService) TopLevelSession added in v0.2.26

func (s *SessionService) TopLevelSession(ctx context.Context, conversationID string) (session SidebarSession, privateTo string, err error)

func (*SessionService) TurnAttachments added in v0.1.31

func (s *SessionService) TurnAttachments(ctx context.Context, conversationID, turnID string) ([]protocol.OutboundAttachment, error)

func (*SessionService) TurnProgress added in v0.2.26

func (s *SessionService) TurnProgress(ctx context.Context, turnID string) (protocol.TurnProgress, error)

func (*SessionService) UnshareTab added in v0.2.9

func (s *SessionService) UnshareTab(ctx context.Context, space, path string) (*SearchPage, error)

func (*SessionService) UpdateConversationDetails added in v0.1.0

func (s *SessionService) UpdateConversationDetails(ctx context.Context, conversationID string, name *string) (bool, error)

func (*SessionService) UpdateGoalStatus

func (s *SessionService) UpdateGoalStatus(conversationID, status, note string) (GoalState, error)

func (*SessionService) WakeParks added in v0.2.44

func (s *SessionService) WakeParks(ctx context.Context)

func (*SessionService) WatchListing added in v0.2.69

func (s *SessionService) WatchListing(username string) (rings <-chan struct{}, stop func())

type SidebarChat added in v0.1.27

type SidebarChat struct {
	Session     SidebarSession
	Room        string
	Routine     bool
	RoutineName string
}

type SidebarSession added in v0.1.0

type SidebarSession struct {
	Conversation  protocol.Conversation
	Kind          ConversationKind
	RemoteSession string
	Summary       *protocol.SessionSummary
	Running       bool
	Background    bool
	Asking        bool
	Automation    bool
	Goal          bool
	Name          string
	ForkedFrom    string
	Tags          []string
	Server        string
	Directory     string
	Offline       bool
	SpaceID       string
	SlackChannel  string
	RoutinePath   string
	Reply         string
	Model         string
	Attention     Attention
	AutoPark      bool
	Origin        ChatOriginFacts
	StateSince    time.Time
	Queued        bool
	External      bool
	ArrivedAt     time.Time
}

func (*SidebarSession) Label added in v0.2.0

func (row *SidebarSession) Label() string

type Space added in v0.1.53

type Space struct{ ID, Name string }

type SpaceLimit added in v0.2.26

type SpaceLimit struct {
	// contains filtered or unexported fields
}

func (SpaceLimit) AllowsAgent added in v0.2.26

func (l SpaceLimit) AllowsAgent(agent string) bool

func (SpaceLimit) AllowsSession added in v0.2.26

func (l SpaceLimit) AllowsSession(session *SidebarSession) bool

func (SpaceLimit) AllowsSpaceID added in v0.2.26

func (l SpaceLimit) AllowsSpaceID(id string) bool

func (SpaceLimit) AllowsSpaceName added in v0.2.26

func (l SpaceLimit) AllowsSpaceName(name string) bool

func (SpaceLimit) Limited added in v0.2.26

func (l SpaceLimit) Limited() bool

type StripLayout added in v0.2.44

type StripLayout struct {
	Folded map[string]bool
	Order  []string
}

type Tab added in v0.2.2

type Tab struct {
	Path         string
	Group, Space string
	Search       *SearchPage
}

type TabGroup added in v0.2.2

type TabGroup struct {
	ID, Name, Color string
	Collapsed       bool
}

type TabList added in v0.2.74

type TabList string
const (
	RecentList TabList = "recent"
	ParkedList TabList = "parked"
)

type TabState added in v0.2.2

type TabState struct {
	Tabs        []Tab
	Groups      []TabGroup
	Space       string
	Last        map[string]string
	SharedOrder []string
}

type ThreadCreator

type ThreadCreator string
const ThreadCreatedByRoutine ThreadCreator = "routine"

type ThreadState

type ThreadState struct {
	Agent     string        `json:"agent,omitempty"`
	CreatedBy ThreadCreator `json:"created_by,omitempty"`
	// contains filtered or unexported fields
}

func (ThreadState) Sticky added in v0.2.30

func (t ThreadState) Sticky() harness.AgentSticky

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL