sqlc

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquireOutboxMessagesParams

type AcquireOutboxMessagesParams struct {
	LockOwner pgtype.Text
	Column2   pgtype.Text
	Limit     int32
}

type AcquireTaskLeaseParams

type AcquireTaskLeaseParams struct {
	Name    string
	Holder  string
	Column3 pgtype.Text
}

type AdvanceIdempotencyRecoveryPointParams

type AdvanceIdempotencyRecoveryPointParams struct {
	RecoveryPoint string
	TypeID        string
}

type AgentAccountStatus

type AgentAccountStatus struct {
	ID                string
	AccountID         string
	AgentDefinitionID string
	StatusCode        string
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
}

type AgentAction

type AgentAction struct {
	ID                  string
	AccountID           string
	AgentRunID          string
	ToolSlug            string
	StatusCode          string
	Label               pgtype.Text
	Description         pgtype.Text
	Input               []byte
	Output              []byte
	ErrorMessage        pgtype.Text
	EntityType          pgtype.Text
	EntityID            pgtype.Text
	RequiresReview      bool
	ReviewedAt          pgtype.Timestamptz
	ReviewedBy          pgtype.Text
	ReviewedByActorType pgtype.Text
	ReviewedByActorName pgtype.Text
	ExecutedAt          pgtype.Timestamptz
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
}

type AgentArtifact

type AgentArtifact struct {
	ID            string
	AccountID     string
	AgentActionID string
	ArtifactType  string
	Name          string
	Content       pgtype.Text
	Metadata      []byte
	S3Key         pgtype.Text
	MimeType      pgtype.Text
	SizeBytes     pgtype.Int8
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
}

type AgentConfig

type AgentConfig struct {
	ID                string
	AccountID         string
	AgentDefinitionID string
	IsEnabled         bool
	Config            []byte
	Schedule          pgtype.Text
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
}

type AgentDefinition

