postgres

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConnMaxLifetime = 15 * time.Minute
	MaxIdleConns    = 3
	MaxOpenConns    = 3

	DefaultTablePrefix = "at_"
)

Functions

func MigrateDB

func MigrateDB(ctx context.Context, cfg *config.Migrate) error

Types

type Postgres

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

func New

func New(ctx context.Context, cfg *config.StorePostgres, encKey []byte) (*Postgres, error)

func (*Postgres) AccumulateUsage added in v0.2.0

func (p *Postgres) AccumulateUsage(ctx context.Context, agentID string, inputTokens, outputTokens, costCents int64) error

func (*Postgres) AddLabelToTask added in v0.2.0

func (p *Postgres) AddLabelToTask(ctx context.Context, taskID, labelID string) error

func (*Postgres) CheckoutTask added in v0.2.0

func (p *Postgres) CheckoutTask(ctx context.Context, taskID, agentID string) error

func (*Postgres) Close

func (p *Postgres) Close()

func (*Postgres) CreateAPIToken

func (p *Postgres) CreateAPIToken(ctx context.Context, token service.APIToken, tokenHash string) (*service.APIToken, error)

func (*Postgres) CreateAgent added in v0.2.0

func (p *Postgres) CreateAgent(ctx context.Context, agent service.Agent) (*service.Agent, error)

func (*Postgres) CreateAgentMemory added in v0.2.0

func (p *Postgres) CreateAgentMemory(ctx context.Context, mem service.AgentMemory) (*service.AgentMemory, error)

func (*Postgres) CreateAgentMemoryMessages added in v0.2.0

func (p *Postgres) CreateAgentMemoryMessages(ctx context.Context, msgs service.AgentMemoryMessages) error

func (*Postgres) CreateApproval added in v0.2.0

func (p *Postgres) CreateApproval(ctx context.Context, approval service.Approval) (*service.Approval, error)

func (*Postgres) CreateBotConfig added in v0.2.0

func (p *Postgres) CreateBotConfig(ctx context.Context, bot service.BotConfig) (*service.BotConfig, error)

func (*Postgres) CreateChatMessage added in v0.2.0

func (p *Postgres) CreateChatMessage(ctx context.Context, msg service.ChatMessage) (*service.ChatMessage, error)

func (*Postgres) CreateChatMessages added in v0.2.0

func (p *Postgres) CreateChatMessages(ctx context.Context, msgs []service.ChatMessage) error

func (*Postgres) CreateChatSession added in v0.2.0

func (p *Postgres) CreateChatSession(ctx context.Context, session service.ChatSession) (*service.ChatSession, error)

func (*Postgres) CreateComment added in v0.2.0

func (p *Postgres) CreateComment(ctx context.Context, comment service.IssueComment) (*service.IssueComment, error)

func (*Postgres) CreateConnection added in v0.2.1

func (p *Postgres) CreateConnection(ctx context.Context, c service.Connection) (*service.Connection, error)

func (*Postgres) CreateGoal added in v0.2.0

func (p *Postgres) CreateGoal(ctx context.Context, goal service.Goal) (*service.Goal, error)

func (*Postgres) CreateGuide added in v0.2.1

func (p *Postgres) CreateGuide(ctx context.Context, g service.Guide) (*service.Guide, error)

func (*Postgres) CreateHeartbeatRun added in v0.2.0

func (p *Postgres) CreateHeartbeatRun(ctx context.Context, run service.HeartbeatRun) (*service.HeartbeatRun, error)

func (*Postgres) CreateLabel added in v0.2.0

func (p *Postgres) CreateLabel(ctx context.Context, label service.Label) (*service.Label, error)

func (*Postgres) CreateMCPServer added in v0.2.0

func (p *Postgres) CreateMCPServer(ctx context.Context, s service.MCPServer) (*service.MCPServer, error)

func (*Postgres) CreateMCPSet added in v0.2.0

func (p *Postgres) CreateMCPSet(ctx context.Context, s service.MCPSet) (*service.MCPSet, error)

func (*Postgres) CreateMarketplaceSource added in v0.2.0

func (p *Postgres) CreateMarketplaceSource(ctx context.Context, src service.MarketplaceSource) (*service.MarketplaceSource, error)

func (*Postgres) CreateNodeConfig added in v0.2.0

func (p *Postgres) CreateNodeConfig(ctx context.Context, nc service.NodeConfig) (*service.NodeConfig, error)

func (*Postgres) CreateOrCoalesce added in v0.2.0

func (p *Postgres) CreateOrCoalesce(ctx context.Context, req service.WakeupRequest) (*service.WakeupRequest, error)

func (*Postgres) CreateOrganization added in v0.2.0

func (p *Postgres) CreateOrganization(ctx context.Context, org service.Organization) (*service.Organization, error)

func (*Postgres) CreateOrganizationAgent added in v0.2.0

func (p *Postgres) CreateOrganizationAgent(ctx context.Context, oa service.OrganizationAgent) (*service.OrganizationAgent, error)

func (*Postgres) CreatePackSource added in v0.2.1

func (p *Postgres) CreatePackSource(ctx context.Context, ps service.PackSource) (*service.PackSource, error)

func (*Postgres) CreateProject added in v0.2.0

