Documentation
¶
Index ¶
- Variables
- func Listen(ctx context.Context, addr string) (net.Listener, error)
- func NewSourceLoader(ctx context.Context, inner config.Source, refreshInterval time.Duration) *sourceLoader
- type Server
- type SessionManager
- func (sm *SessionManager) CreateSession(ctx context.Context, sessionTemplate *session.Session) (*session.Session, error)
- func (sm *SessionManager) DeleteSession(ctx context.Context, sessionID string) error
- func (sm *SessionManager) FollowUpSession(_ context.Context, sessionID string, messages []api.Message) error
- func (sm *SessionManager) GetAgentToolCount(ctx context.Context, agentFilename, agentName string) (int, error)
- func (sm *SessionManager) GetSession(ctx context.Context, id string) (*session.Session, error)
- func (sm *SessionManager) GetSessions(ctx context.Context) ([]*session.Session, error)
- func (sm *SessionManager) ResumeElicitation(ctx context.Context, sessionID, action string, content map[string]any) error
- func (sm *SessionManager) ResumeSession(ctx context.Context, sessionID, confirmation, reason, toolName string) error
- func (sm *SessionManager) RunSession(ctx context.Context, sessionID, agentFilename, currentAgent string, ...) (<-chan runtime.Event, error)
- func (sm *SessionManager) SteerSession(_ context.Context, sessionID string, messages []api.Message) error
- func (sm *SessionManager) ToggleToolApproval(ctx context.Context, sessionID string) error
- func (sm *SessionManager) UpdateSessionPermissions(ctx context.Context, sessionID string, perms *session.PermissionsConfig) error
- func (sm *SessionManager) UpdateSessionTitle(ctx context.Context, sessionID, title string) error
Constants ¶
This section is empty.
Variables ¶
var ErrSessionBusy = errors.New("session is already processing a request")
ErrSessionBusy is returned when a session is already processing a request.
Functions ¶
Types ¶
type SessionManager ¶
SessionManager manages sessions for HTTP and Connect-RPC servers.
func NewSessionManager ¶
func NewSessionManager(ctx context.Context, sources config.Sources, sessionStore session.Store, refreshInterval time.Duration, runConfig *config.RuntimeConfig) *SessionManager
NewSessionManager creates a new session manager.
func (*SessionManager) CreateSession ¶
func (sm *SessionManager) CreateSession(ctx context.Context, sessionTemplate *session.Session) (*session.Session, error)
CreateSession creates a new session from a template.
func (*SessionManager) DeleteSession ¶
func (sm *SessionManager) DeleteSession(ctx context.Context, sessionID string) error
DeleteSession deletes a session by ID.
func (*SessionManager) FollowUpSession ¶ added in v1.44.0
func (sm *SessionManager) FollowUpSession(_ context.Context, sessionID string, messages []api.Message) error
FollowUpSession enqueues user messages for end-of-turn processing in a running session. Each message is popped one at a time after the current turn finishes, giving each follow-up a full undivided agent turn.
func (*SessionManager) GetAgentToolCount ¶
func (sm *SessionManager) GetAgentToolCount(ctx context.Context, agentFilename, agentName string) (int, error)
GetAgentToolCount loads the agent's team and returns the number of tools available to the given agent.
func (*SessionManager) GetSession ¶
GetSession retrieves a session by ID.
func (*SessionManager) GetSessions ¶
GetSessions retrieves all sessions.
func (*SessionManager) ResumeElicitation ¶
func (sm *SessionManager) ResumeElicitation(ctx context.Context, sessionID, action string, content map[string]any) error
ResumeElicitation resumes an elicitation request.
func (*SessionManager) ResumeSession ¶
func (sm *SessionManager) ResumeSession(ctx context.Context, sessionID, confirmation, reason, toolName string) error
ResumeSession resumes a paused session with an optional rejection reason or tool name.
func (*SessionManager) RunSession ¶
func (sm *SessionManager) RunSession(ctx context.Context, sessionID, agentFilename, currentAgent string, messages []api.Message) (<-chan runtime.Event, error)
RunSession runs a session with the given messages.
func (*SessionManager) SteerSession ¶ added in v1.44.0
func (sm *SessionManager) SteerSession(_ context.Context, sessionID string, messages []api.Message) error
SteerSession enqueues user messages for mid-turn injection into a running session. The messages are picked up by the agent loop after the current tool calls finish but before the next LLM call. Returns an error if the session is not actively running or if the steer buffer is full.
func (*SessionManager) ToggleToolApproval ¶
func (sm *SessionManager) ToggleToolApproval(ctx context.Context, sessionID string) error
ToggleToolApproval toggles the tool approval mode for a session.
func (*SessionManager) UpdateSessionPermissions ¶
func (sm *SessionManager) UpdateSessionPermissions(ctx context.Context, sessionID string, perms *session.PermissionsConfig) error
UpdateSessionPermissions updates the permissions for a session.
func (*SessionManager) UpdateSessionTitle ¶
func (sm *SessionManager) UpdateSessionTitle(ctx context.Context, sessionID, title string) error
UpdateSessionTitle updates the title for a session. If the session is actively running, it also updates the in-memory session object to prevent subsequent runtime saves from overwriting the title.