Versions in this module Expand all Collapse all v0 v0.2.0 Jul 14, 2026 Changes in this version + func AutomationJobRowToStrings(jsonStr string) []string + func AutomationStringsToJSON(ss []string) string + func GenerateAutomationAPIKey() (rawKey, hash, prefix string, err error) + func HashAutomationAPIKey(rawKey string) string + func IsAutomationAPIKey(s string) bool + func MaskAutomationAPIKey(rawKey string) string + func TimePtrToUnix(t *time.Time) *int64 + func UnixNow() int64 + func UnixPtrToTime(u *int64) *time.Time + type AutomationAPIKeyRow struct + CreatedAt int64 + Enabled bool + ExpiresAt int64 + ID string + KeyHash string + KeyPrefix string + Label string + OwnerID string + type AutomationJobRow struct + AgentBaseType string + AgentMaxTurns int + AgentModel string + AgentSkillsJSON string + AgentSlug string + AgentSysPrompt string + AgentToolsJSON string + CreatedAt int64 + Description string + ID string + LastRunAt *int64 + LastRunStatus string + Name string + NextRunAt *int64 + OwnerID string + Status string + Task string + TriggerCron string + TriggerInterval int64 + TriggerRunAt *int64 + TriggerType string + UpdatedAt int64 + type AutomationRunRow struct + CreatedAt int64 + EndedAt *int64 + Error string + ID string + JobID string + Output string + StartedAt int64 + Status string type DB + func (db *DB) CreateAutomationAPIKey(ctx context.Context, row AutomationAPIKeyRow) error + func (db *DB) CreateAutomationJob(ctx context.Context, row AutomationJobRow) error + func (db *DB) CreateAutomationRun(ctx context.Context, row AutomationRunRow) error + func (db *DB) DeleteAutomationAPIKey(ctx context.Context, id string) error + func (db *DB) DeleteAutomationJob(ctx context.Context, id, ownerID string) error + func (db *DB) GetAutomationAPIKeyByHash(ctx context.Context, hash string) (*AutomationAPIKeyRow, error) + func (db *DB) GetAutomationJob(ctx context.Context, id string) (*AutomationJobRow, error) + func (db *DB) GetAutomationRun(ctx context.Context, id string) (*AutomationRunRow, error) + func (db *DB) InitializeAutomationDaemon(ctx context.Context) error + func (db *DB) ListAutomationAPIKeys(ctx context.Context) ([]*AutomationAPIKeyRow, error) + func (db *DB) ListAutomationJobs(ctx context.Context, ownerID string) ([]*AutomationJobRow, error) + func (db *DB) ListAutomationRuns(ctx context.Context, jobID string, limit int) ([]*AutomationRunRow, error) + func (db *DB) RevokeAutomationAPIKey(ctx context.Context, id string) error + func (db *DB) UpdateAutomationJob(ctx context.Context, row AutomationJobRow) error + func (db *DB) UpdateAutomationRun(ctx context.Context, row AutomationRunRow) error v0.1.0 Jun 22, 2026 Changes in this version + var ErrMessageNotFound = errors.New("mailbox message not found") + var ErrProfileNotFound = errors.New("agent profile not found") + var ErrTeamNotFound = errors.New("team not found") + type Config struct + AutoMigrate bool + BusyTimeoutMS int + DSN string + Driver Driver + func DefaultMySQLConfig(dsn string) Config + func DefaultPostgresConfig(dsn string) Config + func DefaultSQLiteConfig(path string) Config + type DB struct + func Open(ctx context.Context, cfg Config) (*DB, error) + func (db *DB) Close() error + func (db *DB) CountUnreadByAgents(ctx context.Context, agentIDs []string) (map[string]int, error) + func (db *DB) CreateSessionTask(ctx context.Context, task SessionTask) error + func (db *DB) DSN() string + func (db *DB) DeleteCredential(ctx context.Context, key string) error + func (db *DB) DeleteMessage(ctx context.Context, msgID string) error + func (db *DB) DeleteProfile(ctx context.Context, id string) error + func (db *DB) DeleteSessionTask(ctx context.Context, sessionID, taskID string) error + func (db *DB) DeleteTeam(ctx context.Context, id string) error + func (db *DB) Driver() Driver + func (db *DB) FindProfilesByRole(ctx context.Context, role string) ([]GAgentProfile, error) + func (db *DB) FindProfilesByTeam(ctx context.Context, teamID string) ([]GAgentProfile, error) + func (db *DB) GetCredential(ctx context.Context, key string) (string, bool, error) + func (db *DB) GetFileSessions(ctx context.Context, filePath string) ([]SessionFile, error) + func (db *DB) GetMessage(ctx context.Context, msgID string) (GMailboxMessage, error) + func (db *DB) GetMessageHistory(ctx context.Context, toAgent string, limit int) ([]GMailboxMessage, error) + func (db *DB) GetMessageThread(ctx context.Context, rootID string) ([]GMailboxMessage, error) + func (db *DB) GetProfile(ctx context.Context, id string) (GAgentProfile, error) + func (db *DB) GetSessionFiles(ctx context.Context, sessionID string) ([]SessionFile, error) + func (db *DB) GetSessionTask(ctx context.Context, sessionID, taskID string) (SessionTask, error) + func (db *DB) GetTeam(ctx context.Context, id string) (GTeam, error) + func (db *DB) GetTeamAgents(ctx context.Context, teamID string) ([]string, error) + func (db *DB) GetTeamByName(ctx context.Context, name string) (GTeam, error) + func (db *DB) GetUnreadMessages(ctx context.Context, toAgent string) ([]GMailboxMessage, error) + func (db *DB) GormDB() *gorm.DB + func (db *DB) HasSessionFileEntry(ctx context.Context, sessionID string) (bool, error) + func (db *DB) Initialize(ctx context.Context) error + func (db *DB) InsertMessage(ctx context.Context, row GMailboxMessage) error + func (db *DB) ListCredentialKeys(ctx context.Context) ([]string, error) + func (db *DB) ListProfiles(ctx context.Context) ([]GAgentProfile, error) + func (db *DB) ListSessionTasks(ctx context.Context, sessionID string) ([]SessionTask, error) + func (db *DB) ListTeams(ctx context.Context) ([]GTeam, error) + func (db *DB) MarkAllMessagesRead(ctx context.Context, toAgent string) error + func (db *DB) MarkMessageRead(ctx context.Context, msgID string) error + func (db *DB) NextSessionTaskPosition(ctx context.Context, sessionID string) (int, error) + func (db *DB) Ping(ctx context.Context) error + func (db *DB) SQL() *sql.DB + func (db *DB) SetProfileTeam(ctx context.Context, agentID, teamID string) error + func (db *DB) UpdateSessionTask(ctx context.Context, task SessionTask) error + func (db *DB) UpsertCredential(ctx context.Context, key, plaintext string) error + func (db *DB) UpsertProfile(ctx context.Context, row GAgentProfile) error + func (db *DB) UpsertProfileIfAbsent(ctx context.Context, row GAgentProfile) error + func (db *DB) UpsertSessionFile(ctx context.Context, sf SessionFile) error + func (db *DB) UpsertTeam(ctx context.Context, row GTeam) error + type Driver string + const DriverMySQL + const DriverPostgres + const DriverSQLite + type GAgentProfile struct + CreatedAtUnix int64 + ID string + MetadataJSON string + Model string + Nickname string + Role string + SkillsJSON string + SystemPromptTemplate string + TeamID string + UpdatedAtUnix int64 + func (GAgentProfile) TableName() string + type GMailboxMessage struct + Body string + CreatedAt int64 + FromAgent string + ID string + Kind string + ReadAt *int64 + ReplyTo string + Subject string + TeamID string + ToAgent string + func (GMailboxMessage) TableName() string + type GTeam struct + CreatedAtUnix int64 + Description string + ID string + MetadataJSON string + Name string + UpdatedAtUnix int64 + func (GTeam) TableName() string + type SessionFile struct + FilePath string + ID int64 + LinesAdded int + LinesRemoved int + Operation string + SessionID string + TimestampUnix int64 + ToolUseID string + type SessionTask struct + ActiveForm string + BlockedBy []string + Blocks []string + CreatedAtUnix int64 + Description string + ID int64 + Metadata map[string]any + Owner string + Position int + SessionID string + Status string + Subject string + TaskID string + UpdatedAtUnix int64