func (p *Postgres) CreateProject(ctx context.Context, project service.Project) (*service.Project, error)

func (*Postgres) CreateProvider

func (p *Postgres) CreateProvider(ctx context.Context, record service.ProviderRecord) (*service.ProviderRecord, error)

func (*Postgres) CreateRAGCollection added in v0.2.0

func (p *Postgres) CreateRAGCollection(ctx context.Context, c service.RAGCollection) (*service.RAGCollection, error)

func (*Postgres) CreateRevision added in v0.2.0

func (*Postgres) CreateSkill added in v0.2.0

func (p *Postgres) CreateSkill(ctx context.Context, sk service.Skill) (*service.Skill, error)

func (*Postgres) CreateTask added in v0.2.0

func (p *Postgres) CreateTask(ctx context.Context, task service.Task) (*service.Task, error)

func (*Postgres) CreateTrigger added in v0.2.0

func (p *Postgres) CreateTrigger(ctx context.Context, t service.Trigger) (*service.Trigger, error)

func (*Postgres) CreateVariable added in v0.2.0

func (p *Postgres) CreateVariable(ctx context.Context, v service.Variable) (*service.Variable, error)

func (*Postgres) CreateWorkflow added in v0.2.0

func (p *Postgres) CreateWorkflow(ctx context.Context, w service.Workflow) (*service.Workflow, error)

func (*Postgres) CreateWorkflowVersion added in v0.2.0

func (p *Postgres) CreateWorkflowVersion(ctx context.Context, v service.WorkflowVersion) (*service.WorkflowVersion, error)

func (*Postgres) DeleteAPIToken

func (p *Postgres) DeleteAPIToken(ctx context.Context, id string) error

func (*Postgres) DeleteAgent added in v0.2.0

func (p *Postgres) DeleteAgent(ctx context.Context, id string) error

func (*Postgres) DeleteAgentMemory added in v0.2.0

func (p *Postgres) DeleteAgentMemory(ctx context.Context, id string) error

func (*Postgres) DeleteAgentTaskSession added in v0.2.0

func (p *Postgres) DeleteAgentTaskSession(ctx context.Context, agentID, taskKey string) error

func (*Postgres) DeleteBotConfig added in v0.2.0

func (p *Postgres) DeleteBotConfig(ctx context.Context, id string) error

func (*Postgres) DeleteChatMessages added in v0.2.0

func (p *Postgres) DeleteChatMessages(ctx context.Context, sessionID string) error

func (*Postgres) DeleteChatSession added in v0.2.0

func (p *Postgres) DeleteChatSession(ctx context.Context, id string) error

func (*Postgres) DeleteComment added in v0.2.0

func (p *Postgres) DeleteComment(ctx context.Context, id string) error

func (*Postgres) DeleteConnection added in v0.2.1

func (p *Postgres) DeleteConnection(ctx context.Context, id string) error

func (*Postgres) DeleteGoal added in v0.2.0

func (p *Postgres) DeleteGoal(ctx context.Context, id string) error

func (*Postgres) DeleteGuide added in v0.2.1

func (p *Postgres) DeleteGuide(ctx context.Context, id string) error

func (*Postgres) DeleteLabel added in v0.2.0

func (p *Postgres) DeleteLabel(ctx context.Context, id string) error

func (*Postgres) DeleteMCPServer added in v0.2.0

func (p *Postgres) DeleteMCPServer(ctx context.Context, id string) error

func (*Postgres) DeleteMCPSet added in v0.2.0

func (p *Postgres) DeleteMCPSet(ctx context.Context, id string) error

func (*Postgres) DeleteMarketplaceSource added in v0.2.0

func (p *Postgres) DeleteMarketplaceSource(ctx context.Context, id string) error

func (*Postgres) DeleteNodeConfig added in v0.2.0

func (p *Postgres) DeleteNodeConfig(ctx context.Context, id string) error

func (*Postgres) DeleteOrganization added in v0.2.0

func (p *Postgres) DeleteOrganization(ctx context.Context, id string) error

func (*Postgres) DeleteOrganizationAgent added in v0.2.0

func (p *Postgres) DeleteOrganizationAgent(ctx context.Context, id string) error

func (*Postgres) DeleteOrganizationAgentByPair added in v0.2.0

func (p *Postgres) DeleteOrganizationAgentByPair(ctx context.Context, orgID, agentID string) error

func (*Postgres) DeletePackSource added in v0.2.1

func (p *Postgres) DeletePackSource(ctx context.Context, id string) error

func (*Postgres) DeleteProject added in v0.2.0

func (p *Postgres) DeleteProject(ctx context.Context, id string) error

func (*Postgres) DeleteProvider

func (p *Postgres) DeleteProvider(ctx context.Context, key string) error

func (*Postgres) DeleteRAGCollection added in v0.2.0

func (p *Postgres) DeleteRAGCollection(ctx context.Context, id string) error

func (*Postgres) DeleteRAGPage added in v0.2.0

func (p *Postgres) DeleteRAGPage(ctx context.Context, id string) error

func (*Postgres) DeleteRAGPageBySource added in v0.2.0

func (p *Postgres) DeleteRAGPageBySource(ctx context.Context, collectionID, source string) error

