Documentation
¶
Index ¶
- Variables
- func MigrateDB(ctx context.Context, cfg *config.Migrate) error
- type Postgres
- func (p *Postgres) AccumulateUsage(ctx context.Context, agentID string, ...) error
- func (p *Postgres) AddLabelToTask(ctx context.Context, taskID, labelID string) error
- func (p *Postgres) CheckoutTask(ctx context.Context, taskID, agentID string) error
- func (p *Postgres) Close()
- func (p *Postgres) CreateAPIToken(ctx context.Context, token service.APIToken, tokenHash string) (*service.APIToken, error)
- func (p *Postgres) CreateAgent(ctx context.Context, agent service.Agent) (*service.Agent, error)
- func (p *Postgres) CreateAgentMemory(ctx context.Context, mem service.AgentMemory) (*service.AgentMemory, error)
- func (p *Postgres) CreateAgentMemoryMessages(ctx context.Context, msgs service.AgentMemoryMessages) error
- func (p *Postgres) CreateApproval(ctx context.Context, approval service.Approval) (*service.Approval, error)
- func (p *Postgres) CreateBotConfig(ctx context.Context, bot service.BotConfig) (*service.BotConfig, error)
- func (p *Postgres) CreateChatMessage(ctx context.Context, msg service.ChatMessage) (*service.ChatMessage, error)
- func (p *Postgres) CreateChatMessages(ctx context.Context, msgs []service.ChatMessage) error
- func (p *Postgres) CreateChatSession(ctx context.Context, session service.ChatSession) (*service.ChatSession, error)
- func (p *Postgres) CreateComment(ctx context.Context, comment service.IssueComment) (*service.IssueComment, error)
- func (p *Postgres) CreateConnection(ctx context.Context, c service.Connection) (*service.Connection, error)
- func (p *Postgres) CreateGoal(ctx context.Context, goal service.Goal) (*service.Goal, error)
- func (p *Postgres) CreateGuide(ctx context.Context, g service.Guide) (*service.Guide, error)
- func (p *Postgres) CreateHeartbeatRun(ctx context.Context, run service.HeartbeatRun) (*service.HeartbeatRun, error)
- func (p *Postgres) CreateLabel(ctx context.Context, label service.Label) (*service.Label, error)
- func (p *Postgres) CreateMCPServer(ctx context.Context, s service.MCPServer) (*service.MCPServer, error)
- func (p *Postgres) CreateMCPSet(ctx context.Context, s service.MCPSet) (*service.MCPSet, error)
- func (p *Postgres) CreateMarketplaceSource(ctx context.Context, src service.MarketplaceSource) (*service.MarketplaceSource, error)
- func (p *Postgres) CreateNodeConfig(ctx context.Context, nc service.NodeConfig) (*service.NodeConfig, error)
- func (p *Postgres) CreateOrCoalesce(ctx context.Context, req service.WakeupRequest) (*service.WakeupRequest, error)
- func (p *Postgres) CreateOrganization(ctx context.Context, org service.Organization) (*service.Organization, error)
- func (p *Postgres) CreateOrganizationAgent(ctx context.Context, oa service.OrganizationAgent) (*service.OrganizationAgent, error)
- func (p *Postgres) CreatePackSource(ctx context.Context, ps service.PackSource) (*service.PackSource, error)
- func (p *Postgres) CreateProject(ctx context.Context, project service.Project) (*service.Project, error)
- func (p *Postgres) CreateProvider(ctx context.Context, record service.ProviderRecord) (*service.ProviderRecord, error)
- func (p *Postgres) CreateRAGCollection(ctx context.Context, c service.RAGCollection) (*service.RAGCollection, error)
- func (p *Postgres) CreateRevision(ctx context.Context, rev service.AgentConfigRevision) (*service.AgentConfigRevision, error)
- func (p *Postgres) CreateSkill(ctx context.Context, sk service.Skill) (*service.Skill, error)
- func (p *Postgres) CreateTask(ctx context.Context, task service.Task) (*service.Task, error)
- func (p *Postgres) CreateTrigger(ctx context.Context, t service.Trigger) (*service.Trigger, error)
- func (p *Postgres) CreateVariable(ctx context.Context, v service.Variable) (*service.Variable, error)
- func (p *Postgres) CreateWorkflow(ctx context.Context, w service.Workflow) (*service.Workflow, error)
- func (p *Postgres) CreateWorkflowVersion(ctx context.Context, v service.WorkflowVersion) (*service.WorkflowVersion, error)
- func (p *Postgres) DeleteAPIToken(ctx context.Context, id string) error
- func (p *Postgres) DeleteAgent(ctx context.Context, id string) error
- func (p *Postgres) DeleteAgentMemory(ctx context.Context, id string) error
- func (p *Postgres) DeleteAgentTaskSession(ctx context.Context, agentID, taskKey string) error
- func (p *Postgres) DeleteBotConfig(ctx context.Context, id string) error
- func (p *Postgres) DeleteChatMessages(ctx context.Context, sessionID string) error
- func (p *Postgres) DeleteChatSession(ctx context.Context, id string) error
- func (p *Postgres) DeleteComment(ctx context.Context, id string) error
- func (p *Postgres) DeleteConnection(ctx context.Context, id string) error
- func (p *Postgres) DeleteGoal(ctx context.Context, id string) error
- func (p *Postgres) DeleteGuide(ctx context.Context, id string) error
- func (p *Postgres) DeleteLabel(ctx context.Context, id string) error
- func (p *Postgres) DeleteMCPServer(ctx context.Context, id string) error
- func (p *Postgres) DeleteMCPSet(ctx context.Context, id string) error
- func (p *Postgres) DeleteMarketplaceSource(ctx context.Context, id string) error
- func (p *Postgres) DeleteNodeConfig(ctx context.Context, id string) error
- func (p *Postgres) DeleteOrganization(ctx context.Context, id string) error
- func (p *Postgres) DeleteOrganizationAgent(ctx context.Context, id string) error
- func (p *Postgres) DeleteOrganizationAgentByPair(ctx context.Context, orgID, agentID string) error
- func (p *Postgres) DeletePackSource(ctx context.Context, id string) error
- func (p *Postgres) DeleteProject(ctx context.Context, id string) error
- func (p *Postgres) DeleteProvider(ctx context.Context, key string) error
- func (p *Postgres) DeleteRAGCollection(ctx context.Context, id string) error
- func (p *Postgres) DeleteRAGPage(ctx context.Context, id string) error
- func (p *Postgres) DeleteRAGPageBySource(ctx context.Context, collectionID, source string) error
- func (p *Postgres) DeleteRAGPagesByCollectionID(ctx context.Context, collectionID string) error
- func (p *Postgres) DeleteSkill(ctx context.Context, id string) error
- func (p *Postgres) DeleteTask(ctx context.Context, id string) error
- func (p *Postgres) DeleteTrigger(ctx context.Context, id string) error
- func (p *Postgres) DeleteUserPreference(ctx context.Context, userID, key string) error
- func (p *Postgres) DeleteVariable(ctx context.Context, id string) error
- func (p *Postgres) DeleteWorkflow(ctx context.Context, id string) error
- func (p *Postgres) GetAPITokenByHash(ctx context.Context, hash string) (*service.APIToken, error)
- func (p *Postgres) GetActiveRun(ctx context.Context, agentID string) (*service.HeartbeatRun, error)
- func (p *Postgres) GetAgent(ctx context.Context, id string) (*service.Agent, error)
- func (p *Postgres) GetAgentBudget(ctx context.Context, agentID string) (*service.AgentBudget, error)
- func (p *Postgres) GetAgentMemory(ctx context.Context, id string) (*service.AgentMemory, error)
- func (p *Postgres) GetAgentMemoryMessages(ctx context.Context, memoryID string) (*service.AgentMemoryMessages, error)
- func (p *Postgres) GetAgentRuntimeState(ctx context.Context, agentID string) (*service.AgentRuntimeState, error)
- func (p *Postgres) GetAgentTaskSession(ctx context.Context, agentID, taskKey string) (*service.AgentTaskSession, error)
- func (p *Postgres) GetAgentTotalSpend(ctx context.Context, agentID string) (float64, error)
- func (p *Postgres) GetAgentUsage(ctx context.Context, agentID string, q *query.Query) (*service.ListResult[service.AgentUsageRecord], error)
- func (p *Postgres) GetApproval(ctx context.Context, id string) (*service.Approval, error)
- func (p *Postgres) GetAuditTrail(ctx context.Context, resourceType, resourceID string) ([]service.AuditEntry, error)
- func (p *Postgres) GetBotConfig(ctx context.Context, id string) (*service.BotConfig, error)
- func (p *Postgres) GetChatSession(ctx context.Context, id string) (*service.ChatSession, error)
- func (p *Postgres) GetChatSessionByPlatform(ctx context.Context, platform, platformUserID, platformChannelID string) (*service.ChatSession, error)
- func (p *Postgres) GetChatSessionByTaskID(ctx context.Context, taskID string) (*service.ChatSession, error)
- func (p *Postgres) GetComment(ctx context.Context, id string) (*service.IssueComment, error)
- func (p *Postgres) GetConnection(ctx context.Context, id string) (*service.Connection, error)
- func (p *Postgres) GetConnectionByName(ctx context.Context, provider, name string) (*service.Connection, error)
- func (p *Postgres) GetCostByAgent(ctx context.Context, agentID string) (float64, error)
- func (p *Postgres) GetCostByBillingCode(ctx context.Context, billingCode string) (float64, error)
- func (p *Postgres) GetCostByGoal(ctx context.Context, goalID string) (float64, error)
- func (p *Postgres) GetCostByProject(ctx context.Context, projectID string) (float64, error)
- func (p *Postgres) GetGoal(ctx context.Context, id string) (*service.Goal, error)
- func (p *Postgres) GetGoalAncestry(ctx context.Context, id string) ([]service.Goal, error)
- func (p *Postgres) GetGuide(ctx context.Context, id string) (*service.Guide, error)
- func (p *Postgres) GetHeartbeat(ctx context.Context, agentID string) (*service.AgentHeartbeat, error)
- func (p *Postgres) GetHeartbeatRun(ctx context.Context, id string) (*service.HeartbeatRun, error)
- func (p *Postgres) GetLabel(ctx context.Context, id string) (*service.Label, error)
- func (p *Postgres) GetLatestRevision(ctx context.Context, agentID string) (*service.AgentConfigRevision, error)
- func (p *Postgres) GetMCPServer(ctx context.Context, id string) (*service.MCPServer, error)
- func (p *Postgres) GetMCPServerByName(ctx context.Context, name string) (*service.MCPServer, error)
- func (p *Postgres) GetMCPSet(ctx context.Context, id string) (*service.MCPSet, error)
- func (p *Postgres) GetMCPSetByName(ctx context.Context, name string) (*service.MCPSet, error)
- func (p *Postgres) GetMarketplaceSource(ctx context.Context, id string) (*service.MarketplaceSource, error)
- func (p *Postgres) GetNodeConfig(ctx context.Context, id string) (*service.NodeConfig, error)
- func (p *Postgres) GetOrganization(ctx context.Context, id string) (*service.Organization, error)
- func (p *Postgres) GetOrganizationAgent(ctx context.Context, id string) (*service.OrganizationAgent, error)
- func (p *Postgres) GetOrganizationAgentByPair(ctx context.Context, orgID, agentID string) (*service.OrganizationAgent, error)
- func (p *Postgres) GetPackSource(ctx context.Context, id string) (*service.PackSource, error)
- func (p *Postgres) GetProject(ctx context.Context, id string) (*service.Project, error)
- func (p *Postgres) GetProvider(ctx context.Context, key string) (*service.ProviderRecord, error)
- func (p *Postgres) GetRAGCollection(ctx context.Context, id string) (*service.RAGCollection, error)
- func (p *Postgres) GetRAGCollectionByName(ctx context.Context, name string) (*service.RAGCollection, error)
- func (p *Postgres) GetRAGPage(ctx context.Context, id string) (*service.RAGPage, error)
- func (p *Postgres) GetRAGPageBySource(ctx context.Context, collectionID, source string) (*service.RAGPage, error)
- func (p *Postgres) GetRAGState(ctx context.Context, key string) (*service.RAGState, error)
- func (p *Postgres) GetRevision(ctx context.Context, id string) (*service.AgentConfigRevision, error)
- func (p *Postgres) GetSkill(ctx context.Context, id string) (*service.Skill, error)
- func (p *Postgres) GetSkillByName(ctx context.Context, name string) (*service.Skill, error)
- func (p *Postgres) GetTask(ctx context.Context, id string) (*service.Task, error)
- func (p *Postgres) GetTokenTotalUsage(ctx context.Context, tokenID string) (int64, error)
- func (p *Postgres) GetTokenUsage(ctx context.Context, tokenID string) ([]service.TokenUsage, error)
- func (p *Postgres) GetTrigger(ctx context.Context, id string) (*service.Trigger, error)
- func (p *Postgres) GetTriggerByAlias(ctx context.Context, alias string) (*service.Trigger, error)
- func (p *Postgres) GetUsageGrouped(ctx context.Context, filter service.UsageFilter, groupBy string, limit int) ([]service.UsageSummary, error)
- func (p *Postgres) GetUsageSummary(ctx context.Context, filter service.UsageFilter) (service.UsageSummary, error)
- func (p *Postgres) GetUsageTimeSeries(ctx context.Context, filter service.UsageFilter, bucket string) ([]service.UsageTimeSeriesPoint, error)
- func (p *Postgres) GetUserPreference(ctx context.Context, userID, key string) (*service.UserPreference, error)
- func (p *Postgres) GetVariable(ctx context.Context, id string) (*service.Variable, error)
- func (p *Postgres) GetVariableByKey(ctx context.Context, key string) (*service.Variable, error)
- func (p *Postgres) GetWakeupRequest(ctx context.Context, id string) (*service.WakeupRequest, error)
- func (p *Postgres) GetWorkflow(ctx context.Context, id string) (*service.Workflow, error)
- func (p *Postgres) GetWorkflowByName(ctx context.Context, name string) (*service.Workflow, error)
- func (p *Postgres) GetWorkflowVersion(ctx context.Context, workflowID string, version int) (*service.WorkflowVersion, error)
- func (p *Postgres) IncrementIssueCounter(ctx context.Context, orgID string) (int64, error)
- func (p *Postgres) ListAPITokens(ctx context.Context, q *query.Query) (*service.ListResult[service.APIToken], error)
- func (p *Postgres) ListAgentBudgets(ctx context.Context) ([]service.AgentBudget, error)
- func (p *Postgres) ListAgentMemories(ctx context.Context, agentID, orgID string) ([]service.AgentMemory, error)
- func (p *Postgres) ListAgentOrganizations(ctx context.Context, agentID string) ([]service.OrganizationAgent, error)
- func (p *Postgres) ListAgentTaskSessions(ctx context.Context, agentID string) ([]service.AgentTaskSession, error)
- func (p *Postgres) ListAgents(ctx context.Context, q *query.Query) (*service.ListResult[service.Agent], error)
- func (p *Postgres) ListAllTriggers(ctx context.Context) ([]service.Trigger, error)
- func (p *Postgres) ListApprovals(ctx context.Context, q *query.Query) (*service.ListResult[service.Approval], error)
- func (p *Postgres) ListAuditEntries(ctx context.Context, q *query.Query) (*service.ListResult[service.AuditEntry], error)
- func (p *Postgres) ListBotConfigs(ctx context.Context, q *query.Query) (*service.ListResult[service.BotConfig], error)
- func (p *Postgres) ListChatMessages(ctx context.Context, sessionID string) ([]service.ChatMessage, error)
- func (p *Postgres) ListChatSessions(ctx context.Context, q *query.Query) (*service.ListResult[service.ChatSession], error)
- func (p *Postgres) ListChildTasks(ctx context.Context, parentID string) ([]service.Task, error)
- func (p *Postgres) ListCommentsByTask(ctx context.Context, taskID string) ([]service.IssueComment, error)
- func (p *Postgres) ListConnections(ctx context.Context, q *query.Query) (*service.ListResult[service.Connection], error)
- func (p *Postgres) ListConnectionsByProvider(ctx context.Context, provider string) ([]service.Connection, error)
- func (p *Postgres) ListCostEvents(ctx context.Context, q *query.Query) (*service.ListResult[service.CostEvent], error)
- func (p *Postgres) ListEnabledCronTriggers(ctx context.Context) ([]service.Trigger, error)
- func (p *Postgres) ListGoals(ctx context.Context, q *query.Query) (*service.ListResult[service.Goal], error)
- func (p *Postgres) ListGoalsByParent(ctx context.Context, parentID string) ([]service.Goal, error)
- func (p *Postgres) ListGuides(ctx context.Context, q *query.Query) (*service.ListResult[service.Guide], error)
- func (p *Postgres) ListHeartbeatRuns(ctx context.Context, agentID string, q *query.Query) (*service.ListResult[service.HeartbeatRun], error)
- func (p *Postgres) ListHeartbeats(ctx context.Context) ([]service.AgentHeartbeat, error)
- func (p *Postgres) ListLabels(ctx context.Context, orgID string) ([]service.Label, error)
- func (p *Postgres) ListLabelsForTask(ctx context.Context, taskID string) ([]service.Label, error)
- func (p *Postgres) ListMCPServers(ctx context.Context, q *query.Query) (*service.ListResult[service.MCPServer], error)
- func (p *Postgres) ListMCPSets(ctx context.Context, q *query.Query) (*service.ListResult[service.MCPSet], error)
- func (p *Postgres) ListMarketplaceSources(ctx context.Context) ([]service.MarketplaceSource, error)
- func (p *Postgres) ListModelPricing(ctx context.Context) ([]service.ModelPricing, error)
- func (p *Postgres) ListNodeConfigs(ctx context.Context, q *query.Query) (*service.ListResult[service.NodeConfig], error)
- func (p *Postgres) ListNodeConfigsByType(ctx context.Context, configType string) ([]service.NodeConfig, error)
- func (p *Postgres) ListOrgMemories(ctx context.Context, orgID string) ([]service.AgentMemory, error)
- func (p *Postgres) ListOrganizationAgents(ctx context.Context, orgID string) ([]service.OrganizationAgent, error)
- func (p *Postgres) ListOrganizations(ctx context.Context, q *query.Query) (*service.ListResult[service.Organization], error)
- func (p *Postgres) ListPackSources(ctx context.Context, q *query.Query) (*service.ListResult[service.PackSource], error)
- func (p *Postgres) ListPendingApprovals(ctx context.Context, orgID string) ([]service.Approval, error)
- func (p *Postgres) ListPendingForAgent(ctx context.Context, agentID string) ([]service.WakeupRequest, error)
- func (p *Postgres) ListProjects(ctx context.Context, q *query.Query) (*service.ListResult[service.Project], error)
- func (p *Postgres) ListProjectsByGoal(ctx context.Context, goalID string) ([]service.Project, error)
- func (p *Postgres) ListProjectsByOrganization(ctx context.Context, orgID string) ([]service.Project, error)
- func (p *Postgres) ListProviders(ctx context.Context, q *query.Query) (*service.ListResult[service.ProviderRecord], error)
- func (p *Postgres) ListRAGCollections(ctx context.Context, q *query.Query) (*service.ListResult[service.RAGCollection], error)
- func (p *Postgres) ListRAGPages(ctx context.Context, collectionID string, q *query.Query) (*service.ListResult[service.RAGPage], error)
- func (p *Postgres) ListRevisions(ctx context.Context, agentID string) ([]service.AgentConfigRevision, error)
- func (p *Postgres) ListSkills(ctx context.Context, q *query.Query) (*service.ListResult[service.Skill], error)
- func (p *Postgres) ListTasks(ctx context.Context, q *query.Query) (*service.ListResult[service.Task], error)
- func (p *Postgres) ListTasksByAgent(ctx context.Context, agentID string) ([]service.Task, error)
- func (p *Postgres) ListTasksByGoal(ctx context.Context, goalID string) ([]service.Task, error)
- func (p *Postgres) ListTasksForLabel(ctx context.Context, labelID string) ([]string, error)
- func (p *Postgres) ListTriggers(ctx context.Context, workflowID string) ([]service.Trigger, error)
- func (p *Postgres) ListUserPreferences(ctx context.Context, userID string) ([]service.UserPreference, error)
- func (p *Postgres) ListVariables(ctx context.Context, q *query.Query) (*service.ListResult[service.Variable], error)
- func (p *Postgres) ListWorkflowVersions(ctx context.Context, workflowID string) ([]service.WorkflowVersion, error)
- func (p *Postgres) ListWorkflows(ctx context.Context, q *query.Query) (*service.ListResult[service.Workflow], error)
- func (p *Postgres) MarkDispatched(ctx context.Context, id, runID string) error
- func (p *Postgres) MarkStale(ctx context.Context, threshold time.Duration) (int, error)
- func (p *Postgres) PromoteDeferred(ctx context.Context, agentID string) error
- func (p *Postgres) RecordAgentUsage(ctx context.Context, usage service.AgentUsageRecord) error
- func (p *Postgres) RecordAudit(ctx context.Context, entry service.AuditEntry) error
- func (p *Postgres) RecordCostEvent(ctx context.Context, event service.CostEvent) error
- func (p *Postgres) RecordHeartbeat(ctx context.Context, agentID string, metadata map[string]any) error
- func (p *Postgres) RecordUsage(ctx context.Context, tokenID, model string, usage service.Usage) error
- func (p *Postgres) ReleaseTask(ctx context.Context, taskID string) error
- func (p *Postgres) RemoveLabelFromTask(ctx context.Context, taskID, labelID string) error
- func (p *Postgres) ResetTokenUsage(ctx context.Context, tokenID string) error
- func (p *Postgres) RotateEncryptionKey(ctx context.Context, newKey []byte) error
- func (p *Postgres) SearchAgentMemories(ctx context.Context, agentID, orgID, query string) ([]service.AgentMemory, error)
- func (p *Postgres) SetActiveVersion(ctx context.Context, workflowID string, version int) error
- func (p *Postgres) SetAgentBudget(ctx context.Context, budget service.AgentBudget) error
- func (p *Postgres) SetEncryptionKey(newKey []byte)
- func (p *Postgres) SetModelPricing(ctx context.Context, pricing service.ModelPricing) error
- func (p *Postgres) SetRAGState(ctx context.Context, key string, value string) error
- func (p *Postgres) SetUserPreference(ctx context.Context, pref service.UserPreference) error
- func (p *Postgres) UpdateAPIToken(ctx context.Context, id string, token service.APIToken) (*service.APIToken, error)
- func (p *Postgres) UpdateAgent(ctx context.Context, id string, agent service.Agent) (*service.Agent, error)
- func (p *Postgres) UpdateApproval(ctx context.Context, id string, approval service.Approval) (*service.Approval, error)
- func (p *Postgres) UpdateBotConfig(ctx context.Context, id string, bot service.BotConfig) (*service.BotConfig, error)
- func (p *Postgres) UpdateChatSession(ctx context.Context, id string, session service.ChatSession) (*service.ChatSession, error)
- func (p *Postgres) UpdateComment(ctx context.Context, id string, comment service.IssueComment) (*service.IssueComment, error)
- func (p *Postgres) UpdateConnection(ctx context.Context, id string, c service.Connection) (*service.Connection, error)
- func (p *Postgres) UpdateGoal(ctx context.Context, id string, goal service.Goal) (*service.Goal, error)
- func (p *Postgres) UpdateGuide(ctx context.Context, id string, g service.Guide) (*service.Guide, error)
- func (p *Postgres) UpdateHeartbeatRun(ctx context.Context, id string, run service.HeartbeatRun) (*service.HeartbeatRun, error)
- func (p *Postgres) UpdateLabel(ctx context.Context, id string, label service.Label) (*service.Label, error)
- func (p *Postgres) UpdateLastUsed(ctx context.Context, id string) error
- func (p *Postgres) UpdateMCPServer(ctx context.Context, id string, s service.MCPServer) (*service.MCPServer, error)
- func (p *Postgres) UpdateMCPSet(ctx context.Context, id string, s service.MCPSet) (*service.MCPSet, error)
- func (p *Postgres) UpdateMarketplaceSource(ctx context.Context, id string, src service.MarketplaceSource) (*service.MarketplaceSource, error)
- func (p *Postgres) UpdateNodeConfig(ctx context.Context, id string, nc service.NodeConfig) (*service.NodeConfig, error)
- func (p *Postgres) UpdateOrganization(ctx context.Context, id string, org service.Organization) (*service.Organization, error)
- func (p *Postgres) UpdateOrganizationAgent(ctx context.Context, id string, oa service.OrganizationAgent) (*service.OrganizationAgent, error)
- func (p *Postgres) UpdatePackSource(ctx context.Context, id string, ps service.PackSource) (*service.PackSource, error)
- func (p *Postgres) UpdateProject(ctx context.Context, id string, project service.Project) (*service.Project, error)
- func (p *Postgres) UpdateProvider(ctx context.Context, key string, record service.ProviderRecord) (*service.ProviderRecord, error)
- func (p *Postgres) UpdateRAGCollection(ctx context.Context, id string, c service.RAGCollection) (*service.RAGCollection, error)
- func (p *Postgres) UpdateSkill(ctx context.Context, id string, sk service.Skill) (*service.Skill, error)
- func (p *Postgres) UpdateTask(ctx context.Context, id string, task service.Task) (*service.Task, error)
- func (p *Postgres) UpdateTaskStatus(ctx context.Context, id string, status string, result string) error
- func (p *Postgres) UpdateTrigger(ctx context.Context, id string, t service.Trigger) (*service.Trigger, error)
- func (p *Postgres) UpdateVariable(ctx context.Context, id string, v service.Variable) (*service.Variable, error)
- func (p *Postgres) UpdateWorkflow(ctx context.Context, id string, w service.Workflow) (*service.Workflow, error)
- func (p *Postgres) UpsertAgentRuntimeState(ctx context.Context, state service.AgentRuntimeState) error
- func (p *Postgres) UpsertAgentTaskSession(ctx context.Context, session service.AgentTaskSession) error
- func (p *Postgres) UpsertRAGPage(ctx context.Context, page service.RAGPage) (*service.RAGPage, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ConnMaxLifetime = 15 * time.Minute MaxIdleConns = 3 MaxOpenConns = 3 DefaultTablePrefix = "at_" )
Functions ¶
Types ¶
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) AccumulateUsage ¶ added in v0.2.0
func (*Postgres) AddLabelToTask ¶ added in v0.2.0
func (*Postgres) CheckoutTask ¶ added in v0.2.0
func (*Postgres) CreateAPIToken ¶
func (*Postgres) CreateAgent ¶ added in v0.2.0
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 (*Postgres) CreateApproval ¶ added in v0.2.0
func (*Postgres) CreateBotConfig ¶ added in v0.2.0
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 (*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 (*Postgres) CreateGuide ¶ added in v0.2.1
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 (*Postgres) CreateMCPServer ¶ added in v0.2.0
func (*Postgres) CreateMCPSet ¶ added in v0.2.0
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 (*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 (p *Postgres) CreateRevision(ctx context.Context, rev service.AgentConfigRevision) (*service.AgentConfigRevision, error)
func (*Postgres) CreateSkill ¶ added in v0.2.0
func (*Postgres) CreateTask ¶ added in v0.2.0
func (*Postgres) CreateTrigger ¶ added in v0.2.0
func (*Postgres) CreateVariable ¶ added in v0.2.0
func (*Postgres) CreateWorkflow ¶ added in v0.2.0
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 (*Postgres) DeleteAgent ¶ added in v0.2.0
func (*Postgres) DeleteAgentMemory ¶ added in v0.2.0
func (*Postgres) DeleteAgentTaskSession ¶ added in v0.2.0
func (*Postgres) DeleteBotConfig ¶ added in v0.2.0
func (*Postgres) DeleteChatMessages ¶ added in v0.2.0
func (*Postgres) DeleteChatSession ¶ added in v0.2.0
func (*Postgres) DeleteComment ¶ added in v0.2.0
func (*Postgres) DeleteConnection ¶ added in v0.2.1
func (*Postgres) DeleteGoal ¶ added in v0.2.0
func (*Postgres) DeleteGuide ¶ added in v0.2.1
func (*Postgres) DeleteLabel ¶ added in v0.2.0
func (*Postgres) DeleteMCPServer ¶ added in v0.2.0
func (*Postgres) DeleteMCPSet ¶ added in v0.2.0
func (*Postgres) DeleteMarketplaceSource ¶ added in v0.2.0
func (*Postgres) DeleteNodeConfig ¶ added in v0.2.0
func (*Postgres) DeleteOrganization ¶ added in v0.2.0
func (*Postgres) DeleteOrganizationAgent ¶ added in v0.2.0
func (*Postgres) DeleteOrganizationAgentByPair ¶ added in v0.2.0
func (*Postgres) DeletePackSource ¶ added in v0.2.1
func (*Postgres) DeleteProject ¶ added in v0.2.0
func (*Postgres) DeleteProvider ¶
func (*Postgres) DeleteRAGCollection ¶ added in v0.2.0
func (*Postgres) DeleteRAGPage ¶ added in v0.2.0
func (*Postgres) DeleteRAGPageBySource ¶ added in v0.2.0
func (*Postgres) DeleteRAGPagesByCollectionID ¶ added in v0.2.0
func (*Postgres) DeleteSkill ¶ added in v0.2.0
func (*Postgres) DeleteTask ¶ added in v0.2.0
func (*Postgres) DeleteTrigger ¶ added in v0.2.0
func (*Postgres) DeleteUserPreference ¶ added in v0.2.0
func (*Postgres) DeleteVariable ¶ added in v0.2.0
func (*Postgres) DeleteWorkflow ¶ added in v0.2.0
func (*Postgres) GetAPITokenByHash ¶
func (*Postgres) GetActiveRun ¶ added in v0.2.0
func (*Postgres) GetAgentBudget ¶ added in v0.2.0
func (*Postgres) GetAgentMemory ¶ added in v0.2.0
func (*Postgres) GetAgentMemoryMessages ¶ added in v0.2.0
func (*Postgres) GetAgentRuntimeState ¶ added in v0.2.0
func (*Postgres) GetAgentTaskSession ¶ added in v0.2.0
func (*Postgres) GetAgentTotalSpend ¶ added in v0.2.0
func (*Postgres) GetAgentUsage ¶ added in v0.2.0
func (*Postgres) GetApproval ¶ added in v0.2.0
func (*Postgres) GetAuditTrail ¶ added in v0.2.0
func (*Postgres) GetBotConfig ¶ added in v0.2.0
func (*Postgres) GetChatSession ¶ added in v0.2.0
func (*Postgres) GetChatSessionByPlatform ¶ added in v0.2.0
func (*Postgres) GetChatSessionByTaskID ¶ added in v0.2.0
func (*Postgres) GetComment ¶ added in v0.2.0
func (*Postgres) GetConnection ¶ added in v0.2.1
func (*Postgres) GetConnectionByName ¶ added in v0.2.1
func (*Postgres) GetCostByAgent ¶ added in v0.2.0
func (*Postgres) GetCostByBillingCode ¶ added in v0.2.0
func (*Postgres) GetCostByGoal ¶ added in v0.2.0
func (*Postgres) GetCostByProject ¶ added in v0.2.0
func (*Postgres) GetGoalAncestry ¶ added in v0.2.0
func (*Postgres) GetHeartbeat ¶ added in v0.2.0
func (*Postgres) GetHeartbeatRun ¶ added in v0.2.0
func (*Postgres) GetLatestRevision ¶ added in v0.2.0
func (*Postgres) GetMCPServer ¶ added in v0.2.0
func (*Postgres) GetMCPServerByName ¶ added in v0.2.0
func (*Postgres) GetMCPSetByName ¶ added in v0.2.0
func (*Postgres) GetMarketplaceSource ¶ added in v0.2.0
func (*Postgres) GetNodeConfig ¶ added in v0.2.0
func (*Postgres) GetOrganization ¶ added in v0.2.0
func (*Postgres) GetOrganizationAgent ¶ added in v0.2.0
func (*Postgres) GetOrganizationAgentByPair ¶ added in v0.2.0
func (*Postgres) GetPackSource ¶ added in v0.2.1
func (*Postgres) GetProject ¶ added in v0.2.0
func (*Postgres) GetProvider ¶
func (*Postgres) GetRAGCollection ¶ added in v0.2.0
func (*Postgres) GetRAGCollectionByName ¶ added in v0.2.0
func (*Postgres) GetRAGPage ¶ added in v0.2.0
func (*Postgres) GetRAGPageBySource ¶ added in v0.2.0
func (*Postgres) GetRAGState ¶ added in v0.2.0
func (*Postgres) GetRevision ¶ added in v0.2.0
func (*Postgres) GetSkillByName ¶ added in v0.2.0
func (*Postgres) GetTokenTotalUsage ¶ added in v0.2.0
func (*Postgres) GetTokenUsage ¶ added in v0.2.0
func (*Postgres) GetTrigger ¶ added in v0.2.0
func (*Postgres) GetTriggerByAlias ¶ added in v0.2.0
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 (*Postgres) GetVariable ¶ added in v0.2.0
func (*Postgres) GetVariableByKey ¶ added in v0.2.0
func (*Postgres) GetWakeupRequest ¶ added in v0.2.0
func (*Postgres) GetWorkflow ¶ added in v0.2.0
func (*Postgres) GetWorkflowByName ¶ added in v0.2.1
func (*Postgres) GetWorkflowVersion ¶ added in v0.2.0
func (*Postgres) IncrementIssueCounter ¶ added in v0.2.0
func (*Postgres) ListAPITokens ¶
func (*Postgres) ListAgentBudgets ¶ added in v0.2.1
ListAgentBudgets returns all configured agent budgets.
func (*Postgres) ListAgentMemories ¶ added in v0.2.0
func (*Postgres) ListAgentOrganizations ¶ added in v0.2.0
func (*Postgres) ListAgentTaskSessions ¶ added in v0.2.0
func (*Postgres) ListAgents ¶ added in v0.2.0
func (*Postgres) ListAllTriggers ¶ added in v0.2.0
func (*Postgres) ListApprovals ¶ added in v0.2.0
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 (*Postgres) ListChatMessages ¶ added in v0.2.0
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 (*Postgres) ListCommentsByTask ¶ added in v0.2.0
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 (*Postgres) ListCostEvents ¶ added in v0.2.0
func (*Postgres) ListEnabledCronTriggers ¶ added in v0.2.0
func (*Postgres) ListGoalsByParent ¶ added in v0.2.0
func (*Postgres) ListGuides ¶ added in v0.2.1
func (*Postgres) ListHeartbeatRuns ¶ added in v0.2.0
func (*Postgres) ListHeartbeats ¶ added in v0.2.0
func (*Postgres) ListLabels ¶ added in v0.2.0
func (*Postgres) ListLabelsForTask ¶ added in v0.2.0
func (*Postgres) ListMCPServers ¶ added in v0.2.0
func (*Postgres) ListMCPSets ¶ added in v0.2.0
func (*Postgres) ListMarketplaceSources ¶ added in v0.2.0
func (*Postgres) ListModelPricing ¶ added in v0.2.0
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 (*Postgres) ListOrgMemories ¶ added in v0.2.0
func (*Postgres) ListOrganizationAgents ¶ added in v0.2.0
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 (*Postgres) ListPendingForAgent ¶ added in v0.2.0
func (*Postgres) ListProjects ¶ added in v0.2.0
func (*Postgres) ListProjectsByGoal ¶ added in v0.2.0
func (*Postgres) ListProjectsByOrganization ¶ added in v0.2.0
func (*Postgres) ListProviders ¶
func (p *Postgres) ListProviders(ctx context.Context, q *query.Query) (*service.ListResult[service.ProviderRecord], error)
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 (*Postgres) ListRevisions ¶ added in v0.2.0
func (*Postgres) ListSkills ¶ added in v0.2.0
func (*Postgres) ListTasksByAgent ¶ added in v0.2.0
func (*Postgres) ListTasksByGoal ¶ added in v0.2.0
func (*Postgres) ListTasksForLabel ¶ added in v0.2.0
func (*Postgres) ListTriggers ¶ added in v0.2.0
func (*Postgres) ListUserPreferences ¶ added in v0.2.0
func (*Postgres) ListVariables ¶ added in v0.2.0
func (*Postgres) ListWorkflowVersions ¶ added in v0.2.0
func (*Postgres) ListWorkflows ¶ added in v0.2.0
func (*Postgres) MarkDispatched ¶ added in v0.2.0
func (*Postgres) PromoteDeferred ¶ added in v0.2.0
func (*Postgres) RecordAgentUsage ¶ added in v0.2.0
func (*Postgres) RecordAudit ¶ added in v0.2.0
func (*Postgres) RecordCostEvent ¶ added in v0.2.0
func (*Postgres) RecordHeartbeat ¶ added in v0.2.0
func (*Postgres) RecordUsage ¶ added in v0.2.0
func (*Postgres) ReleaseTask ¶ added in v0.2.0
func (*Postgres) RemoveLabelFromTask ¶ added in v0.2.0
func (*Postgres) ResetTokenUsage ¶ added in v0.2.0
func (*Postgres) RotateEncryptionKey ¶ added in v0.1.3
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 (*Postgres) SetActiveVersion ¶ added in v0.2.0
func (*Postgres) SetAgentBudget ¶ added in v0.2.0
func (*Postgres) SetEncryptionKey ¶ added in v0.1.3
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 (*Postgres) SetRAGState ¶ added in v0.2.0
func (*Postgres) SetUserPreference ¶ added in v0.2.0
func (*Postgres) UpdateAPIToken ¶
func (*Postgres) UpdateAgent ¶ added in v0.2.0
func (*Postgres) UpdateApproval ¶ added in v0.2.0
func (*Postgres) UpdateBotConfig ¶ added in v0.2.0
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 (*Postgres) UpdateGuide ¶ added in v0.2.1
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 (*Postgres) UpdateLastUsed ¶
func (*Postgres) UpdateMCPServer ¶ added in v0.2.0
func (*Postgres) UpdateMCPSet ¶ added in v0.2.0
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 (*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 (*Postgres) UpdateTask ¶ added in v0.2.0
func (*Postgres) UpdateTaskStatus ¶ added in v0.2.0
func (*Postgres) UpdateTrigger ¶ added in v0.2.0
func (*Postgres) UpdateVariable ¶ added in v0.2.0
func (*Postgres) UpdateWorkflow ¶ added in v0.2.0
func (*Postgres) UpsertAgentRuntimeState ¶ added in v0.2.0
func (*Postgres) UpsertAgentTaskSession ¶ added in v0.2.0
Source Files
¶
- agent-budgets.go
- agent-config-revisions.go
- agent-memory.go
- agent-runtime-state.go
- agent-task-sessions.go
- agents.go
- approvals.go
- audit.go
- bot-configs.go
- chat-sessions.go
- connections.go
- cost-events.go
- goals.go
- guides.go
- heartbeat-runs.go
- heartbeats.go
- issue-comments.go
- labels.go
- marketplace-sources.go
- mcp-servers.go
- mcp-sets.go
- migrate.go
- node-configs.go
- organization-agents.go
- organizations.go
- pack-sources.go
- postgres.go
- projects.go
- rag-collections.go
- rag-pages.go
- rag_states.go
- secrets.go
- skills.go
- tasks.go
- token-usage.go
- tokens.go
- triggers.go
- usage.go
- user-preferences.go
- utils.go
- wakeup-requests.go
- workflow_versions.go
- workflows.go
Click to show internal directories.
Click to hide internal directories.