session

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextOptions

type ContextOptions struct {
	MaxTokens    int      `json:"max_tokens,omitempty"`
	IncludeTypes []string `json:"include_types,omitempty"`
	Since        string   `json:"since,omitempty"`
}

ContextOptions controls how session context is formatted

type CreateRequest

type CreateRequest struct {
	AgentID  string                 `json:"agent_id"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

CreateRequest is the request body for creating a session

type Manager

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

Manager handles session lifecycle

func NewManager

func NewManager(metaDB *metadata.DB, arcRegistry *arc.Registry, logger zerolog.Logger) *Manager

NewManager creates a new session manager

func (*Manager) Create

func (m *Manager) Create(ctx context.Context, orgID string, req *CreateRequest) (*Session, error)

Create starts a new session

func (*Manager) Get

func (m *Manager) Get(ctx context.Context, orgID, sessionID string) (*Session, error)

Get returns a session by ID

func (*Manager) GetContext

func (m *Manager) GetContext(ctx context.Context, orgID, sessionID string, opts *ContextOptions) (*SessionContext, error)

GetContext returns LLM-ready formatted context for a session

func (*Manager) List

func (m *Manager) List(ctx context.Context, orgID, agentID string) ([]*Session, error)

List returns sessions for an org, optionally filtered by agent

func (*Manager) Update

func (m *Manager) Update(ctx context.Context, orgID, sessionID string, req *UpdateRequest) (*Session, error)

Update updates a session's status or metadata

type Session

type Session struct {
	ID        string                 `json:"id"`
	OrgID     string                 `json:"org_id"`
	AgentID   string                 `json:"agent_id"`
	Status    string                 `json:"status"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
	CreatedAt time.Time              `json:"created_at"`
	UpdatedAt time.Time              `json:"updated_at"`
	ClosedAt  *time.Time             `json:"closed_at,omitempty"`
}

Session represents a bounded context for agent work

type SessionContext

type SessionContext struct {
	SessionID   string `json:"session_id"`
	Context     string `json:"context"`
	MemoryCount int    `json:"memory_count"`
}

SessionContext is the LLM-ready context for a session

type UpdateRequest

type UpdateRequest struct {
	Status   string                 `json:"status,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

UpdateRequest is the request body for updating a session

Jump to

Keyboard shortcuts

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