func (*Postgres) DeleteRAGPagesByCollectionID added in v0.2.0

func (p *Postgres) DeleteRAGPagesByCollectionID(ctx context.Context, collectionID string) error

func (*Postgres) DeleteSkill added in v0.2.0

func (p *Postgres) DeleteSkill(ctx context.Context, id string) error

func (*Postgres) DeleteTask added in v0.2.0

func (p *Postgres) DeleteTask(ctx context.Context, id string) error

func (*Postgres) DeleteTrigger added in v0.2.0

func (p *Postgres) DeleteTrigger(ctx context.Context, id string) error

func (*Postgres) DeleteUserPreference added in v0.2.0

func (p *Postgres) DeleteUserPreference(ctx context.Context, userID, key string) error

func (*Postgres) DeleteVariable added in v0.2.0

func (p *Postgres) DeleteVariable(ctx context.Context, id string) error

func (*Postgres) DeleteWorkflow added in v0.2.0

func (p *Postgres) DeleteWorkflow(ctx context.Context, id string) error

func (*Postgres) GetAPITokenByHash

func (p *Postgres) GetAPITokenByHash(ctx context.Context, hash string) (*service.APIToken, error)

func (*Postgres) GetActiveRun added in v0.2.0

func (p *Postgres) GetActiveRun(ctx context.Context, agentID string) (*service.HeartbeatRun, error)

func (*Postgres) GetAgent added in v0.2.0

func (p *Postgres) GetAgent(ctx context.Context, id string) (*service.Agent, error)

func (*Postgres) GetAgentBudget added in v0.2.0

func (p *Postgres) GetAgentBudget(ctx context.Context, agentID string) (*service.AgentBudget, error)

func (*Postgres) GetAgentMemory added in v0.2.0

func (p *Postgres) GetAgentMemory(ctx context.Context, id string) (*service.AgentMemory, error)

func (*Postgres) GetAgentMemoryMessages added in v0.2.0

func (p *Postgres) GetAgentMemoryMessages(ctx context.Context, memoryID string) (*service.AgentMemoryMessages, error)

func (*Postgres) GetAgentRuntimeState added in v0.2.0

func (p *Postgres) GetAgentRuntimeState(ctx context.Context, agentID string) (*service.AgentRuntimeState, error)

func (*Postgres) GetAgentTaskSession added in v0.2.0

func (p *Postgres) GetAgentTaskSession(ctx context.Context, agentID, taskKey string) (*service.AgentTaskSession, error)

func (*Postgres) GetAgentTotalSpend added in v0.2.0

func (p *Postgres) GetAgentTotalSpend(ctx context.Context, agentID string) (float64, error)

func (*Postgres) GetAgentUsage added in v0.2.0

func (p *Postgres) GetAgentUsage(ctx context.Context, agentID string, q *query.Query) (*service.ListResult[service.AgentUsageRecord], error)

func (*Postgres) GetApproval added in v0.2.0

func (p *Postgres) GetApproval(ctx context.Context, id string) (*service.Approval, error)

func (*Postgres) GetAuditTrail added in v0.2.0

func (p *Postgres) GetAuditTrail(ctx context.Context, resourceType, resourceID string) ([]service.AuditEntry, error)

func (*Postgres) GetBotConfig added in v0.2.0

func (p *Postgres) GetBotConfig(ctx context.Context, id string) (*service.BotConfig, error)

func (*Postgres) GetChatSession added in v0.2.0

func (p *Postgres) GetChatSession(ctx context.Context, id string) (*service.ChatSession, error)

func (*Postgres) GetChatSessionByPlatform added in v0.2.0

func (p *Postgres) GetChatSessionByPlatform(ctx context.Context, platform, platformUserID, platformChannelID string) (*service.ChatSession, error)

func (*Postgres) GetChatSessionByTaskID added in v0.2.0

func (p *Postgres) GetChatSessionByTaskID(ctx context.Context, taskID string) (*service.ChatSession, error)

func (*Postgres) GetComment added in v0.2.0

func (p *Postgres) GetComment(ctx context.Context, id string) (*service.IssueComment, error)

func (*Postgres) GetConnection added in v0.2.1

func (p *Postgres) GetConnection(ctx context.Context, id string) (*service.Connection, error)

func (*Postgres) GetConnectionByName added in v0.2.1

func (p *Postgres) GetConnectionByName(ctx context.Context, provider, name string) (*service.Connection, error)

func (*Postgres) GetCostByAgent added in v0.2.0

func (p *Postgres) GetCostByAgent(ctx context.Context, agentID string) (float64, error)

func (*Postgres) GetCostByBillingCode added in v0.2.0

func (p *Postgres) GetCostByBillingCode(ctx context.Context, billingCode string) (float64, error)

func (*Postgres) GetCostByGoal added in v0.2.0

func (p *Postgres) GetCostByGoal(ctx context.Context, goalID string) (float64, error)

func (*Postgres) GetCostByProject added in v0.2.0

func (p *Postgres) GetCostByProject(ctx context.Context, projectID string) (float64, error)

func (*Postgres) GetGoal added in v0.2.0

func (p *Postgres) GetGoal(ctx context.Context, id string) (*service.Goal, error)