type AgentDefinition struct {
	ID             string
	AccountID      pgtype.Text
	Name           string
	Slug           string
	Description    pgtype.Text
	DefinitionType string
	CategoryCode   string
	TriggerType    string
	IsActive       bool
	Config         []byte
	RoleID         pgtype.Text
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type AgentDefinitionTool

type AgentDefinitionTool struct {
	ID                string
	AgentDefinitionID string
	Config            []byte
	SortOrder         int32
	RequireReview     bool
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	ToolSlug          string
}

type AgentMemory

type AgentMemory struct {
	ID         string
	AccountID  string
	Category   string
	Content    string
	Metadata   []byte
	EntityType pgtype.Text
	EntityID   pgtype.Text
	Importance float64
	ExpiresAt  pgtype.Timestamptz
	CreatedAt  pgtype.Timestamptz
	UpdatedAt  pgtype.Timestamptz
}

type AgentRun

type AgentRun struct {
	ID                       string
	AccountID                string
	AgentDefinitionID        string
	AgentConfigID            pgtype.Text
	StatusCode               string
	TriggerType              string
	Input                    []byte
	Output                   []byte
	ErrorMessage             pgtype.Text
	StartedAt                pgtype.Timestamptz
	CompletedAt              pgtype.Timestamptz
	DurationMs               pgtype.Int4
	TotalInputTokens         int64
	TotalOutputTokens        int64
	TriggeredByActorID       pgtype.Text
	TriggeredByIdentityType  pgtype.Text
	TriggeredByActorName     pgtype.Text
	AllowedToolSlugs         []byte
	CreatedAt                pgtype.Timestamptz
	UpdatedAt                pgtype.Timestamptz
	ConversationID           pgtype.Text
	TriggerMessageID         pgtype.Text
	DivergedFromConversation bool
	RetryCount               int32
}

type AgentRunEvent

type AgentRunEvent struct {
	ID            string
	AgentRunID    string
	AccountID     string
	StepType      string
	Title         string
	Content       pgtype.Text
	Sequence      int32
	DurationMs    pgtype.Int4
	AgentActionID pgtype.Text
	Metadata      []byte
	ActorID       pgtype.Text
	ActorType     pgtype.Text
	ActorName     pgtype.Text
	CreatedAt     pgtype.Timestamptz
}

type AgentTokenUsage

type AgentTokenUsage struct {
	ID           string
	AccountID    string
	Date         pgtype.Date
	InputTokens  int64
	OutputTokens int64
	TotalCost    float64
	RunCount     int32
	CreatedAt    pgtype.Timestamptz
	UpdatedAt    pgtype.Timestamptz
}

type CountDeletedRecordsByResourceAndResourceIDParams

type CountDeletedRecordsByResourceAndResourceIDParams struct {
	ResourceType string
	ResourceID   string
}

type CreateIdempotencyKeyParams

type CreateIdempotencyKeyParams struct {
	TypeID         string
	ServiceName    string
	Handler        string
	IdempotencyKey string
	ActorID        pgtype.Text
	IdentityType   string
	ScopeHash      string
	RecoveryPoint  string
}

type CreateOutboxMessageParams

type CreateOutboxMessageParams struct {
	MessageID       string
	ServiceName     string
	MessageType     string
	Destination     string
	RoutingKey      pgtype.Text
	Headers         db.NullableRawMessage
	Payload         []byte
	MaxAttempts     int32
	Column9         pgtype.Text
	RequestID       pgtype.Text
	ParentMessageID pgtype.Text
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteAgentAccountStatusParams

type DeleteAgentAccountStatusParams struct {
	AccountID         string
	AgentDefinitionID string
}

type DeleteAgentMemoryParams

type DeleteAgentMemoryParams struct {
	ID        string
	AccountID string
}

type DeletedRecord

type DeletedRecord struct {
	ID           int64
	DeletedAt    pgtype.Timestamptz
	ResourceType string
	ResourceID   string
	Data         []byte
}

type GetAgentAccountStatusParams

type GetAgentAccountStatusParams struct {
	AccountID         string
	AgentDefinitionID string
}

type GetAgentConfigByAccountAndDefinitionParams

type GetAgentConfigByAccountAndDefinitionParams struct {
	AccountID         string
	AgentDefinitionID string
}

type GetAgentDefinitionByAccountAndSlugParams

type GetAgentDefinitionByAccountAndSlugParams struct {
	Slug      string
	AccountID pgtype.Text
}

type GetAgentMemoriesByIDsParams

type GetAgentMemoriesByIDsParams struct {
	Ids       []string
	AccountID string
}

type GetAgentTokenUsageByAccountAndDateParams

type GetAgentTokenUsageByAccountAndDateParams struct {
	AccountID string
	Date      pgtype.Date
}

type GetIdempotencyKeyByScopeHashParams

type GetIdempotencyKeyByScopeHashParams struct {
	ServiceName string
	ScopeHash   string
}

type GetInboxRecordByMessageAndHandlerParams

type GetInboxRecordByMessageAndHandlerParams struct {
	MessageID string
	Handler   string
}

type GetMonthlyTokenUsageByAccountParams

type GetMonthlyTokenUsageByAccountParams struct {
	AccountID string
	Date      pgtype.Date
}

type GetMonthlyTokenUsageByAccountRow

type GetMonthlyTokenUsageByAccountRow struct {
	InputTokens  int64
	OutputTokens int64
}

type InsertAgentActionParams

type InsertAgentActionParams struct {
	ID             string
	AccountID      string
	AgentRunID     string
	ToolSlug       string
	StatusCode     string
	Label          pgtype.Text
	Description    pgtype.Text
	Input          []byte
	Output         []byte
	RequiresReview bool
}

type InsertAgentArtifactParams

type InsertAgentArtifactParams struct {
	ID            string
	AccountID     string
	AgentActionID string
	ArtifactType  string
	Name          string
	Content       pgtype.Text
	Metadata      []byte
	S3Key         pgtype.Text
	MimeType      pgtype.Text
	SizeBytes     pgtype.Int8
}

type InsertAgentConfigParams

type InsertAgentConfigParams struct {
	ID                string
	AccountID         string
	AgentDefinitionID string
	IsEnabled         bool
	Config            []byte
	Schedule          pgtype.Text
}

type InsertAgentDefinitionParams

type InsertAgentDefinitionParams struct {
	ID             string
	AccountID      pgtype.Text
	Name           string
	Slug           string
	Description    pgtype.Text
	DefinitionType string
	CategoryCode   string
	TriggerType    string
	IsActive       bool
	Config         []byte
	RoleID         pgtype.Text
}

type InsertAgentDefinitionToolParams

type InsertAgentDefinitionToolParams struct {
	ID                string
	AgentDefinitionID string
	ToolSlug          string
	Config            []byte
	SortOrder         int32
	RequireReview     bool
}

type InsertAgentMemoryParams

type InsertAgentMemoryParams struct {
	ID         string
	AccountID  string
	Category   string
	Content    string
	Metadata   []byte
	EntityType pgtype.Text
	EntityID   pgtype.Text
	Importance float64
	ExpiresAt  pgtype.Timestamptz
}

type InsertAgentRunEventParams

type InsertAgentRunEventParams struct {
	ID            string
	AgentRunID    string
	AccountID     string
	StepType      string
	Title         string
	Content       pgtype.Text
	Sequence      int32
	DurationMs    pgtype.Int4
	AgentActionID pgtype.Text
	Metadata      []byte
	ActorID       pgtype.Text
	ActorType     pgtype.Text
	ActorName     pgtype.Text
}

type InsertAgentRunParams

type InsertAgentRunParams struct {
	ID                      string
	AccountID               string
	AgentDefinitionID       string
	AgentConfigID           pgtype.Text
	StatusCode              string
	TriggerType             string
	Input                   []byte
	Output                  []byte
	TriggeredByActorID      pgtype.Text
	TriggeredByIdentityType pgtype.Text
	TriggeredByActorName    pgtype.Text
	ConversationID          pgtype.Text
	TriggerMessageID        pgtype.Text
}

type InsertAgentTokenUsageParams

type InsertAgentTokenUsageParams struct {
	ID           string
	AccountID    string
	Date         pgtype.Date
	InputTokens  int64
	OutputTokens int64
	TotalCost    float64
	RunCount     int32
}

type InsertDeletedRecordParams

type InsertDeletedRecordParams struct {
	ResourceType string
	ResourceID   string
	Data         []byte
}

type ListAccountMemoriesParams

type ListAccountMemoriesParams struct {
	AccountID string
	EntityID  pgtype.Text
	Limit     int32
}

type ListAgentDefinitionsByAccountCursorParams

type ListAgentDefinitionsByAccountCursorParams struct {
	AccountID            string
	FilterDefinitionType bool
	DefinitionTypes      []string
	FilterTriggerType    bool
	TriggerTypes         []string
	FilterStatus         bool
	StatusCodes          []string
	FilterQuery          bool
	Search               pgtype.Text
	HasCursor            bool
	CursorID             string
	Lim                  int32
}

type ListAgentDefinitionsByAccountFilteredParams

type ListAgentDefinitionsByAccountFilteredParams struct {
	AccountID            pgtype.Text
	FilterDefinitionType bool
	DefinitionTypes      []string
	FilterTriggerType    bool
	TriggerTypes         []string
}

type ListAgentMemoriesByAccountCursorParams

type ListAgentMemoriesByAccountCursorParams struct {
	AccountID        string
	FilterCategory   bool
	Category         string
	FilterEntityType bool
	EntityType       pgtype.Text
	FilterQuery      bool
	Search           pgtype.Text
	HasCursor        bool
	CursorID         string
	Lim              int32
}

type ListAgentMemoriesByAccountParams

type ListAgentMemoriesByAccountParams struct {
	AccountID string
	Limit     int32
}

type ListAgentRunsByAccountFilteredParams

type ListAgentRunsByAccountFilteredParams struct {
	AccountID         string
	FilterStatus      bool
	StatusCode        string
	FilterDefinition  bool
	AgentDefinitionID string
	FilterQuery       bool
	Search            pgtype.Text
	HasCursor         bool
	CursorID          string
	Lim               int32
}

type ListAgentRunsByAccountParams

type ListAgentRunsByAccountParams struct {
	AccountID string
	Limit     int32
}

type ListAgentTokenUsageByAccountParams

type ListAgentTokenUsageByAccountParams struct {
	AccountID string
	SinceDate pgtype.Date
	HasCursor bool
	CursorID  string
	Lim       int32
}

type ListEnabledConfigsWithScheduleRow

type ListEnabledConfigsWithScheduleRow struct {
	ID                string
	AccountID         string
	AgentDefinitionID string
	IsEnabled         bool
	Config            []byte
	Schedule          pgtype.Text
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	DefinitionSlug    string
}

type ListMemoriesByEntityParams

type ListMemoriesByEntityParams struct {
	AccountID  string
	EntityType pgtype.Text
	EntityID   pgtype.Text
	Limit      int32
}

type ListToolsByAgentDefinitionIDRow

type ListToolsByAgentDefinitionIDRow struct {
	ID                string
	AgentDefinitionID string
	ToolSlug          string
	Config            []byte
	SortOrder         int32
	RequireReview     bool
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
}

type MarkAgentActionReviewedParams

type MarkAgentActionReviewedParams struct {
	StatusCode          string
	ReviewedBy          pgtype.Text
	ReviewedByActorType pgtype.Text
	ReviewedByActorName pgtype.Text
	ID                  string
}

type MarkInboxRecordFailedParams

type MarkInboxRecordFailedParams struct {
	LastError pgtype.Text
	ID        int64
}

type MarkOutboxMessageFailedParams

type MarkOutboxMessageFailedParams struct {
	LastError pgtype.Text
	Column2   pgtype.Text
	ID        int64
}

type MessageInbox

type MessageInbox struct {
	ID              int64
	MessageID       string
	ServiceName     string
	Handler         string
	MessageType     string
	RequestID       pgtype.Text
	ParentMessageID pgtype.Text
	Status          string
	Attempts        int32
	LastError       pgtype.Text
	ReceivedAt      pgtype.Timestamptz
	ProcessedAt     pgtype.Timestamptz
}

type MessageOutbox

type MessageOutbox struct {
	ID              int64
	MessageID       string
	ServiceName     string
	MessageType     string
	Destination     string
	RoutingKey      pgtype.Text
	Headers         db.NullableRawMessage
	Payload         []byte
	Status          string
	Attempts        int32
	MaxAttempts     int32
	NextRunAt       pgtype.Timestamptz
	LockedAt        pgtype.Timestamptz
	LockOwner       pgtype.Text
	LockExpiresAt   pgtype.Timestamptz
	LastError       pgtype.Text
	PublishedAt     pgtype.Timestamptz
	RequestID       pgtype.Text
	ParentMessageID pgtype.Text
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
}

type PurgeProcessedInboxMessagesParams

type PurgeProcessedInboxMessagesParams struct {
	Column1 pgtype.Text
	Limit   int32
}

type PurgePublishedOutboxMessagesParams

type PurgePublishedOutboxMessagesParams struct {
	Column1 pgtype.Text
	Limit   int32
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AcquireOutboxMessages

func (q *Queries) AcquireOutboxMessages(ctx context.Context, arg AcquireOutboxMessagesParams) error

func (*Queries) AcquireTaskLease

func (q *Queries) AcquireTaskLease(ctx context.Context, arg AcquireTaskLeaseParams) (int64, error)

func (*Queries) AdvanceIdempotencyRecoveryPoint

func (q *Queries) AdvanceIdempotencyRecoveryPoint(ctx context.Context, arg AdvanceIdempotencyRecoveryPointParams) error

func (*Queries) CleanupExpiredOutboxLocks

func (q *Queries) CleanupExpiredOutboxLocks(ctx context.Context, limit int32) (int64, error)

func (*Queries) CountDeletedRecordsByResourceAndResourceID

func (q *Queries) CountDeletedRecordsByResourceAndResourceID(ctx context.Context, arg CountDeletedRecordsByResourceAndResourceIDParams) (int64, error)

func (*Queries) CreateIdempotencyKey

func (q *Queries) CreateIdempotencyKey(ctx context.Context, arg CreateIdempotencyKeyParams) (int64, error)

func (*Queries) CreateOutboxMessage

func (q *Queries) CreateOutboxMessage(ctx context.Context, arg CreateOutboxMessageParams) (int64, error)

func (*Queries) DeleteAgentAccountStatus

func (q *Queries) DeleteAgentAccountStatus(ctx context.Context, arg DeleteAgentAccountStatusParams) error

func (*Queries) DeleteAgentDefinitionToolsByAgentID

func (q *Queries) DeleteAgentDefinitionToolsByAgentID(ctx context.Context, agentDefinitionID string) error

func (*Queries) DeleteAgentMemory

func (q *Queries) DeleteAgentMemory(ctx context.Context, arg DeleteAgentMemoryParams) error

func (*Queries) GetAgentAccountStatus

func (q *Queries) GetAgentAccountStatus(ctx context.Context, arg GetAgentAccountStatusParams) (AgentAccountStatus, error)

Agent Account Status queries

func (*Queries) GetAgentActionByID

func (q *Queries) GetAgentActionByID(ctx context.Context, id string) (AgentAction, error)

func (*Queries) GetAgentArtifactByID

func (q *Queries) GetAgentArtifactByID(ctx context.Context, id string) (AgentArtifact, error)

func (*Queries) GetAgentConfigByAccountAndDefinition

func (q *Queries) GetAgentConfigByAccountAndDefinition(ctx context.Context, arg GetAgentConfigByAccountAndDefinitionParams) (AgentConfig, error)

func (*Queries) GetAgentConfigByID

func (q *Queries) GetAgentConfigByID(ctx context.Context, id string) (AgentConfig, error)

func (*Queries) GetAgentDefinitionByAccountAndSlug

func (q *Queries) GetAgentDefinitionByAccountAndSlug(ctx context.Context, arg GetAgentDefinitionByAccountAndSlugParams) (AgentDefinition, error)

func (*Queries) GetAgentDefinitionByID

func (q *Queries) GetAgentDefinitionByID(ctx context.Context, id string) (AgentDefinition, error)

Agent Definition queries

func (*Queries) GetAgentDefinitionBySlug

func (q *Queries) GetAgentDefinitionBySlug(ctx context.Context, slug string) (AgentDefinition, error)

func (*Queries) GetAgentMemoriesByIDs

func (q *Queries) GetAgentMemoriesByIDs(ctx context.Context, arg GetAgentMemoriesByIDsParams) ([]AgentMemory, error)

Returns agent memories matching the given IDs that belong to the caller's account. Used by the api-gateway resourcekit resolver.

func (*Queries) GetAgentMemoryByID

func (q *Queries) GetAgentMemoryByID(ctx context.Context, id string) (AgentMemory, error)

func (*Queries) GetAgentRunByID

func (q *Queries) GetAgentRunByID(ctx context.Context, id string) (AgentRun, error)

func (*Queries) GetAgentTokenUsageByAccountAndDate

func (q *Queries) GetAgentTokenUsageByAccountAndDate(ctx context.Context, arg GetAgentTokenUsageByAccountAndDateParams) (AgentTokenUsage, error)

func (*Queries) GetIdempotencyKeyByScopeHash

func (q *Queries) GetIdempotencyKeyByScopeHash(ctx context.Context, arg GetIdempotencyKeyByScopeHashParams) (ServiceIdempotencyKey, error)

func (*Queries) GetIdempotencyRecoveryPoint

func (q *Queries) GetIdempotencyRecoveryPoint(ctx context.Context, typeID string) (string, error)

func (*Queries) GetInboxRecordByMessageAndHandler

func (q *Queries) GetInboxRecordByMessageAndHandler(ctx context.Context, arg GetInboxRecordByMessageAndHandlerParams) (MessageInbox, error)

func (*Queries) GetLastRunByConfigID

func (q *Queries) GetLastRunByConfigID(ctx context.Context, agentConfigID pgtype.Text) (AgentRun, error)

func (*Queries) GetLockedOutboxMessages

func (q *Queries) GetLockedOutboxMessages(ctx context.Context, lockOwner pgtype.Text) ([]MessageOutbox, error)

func (*Queries) GetMaxAgentRunEventSequence

func (q *Queries) GetMaxAgentRunEventSequence(ctx context.Context, agentRunID string) (int32, error)

func (*Queries) InsertAgentAction

func (q *Queries) InsertAgentAction(ctx context.Context, arg InsertAgentActionParams) error

Agent Action queries

func (*Queries) InsertAgentArtifact

func (q *Queries) InsertAgentArtifact(ctx context.Context, arg InsertAgentArtifactParams) error

Agent Artifact queries

func (*Queries) InsertAgentConfig

func (q *Queries) InsertAgentConfig(ctx context.Context, arg InsertAgentConfigParams) error

Agent Config queries

func (*Queries) InsertAgentDefinition

func (q *Queries) InsertAgentDefinition(ctx context.Context, arg InsertAgentDefinitionParams) error

func (*Queries) InsertAgentDefinitionTool

func (q *Queries) InsertAgentDefinitionTool(ctx context.Context, arg InsertAgentDefinitionToolParams) error

Agent Definition Tool queries Tool definitions (built-in tools) live in the code catalog (agents.BuiltinTools); agent_definition_tool references them by slug. Display metadata is resolved from the catalog, so these queries only touch agent_definition_tool.

func (*Queries) InsertAgentMemory

func (q *Queries) InsertAgentMemory(ctx context.Context, arg InsertAgentMemoryParams) error

Agent Memory queries

func (*Queries) InsertAgentRun

func (q *Queries) InsertAgentRun(ctx context.Context, arg InsertAgentRunParams) error

Agent Run queries

func (*Queries) InsertAgentRunEvent

func (q *Queries) InsertAgentRunEvent(ctx context.Context, arg InsertAgentRunEventParams) error

Agent Run Event queries

func (*Queries) InsertAgentTokenUsage

func (q *Queries) InsertAgentTokenUsage(ctx context.Context, arg InsertAgentTokenUsageParams) error

Agent Token Usage queries

func (*Queries) InsertDeletedRecord

func (q *Queries) InsertDeletedRecord(ctx context.Context, arg InsertDeletedRecordParams) error

func (*Queries) ListAccountMemories

func (q *Queries) ListAccountMemories(ctx context.Context, arg ListAccountMemoriesParams) ([]AgentMemory, error)

func (*Queries) ListAgentAccountStatusesByAccount

func (q *Queries) ListAgentAccountStatusesByAccount(ctx context.Context, accountID string) ([]AgentAccountStatus, error)

func (*Queries) ListAgentActionsByRun

func (q *Queries) ListAgentActionsByRun(ctx context.Context, agentRunID string) ([]AgentAction, error)

func (*Queries) ListAgentArtifactsByAction

func (q *Queries) ListAgentArtifactsByAction(ctx context.Context, agentActionID string) ([]AgentArtifact, error)

func (*Queries) ListAgentConfigsByAccount

func (q *Queries) ListAgentConfigsByAccount(ctx context.Context, accountID string) ([]AgentConfig, error)

func (*Queries) ListAgentDefinitions

func (q *Queries) ListAgentDefinitions(ctx context.Context) ([]AgentDefinition, error)

func (*Queries) ListAgentDefinitionsByAccount

func (q *Queries) ListAgentDefinitionsByAccount(ctx context.Context, accountID pgtype.Text) ([]AgentDefinition, error)

func (*Queries) ListAgentDefinitionsByAccountCursor

func (q *Queries) ListAgentDefinitionsByAccountCursor(ctx context.Context, arg ListAgentDefinitionsByAccountCursorParams) ([]AgentDefinition, error)

func (*Queries) ListAgentDefinitionsByAccountFiltered

func (q *Queries) ListAgentDefinitionsByAccountFiltered(ctx context.Context, arg ListAgentDefinitionsByAccountFilteredParams) ([]AgentDefinition, error)

func (*Queries) ListAgentMemoriesByAccount

func (q *Queries) ListAgentMemoriesByAccount(ctx context.Context, arg ListAgentMemoriesByAccountParams) ([]AgentMemory, error)

func (*Queries) ListAgentMemoriesByAccountCursor

func (q *Queries) ListAgentMemoriesByAccountCursor(ctx context.Context, arg ListAgentMemoriesByAccountCursorParams) ([]AgentMemory, error)

func (*Queries) ListAgentRunEventsByRunID

func (q *Queries) ListAgentRunEventsByRunID(ctx context.Context, agentRunID string) ([]AgentRunEvent, error)

func (*Queries) ListAgentRunsByAccount

func (q *Queries) ListAgentRunsByAccount(ctx context.Context, arg ListAgentRunsByAccountParams) ([]AgentRun, error)

func (*Queries) ListAgentRunsByAccountFiltered

func (q *Queries) ListAgentRunsByAccountFiltered(ctx context.Context, arg ListAgentRunsByAccountFilteredParams) ([]AgentRun, error)

func (*Queries) ListAgentTokenUsageByAccount

func (q *Queries) ListAgentTokenUsageByAccount(ctx context.Context, arg ListAgentTokenUsageByAccountParams) ([]AgentTokenUsage, error)

func (*Queries) ListEnabledConfigsWithSchedule

func (q *Queries) ListEnabledConfigsWithSchedule(ctx context.Context) ([]ListEnabledConfigsWithScheduleRow, error)

Scheduler queries

func (*Queries) ListMemoriesByEntity

func (q *Queries) ListMemoriesByEntity(ctx context.Context, arg ListMemoriesByEntityParams) ([]AgentMemory, error)

Memory queries

func (*Queries) ListToolsByAgentDefinitionID

func (q *Queries) ListToolsByAgentDefinitionID(ctx context.Context, agentDefinitionID string) ([]ListToolsByAgentDefinitionIDRow, error)

func (*Queries) MarkAgentActionReviewed

func (q *Queries) MarkAgentActionReviewed(ctx context.Context, arg MarkAgentActionReviewedParams) error

func (*Queries) MarkAgentRunAutoRetrying

func (q *Queries) MarkAgentRunAutoRetrying(ctx context.Context, id string) (int32, error)

Bump the retry counter for a run the runner is about to transparently re-enqueue after a transient, whole-chain-unavailable failure. Unlike MarkAgentRunRetrying (manual path, guarded on 'failed'), this fires mid-flight before the run is ever marked failed, so it guards on 'running' and leaves the status 'running' — the run is not surfaced as failed, it is simply re-queued. The guard makes this a no-op (no rows) if the run already left the running state, preventing a double re-enqueue.

func (*Queries) MarkAgentRunCancelledByUser

func (q *Queries) MarkAgentRunCancelledByUser(ctx context.Context, id string) error

func (*Queries) MarkAgentRunDivergedFromConversation

func (q *Queries) MarkAgentRunDivergedFromConversation(ctx context.Context, id string) error

func (*Queries) MarkAgentRunRetrying

func (q *Queries) MarkAgentRunRetrying(ctx context.Context, id string) (int32, error)

Atomically move a failed run back to running and bump its retry counter. The status guard makes this a no-op (returns no rows) when the run isn't failed, preventing double-retry races. Clears the prior error so a successful re-attempt doesn't leave a stale error_message behind.

func (*Queries) MarkInboxRecordFailed

func (q *Queries) MarkInboxRecordFailed(ctx context.Context, arg MarkInboxRecordFailedParams) error

func (*Queries) MarkInboxRecordProcessed

func (q *Queries) MarkInboxRecordProcessed(ctx context.Context, id int64) error

func (*Queries) MarkOutboxMessageFailed

func (q *Queries) MarkOutboxMessageFailed(ctx context.Context, arg MarkOutboxMessageFailedParams) error

func (*Queries) MarkOutboxMessagesPublished

func (q *Queries) MarkOutboxMessagesPublished(ctx context.Context, ids []int64) error

func (*Queries) PurgeProcessedInboxMessages

func (q *Queries) PurgeProcessedInboxMessages(ctx context.Context, arg PurgeProcessedInboxMessagesParams) (int64, error)

func (*Queries) PurgePublishedOutboxMessages

func (q *Queries) PurgePublishedOutboxMessages(ctx context.Context, arg PurgePublishedOutboxMessagesParams) (int64, error)

func (*Queries) ReapStalledRuns

func (q *Queries) ReapStalledRuns(ctx context.Context, arg ReapStalledRunsParams) ([]ReapStalledRunsRow, error)

Safety net for runs orphaned by a process kill (OOM/liveness/SIGTERM) mid-flight: the goroutine that would finalize them is gone, so they are stuck in 'running' forever. Fail any run that has been 'running' since before the cutoff so its status (and any chat bubble keyed to it) resolves instead of hanging. Guarded on status_code = 'running' so it never disturbs a run that has since paused/completed/cancelled. Returns the reaped ids for logging.

func (*Queries) ReleaseTaskLease

func (q *Queries) ReleaseTaskLease(ctx context.Context, arg ReleaseTaskLeaseParams) error

func (*Queries) RenewTaskLease

func (q *Queries) RenewTaskLease(ctx context.Context, arg RenewTaskLeaseParams) (int64, error)

func (*Queries) SetIdempotencyResponse

func (q *Queries) SetIdempotencyResponse(ctx context.Context, arg SetIdempotencyResponseParams) error

func (*Queries) SoftDeleteAgentDefinition

func (q *Queries) SoftDeleteAgentDefinition(ctx context.Context, arg SoftDeleteAgentDefinitionParams) error

func (*Queries) TryInsertInboxRecord

func (q *Queries) TryInsertInboxRecord(ctx context.Context, arg TryInsertInboxRecordParams) (int64, error)

func (*Queries) UpdateAgentActionStatus

func (q *Queries) UpdateAgentActionStatus(ctx context.Context, arg UpdateAgentActionStatusParams) error

func (*Queries) UpdateAgentConfigEnabled

func (q *Queries) UpdateAgentConfigEnabled(ctx context.Context, arg UpdateAgentConfigEnabledParams) error

func (*Queries) UpdateAgentDefinition

func (q *Queries) UpdateAgentDefinition(ctx context.Context, arg UpdateAgentDefinitionParams) error

func (*Queries) UpdateAgentMemory

func (q *Queries) UpdateAgentMemory(ctx context.Context, arg UpdateAgentMemoryParams) error

func (*Queries) UpdateAgentRunCancelled

func (q *Queries) UpdateAgentRunCancelled(ctx context.Context, arg UpdateAgentRunCancelledParams) error

func (*Queries) UpdateAgentRunCompleted

func (q *Queries) UpdateAgentRunCompleted(ctx context.Context, arg UpdateAgentRunCompletedParams) error

func (*Queries) UpdateAgentRunFailed

func (q *Queries) UpdateAgentRunFailed(ctx context.Context, arg UpdateAgentRunFailedParams) error

func (*Queries) UpdateAgentRunStarted

func (q *Queries) UpdateAgentRunStarted(ctx context.Context, id string) (int64, error)

Run lifecycle queries

func (*Queries) UpdateAgentRunStatus

func (q *Queries) UpdateAgentRunStatus(ctx context.Context, arg UpdateAgentRunStatusParams) error

func (*Queries) UpsertAgentAccountStatus

func (q *Queries) UpsertAgentAccountStatus(ctx context.Context, arg UpsertAgentAccountStatusParams) error

func (*Queries) UpsertAgentTokenUsage

func (q *Queries) UpsertAgentTokenUsage(ctx context.Context, arg UpsertAgentTokenUsageParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type ReapStalledRunsParams

type ReapStalledRunsParams struct {
	ErrorMessage pgtype.Text
	StartedAt    pgtype.Timestamptz
}

type ReapStalledRunsRow

type ReapStalledRunsRow struct {
	ID        string
	AccountID string
}

type ReleaseTaskLeaseParams

type ReleaseTaskLeaseParams struct {
	Name   string
	Holder string
}

type RenewTaskLeaseParams

type RenewTaskLeaseParams struct {
	Column1 pgtype.Text
	Name    string
	Holder  string
}

type ServiceIdempotencyKey

type ServiceIdempotencyKey struct {
	ID             int64
	TypeID         string
	ServiceName    string
	Handler        string
	IdempotencyKey string
	ActorID        pgtype.Text
	IdentityType   string
	ScopeHash      string
	ResponseCode   pgtype.Int4
	ResponseBody   []byte
	RecoveryPoint  string
	LockedAt       pgtype.Timestamptz
	LockOwner      pgtype.Text
	LockExpiresAt  pgtype.Timestamptz
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	LastRunAt      pgtype.Timestamptz
	ExpiresAt      pgtype.Timestamptz
}

type SetIdempotencyResponseParams

type SetIdempotencyResponseParams struct {
	ResponseCode  pgtype.Int4
	ResponseBody  []byte
	RecoveryPoint string
	TypeID        string
}

type SoftDeleteAgentDefinitionParams

type SoftDeleteAgentDefinitionParams struct {
	ID        string
	AccountID pgtype.Text
}

type TaskLease

type TaskLease struct {
	Name       string
	Holder     string
	AcquiredAt pgtype.Timestamptz
	ExpiresAt  pgtype.Timestamptz
}

type TryInsertInboxRecordParams

type TryInsertInboxRecordParams struct {
	MessageID       string
	ServiceName     string
	Handler         string
	MessageType     string
	RequestID       pgtype.Text
	ParentMessageID pgtype.Text
}

type UpdateAgentActionStatusParams

type UpdateAgentActionStatusParams struct {
	StatusCode string
	Output     []byte
	ID         string
}

type UpdateAgentConfigEnabledParams

type UpdateAgentConfigEnabledParams struct {
	IsEnabled bool
	ID        string
}

type UpdateAgentDefinitionParams

type UpdateAgentDefinitionParams struct {
	Name             pgtype.Text
	Slug             pgtype.Text
	ClearDescription bool
	Description      pgtype.Text
	CategoryCode     pgtype.Text
	TriggerType      pgtype.Text
	UpdateConfig     bool
	NewConfig        []byte
	ClearRoleID      bool
	RoleID           pgtype.Text
	ID               string
	AccountID        pgtype.Text
}

type UpdateAgentMemoryParams

type UpdateAgentMemoryParams struct {
	Category       pgtype.Text
	Content        pgtype.Text
	Metadata       []byte
	ClearEntity    bool
	EntityType     pgtype.Text
	EntityID       pgtype.Text
	Importance     pgtype.Float8
	ClearExpiresAt bool
	ExpiresAt      pgtype.Timestamptz
	ID             string
	AccountID      string
}

type UpdateAgentRunCancelledParams

type UpdateAgentRunCancelledParams struct {
	Output            []byte
	TotalInputTokens  int64
	TotalOutputTokens int64
	ID                string
}

type UpdateAgentRunCompletedParams

type UpdateAgentRunCompletedParams struct {
	StatusCode        string
	Output            []byte
	DurationMs        pgtype.Int4
	TotalInputTokens  int64
	TotalOutputTokens int64
	ID                string
}

type UpdateAgentRunFailedParams

type UpdateAgentRunFailedParams struct {
	ErrorMessage pgtype.Text
	DurationMs   pgtype.Int4
	ID           string
}

type UpdateAgentRunStatusParams

type UpdateAgentRunStatusParams struct {
	StatusCode string
	ID         string
}

type UpsertAgentAccountStatusParams

type UpsertAgentAccountStatusParams struct {
	ID                string
	AccountID         string
	AgentDefinitionID string
	StatusCode        string
}

type UpsertAgentTokenUsageParams

type UpsertAgentTokenUsageParams struct {
	ID           string
	AccountID    string
	Date         pgtype.Date
	InputTokens  int64
	OutputTokens int64
	TotalCost    float64
	RunCount     int32
}

Jump to

Keyboard shortcuts

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