func (*Postgres) GetGoalAncestry added in v0.2.0

func (p *Postgres) GetGoalAncestry(ctx context.Context, id string) ([]service.Goal, error)

func (*Postgres) GetGuide added in v0.2.1

func (p *Postgres) GetGuide(ctx context.Context, id string) (*service.Guide, error)

func (*Postgres) GetHeartbeat added in v0.2.0

func (p *Postgres) GetHeartbeat(ctx context.Context, agentID string) (*service.AgentHeartbeat, error)

func (*Postgres) GetHeartbeatRun added in v0.2.0

func (p *Postgres) GetHeartbeatRun(ctx context.Context, id string) (*service.HeartbeatRun, error)

func (*Postgres) GetLabel added in v0.2.0

func (p *Postgres) GetLabel(ctx context.Context, id string) (*service.Label, error)

func (*Postgres) GetLatestRevision added in v0.2.0

func (p *Postgres) GetLatestRevision(ctx context.Context, agentID string) (*service.AgentConfigRevision, error)

func (*Postgres) GetMCPServer added in v0.2.0

func (p *Postgres) GetMCPServer(ctx context.Context, id string) (*service.MCPServer, error)

func (*Postgres) GetMCPServerByName added in v0.2.0

func (p *Postgres) GetMCPServerByName(ctx context.Context, name string) (*service.MCPServer, error)

func (*Postgres) GetMCPSet added in v0.2.0

func (p *Postgres) GetMCPSet(ctx context.Context, id string) (*service.MCPSet, error)

func (*Postgres) GetMCPSetByName added in v0.2.0

func (p *Postgres) GetMCPSetByName(ctx context.Context, name string) (*service.MCPSet, error)

func (*Postgres) GetMarketplaceSource added in v0.2.0

func (p *Postgres) GetMarketplaceSource(ctx context.Context, id string) (*service.MarketplaceSource, error)

func (*Postgres) GetNodeConfig added in v0.2.0

func (p *Postgres) GetNodeConfig(ctx context.Context, id string) (*service.NodeConfig, error)

func (*Postgres) GetOrganization added in v0.2.0

func (p *Postgres) GetOrganization(ctx context.Context, id string) (*service.Organization, error)

func (*Postgres) GetOrganizationAgent added in v0.2.0

func (p *Postgres) GetOrganizationAgent(ctx context.Context, id string) (*service.OrganizationAgent, error)

func (*Postgres) GetOrganizationAgentByPair added in v0.2.0

func (p *Postgres) GetOrganizationAgentByPair(ctx context.Context, orgID, agentID string) (*service.OrganizationAgent, error)

func (*Postgres) GetPackSource added in v0.2.1

func (p *Postgres) GetPackSource(ctx context.Context, id string) (*service.PackSource, error)

func (*Postgres) GetProject added in v0.2.0

func (p *Postgres) GetProject(ctx context.Context, id string) (*service.Project, error)

func (*Postgres) GetProvider

func (p *Postgres) GetProvider(ctx context.Context, key string) (*service.ProviderRecord, error)

func (*Postgres) GetRAGCollection added in v0.2.0

func (p *Postgres) GetRAGCollection(ctx context.Context, id string) (*service.RAGCollection, error)

func (*Postgres) GetRAGCollectionByName added in v0.2.0

func (p *Postgres) GetRAGCollectionByName(ctx context.Context, name string) (*service.RAGCollection, error)

func (*Postgres) GetRAGPage added in v0.2.0

func (p *Postgres) GetRAGPage(ctx context.Context, id string) (*service.RAGPage, error)

func (*Postgres) GetRAGPageBySource added in v0.2.0

func (p *Postgres) GetRAGPageBySource(ctx context.Context, collectionID, source string) (*service.RAGPage, error)

func (*Postgres) GetRAGState added in v0.2.0

func (p *Postgres) GetRAGState(ctx context.Context, key string) (*service.RAGState, error)

func (*Postgres) GetRevision added in v0.2.0

func (p *Postgres) GetRevision(ctx context.Context, id string) (*service.AgentConfigRevision, error)

func (*Postgres) GetSkill added in v0.2.0

func (p *Postgres) GetSkill(ctx context.Context, id string) (*service.Skill, error)

func (*Postgres) GetSkillByName added in v0.2.0

func (p *Postgres) GetSkillByName(ctx context.Context, name string) (*service.Skill, error)

func (*Postgres) GetTask added in v0.2.0

func (p *Postgres) GetTask(ctx context.Context, id string) (*service.Task, error)

func (*Postgres) GetTokenTotalUsage added in v0.2.0

func (p *Postgres) GetTokenTotalUsage(ctx context.Context, tokenID string) (int64, error)

func (*Postgres) GetTokenUsage added in v0.2.0

func (p *Postgres) GetTokenUsage(ctx context.Context, tokenID string) ([]service.TokenUsage, error)

func (*Postgres) GetTrigger added in v0.2.0

func (p *Postgres) GetTrigger(ctx context.Context, id string) (*service.Trigger, error)

func (*Postgres) GetTriggerByAlias added in v0.2.0

func (p *Postgres) GetTriggerByAlias(ctx context.Context, alias string) (*service.Trigger, error)

func (*Postgres) GetUsageGrouped added in v0.2.1

func (p *Postgres) GetUsageGrouped(ctx context.Context, filter service.UsageFilter, groupBy string, limit int) ([]service.UsageSummary, error)

func (*Postgres) GetUsageSummary added in v0.2.1

func (p *Postgres) GetUsageSummary(ctx context.Context, filter service.UsageFilter) (service.UsageSummary, error)

func (*Postgres) GetUsageTimeSeries added in v0.2.1

func (p *Postgres) GetUsageTimeSeries(ctx context.Context, filter service.UsageFilter, bucket string) ([]service.UsageTimeSeriesPoint, error)

func (*Postgres) GetUserPreference added in v0.2.0

func (p *Postgres) GetUserPreference(ctx context.Context, userID, key string) (*service.UserPreference, error)

func (*Postgres) GetVariable added in v0.2.0

func (p *Postgres) GetVariable(ctx context.Context, id string) (*service.Variable, error)

func (*Postgres) GetVariableByKey added in v0.2.0

func (p *Postgres) GetVariableByKey(ctx context.Context, key string) (*service.Variable, error)

func (*Postgres) GetWakeupRequest added in v0.2.0

func (p *Postgres) GetWakeupRequest(ctx context.Context, id string) (*service.WakeupRequest, error)

func (*Postgres) GetWorkflow added in v0.2.0

func (p *Postgres) GetWorkflow(ctx context.Context, id string) (*service.Workflow, error)

func (*Postgres) GetWorkflowByName added in v0.2.1

func (p *Postgres) GetWorkflowByName(ctx context.Context, name string) (*service.Workflow, error)

func (*Postgres) GetWorkflowVersion added in v0.2.0

func (p *Postgres) GetWorkflowVersion(ctx context.Context, workflowID string, version int) (*service.WorkflowVersion, error)

func (*Postgres) IncrementIssueCounter added in v0.2.0

func (p *Postgres) IncrementIssueCounter(ctx context.Context, orgID string) (int64, error)

func (*Postgres) ListAPITokens

func (p *Postgres) ListAPITokens(ctx context.Context, q *query.Query) (*service.ListResult[service.APIToken], error)

func (*Postgres) ListAgentBudgets added in v0.2.1

func (p *Postgres) ListAgentBudgets(ctx context.Context) ([]service.AgentBudget, error)

ListAgentBudgets returns all configured agent budgets.

func (*Postgres) ListAgentMemories added in v0.2.0

func (p *Postgres) ListAgentMemories(ctx context.Context, agentID, orgID string) ([]service.AgentMemory, error)

func (*Postgres) ListAgentOrganizations added in v0.2.0

func (p *Postgres) ListAgentOrganizations(ctx context.Context, agentID string) ([]service.OrganizationAgent, error)

func (*Postgres) ListAgentTaskSessions added in v0.2.0

func (p *Postgres) ListAgentTaskSessions(ctx context.Context, agentID string) ([]service.AgentTaskSession, error)

func (*Postgres) ListAgents added in v0.2.0

func (p *Postgres) ListAgents(ctx context.Context, q *query.Query) (*service.ListResult[service.Agent], error)

func (*Postgres) ListAllTriggers added in v0.2.0

func (p *Postgres) ListAllTriggers(ctx context.Context) ([]service.Trigger, error)

func (*Postgres) ListApprovals added in v0.2.0

func (p *Postgres) ListApprovals(ctx context.Context, q *query.Query) (*service.ListResult[service.Approval], error)

func (*Postgres) ListAuditEntries added in v0.2.0

func (p *Postgres) ListAuditEntries(ctx context.Context, q *query.Query) (*service.ListResult[service.AuditEntry], error)

func (*Postgres) ListBotConfigs added in v0.2.0

func (p *Postgres) ListBotConfigs(ctx context.Context, q *query.Query) (*service.ListResult[service.BotConfig], error)

func (*Postgres) ListChatMessages added in v0.2.0

func (p *Postgres) ListChatMessages(ctx context.Context, sessionID string) ([]service.ChatMessage, error)

func (*Postgres) ListChatSessions added in v0.2.0

func (p *Postgres) ListChatSessions(ctx context.Context, q *query.Query) (*service.ListResult[service.ChatSession], error)

func (*Postgres) ListChildTasks added in v0.2.0

func (p *Postgres) ListChildTasks(ctx context.Context, parentID string) ([]service.Task, error)

func (*Postgres) ListCommentsByTask added in v0.2.0

func (p *Postgres) ListCommentsByTask(ctx context.Context, taskID string) ([]service.IssueComment, error)

func (*Postgres) ListConnections added in v0.2.1

func (p *Postgres) ListConnections(ctx context.Context, q *query.Query) (*service.ListResult[service.Connection], error)

func (*Postgres) ListConnectionsByProvider added in v0.2.1

func (p *Postgres) ListConnectionsByProvider(ctx context.Context, provider string) ([]service.Connection, error)

func (*Postgres) ListCostEvents added in v0.2.0

func (p *Postgres) ListCostEvents(ctx context.Context, q *query.Query) (*service.ListResult[service.CostEvent], error)

func (*Postgres) ListEnabledCronTriggers added in v0.2.0

func (p *Postgres) ListEnabledCronTriggers(ctx context.Context) ([]service.Trigger, error)

func (*Postgres) ListGoals added in v0.2.0

func (p *Postgres) ListGoals(ctx context.Context, q *query.Query) (*service.ListResult[service.Goal], error)

func (*Postgres) ListGoalsByParent added in v0.2.0

func (p *Postgres) ListGoalsByParent(ctx context.Context, parentID string) ([]service.Goal, error)

func (*Postgres) ListGuides added in v0.2.1

func (p *Postgres) ListGuides(ctx context.Context, q *query.Query) (*service.ListResult[service.Guide], error)

func (*Postgres) ListHeartbeatRuns added in v0.2.0

func (p *Postgres) ListHeartbeatRuns(ctx context.Context, agentID string, q *query.Query) (*service.ListResult[service.HeartbeatRun], error)

func (*Postgres) ListHeartbeats added in v0.2.0

func (p *Postgres) ListHeartbeats(ctx context.Context) ([]service.AgentHeartbeat, error)

func (*Postgres) ListLabels added in v0.2.0

func (p *Postgres) ListLabels(ctx context.Context, orgID string) ([]service.Label, error)

func (*Postgres) ListLabelsForTask added in v0.2.0

func (p *Postgres) ListLabelsForTask(ctx context.Context, taskID string) ([]service.Label, error)

func (*Postgres) ListMCPServers added in v0.2.0

func (p *Postgres) ListMCPServers(ctx context.Context, q *query.Query) (*service.ListResult[service.MCPServer], error)

func (*Postgres) ListMCPSets added in v0.2.0

func (p *Postgres) ListMCPSets(ctx context.Context, q *query.Query) (*service.ListResult[service.MCPSet], error)

func (*Postgres) ListMarketplaceSources added in v0.2.0

func (p *Postgres) ListMarketplaceSources(ctx context.Context) ([]service.MarketplaceSource, error)

func (*Postgres) ListModelPricing added in v0.2.0

func (p *Postgres) ListModelPricing(ctx context.Context) ([]service.ModelPricing, error)

func (*Postgres) ListNodeConfigs added in v0.2.0

func (p *Postgres) ListNodeConfigs(ctx context.Context, q *query.Query) (*service.ListResult[service.NodeConfig], error)

func (*Postgres) ListNodeConfigsByType added in v0.2.0

func (p *Postgres) ListNodeConfigsByType(ctx context.Context, configType string) ([]service.NodeConfig, error)

func (*Postgres) ListOrgMemories added in v0.2.0

func (p *Postgres) ListOrgMemories(ctx context.Context, orgID string) ([]service.AgentMemory, error)

func (*Postgres) ListOrganizationAgents added in v0.2.0

func (p *Postgres) ListOrganizationAgents(ctx context.Context, orgID string) ([]service.OrganizationAgent, error)

func (*Postgres) ListOrganizations added in v0.2.0

func (p *Postgres) ListOrganizations(ctx context.Context, q *query.Query) (*service.ListResult[service.Organization], error)

func (*Postgres) ListPackSources added in v0.2.1

func (p *Postgres) ListPackSources(ctx context.Context, q *query.Query) (*service.ListResult[service.PackSource], error)

func (*Postgres) ListPendingApprovals added in v0.2.0

func (p *Postgres) ListPendingApprovals(ctx context.Context, orgID string) ([]service.Approval, error)

func (*Postgres) ListPendingForAgent added in v0.2.0

func (p *Postgres) ListPendingForAgent(ctx context.Context, agentID string) ([]service.WakeupRequest, error)

func (*Postgres) ListProjects added in v0.2.0

func (p *Postgres) ListProjects(ctx context.Context, q *query.Query) (*service.ListResult[service.Project], error)

func (*Postgres) ListProjectsByGoal added in v0.2.0

func (p *Postgres) ListProjectsByGoal(ctx context.Context, goalID string) ([]service.Project, error)

func (*Postgres) ListProjectsByOrganization added in v0.2.0

func (p *Postgres) ListProjectsByOrganization(ctx context.Context, orgID string) ([]service.Project, error)

func (*Postgres) ListProviders

func (*Postgres) ListRAGCollections added in v0.2.0

func (p *Postgres) ListRAGCollections(ctx context.Context, q *query.Query) (*service.ListResult[service.RAGCollection], error)

func (*Postgres) ListRAGPages added in v0.2.0

func (p *Postgres) ListRAGPages(ctx context.Context, collectionID string, q *query.Query) (*service.ListResult[service.RAGPage], error)

func (*Postgres) ListRevisions added in v0.2.0

func (p *Postgres) ListRevisions(ctx context.Context, agentID string) ([]service.AgentConfigRevision, error)

func (*Postgres) ListSkills added in v0.2.0

func (p *Postgres) ListSkills(ctx context.Context, q *query.Query) (*service.ListResult[service.Skill], error)

func (*Postgres) ListTasks added in v0.2.0

func (p *Postgres) ListTasks(ctx context.Context, q *query.Query) (*service.ListResult[service.Task], error)

func (*Postgres) ListTasksByAgent added in v0.2.0

func (p *Postgres) ListTasksByAgent(ctx context.Context, agentID string) ([]service.Task, error)

func (*Postgres) ListTasksByGoal added in v0.2.0

func (p *Postgres) ListTasksByGoal(ctx context.Context, goalID string) ([]service.Task, error)

func (*Postgres) ListTasksForLabel added in v0.2.0

func (p *Postgres) ListTasksForLabel(ctx context.Context, labelID string) ([]string, error)

func (*Postgres) ListTriggers added in v0.2.0

func (p *Postgres) ListTriggers(ctx context.Context, workflowID string) ([]service.Trigger, error)

func (*Postgres) ListUserPreferences added in v0.2.0

func (p *Postgres) ListUserPreferences(ctx context.Context, userID string) ([]service.UserPreference, error)

func (*Postgres) ListVariables added in v0.2.0

func (p *Postgres) ListVariables(ctx context.Context, q *query.Query) (*service.ListResult[service.Variable], error)

func (*Postgres) ListWorkflowVersions added in v0.2.0

func (p *Postgres) ListWorkflowVersions(ctx context.Context, workflowID string) ([]service.WorkflowVersion, error)

func (*Postgres) ListWorkflows added in v0.2.0

func (p *Postgres) ListWorkflows(ctx context.Context, q *query.Query) (*service.ListResult[service.Workflow], error)

func (*Postgres) MarkDispatched added in v0.2.0

func (p *Postgres) MarkDispatched(ctx context.Context, id, runID string) error

func (*Postgres) MarkStale added in v0.2.0

func (p *Postgres) MarkStale(ctx context.Context, threshold time.Duration) (int, error)

func (*Postgres) PromoteDeferred added in v0.2.0

func (p *Postgres) PromoteDeferred(ctx context.Context, agentID string) error

func (*Postgres) RecordAgentUsage added in v0.2.0

func (p *Postgres) RecordAgentUsage(ctx context.Context, usage service.AgentUsageRecord) error

func (*Postgres) RecordAudit added in v0.2.0

func (p *Postgres) RecordAudit(ctx context.Context, entry service.AuditEntry) error

func (*Postgres) RecordCostEvent added in v0.2.0

func (p *Postgres) RecordCostEvent(ctx context.Context, event service.CostEvent) error

func (*Postgres) RecordHeartbeat added in v0.2.0

func (p *Postgres) RecordHeartbeat(ctx context.Context, agentID string, metadata map[string]any) error

func (*Postgres) RecordUsage added in v0.2.0

func (p *Postgres) RecordUsage(ctx context.Context, tokenID, model string, usage service.Usage) error

func (*Postgres) ReleaseTask added in v0.2.0

func (p *Postgres) ReleaseTask(ctx context.Context, taskID string) error

func (*Postgres) RemoveLabelFromTask added in v0.2.0

func (p *Postgres) RemoveLabelFromTask(ctx context.Context, taskID, labelID string) error

func (*Postgres) ResetTokenUsage added in v0.2.0

func (p *Postgres) ResetTokenUsage(ctx context.Context, tokenID string) error

func (*Postgres) RotateEncryptionKey added in v0.1.3

func (p *Postgres) RotateEncryptionKey(ctx context.Context, newKey []byte) error

RotateEncryptionKey decrypts all provider configs with the current key, re-encrypts them with newKey, and updates the rows atomically. Passing nil as newKey disables encryption (stores plaintext).

func (*Postgres) SearchAgentMemories added in v0.2.0

func (p *Postgres) SearchAgentMemories(ctx context.Context, agentID, orgID, query string) ([]service.AgentMemory, error)

func (*Postgres) SetActiveVersion added in v0.2.0

func (p *Postgres) SetActiveVersion(ctx context.Context, workflowID string, version int) error

func (*Postgres) SetAgentBudget added in v0.2.0

func (p *Postgres) SetAgentBudget(ctx context.Context, budget service.AgentBudget) error

func (*Postgres) SetEncryptionKey added in v0.1.3

func (p *Postgres) SetEncryptionKey(newKey []byte)

SetEncryptionKey updates the in-memory encryption key without re-encrypting database rows. Used by peer instances when they receive a key rotation broadcast from the instance that performed the actual rotation.

func (*Postgres) SetModelPricing added in v0.2.0

func (p *Postgres) SetModelPricing(ctx context.Context, pricing service.ModelPricing) error

func (*Postgres) SetRAGState added in v0.2.0

func (p *Postgres) SetRAGState(ctx context.Context, key string, value string) error

func (*Postgres) SetUserPreference added in v0.2.0

func (p *Postgres) SetUserPreference(ctx context.Context, pref service.UserPreference) error

func (*Postgres) UpdateAPIToken

func (p *Postgres) UpdateAPIToken(ctx context.Context, id string, token service.APIToken) (*service.APIToken, error)

func (*Postgres) UpdateAgent added in v0.2.0

func (p *Postgres) UpdateAgent(ctx context.Context, id string, agent service.Agent) (*service.Agent, error)

func (*Postgres) UpdateApproval added in v0.2.0

func (p *Postgres) UpdateApproval(ctx context.Context, id string, approval service.Approval) (*service.Approval, error)

func (*Postgres) UpdateBotConfig added in v0.2.0

func (p *Postgres) UpdateBotConfig(ctx context.Context, id string, bot service.BotConfig) (*service.BotConfig, error)

func (*Postgres) UpdateChatSession added in v0.2.0

func (p *Postgres) UpdateChatSession(ctx context.Context, id string, session service.ChatSession) (*service.ChatSession, error)

func (*Postgres) UpdateComment added in v0.2.0

func (p *Postgres) UpdateComment(ctx context.Context, id string, comment service.IssueComment) (*service.IssueComment, error)

func (*Postgres) UpdateConnection added in v0.2.1

func (p *Postgres) UpdateConnection(ctx context.Context, id string, c service.Connection) (*service.Connection, error)

func (*Postgres) UpdateGoal added in v0.2.0

func (p *Postgres) UpdateGoal(ctx context.Context, id string, goal service.Goal) (*service.Goal, error)

func (*Postgres) UpdateGuide added in v0.2.1

func (p *Postgres) UpdateGuide(ctx context.Context, id string, g service.Guide) (*service.Guide, error)

func (*Postgres) UpdateHeartbeatRun added in v0.2.0

func (p *Postgres) UpdateHeartbeatRun(ctx context.Context, id string, run service.HeartbeatRun) (*service.HeartbeatRun, error)

func (*Postgres) UpdateLabel added in v0.2.0

func (p *Postgres) UpdateLabel(ctx context.Context, id string, label service.Label) (*service.Label, error)

func (*Postgres) UpdateLastUsed

func (p *Postgres) UpdateLastUsed(ctx context.Context, id string) error

func (*Postgres) UpdateMCPServer added in v0.2.0

func (p *Postgres) UpdateMCPServer(ctx context.Context, id string, s service.MCPServer) (*service.MCPServer, error)

func (*Postgres) UpdateMCPSet added in v0.2.0

func (p *Postgres) UpdateMCPSet(ctx context.Context, id string, s service.MCPSet) (*service.MCPSet, error)

func (*Postgres) UpdateMarketplaceSource added in v0.2.0

func (p *Postgres) UpdateMarketplaceSource(ctx context.Context, id string, src service.MarketplaceSource) (*service.MarketplaceSource, error)

func (*Postgres) UpdateNodeConfig added in v0.2.0

func (p *Postgres) UpdateNodeConfig(ctx context.Context, id string, nc service.NodeConfig) (*service.NodeConfig, error)

func (*Postgres) UpdateOrganization added in v0.2.0

func (p *Postgres) UpdateOrganization(ctx context.Context, id string, org service.Organization) (*service.Organization, error)

func (*Postgres) UpdateOrganizationAgent added in v0.2.0

func (p *Postgres) UpdateOrganizationAgent(ctx context.Context, id string, oa service.OrganizationAgent) (*service.OrganizationAgent, error)

func (*Postgres) UpdatePackSource added in v0.2.1

func (p *Postgres) UpdatePackSource(ctx context.Context, id string, ps service.PackSource) (*service.PackSource, error)

func (*Postgres) UpdateProject added in v0.2.0

func (p *Postgres) UpdateProject(ctx context.Context, id string, project service.Project) (*service.Project, error)

func (*Postgres) UpdateProvider

func (p *Postgres) UpdateProvider(ctx context.Context, key string, record service.ProviderRecord) (*service.ProviderRecord, error)

func (*Postgres) UpdateRAGCollection added in v0.2.0

func (p *Postgres) UpdateRAGCollection(ctx context.Context, id string, c service.RAGCollection) (*service.RAGCollection, error)

func (*Postgres) UpdateSkill added in v0.2.0

func (p *Postgres) UpdateSkill(ctx context.Context, id string, sk service.Skill) (*service.Skill, error)

func (*Postgres) UpdateTask added in v0.2.0

func (p *Postgres) UpdateTask(ctx context.Context, id string, task service.Task) (*service.Task, error)

func (*Postgres) UpdateTaskStatus added in v0.2.0

func (p *Postgres) UpdateTaskStatus(ctx context.Context, id string, status string, result string) error

func (*Postgres) UpdateTrigger added in v0.2.0

func (p *Postgres) UpdateTrigger(ctx context.Context, id string, t service.Trigger) (*service.Trigger, error)

func (*Postgres) UpdateVariable added in v0.2.0

func (p *Postgres) UpdateVariable(ctx context.Context, id string, v service.Variable) (*service.Variable, error)

func (*Postgres) UpdateWorkflow added in v0.2.0

func (p *Postgres) UpdateWorkflow(ctx context.Context, id string, w service.Workflow) (*service.Workflow, error)

func (*Postgres) UpsertAgentRuntimeState added in v0.2.0

func (p *Postgres) UpsertAgentRuntimeState(ctx context.Context, state service.AgentRuntimeState) error

func (*Postgres) UpsertAgentTaskSession added in v0.2.0

func (p *Postgres) UpsertAgentTaskSession(ctx context.Context, session service.AgentTaskSession) error

func (*Postgres) UpsertRAGPage added in v0.2.0

func (p *Postgres) UpsertRAGPage(ctx context.Context, page service.RAGPage) (*service.RAGPage, error)

Jump to

Keyboard shortcuts

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