sqlc

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptGoalParams added in v0.49.4

type AcceptGoalParams struct {
	AcceptedOutput pgtype.Text `json:"accepted_output"`
	ID             string      `json:"id"`
}

type AddDigestArticleParams added in v0.30.0

type AddDigestArticleParams struct {
	DigestID  string `json:"digest_id"`
	ArticleID string `json:"article_id"`
	Section   string `json:"section"`
	Position  int64  `json:"position"`
}

type AddGroupMemberParams added in v0.42.0

type AddGroupMemberParams struct {
	GroupID        string `json:"group_id"`
	AgentID        string `json:"agent_id"`
	ReplyChannelID string `json:"reply_channel_id"`
}

type AdvanceMemorySnapshotParams

type AdvanceMemorySnapshotParams struct {
	Version   int64  `json:"version"`
	SessionID string `json:"session_id"`
	UserID    string `json:"user_id"`
	AgentID   string `json:"agent_id"`
}

type Agent added in v0.38.0

type Agent struct {
	ID                   string          `json:"id"`
	Name                 string          `json:"name"`
	Model                string          `json:"model"`
	ModelThinking        string          `json:"model_thinking"`
	ModelStrong          string          `json:"model_strong"`
	ModelStrongThinking  string          `json:"model_strong_thinking"`
	ModelFast            string          `json:"model_fast"`
	ModelFastThinking    string          `json:"model_fast_thinking"`
	SystemPrompt         string          `json:"system_prompt"`
	Soul                 string          `json:"soul"`
	Workspace            string          `json:"workspace"`
	Sandbox              json.RawMessage `json:"sandbox"`
	EnabledBuiltinSkills json.RawMessage `json:"enabled_builtin_skills"`
	Scope                string          `json:"scope"`
	CreatorID            string          `json:"creator_id"`
	Enabled              bool            `json:"enabled"`
	CreatedAt            time.Time       `json:"created_at"`
	UpdatedAt            time.Time       `json:"updated_at"`
}

type AgentGoal added in v0.38.0

type AgentGoal struct {
	ID                 string             `json:"id"`
	UserID             string             `json:"user_id"`
	AgentID            string             `json:"agent_id"`
	ProjectID          pgtype.Text        `json:"project_id"`
	ParentID           pgtype.Text        `json:"parent_id"`
	RootID             string             `json:"root_id"`
	Depth              int64              `json:"depth"`
	Position           int64              `json:"position"`
	Title              string             `json:"title"`
	Intent             string             `json:"intent"`
	Kind               string             `json:"kind"`
	Priority           string             `json:"priority"`
	Required           bool               `json:"required"`
	AcceptanceContract json.RawMessage    `json:"acceptance_contract"`
	ConvergencePolicy  json.RawMessage    `json:"convergence_policy"`
	ReviewPolicy       string             `json:"review_policy"`
	Lifecycle          string             `json:"lifecycle"`
	BlockReason        string             `json:"block_reason"`
	AcceptanceState    string             `json:"acceptance_state"`
	AcceptedOutput     pgtype.Text        `json:"accepted_output"`
	AcceptanceSeq      int64              `json:"acceptance_seq"`
	ActiveAttemptID    pgtype.Text        `json:"active_attempt_id"`
	AttemptCount       int64              `json:"attempt_count"`
	Context            json.RawMessage    `json:"context"`
	DispatchHint       json.RawMessage    `json:"dispatch_hint"`
	CreatedAt          time.Time          `json:"created_at"`
	UpdatedAt          time.Time          `json:"updated_at"`
	AcceptedAt         pgtype.Timestamptz `json:"accepted_at"`
	CancelledAt        pgtype.Timestamptz `json:"cancelled_at"`
	ArchivedAt         pgtype.Timestamptz `json:"archived_at"`
	Plan               json.RawMessage    `json:"plan"`
	PlannedAt          pgtype.Timestamptz `json:"planned_at"`
	// Infrastructure-flaky retry count independent of business attempt budget.
	FlakyCount      int64       `json:"flaky_count"`
	BudgetBonus     int32       `json:"budget_bonus"`
	DoneReason      string      `json:"done_reason"`
	WorkflowID      pgtype.Text `json:"workflow_id"`
	WorkflowVersion pgtype.Int4 `json:"workflow_version"`
	IdempotencyKey  pgtype.Text `json:"idempotency_key"`
}

type AgentGoalAcceptanceEvent added in v0.49.4

type AgentGoalAcceptanceEvent struct {
	ID                string          `json:"id"`
	GoalID            string          `json:"goal_id"`
	AttemptID         pgtype.Text     `json:"attempt_id"`
	Seq               int64           `json:"seq"`
	ItemID            string          `json:"item_id"`
	ItemKind          string          `json:"item_kind"`
	Result            string          `json:"result"`
	Command           string          `json:"command"`
	ExitCode          pgtype.Int8     `json:"exit_code"`
	CacheKey          string          `json:"cache_key"`
	Authority         string          `json:"authority"`
	ReviewerUserID    pgtype.Text     `json:"reviewer_user_id"`
	ReviewerAttemptID pgtype.Text     `json:"reviewer_attempt_id"`
	Rationale         string          `json:"rationale"`
	Scope             string          `json:"scope"`
	ScopeHash         string          `json:"scope_hash"`
	Detail            json.RawMessage `json:"detail"`
	CreatedAt         time.Time       `json:"created_at"`
}

type AgentGoalAttempt added in v0.49.4

type AgentGoalAttempt struct {
	ID              string             `json:"id"`
	GoalID          string             `json:"goal_id"`
	UserID          string             `json:"user_id"`
	AgentID         pgtype.Text        `json:"agent_id"`
	ExecutorAgentID pgtype.Text        `json:"executor_agent_id"`
	SessionID       string             `json:"session_id"`
	Purpose         string             `json:"purpose"`
	AttemptNo       int64              `json:"attempt_no"`
	Status          string             `json:"status"`
	InputContext    json.RawMessage    `json:"input_context"`
	Evidence        json.RawMessage    `json:"evidence"`
	Output          json.RawMessage    `json:"output"`
	Gaps            json.RawMessage    `json:"gaps"`
	Error           string             `json:"error"`
	HeartbeatAt     pgtype.Timestamptz `json:"heartbeat_at"`
	LeaseExpiresAt  pgtype.Timestamptz `json:"lease_expires_at"`
	WorkerID        string             `json:"worker_id"`
	StartedAt       pgtype.Timestamptz `json:"started_at"`
	FinishedAt      pgtype.Timestamptz `json:"finished_at"`
	CreatedAt       time.Time          `json:"created_at"`
	UpdatedAt       time.Time          `json:"updated_at"`
	FailureClass    string             `json:"failure_class"`
	RepairRounds    int32              `json:"repair_rounds"`
	// Audit copy of legacy failure_class before responsibility-class migration.
	PreviousFailureClass string `json:"previous_failure_class"`
}

type AgentGoalEdge added in v0.49.4

type AgentGoalEdge struct {
	GoalID       string             `json:"goal_id"`
	UpstreamID   string             `json:"upstream_id"`
	EdgeKind     string             `json:"edge_kind"`
	OnFailure    string             `json:"on_failure"`
	WaivedAt     pgtype.Timestamptz `json:"waived_at"`
	WaivedByUser pgtype.Text        `json:"waived_by_user"`
	WaiverReason string             `json:"waiver_reason"`
	CreatedAt    time.Time          `json:"created_at"`
}

type AgentGoalEvent added in v0.60.0

type AgentGoalEvent struct {
	ID        string          `json:"id"`
	GoalID    string          `json:"goal_id"`
	AttemptID pgtype.Text     `json:"attempt_id"`
	EventType string          `json:"event_type"`
	Payload   json.RawMessage `json:"payload"`
	CreatedAt time.Time       `json:"created_at"`
}

type AgentWorkflow added in v0.60.0

type AgentWorkflow struct {
	ID                 string          `json:"id"`
	OwnerKind          string          `json:"owner_kind"`
	UserID             pgtype.Text     `json:"user_id"`
	AgentID            pgtype.Text     `json:"agent_id"`
	Name               string          `json:"name"`
	Version            int32           `json:"version"`
	WorkflowKey        pgtype.Text     `json:"workflow_key"`
	Intent             string          `json:"intent"`
	AcceptanceContract json.RawMessage `json:"acceptance_contract"`
	ConvergencePolicy  json.RawMessage `json:"convergence_policy"`
	Inputs             json.RawMessage `json:"inputs"`
	PayloadFormat      string          `json:"payload_format"`
	Payload            json.RawMessage `json:"payload"`
	FullyFrozen        bool            `json:"fully_frozen"`
	SourceGoalID       pgtype.Text     `json:"source_goal_id"`
	CreatedAt          time.Time       `json:"created_at"`
	UpdatedAt          time.Time       `json:"updated_at"`
}

type AgentWorkflowRun added in v0.60.0

type AgentWorkflowRun struct {
	ID              string          `json:"id"`
	WorkflowID      string          `json:"workflow_id"`
	WorkflowVersion int32           `json:"workflow_version"`
	IdempotencyKey  string          `json:"idempotency_key"`
	RootGoalID      pgtype.Text     `json:"root_goal_id"`
	Status          string          `json:"status"`
	Inputs          json.RawMessage `json:"inputs"`
	PlanHash        string          `json:"plan_hash"`
	CreatedAt       time.Time       `json:"created_at"`
	UpdatedAt       time.Time       `json:"updated_at"`
}

type AppSetting added in v0.38.0

type AppSetting struct {
	Key       string    `json:"key"`
	Value     string    `json:"value"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type AppendAcceptanceEventParams added in v0.49.4

type AppendAcceptanceEventParams struct {
	ID                string          `json:"id"`
	GoalID            string          `json:"goal_id"`
	AttemptID         pgtype.Text     `json:"attempt_id"`
	Seq               int64           `json:"seq"`
	ItemID            string          `json:"item_id"`
	ItemKind          string          `json:"item_kind"`
	Result            string          `json:"result"`
	Command           string          `json:"command"`
	ExitCode          pgtype.Int8     `json:"exit_code"`
	CacheKey          string          `json:"cache_key"`
	Authority         string          `json:"authority"`
	ReviewerUserID    pgtype.Text     `json:"reviewer_user_id"`
	ReviewerAttemptID pgtype.Text     `json:"reviewer_attempt_id"`
	Rationale         string          `json:"rationale"`
	Scope             string          `json:"scope"`
	ScopeHash         string          `json:"scope_hash"`
	Detail            json.RawMessage `json:"detail"`
}

type AppendContextItemParams

type AppendContextItemParams struct {
	ConversationID string      `json:"conversation_id"`
	Ordinal        int64       `json:"ordinal"`
	ItemType       string      `json:"item_type"`
	MessageID      pgtype.Text `json:"message_id"`
	SummaryID      pgtype.Text `json:"summary_id"`
	EventType      string      `json:"event_type"`
	Role           string      `json:"role"`
}

type AppendGoalEventParams added in v0.60.0

type AppendGoalEventParams struct {
	ID        string          `json:"id"`
	GoalID    string          `json:"goal_id"`
	AttemptID pgtype.Text     `json:"attempt_id"`
	EventType string          `json:"event_type"`
	Payload   json.RawMessage `json:"payload"`
}

type ArchiveProjectParams added in v0.34.0

type ArchiveProjectParams struct {
	Archived bool   `json:"archived"`
	ID       string `json:"id"`
	UserID   string `json:"user_id"`
}

type AssignUserAgentParams

type AssignUserAgentParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type AuthCredential added in v0.38.0

type AuthCredential struct {
	ID           string    `json:"id"`
	UserID       string    `json:"user_id"`
	PasswordHash string    `json:"password_hash"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

type AuthIdentity

type AuthIdentity struct {
	ID              string          `json:"id"`
	UserID          string          `json:"user_id"`
	Provider        string          `json:"provider"`
	ProviderSubject string          `json:"provider_subject"`
	Email           string          `json:"email"`
	Name            string          `json:"name"`
	AvatarUrl       string          `json:"avatar_url"`
	RawClaims       json.RawMessage `json:"raw_claims"`
	CreatedAt       time.Time       `json:"created_at"`
	UpdatedAt       time.Time       `json:"updated_at"`
}

type AuthPolicy

type AuthPolicy struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	Effect     string    `json:"effect"`
	Subjects   string    `json:"subjects"`
	Actions    string    `json:"actions"`
	Resources  string    `json:"resources"`
	Conditions string    `json:"conditions"`
	Priority   int64     `json:"priority"`
	IsSystem   bool      `json:"is_system"`
	Enabled    bool      `json:"enabled"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

type AuthSession

type AuthSession struct {
	ID        string    `json:"id"`
	UserID    string    `json:"user_id"`
	TokenHash string    `json:"token_hash"`
	ExpiresAt time.Time `json:"expires_at"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type AuthUser

type AuthUser struct {
	ID               string      `json:"id"`
	Email            string      `json:"email"`
	Name             string      `json:"name"`
	AvatarUrl        string      `json:"avatar_url"`
	Role             string      `json:"role"`
	IsActive         bool        `json:"is_active"`
	DefaultAgentID   pgtype.Text `json:"default_agent_id"`
	NotifyIdentityID pgtype.Text `json:"notify_identity_id"`
	AgePublicKey     string      `json:"age_public_key"`
	AgePrivateKey    string      `json:"age_private_key"`
	CreatedAt        time.Time   `json:"created_at"`
	UpdatedAt        time.Time   `json:"updated_at"`
}

type AuthUserAgent

type AuthUserAgent struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type AuthUserToken

type AuthUserToken struct {
	ID            string             `json:"id"`
	UserID        string             `json:"user_id"`
	Name          string             `json:"name"`
	TokenHash     string             `json:"token_hash"`
	TokenPrefix   string             `json:"token_prefix"`
	AutoGenerated bool               `json:"auto_generated"`
	LastUsedAt    pgtype.Timestamptz `json:"last_used_at"`
	ExpiresAt     pgtype.Timestamptz `json:"expires_at"`
	RotatedAt     pgtype.Timestamptz `json:"rotated_at"`
	RevokedAt     pgtype.Timestamptz `json:"revoked_at"`
	CreatedAt     time.Time          `json:"created_at"`
	UpdatedAt     time.Time          `json:"updated_at"`
}

type BlockGoalParams added in v0.49.4

type BlockGoalParams struct {
	BlockReason string `json:"block_reason"`
	ID          string `json:"id"`
}

type BumpAgentMemoryVersionParams added in v0.60.0

type BumpAgentMemoryVersionParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type Channel added in v0.38.0

type Channel struct {
	ID        string      `json:"id"`
	Name      string      `json:"name"`
	Type      string      `json:"type"`
	AgentID   pgtype.Text `json:"agent_id"`
	Enabled   bool        `json:"enabled"`
	Config    string      `json:"config"`
	CreatedAt time.Time   `json:"created_at"`
	UpdatedAt time.Time   `json:"updated_at"`
}

type ChannelAgent added in v0.38.0

type ChannelAgent struct {
	ChannelID string    `json:"channel_id"`
	Platform  string    `json:"platform"`
	ChatID    string    `json:"chat_id"`
	AgentID   string    `json:"agent_id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type ChannelGroupMember added in v0.42.0

type ChannelGroupMember struct {
	GroupID        string    `json:"group_id"`
	AgentID        string    `json:"agent_id"`
	ReplyChannelID string    `json:"reply_channel_id"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type ChannelIdentity added in v0.38.0

type ChannelIdentity struct {
	ID         string    `json:"id"`
	UserID     string    `json:"user_id"`
	Platform   string    `json:"platform"`
	ExternalID string    `json:"external_id"`
	Name       string    `json:"name"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

type ClaimExpiredGroupDispatchParams added in v0.43.0

type ClaimExpiredGroupDispatchParams struct {
	LeaseUntil pgtype.Timestamptz `json:"lease_until"`
	ID         string             `json:"id"`
	Now        pgtype.Timestamptz `json:"now"`
}

type ClaimExpiredGroupOutboxParams added in v0.43.0

type ClaimExpiredGroupOutboxParams struct {
	LeaseUntil pgtype.Timestamptz `json:"lease_until"`
	ID         string             `json:"id"`
	Now        pgtype.Timestamptz `json:"now"`
}

type ClaimGoalParams added in v0.49.4

type ClaimGoalParams struct {
	ActiveAttemptID pgtype.Text `json:"active_attempt_id"`
	ID              string      `json:"id"`
}

type ClaimPendingGroupDispatchParams added in v0.43.0

type ClaimPendingGroupDispatchParams struct {
	LeaseUntil pgtype.Timestamptz `json:"lease_until"`
	ID         string             `json:"id"`
	Now        pgtype.Timestamptz `json:"now"`
}

type ClaimPendingGroupOutboxParams added in v0.43.0

type ClaimPendingGroupOutboxParams struct {
	LeaseUntil pgtype.Timestamptz `json:"lease_until"`
	ID         string             `json:"id"`
	Now        pgtype.Timestamptz `json:"now"`
}

type ClaimWorkflowRunParams added in v0.60.0

type ClaimWorkflowRunParams struct {
	ID              string          `json:"id"`
	WorkflowID      string          `json:"workflow_id"`
	WorkflowVersion int32           `json:"workflow_version"`
	IdempotencyKey  string          `json:"idempotency_key"`
	Status          string          `json:"status"`
	Inputs          json.RawMessage `json:"inputs"`
	PlanHash        string          `json:"plan_hash"`
}

type ClaimWorkflowRunRow added in v0.60.0

type ClaimWorkflowRunRow struct {
	ID              string          `json:"id"`
	WorkflowID      string          `json:"workflow_id"`
	WorkflowVersion int32           `json:"workflow_version"`
	IdempotencyKey  string          `json:"idempotency_key"`
	RootGoalID      pgtype.Text     `json:"root_goal_id"`
	Status          string          `json:"status"`
	Inputs          json.RawMessage `json:"inputs"`
	PlanHash        string          `json:"plan_hash"`
	CreatedAt       time.Time       `json:"created_at"`
	UpdatedAt       time.Time       `json:"updated_at"`
	Claimed         bool            `json:"claimed"`
}

type ClearUserAgentMemoryParams added in v0.60.0

type ClearUserAgentMemoryParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type ConsumeOAuthRefreshTokenParams added in v0.60.0

type ConsumeOAuthRefreshTokenParams struct {
	PublicID     string      `json:"public_id"`
	ReplacedByID pgtype.Text `json:"replaced_by_id"`
}

type CountActiveKnowledgeParams added in v0.60.0

type CountActiveKnowledgeParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type CountArticlesByStatusParams

type CountArticlesByStatusParams struct {
	UserID string `json:"user_id"`
	Status string `json:"status"`
}

type CountBillableAttemptsParams added in v0.60.0

type CountBillableAttemptsParams struct {
	GoalID  string `json:"goal_id"`
	Purpose string `json:"purpose"`
}

type CountRanReviewAttemptsForOutputParams added in v0.60.0

type CountRanReviewAttemptsForOutputParams struct {
	GoalID string    `json:"goal_id"`
	Since  time.Time `json:"since"`
}

type CountRemovedKnowledgeParams added in v0.60.0

type CountRemovedKnowledgeParams struct {
	UserID  string    `json:"user_id"`
	AgentID string    `json:"agent_id"`
	NowAt   time.Time `json:"now_at"`
}

type CountRootGoalParams added in v0.49.4

type CountRootGoalParams struct {
	UserID          pgtype.Text `json:"user_id"`
	AgentID         pgtype.Text `json:"agent_id"`
	ProjectID       pgtype.Text `json:"project_id"`
	WorkflowID      pgtype.Text `json:"workflow_id"`
	Lifecycle       pgtype.Text `json:"lifecycle"`
	Terminal        pgtype.Bool `json:"terminal"`
	Q               pgtype.Text `json:"q"`
	IncludeArchived bool        `json:"include_archived"`
}

type CreateAgentParams

type CreateAgentParams struct {
	ID                   string          `json:"id"`
	Name                 string          `json:"name"`
	Model                string          `json:"model"`
	ModelThinking        string          `json:"model_thinking"`
	ModelStrong          string          `json:"model_strong"`
	ModelStrongThinking  string          `json:"model_strong_thinking"`
	ModelFast            string          `json:"model_fast"`
	ModelFastThinking    string          `json:"model_fast_thinking"`
	SystemPrompt         string          `json:"system_prompt"`
	Soul                 string          `json:"soul"`
	Workspace            string          `json:"workspace"`
	Sandbox              json.RawMessage `json:"sandbox"`
	EnabledBuiltinSkills json.RawMessage `json:"enabled_builtin_skills"`
	Scope                string          `json:"scope"`
	CreatorID            string          `json:"creator_id"`
	Enabled              bool            `json:"enabled"`
}

type CreateArticleParams

type CreateArticleParams struct {
	ID           string             `json:"id"`
	UserID       string             `json:"user_id"`
	AgentID      pgtype.Text        `json:"agent_id"`
	Url          string             `json:"url"`
	CanonicalUrl string             `json:"canonical_url"`
	SourceType   string             `json:"source_type"`
	Title        string             `json:"title"`
	Author       string             `json:"author"`
	Summary      string             `json:"summary"`
	Tags         string             `json:"tags"`
	Status       string             `json:"status"`
	Starred      bool               `json:"starred"`
	FilePath     string             `json:"file_path"`
	Metadata     json.RawMessage    `json:"metadata"`
	PublishedAt  pgtype.Timestamptz `json:"published_at"`
	SavedAt      time.Time          `json:"saved_at"`
	ReadAt       pgtype.Timestamptz `json:"read_at"`
}

type CreateAttemptParams added in v0.49.4

type CreateAttemptParams struct {
	ID              string             `json:"id"`
	GoalID          string             `json:"goal_id"`
	UserID          string             `json:"user_id"`
	AgentID         pgtype.Text        `json:"agent_id"`
	ExecutorAgentID pgtype.Text        `json:"executor_agent_id"`
	SessionID       string             `json:"session_id"`
	Purpose         string             `json:"purpose"`
	AttemptNo       int64              `json:"attempt_no"`
	Status          string             `json:"status"`
	InputContext    json.RawMessage    `json:"input_context"`
	LeaseExpiresAt  pgtype.Timestamptz `json:"lease_expires_at"`
}

type CreateAuthUserTokenParams

type CreateAuthUserTokenParams struct {
	ID            string             `json:"id"`
	UserID        string             `json:"user_id"`
	Name          string             `json:"name"`
	TokenHash     string             `json:"token_hash"`
	TokenPrefix   string             `json:"token_prefix"`
	AutoGenerated bool               `json:"auto_generated"`
	ExpiresAt     pgtype.Timestamptz `json:"expires_at"`
}

type CreateConversationParams

type CreateConversationParams struct {
	ID         string      `json:"id"`
	SessionID  string      `json:"session_id"`
	Title      pgtype.Text `json:"title"`
	Channel    string      `json:"channel"`
	Kind       string      `json:"kind"`
	ProjectID  pgtype.Text `json:"project_id"`
	Archived   bool        `json:"archived"`
	LastActive time.Time   `json:"last_active"`
	AgentID    pgtype.Text `json:"agent_id"`
	UserID     pgtype.Text `json:"user_id"`
	GroupID    pgtype.Text `json:"group_id"`
}

type CreateDigestParams added in v0.30.0

type CreateDigestParams struct {
	ID                   string          `json:"id"`
	UserID               string          `json:"user_id"`
	Date                 string          `json:"date"`
	Narrative            string          `json:"narrative"`
	SavedYesterdayCount  int64           `json:"saved_yesterday_count"`
	UnreadCount          int64           `json:"unread_count"`
	ReadCount            int64           `json:"read_count"`
	ArchivedCount        int64           `json:"archived_count"`
	StarredCount         int64           `json:"starred_count"`
	WorthRevisitingCount int64           `json:"worth_revisiting_count"`
	TotalArticles        int64           `json:"total_articles"`
	TopTags              json.RawMessage `json:"top_tags"`
}

type CreateEdgeParams added in v0.49.4

type CreateEdgeParams struct {
	GoalID     string `json:"goal_id"`
	UpstreamID string `json:"upstream_id"`
	EdgeKind   string `json:"edge_kind"`
	OnFailure  string `json:"on_failure"`
}

type CreateEmailSendDedupParams added in v0.60.0

type CreateEmailSendDedupParams struct {
	UserID         string `json:"user_id"`
	IdempotencyKey string `json:"idempotency_key"`
}

type CreateFeedEntryParams added in v0.43.0

type CreateFeedEntryParams struct {
	ID           string             `json:"id"`
	FeedID       string             `json:"feed_id"`
	Guid         string             `json:"guid"`
	Url          string             `json:"url"`
	Title        string             `json:"title"`
	Status       string             `json:"status"`
	ArticleID    pgtype.Text        `json:"article_id"`
	Attempts     int64              `json:"attempts"`
	ErrorMsg     string             `json:"error_msg"`
	DiscoveredAt time.Time          `json:"discovered_at"`
	ProcessedAt  pgtype.Timestamptz `json:"processed_at"`
}

type CreateFeedParams added in v0.43.0

type CreateFeedParams struct {
	ID            string             `json:"id"`
	UserID        string             `json:"user_id"`
	AgentID       pgtype.Text        `json:"agent_id"`
	Url           string             `json:"url"`
	Kind          string             `json:"kind"`
	Metadata      json.RawMessage    `json:"metadata"`
	Title         string             `json:"title"`
	Description   string             `json:"description"`
	CheckInterval string             `json:"check_interval"`
	LastCheckedAt pgtype.Timestamptz `json:"last_checked_at"`
	LastEtag      string             `json:"last_etag"`
	LastModified  string             `json:"last_modified"`
	Enabled       bool               `json:"enabled"`
}

type CreateGoalIfAbsentParams added in v0.60.0

type CreateGoalIfAbsentParams struct {
	ID                 string          `json:"id"`
	UserID             string          `json:"user_id"`
	AgentID            string          `json:"agent_id"`
	ProjectID          pgtype.Text     `json:"project_id"`
	ParentID           pgtype.Text     `json:"parent_id"`
	RootID             string          `json:"root_id"`
	Depth              int64           `json:"depth"`
	Position           int64           `json:"position"`
	Title              string          `json:"title"`
	Intent             string          `json:"intent"`
	Kind               string          `json:"kind"`
	Priority           string          `json:"priority"`
	Required           bool            `json:"required"`
	AcceptanceContract json.RawMessage `json:"acceptance_contract"`
	ConvergencePolicy  json.RawMessage `json:"convergence_policy"`
	ReviewPolicy       string          `json:"review_policy"`
	Lifecycle          string          `json:"lifecycle"`
	Context            json.RawMessage `json:"context"`
	DispatchHint       json.RawMessage `json:"dispatch_hint"`
	WorkflowID         pgtype.Text     `json:"workflow_id"`
	WorkflowVersion    pgtype.Int4     `json:"workflow_version"`
	IdempotencyKey     pgtype.Text     `json:"idempotency_key"`
}

type CreateGoalParams added in v0.49.4

type CreateGoalParams struct {
	ID                 string          `json:"id"`
	UserID             string          `json:"user_id"`
	AgentID            string          `json:"agent_id"`
	ProjectID          pgtype.Text     `json:"project_id"`
	ParentID           pgtype.Text     `json:"parent_id"`
	RootID             string          `json:"root_id"`
	Depth              int64           `json:"depth"`
	Position           int64           `json:"position"`
	Title              string          `json:"title"`
	Intent             string          `json:"intent"`
	Kind               string          `json:"kind"`
	Priority           string          `json:"priority"`
	Required           bool            `json:"required"`
	AcceptanceContract json.RawMessage `json:"acceptance_contract"`
	ConvergencePolicy  json.RawMessage `json:"convergence_policy"`
	ReviewPolicy       string          `json:"review_policy"`
	Lifecycle          string          `json:"lifecycle"`
	Context            json.RawMessage `json:"context"`
	DispatchHint       json.RawMessage `json:"dispatch_hint"`
	WorkflowID         pgtype.Text     `json:"workflow_id"`
	WorkflowVersion    pgtype.Int4     `json:"workflow_version"`
	IdempotencyKey     pgtype.Text     `json:"idempotency_key"`
}

type CreateGroupDispatchParams added in v0.43.0

type CreateGroupDispatchParams struct {
	ID             string             `json:"id"`
	GroupMessageID string             `json:"group_message_id"`
	GroupID        string             `json:"group_id"`
	AgentID        string             `json:"agent_id"`
	ReplyChannelID string             `json:"reply_channel_id"`
	Status         string             `json:"status"`
	AttemptCount   int64              `json:"attempt_count"`
	LeaseUntil     pgtype.Timestamptz `json:"lease_until"`
	NextAttemptAt  pgtype.Timestamptz `json:"next_attempt_at"`
	LastError      string             `json:"last_error"`
}

type CreateGroupMessageParams added in v0.42.0

type CreateGroupMessageParams struct {
	ID                string             `json:"id"`
	GroupID           string             `json:"group_id"`
	Seq               int64              `json:"seq"`
	SourceChannelID   pgtype.Text        `json:"source_channel_id"`
	ActorType         string             `json:"actor_type"`
	ActorID           string             `json:"actor_id"`
	PlatformMessageID pgtype.Text        `json:"platform_message_id"`
	ReplyTo           pgtype.Text        `json:"reply_to"`
	PlatformTimestamp pgtype.Timestamptz `json:"platform_timestamp"`
	IdempotencyKey    pgtype.Text        `json:"idempotency_key"`
	Content           string             `json:"content"`
	Reasoning         string             `json:"reasoning"`
	AgentSessionID    string             `json:"agent_session_id"`
}

type CreateGroupOutboxParams added in v0.43.0

type CreateGroupOutboxParams struct {
	ID             string             `json:"id"`
	GroupMessageID string             `json:"group_message_id"`
	GroupID        string             `json:"group_id"`
	Envelope       string             `json:"envelope"`
	Status         string             `json:"status"`
	AttemptCount   int64              `json:"attempt_count"`
	LeaseUntil     pgtype.Timestamptz `json:"lease_until"`
	NextAttemptAt  pgtype.Timestamptz `json:"next_attempt_at"`
	LastError      string             `json:"last_error"`
}

type CreateGroupStateParams added in v0.42.0

type CreateGroupStateParams struct {
	ID               string      `json:"id"`
	Platform         string      `json:"platform"`
	PlatformGroupID  string      `json:"platform_group_id"`
	PlatformThreadID string      `json:"platform_thread_id"`
	GroupName        string      `json:"group_name"`
	CreatedByUserID  pgtype.Text `json:"created_by_user_id"`
}

type CreateIngestErrorParams added in v0.42.0

type CreateIngestErrorParams struct {
	ID       string `json:"id"`
	GroupID  string `json:"group_id"`
	Pipeline string `json:"pipeline"`
	Seq      int64  `json:"seq"`
	Reason   string `json:"reason"`
}

type CreateMCPServerParams added in v0.60.0

type CreateMCPServerParams struct {
	ID            string          `json:"id"`
	Scope         string          `json:"scope"`
	UserID        pgtype.Text     `json:"user_id"`
	AgentID       pgtype.Text     `json:"agent_id"`
	Name          string          `json:"name"`
	Url           string          `json:"url"`
	Transport     string          `json:"transport"`
	AuthType      string          `json:"auth_type"`
	CredentialRef string          `json:"credential_ref"`
	Enabled       bool            `json:"enabled"`
	Metadata      json.RawMessage `json:"metadata"`
}

type CreateMemorySnapshotParams

type CreateMemorySnapshotParams struct {
	SessionID string `json:"session_id"`
	UserID    string `json:"user_id"`
	AgentID   string `json:"agent_id"`
	Version   int64  `json:"version"`
}

type CreateMessageParams

type CreateMessageParams struct {
	ID             string `json:"id"`
	ConversationID string `json:"conversation_id"`
	Seq            int64  `json:"seq"`
	Role           string `json:"role"`
	EventType      string `json:"event_type"`
	Content        string `json:"content"`
	TokenCount     int64  `json:"token_count"`
}

type CreateMessagePartParams

type CreateMessagePartParams struct {
	ID          string      `json:"id"`
	MessageID   string      `json:"message_id"`
	PartType    string      `json:"part_type"`
	Ordinal     int64       `json:"ordinal"`
	TextContent pgtype.Text `json:"text_content"`
	ToolCallID  pgtype.Text `json:"tool_call_id"`
	ToolName    pgtype.Text `json:"tool_name"`
	ToolInput   pgtype.Text `json:"tool_input"`
	ToolOutput  pgtype.Text `json:"tool_output"`
	Metadata    pgtype.Text `json:"metadata"`
}

type CreateOAuthAccessTokenParams added in v0.60.0

type CreateOAuthAccessTokenParams struct {
	PublicID        string    `json:"public_id"`
	TokenHash       string    `json:"token_hash"`
	Last4           string    `json:"last4"`
	ClientID        string    `json:"client_id"`
	UserID          string    `json:"user_id"`
	Scopes          []string  `json:"scopes"`
	RefreshFamilyID string    `json:"refresh_family_id"`
	ExpiresAt       time.Time `json:"expires_at"`
}

type CreateOAuthAuthorizationCodeParams added in v0.60.0

type CreateOAuthAuthorizationCodeParams struct {
	CodeHash            string    `json:"code_hash"`
	ClientID            string    `json:"client_id"`
	UserID              string    `json:"user_id"`
	RedirectUri         string    `json:"redirect_uri"`
	Scopes              []string  `json:"scopes"`
	CodeChallenge       string    `json:"code_challenge"`
	CodeChallengeMethod string    `json:"code_challenge_method"`
	ExpiresAt           time.Time `json:"expires_at"`
}

type CreateOAuthClientParams added in v0.60.0

type CreateOAuthClientParams struct {
	ClientID         string   `json:"client_id"`
	Name             string   `json:"name"`
	ClientSecretHash string   `json:"client_secret_hash"`
	ClientType       string   `json:"client_type"`
	RedirectUris     []string `json:"redirect_uris"`
	GrantTypes       []string `json:"grant_types"`
	Scopes           []string `json:"scopes"`
	OwnerUserID      string   `json:"owner_user_id"`
}

type CreateOAuthRefreshFamilyParams added in v0.60.0

type CreateOAuthRefreshFamilyParams struct {
	UserID   string `json:"user_id"`
	ClientID string `json:"client_id"`
}

type CreateOAuthRefreshTokenParams added in v0.60.0

type CreateOAuthRefreshTokenParams struct {
	PublicID  string    `json:"public_id"`
	TokenHash string    `json:"token_hash"`
	ClientID  string    `json:"client_id"`
	UserID    string    `json:"user_id"`
	Scopes    []string  `json:"scopes"`
	FamilyID  string    `json:"family_id"`
	ExpiresAt time.Time `json:"expires_at"`
}

type CreatePersonalAccessTokenParams added in v0.60.0

type CreatePersonalAccessTokenParams struct {
	PublicID  string             `json:"public_id"`
	UserID    string             `json:"user_id"`
	Name      string             `json:"name"`
	TokenHash string             `json:"token_hash"`
	Last4     string             `json:"last4"`
	Scopes    []string           `json:"scopes"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}

type CreateProjectParams added in v0.34.0

type CreateProjectParams struct {
	ID          string      `json:"id"`
	AgentID     string      `json:"agent_id"`
	UserID      string      `json:"user_id"`
	Name        string      `json:"name"`
	BaseDir     string      `json:"base_dir"`
	Description pgtype.Text `json:"description"`
}

type CreateProviderParams

type CreateProviderParams struct {
	ID      string          `json:"id"`
	Type    string          `json:"type"`
	Name    string          `json:"name"`
	Enabled bool            `json:"enabled"`
	Config  json.RawMessage `json:"config"`
}

type CreateSchedJobRunParams

type CreateSchedJobRunParams struct {
	ID         string             `json:"id"`
	JobID      string             `json:"job_id"`
	SessionID  string             `json:"session_id"`
	Status     string             `json:"status"`
	StartedAt  time.Time          `json:"started_at"`
	FinishedAt pgtype.Timestamptz `json:"finished_at"`
	Error      string             `json:"error"`
	UserID     pgtype.Text        `json:"user_id"`
}

type CreateSchedulerJobParams

type CreateSchedulerJobParams struct {
	ID             string             `json:"id"`
	OwnerKind      string             `json:"owner_kind"`
	ExecScope      string             `json:"exec_scope"`
	PluginID       string             `json:"plugin_id"`
	JobKey         string             `json:"job_key"`
	RuntimeName    string             `json:"runtime_name"`
	Name           string             `json:"name"`
	Description    string             `json:"description"`
	ScheduleCron   string             `json:"schedule_cron"`
	ScheduleEvery  string             `json:"schedule_every"`
	ScheduleAt     string             `json:"schedule_at"`
	Message        string             `json:"message"`
	Payload        json.RawMessage    `json:"payload"`
	DispatchKind   string             `json:"dispatch_kind"`
	SessionMode    string             `json:"session_mode"`
	Enabled        bool               `json:"enabled"`
	AgentID        pgtype.Text        `json:"agent_id"`
	UserID         pgtype.Text        `json:"user_id"`
	CreatedAt      time.Time          `json:"created_at"`
	UpdatedAt      time.Time          `json:"updated_at"`
	LastRunAt      pgtype.Timestamptz `json:"last_run_at"`
	LastError      string             `json:"last_error"`
	IdempotencyKey pgtype.Text        `json:"idempotency_key"`
}

type CreateShareParams added in v0.35.0

type CreateShareParams struct {
	ID        string             `json:"id"`
	TokenHash string             `json:"token_hash"`
	UserID    string             `json:"user_id"`
	Title     string             `json:"title"`
	MediaType string             `json:"media_type"`
	Content   []byte             `json:"content"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}

type CreateSkillParams

type CreateSkillParams struct {
	ID                     string          `json:"id"`
	Scope                  string          `json:"scope"`
	UserID                 pgtype.Text     `json:"user_id"`
	AgentID                pgtype.Text     `json:"agent_id"`
	Name                   string          `json:"name"`
	Description            string          `json:"description"`
	Status                 string          `json:"status"`
	DisableModelInvocation bool            `json:"disable_model_invocation"`
	Metadata               json.RawMessage `json:"metadata"`
}

type CreateSummaryParams

type CreateSummaryParams struct {
	ID                      string             `json:"id"`
	ConversationID          string             `json:"conversation_id"`
	Kind                    string             `json:"kind"`
	Depth                   int64              `json:"depth"`
	Content                 string             `json:"content"`
	TokenCount              int64              `json:"token_count"`
	EarliestAt              pgtype.Timestamptz `json:"earliest_at"`
	LatestAt                pgtype.Timestamptz `json:"latest_at"`
	DescendantCount         int64              `json:"descendant_count"`
	DescendantTokenCount    int64              `json:"descendant_token_count"`
	SourceMessageTokenCount int64              `json:"source_message_token_count"`
}

type CreateWebChannelIfNotExistsParams added in v0.43.0

type CreateWebChannelIfNotExistsParams struct {
	ID      string      `json:"id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type CreateWorkflowParams added in v0.60.0

type CreateWorkflowParams struct {
	ID                 string          `json:"id"`
	OwnerKind          string          `json:"owner_kind"`
	UserID             pgtype.Text     `json:"user_id"`
	AgentID            pgtype.Text     `json:"agent_id"`
	Name               string          `json:"name"`
	Version            int32           `json:"version"`
	WorkflowKey        pgtype.Text     `json:"workflow_key"`
	Intent             string          `json:"intent"`
	AcceptanceContract json.RawMessage `json:"acceptance_contract"`
	ConvergencePolicy  json.RawMessage `json:"convergence_policy"`
	Inputs             json.RawMessage `json:"inputs"`
	PayloadFormat      string          `json:"payload_format"`
	Payload            json.RawMessage `json:"payload"`
	FullyFrozen        bool            `json:"fully_frozen"`
	SourceGoalID       pgtype.Text     `json:"source_goal_id"`
}

type CtxAgentMemory

type CtxAgentMemory struct {
	UserID         string          `json:"user_id"`
	AgentID        string          `json:"agent_id"`
	Content        string          `json:"content"`
	Soul           string          `json:"soul"`
	Version        int64           `json:"version"`
	Constraints    json.RawMessage `json:"constraints"`
	ProfileEntries json.RawMessage `json:"profile_entries"`
	CreatedAt      time.Time       `json:"created_at"`
	UpdatedAt      time.Time       `json:"updated_at"`
}

type CtxAgentMemoryChangelog added in v0.38.0

type CtxAgentMemoryChangelog struct {
	ID                  string      `json:"id"`
	UserID              string      `json:"user_id"`
	AgentID             string      `json:"agent_id"`
	SessionID           pgtype.Text `json:"session_id"`
	EntityID            pgtype.Text `json:"entity_id"`
	Scope               string      `json:"scope"`
	Action              string      `json:"action"`
	Source              string      `json:"source"`
	MemoryVersionBefore pgtype.Int8 `json:"memory_version_before"`
	MemoryVersionAfter  pgtype.Int8 `json:"memory_version_after"`
	BeforeText          pgtype.Text `json:"before_text"`
	AfterText           pgtype.Text `json:"after_text"`
	Metadata            pgtype.Text `json:"metadata"`
	CreatedAt           time.Time   `json:"created_at"`
}

type CtxAgentMemorySnapshot added in v0.38.0

type CtxAgentMemorySnapshot struct {
	SessionID string    `json:"session_id"`
	UserID    string    `json:"user_id"`
	AgentID   string    `json:"agent_id"`
	Version   int64     `json:"version"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type CtxConversation

type CtxConversation struct {
	ID             string             `json:"id"`
	SessionID      string             `json:"session_id"`
	Title          pgtype.Text        `json:"title"`
	Channel        string             `json:"channel"`
	Kind           string             `json:"kind"`
	ProjectID      pgtype.Text        `json:"project_id"`
	Archived       bool               `json:"archived"`
	LastActive     time.Time          `json:"last_active"`
	BootstrappedAt pgtype.Timestamptz `json:"bootstrapped_at"`
	AgentID        pgtype.Text        `json:"agent_id"`
	UserID         pgtype.Text        `json:"user_id"`
	CreatedAt      time.Time          `json:"created_at"`
	UpdatedAt      time.Time          `json:"updated_at"`
	GroupID        pgtype.Text        `json:"group_id"`
}

type CtxGroupDispatch added in v0.43.0

type CtxGroupDispatch struct {
	ID              string             `json:"id"`
	GroupMessageID  string             `json:"group_message_id"`
	GroupID         string             `json:"group_id"`
	AgentID         string             `json:"agent_id"`
	ReplyChannelID  string             `json:"reply_channel_id"`
	Status          string             `json:"status"`
	AttemptCount    int64              `json:"attempt_count"`
	LeaseUntil      pgtype.Timestamptz `json:"lease_until"`
	NextAttemptAt   pgtype.Timestamptz `json:"next_attempt_at"`
	LastError       string             `json:"last_error"`
	ResultMessageID string             `json:"result_message_id"`
	CreatedAt       time.Time          `json:"created_at"`
	UpdatedAt       time.Time          `json:"updated_at"`
}

type CtxGroupIngestCursor added in v0.42.0

type CtxGroupIngestCursor struct {
	GroupID   string    `json:"group_id"`
	Pipeline  string    `json:"pipeline"`
	LastSeq   int64     `json:"last_seq"`
	UpdatedAt time.Time `json:"updated_at"`
}

type CtxGroupIngestError added in v0.42.0

type CtxGroupIngestError struct {
	ID        string    `json:"id"`
	GroupID   string    `json:"group_id"`
	Pipeline  string    `json:"pipeline"`
	Seq       int64     `json:"seq"`
	Reason    string    `json:"reason"`
	CreatedAt time.Time `json:"created_at"`
}

type CtxGroupMemory added in v0.42.0

type CtxGroupMemory struct {
	GroupID   string    `json:"group_id"`
	Content   string    `json:"content"`
	Version   int64     `json:"version"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type CtxGroupMessage added in v0.42.0

type CtxGroupMessage struct {
	ID                string             `json:"id"`
	GroupID           string             `json:"group_id"`
	Seq               int64              `json:"seq"`
	SourceChannelID   pgtype.Text        `json:"source_channel_id"`
	ActorType         string             `json:"actor_type"`
	ActorID           string             `json:"actor_id"`
	PlatformMessageID pgtype.Text        `json:"platform_message_id"`
	ReplyTo           pgtype.Text        `json:"reply_to"`
	PlatformTimestamp pgtype.Timestamptz `json:"platform_timestamp"`
	IdempotencyKey    pgtype.Text        `json:"idempotency_key"`
	Content           string             `json:"content"`
	Reasoning         string             `json:"reasoning"`
	AgentSessionID    string             `json:"agent_session_id"`
	CreatedAt         time.Time          `json:"created_at"`
}

type CtxGroupOutbox added in v0.43.0

type CtxGroupOutbox struct {
	ID             string             `json:"id"`
	GroupMessageID string             `json:"group_message_id"`
	GroupID        string             `json:"group_id"`
	Envelope       string             `json:"envelope"`
	Status         string             `json:"status"`
	AttemptCount   int64              `json:"attempt_count"`
	LeaseUntil     pgtype.Timestamptz `json:"lease_until"`
	NextAttemptAt  pgtype.Timestamptz `json:"next_attempt_at"`
	LastError      string             `json:"last_error"`
	CreatedAt      time.Time          `json:"created_at"`
	UpdatedAt      time.Time          `json:"updated_at"`
}

type CtxGroupState added in v0.42.0

type CtxGroupState struct {
	ID               string      `json:"id"`
	Platform         string      `json:"platform"`
	PlatformGroupID  string      `json:"platform_group_id"`
	PlatformThreadID string      `json:"platform_thread_id"`
	NextSeq          int64       `json:"next_seq"`
	CreatedAt        time.Time   `json:"created_at"`
	UpdatedAt        time.Time   `json:"updated_at"`
	GroupName        string      `json:"group_name"`
	CreatedByUserID  pgtype.Text `json:"created_by_user_id"`
}

type CtxItem

type CtxItem struct {
	ConversationID string      `json:"conversation_id"`
	Ordinal        int64       `json:"ordinal"`
	ItemType       string      `json:"item_type"`
	MessageID      pgtype.Text `json:"message_id"`
	SummaryID      pgtype.Text `json:"summary_id"`
	EventType      string      `json:"event_type"`
	Role           string      `json:"role"`
	CreatedAt      time.Time   `json:"created_at"`
}

type CtxMessage

type CtxMessage struct {
	ID             string    `json:"id"`
	ConversationID string    `json:"conversation_id"`
	Seq            int64     `json:"seq"`
	Role           string    `json:"role"`
	EventType      string    `json:"event_type"`
	Content        string    `json:"content"`
	TokenCount     int64     `json:"token_count"`
	CreatedAt      time.Time `json:"created_at"`
}

type CtxMessageEmbedding added in v0.50.0

type CtxMessageEmbedding struct {
	MessageID   string             `json:"message_id"`
	Model       string             `json:"model"`
	ContentHash []byte             `json:"content_hash"`
	Embedding   pgvector_go.Vector `json:"embedding"`
	CreatedAt   time.Time          `json:"created_at"`
	UpdatedAt   time.Time          `json:"updated_at"`
}

type CtxMessagePart

type CtxMessagePart struct {
	ID          string      `json:"id"`
	MessageID   string      `json:"message_id"`
	PartType    string      `json:"part_type"`
	Ordinal     int64       `json:"ordinal"`
	TextContent pgtype.Text `json:"text_content"`
	ToolCallID  pgtype.Text `json:"tool_call_id"`
	ToolName    pgtype.Text `json:"tool_name"`
	ToolInput   pgtype.Text `json:"tool_input"`
	ToolOutput  pgtype.Text `json:"tool_output"`
	Metadata    pgtype.Text `json:"metadata"`
}

type CtxSummary

type CtxSummary struct {
	ID                      string             `json:"id"`
	ConversationID          string             `json:"conversation_id"`
	Kind                    string             `json:"kind"`
	Depth                   int64              `json:"depth"`
	Content                 string             `json:"content"`
	TokenCount              int64              `json:"token_count"`
	EarliestAt              pgtype.Timestamptz `json:"earliest_at"`
	LatestAt                pgtype.Timestamptz `json:"latest_at"`
	DescendantCount         int64              `json:"descendant_count"`
	DescendantTokenCount    int64              `json:"descendant_token_count"`
	SourceMessageTokenCount int64              `json:"source_message_token_count"`
	CreatedAt               time.Time          `json:"created_at"`
}

type CtxSummaryEmbedding added in v0.50.0

type CtxSummaryEmbedding struct {
	SummaryID   string             `json:"summary_id"`
	Model       string             `json:"model"`
	ContentHash []byte             `json:"content_hash"`
	Embedding   pgvector_go.Vector `json:"embedding"`
	CreatedAt   time.Time          `json:"created_at"`
	UpdatedAt   time.Time          `json:"updated_at"`
}

type CtxSummaryMessage

type CtxSummaryMessage struct {
	SummaryID string `json:"summary_id"`
	MessageID string `json:"message_id"`
	Ordinal   int64  `json:"ordinal"`
}

type CtxSummaryParent

type CtxSummaryParent struct {
	SummaryID       string `json:"summary_id"`
	ParentSummaryID string `json:"parent_summary_id"`
	Ordinal         int64  `json:"ordinal"`
}

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 DeleteArticleParams added in v0.35.3

type DeleteArticleParams struct {
	ID     string `json:"id"`
	UserID string `json:"user_id"`
}

type DeleteChatAgentParams

type DeleteChatAgentParams struct {
	ChannelID string `json:"channel_id"`
	Platform  string `json:"platform"`
	ChatID    string `json:"chat_id"`
}

type DeleteContextItemsInRangeParams

type DeleteContextItemsInRangeParams struct {
	ConversationID string `json:"conversation_id"`
	Ordinal        int64  `json:"ordinal"`
	Ordinal_2      int64  `json:"ordinal_2"`
}

type DeleteDigestArticlesParams added in v0.30.0

type DeleteDigestArticlesParams struct {
	DigestID string `json:"digest_id"`
	Section  string `json:"section"`
}

type DeleteEmailSendDedupParams added in v0.60.0

type DeleteEmailSendDedupParams struct {
	UserID         string `json:"user_id"`
	IdempotencyKey string `json:"idempotency_key"`
}

type DeleteFeedParams added in v0.43.0

type DeleteFeedParams struct {
	ID     string `json:"id"`
	UserID string `json:"user_id"`
}

type DeleteMCPServerByScopeParams added in v0.60.0

type DeleteMCPServerByScopeParams struct {
	ID      string      `json:"id"`
	Scope   string      `json:"scope"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type DeletePluginStateEntryParams

type DeletePluginStateEntryParams struct {
	PluginID  string `json:"plugin_id"`
	ScopeKind string `json:"scope_kind"`
	ScopeID   string `json:"scope_id"`
	StateKey  string `json:"state_key"`
}

type DeleteProjectParams added in v0.34.0

type DeleteProjectParams struct {
	ID     string `json:"id"`
	UserID string `json:"user_id"`
}

type DeleteReflectOwnedUserAgentSkillParams added in v0.60.0

type DeleteReflectOwnedUserAgentSkillParams struct {
	ID              string `json:"id"`
	UserID          string `json:"user_id"`
	AgentID         string `json:"agent_id"`
	ExpectedVersion int64  `json:"expected_version"`
}

type DeleteShareByUserParams added in v0.35.0

type DeleteShareByUserParams struct {
	ID     string `json:"id"`
	UserID string `json:"user_id"`
}

type DeleteSkillFileParams

type DeleteSkillFileParams struct {
	SkillID string `json:"skill_id"`
	Path    string `json:"path"`
}

type DeleteSkillParams added in v0.35.3

type DeleteSkillParams struct {
	ID      string      `json:"id"`
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
}

type DeleteToolOverrideParams added in v0.60.0

type DeleteToolOverrideParams struct {
	ToolName string      `json:"tool_name"`
	Scope    string      `json:"scope"`
	UserID   pgtype.Text `json:"user_id"`
	AgentID  pgtype.Text `json:"agent_id"`
}

type DeleteUserAgentMemoryParams

type DeleteUserAgentMemoryParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type DeleteVaultEntryByScopeParams added in v0.48.0

type DeleteVaultEntryByScopeParams struct {
	Scope   string      `json:"scope"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
	Name    string      `json:"name"`
}

type DeprecateFactParams added in v0.60.0

type DeprecateFactParams struct {
	ID      string `json:"id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type DisableOAuthClientParams added in v0.60.0

type DisableOAuthClientParams struct {
	ClientID    string `json:"client_id"`
	OwnerUserID string `json:"owner_user_id"`
}

type EmailSendDedup added in v0.60.0

type EmailSendDedup struct {
	ID             string    `json:"id"`
	UserID         string    `json:"user_id"`
	IdempotencyKey string    `json:"idempotency_key"`
	SentAt         time.Time `json:"sent_at"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type ExtendRunningGroupDispatchLeaseParams added in v0.43.0

type ExtendRunningGroupDispatchLeaseParams struct {
	LeaseUntil   pgtype.Timestamptz `json:"lease_until"`
	ID           string             `json:"id"`
	AttemptCount int64              `json:"attempt_count"`
}

type ExtendRunningGroupOutboxLeaseParams added in v0.43.0

type ExtendRunningGroupOutboxLeaseParams struct {
	LeaseUntil   pgtype.Timestamptz `json:"lease_until"`
	ID           string             `json:"id"`
	AttemptCount int64              `json:"attempt_count"`
}

type Fact added in v0.60.0

type Fact struct {
	ID         string          `json:"id"`
	Subject    string          `json:"subject"`
	Scope      string          `json:"scope"`
	UserID     string          `json:"user_id"`
	AgentID    string          `json:"agent_id"`
	Content    string          `json:"content"`
	Status     string          `json:"status"`
	Metadata   json.RawMessage `json:"metadata"`
	Supersedes pgtype.Text     `json:"supersedes"`
	Version    int64           `json:"version"`
	Source     string          `json:"source"`
	CreatedAt  time.Time       `json:"created_at"`
	UpdatedAt  time.Time       `json:"updated_at"`
}

type FinalizeAttemptParams added in v0.49.4

type FinalizeAttemptParams struct {
	ToStatus     string `json:"to_status"`
	Error        string `json:"error"`
	FailureClass string `json:"failure_class"`
	ID           string `json:"id"`
}

type GetActiveAttemptParams added in v0.49.4

type GetActiveAttemptParams struct {
	GoalID  string `json:"goal_id"`
	Purpose string `json:"purpose"`
}

type GetArticleByCanonicalURLParams

type GetArticleByCanonicalURLParams struct {
	UserID       string `json:"user_id"`
	CanonicalUrl string `json:"canonical_url"`
}

type GetArticleParams added in v0.35.3

type GetArticleParams struct {
	ID     string `json:"id"`
	UserID string `json:"user_id"`
}

type GetChatAgentParams

type GetChatAgentParams struct {
	ChannelID string `json:"channel_id"`
	Platform  string `json:"platform"`
	ChatID    string `json:"chat_id"`
}

type GetContextMessageItemsRow

type GetContextMessageItemsRow struct {
	ConversationID string      `json:"conversation_id"`
	Ordinal        int64       `json:"ordinal"`
	ItemType       string      `json:"item_type"`
	MessageID      pgtype.Text `json:"message_id"`
	SummaryID      pgtype.Text `json:"summary_id"`
	EventType      string      `json:"event_type"`
	Role           string      `json:"role"`
	CreatedAt      time.Time   `json:"created_at"`
	MsgTokenCount  int64       `json:"msg_token_count"`
}

type GetContextStatsRow added in v0.46.0

type GetContextStatsRow struct {
	MessageCount     int64 `json:"message_count"`
	SourceTokenCount int64 `json:"source_token_count"`
	ActiveTokenCount int64 `json:"active_token_count"`
	SummaryDepth     int64 `json:"summary_depth"`
}

type GetConversationAgentBySessionIDParams added in v0.46.0

type GetConversationAgentBySessionIDParams struct {
	SessionID string      `json:"session_id"`
	UserID    pgtype.Text `json:"user_id"`
}

type GetConversationBySessionIDParams added in v0.35.3

type GetConversationBySessionIDParams struct {
	SessionID string      `json:"session_id"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
}

type GetConversationParams added in v0.35.3

type GetConversationParams struct {
	ID      string      `json:"id"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type GetConversationTimeBoundsRow added in v0.46.0

type GetConversationTimeBoundsRow struct {
	EarliestAt interface{} `json:"earliest_at"`
	LatestAt   interface{} `json:"latest_at"`
}

type GetDigestByDateParams added in v0.30.0

type GetDigestByDateParams struct {
	UserID string `json:"user_id"`
	Date   string `json:"date"`
}

type GetEdgeParams added in v0.49.4

type GetEdgeParams struct {
	GoalID     string `json:"goal_id"`
	UpstreamID string `json:"upstream_id"`
}

type GetEmailSendDedupParams added in v0.60.0

type GetEmailSendDedupParams struct {
	UserID         string `json:"user_id"`
	IdempotencyKey string `json:"idempotency_key"`
}

type GetFactForUpdateParams added in v0.60.0

type GetFactForUpdateParams struct {
	ID      string `json:"id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type GetFactParams added in v0.60.0

type GetFactParams struct {
	ID      string `json:"id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type GetFeedByURLParams added in v0.43.0

type GetFeedByURLParams struct {
	UserID string `json:"user_id"`
	Url    string `json:"url"`
}

type GetFeedEntryParams added in v0.43.0

type GetFeedEntryParams struct {
	ID     string `json:"id"`
	FeedID string `json:"feed_id"`
}

type GetFeedParams added in v0.43.0

type GetFeedParams struct {
	ID     string `json:"id"`
	UserID string `json:"user_id"`
}

type GetFreshTailMessageIDsParams

type GetFreshTailMessageIDsParams struct {
	ConversationID string `json:"conversation_id"`
	Limit          int32  `json:"limit"`
}

type GetGoalByIdempotencyKeyParams added in v0.60.0

type GetGoalByIdempotencyKeyParams struct {
	UserID         string      `json:"user_id"`
	IdempotencyKey pgtype.Text `json:"idempotency_key"`
}

type GetGoalHealthReportParams added in v0.60.0

type GetGoalHealthReportParams struct {
	SinceAt time.Time   `json:"since_at"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
	GoalIds []string    `json:"goal_ids"`
}

type GetGroupMemberParams added in v0.42.0

type GetGroupMemberParams struct {
	GroupID string `json:"group_id"`
	AgentID string `json:"agent_id"`
}

type GetGroupMessageByPlatformIDParams added in v0.42.0

type GetGroupMessageByPlatformIDParams struct {
	GroupID           string      `json:"group_id"`
	PlatformMessageID pgtype.Text `json:"platform_message_id"`
}

type GetGroupStateByTripleParams added in v0.42.0

type GetGroupStateByTripleParams struct {
	Platform         string `json:"platform"`
	PlatformGroupID  string `json:"platform_group_id"`
	PlatformThreadID string `json:"platform_thread_id"`
}

type GetIngestCursorParams added in v0.42.0

type GetIngestCursorParams struct {
	GroupID  string `json:"group_id"`
	Pipeline string `json:"pipeline"`
}

type GetKnowledgeUsageForUpdateParams added in v0.60.0

type GetKnowledgeUsageForUpdateParams struct {
	FactID  string `json:"fact_id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type GetLatestCuratorDeprecateFactChangelogParams added in v0.60.0

type GetLatestCuratorDeprecateFactChangelogParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
	FactID  string `json:"fact_id"`
}

type GetLatestQualifyingKnowledgeDeprecateChangelogParams added in v0.60.0

type GetLatestQualifyingKnowledgeDeprecateChangelogParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
	FactID  string `json:"fact_id"`
}

type GetLatestWorkflowVersionParams added in v0.60.0

type GetLatestWorkflowVersionParams struct {
	OwnerKind string      `json:"owner_kind"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
	Name      string      `json:"name"`
}

type GetMainConversationByProjectParams added in v0.35.3

type GetMainConversationByProjectParams struct {
	ProjectID pgtype.Text `json:"project_id"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
}

type GetMaxAttemptNoParams added in v0.49.4

type GetMaxAttemptNoParams struct {
	GoalID  string `json:"goal_id"`
	Purpose string `json:"purpose"`
}

type GetMemoryChangelogAtVersionParams

type GetMemoryChangelogAtVersionParams struct {
	UserID             string      `json:"user_id"`
	AgentID            string      `json:"agent_id"`
	Scope              string      `json:"scope"`
	MemoryVersionAfter pgtype.Int8 `json:"memory_version_after"`
}

type GetMemorySnapshotParams

type GetMemorySnapshotParams struct {
	SessionID string `json:"session_id"`
	UserID    string `json:"user_id"`
	AgentID   string `json:"agent_id"`
}

type GetMessageParams added in v0.38.0

type GetMessageParams struct {
	ID             string `json:"id"`
	ConversationID string `json:"conversation_id"`
}

type GetMessageScopedParams added in v0.49.0

type GetMessageScopedParams struct {
	ID      string      `json:"id"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type GetMessageScopedRow added in v0.49.0

type GetMessageScopedRow struct {
	ID                string      `json:"id"`
	ConversationID    string      `json:"conversation_id"`
	Seq               int64       `json:"seq"`
	Role              string      `json:"role"`
	EventType         string      `json:"event_type"`
	Content           string      `json:"content"`
	TokenCount        int64       `json:"token_count"`
	CreatedAt         time.Time   `json:"created_at"`
	SessionID         string      `json:"session_id"`
	ConversationTitle pgtype.Text `json:"conversation_title"`
}

type GetMessagesByConversationRangeParams

type GetMessagesByConversationRangeParams struct {
	ConversationID string `json:"conversation_id"`
	Seq            int64  `json:"seq"`
	Seq_2          int64  `json:"seq_2"`
}

type GetMessagesSinceParams

type GetMessagesSinceParams struct {
	ConversationID string    `json:"conversation_id"`
	CreatedAt      time.Time `json:"created_at"`
}

type GetOAuthAccessTokenByPublicIDRow added in v0.60.0

type GetOAuthAccessTokenByPublicIDRow struct {
	ID              string             `json:"id"`
	PublicID        string             `json:"public_id"`
	TokenHash       string             `json:"token_hash"`
	Last4           string             `json:"last4"`
	ClientID        string             `json:"client_id"`
	UserID          string             `json:"user_id"`
	Scopes          []string           `json:"scopes"`
	RefreshFamilyID string             `json:"refresh_family_id"`
	ExpiresAt       time.Time          `json:"expires_at"`
	LastUsedAt      pgtype.Timestamptz `json:"last_used_at"`
	CreatedAt       time.Time          `json:"created_at"`
	FamilyRevokedAt pgtype.Timestamptz `json:"family_revoked_at"`
}

type GetOAuthRefreshTokenByPublicIDRow added in v0.60.0

type GetOAuthRefreshTokenByPublicIDRow struct {
	ID              string             `json:"id"`
	PublicID        string             `json:"public_id"`
	TokenHash       string             `json:"token_hash"`
	ClientID        string             `json:"client_id"`
	UserID          string             `json:"user_id"`
	Scopes          []string           `json:"scopes"`
	FamilyID        string             `json:"family_id"`
	ReplacedByID    pgtype.Text        `json:"replaced_by_id"`
	ConsumedAt      pgtype.Timestamptz `json:"consumed_at"`
	ExpiresAt       time.Time          `json:"expires_at"`
	CreatedAt       time.Time          `json:"created_at"`
	FamilyRevokedAt pgtype.Timestamptz `json:"family_revoked_at"`
}

type GetPluginStateEntryParams

type GetPluginStateEntryParams struct {
	PluginID  string `json:"plugin_id"`
	ScopeKind string `json:"scope_kind"`
	ScopeID   string `json:"scope_id"`
	StateKey  string `json:"state_key"`
}

type GetProjectByNameParams added in v0.34.0

type GetProjectByNameParams struct {
	AgentID string `json:"agent_id"`
	UserID  string `json:"user_id"`
	Name    string `json:"name"`
}

type GetProjectParams added in v0.34.0

type GetProjectParams struct {
	ID     string `json:"id"`
	UserID string `json:"user_id"`
}

type GetRequiredChildRollupCountsRow added in v0.60.0

type GetRequiredChildRollupCountsRow struct {
	Total     int64 `json:"total"`
	Accepted  int64 `json:"accepted"`
	Failed    int64 `json:"failed"`
	Blocked   int64 `json:"blocked"`
	DepFailed int64 `json:"dep_failed"`
}

type GetSchedJobRunParams added in v0.38.0

type GetSchedJobRunParams struct {
	ID    string `json:"id"`
	JobID string `json:"job_id"`
}

type GetSchedulerJobByIdempotencyKeyParams added in v0.60.0

type GetSchedulerJobByIdempotencyKeyParams struct {
	UserID         pgtype.Text `json:"user_id"`
	IdempotencyKey pgtype.Text `json:"idempotency_key"`
}

type GetSkillFileParams

type GetSkillFileParams struct {
	SkillID string `json:"skill_id"`
	Path    string `json:"path"`
}

type GetSkillParams added in v0.35.3

type GetSkillParams struct {
	ID      string      `json:"id"`
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
}

type GetSkillUsageForUpdateParams added in v0.60.0

type GetSkillUsageForUpdateParams struct {
	SkillID string `json:"skill_id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type GetSummariesByDepthParams

type GetSummariesByDepthParams struct {
	ConversationID string `json:"conversation_id"`
	Depth          int64  `json:"depth"`
}

type GetSummaryMessageSeqRangeRow added in v0.46.0

type GetSummaryMessageSeqRangeRow struct {
	MessageSeqFrom int64 `json:"message_seq_from"`
	MessageSeqTo   int64 `json:"message_seq_to"`
}

type GetSummaryParams added in v0.38.0

type GetSummaryParams struct {
	ID             string `json:"id"`
	ConversationID string `json:"conversation_id"`
}

type GetSystemAgentSkillByNameParams added in v0.48.0

type GetSystemAgentSkillByNameParams struct {
	AgentID pgtype.Text `json:"agent_id"`
	Name    string      `json:"name"`
}

type GetUserAgentMemoryParams

type GetUserAgentMemoryParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type GetUserAgentSkillByNameParams added in v0.60.0

type GetUserAgentSkillByNameParams struct {
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
	Name    string      `json:"name"`
}

type GetUserSkillByNameParams

type GetUserSkillByNameParams struct {
	UserID pgtype.Text `json:"user_id"`
	Name   string      `json:"name"`
}

type GetVaultEntryByScopeParams added in v0.48.0

type GetVaultEntryByScopeParams struct {
	Scope   string      `json:"scope"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
	Name    string      `json:"name"`
}

type GetWorkflowRunByKeyParams added in v0.60.0

type GetWorkflowRunByKeyParams struct {
	WorkflowID     string `json:"workflow_id"`
	IdempotencyKey string `json:"idempotency_key"`
}

type HasEligiblePairActivityAfterParams added in v0.60.0

type HasEligiblePairActivityAfterParams struct {
	UserID  string    `json:"user_id"`
	AgentID string    `json:"agent_id"`
	After   time.Time `json:"after"`
}

type HeartbeatAttemptParams added in v0.49.4

type HeartbeatAttemptParams struct {
	LeaseExpiresAt pgtype.Timestamptz `json:"lease_expires_at"`
	ID             string             `json:"id"`
}

type InsertArticleContentIfAbsentParams added in v0.60.0

type InsertArticleContentIfAbsentParams struct {
	ArticleID string `json:"article_id"`
	Content   string `json:"content"`
}

type InsertFactParams added in v0.60.0

type InsertFactParams struct {
	ID         string          `json:"id"`
	Subject    string          `json:"subject"`
	UserID     string          `json:"user_id"`
	AgentID    string          `json:"agent_id"`
	Content    string          `json:"content"`
	Metadata   json.RawMessage `json:"metadata"`
	Supersedes pgtype.Text     `json:"supersedes"`
	Source     string          `json:"source"`
}

type InsertMemoryChangelogParams

type InsertMemoryChangelogParams struct {
	ID                  string      `json:"id"`
	UserID              string      `json:"user_id"`
	AgentID             string      `json:"agent_id"`
	SessionID           pgtype.Text `json:"session_id"`
	EntityID            pgtype.Text `json:"entity_id"`
	Scope               string      `json:"scope"`
	Action              string      `json:"action"`
	Source              string      `json:"source"`
	MemoryVersionBefore pgtype.Int8 `json:"memory_version_before"`
	MemoryVersionAfter  pgtype.Int8 `json:"memory_version_after"`
	BeforeText          pgtype.Text `json:"before_text"`
	AfterText           pgtype.Text `json:"after_text"`
	Metadata            pgtype.Text `json:"metadata"`
}

type InsertSkillChangelogParams added in v0.60.0

type InsertSkillChangelogParams struct {
	SkillID       string          `json:"skill_id"`
	UserID        pgtype.Text     `json:"user_id"`
	AgentID       pgtype.Text     `json:"agent_id"`
	Scope         string          `json:"scope"`
	Action        string          `json:"action"`
	VersionBefore pgtype.Int8     `json:"version_before"`
	VersionAfter  int64           `json:"version_after"`
	Metadata      json.RawMessage `json:"metadata"`
}

type IsIngestErrorParams added in v0.42.0

type IsIngestErrorParams struct {
	GroupID  string `json:"group_id"`
	Pipeline string `json:"pipeline"`
	Seq      int64  `json:"seq"`
}

type KnowledgeUsage added in v0.60.0

type KnowledgeUsage struct {
	FactID     string    `json:"fact_id"`
	UserID     string    `json:"user_id"`
	AgentID    string    `json:"agent_id"`
	LastUsedAt time.Time `json:"last_used_at"`
	CreatedAt  time.Time `json:"created_at"`
}

type LinkSummaryToMessageParams

type LinkSummaryToMessageParams struct {
	SummaryID string `json:"summary_id"`
	MessageID string `json:"message_id"`
	Ordinal   int64  `json:"ordinal"`
}

type LinkSummaryToParentParams

type LinkSummaryToParentParams struct {
	SummaryID       string `json:"summary_id"`
	ParentSummaryID string `json:"parent_summary_id"`
	Ordinal         int64  `json:"ordinal"`
}

type ListActiveFactsBySubjectParams added in v0.60.0

type ListActiveFactsBySubjectParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
	Subject string `json:"subject"`
}

type ListActiveKnowledgeContentsParams added in v0.60.0

type ListActiveKnowledgeContentsParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type ListActiveKnowledgeParams added in v0.60.0

type ListActiveKnowledgeParams struct {
	UserID          string             `json:"user_id"`
	AgentID         string             `json:"agent_id"`
	CursorTimestamp pgtype.Timestamptz `json:"cursor_timestamp"`
	CursorID        pgtype.Text        `json:"cursor_id"`
	LimitCount      int32              `json:"limit_count"`
}

type ListActiveReflectOwnedUserAgentSkillsParams added in v0.60.0

type ListActiveReflectOwnedUserAgentSkillsParams struct {
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type ListAgentConversationLastActiveRow added in v0.46.0

type ListAgentConversationLastActiveRow struct {
	AgentID    pgtype.Text `json:"agent_id"`
	LastActive interface{} `json:"last_active"`
}

type ListArticlesMissingContentRow added in v0.60.0

type ListArticlesMissingContentRow struct {
	ID       string `json:"id"`
	UserID   string `json:"user_id"`
	FilePath string `json:"file_path"`
}

type ListArticlesNeedingEmbeddingParams added in v0.50.3

type ListArticlesNeedingEmbeddingParams struct {
	Model string `json:"model"`
	Limit int32  `json:"limit"`
}

type ListArticlesNeedingEmbeddingRow added in v0.50.3

type ListArticlesNeedingEmbeddingRow struct {
	ID            string      `json:"id"`
	Content       string      `json:"content"`
	EmbeddedModel pgtype.Text `json:"embedded_model"`
	EmbeddedHash  []byte      `json:"embedded_hash"`
}

type ListArticlesParams

type ListArticlesParams struct {
	UserID     string      `json:"user_id"`
	Status     interface{} `json:"status"`
	SourceType interface{} `json:"source_type"`
	Starred    int64       `json:"starred"`
	Offset     int32       `json:"offset"`
	Limit      int32       `json:"limit"`
}

type ListAttemptByGoalParams added in v0.49.4

type ListAttemptByGoalParams struct {
	GoalID  string      `json:"goal_id"`
	Purpose pgtype.Text `json:"purpose"`
}

type ListContextItemsPageParams added in v0.46.0

type ListContextItemsPageParams struct {
	ConversationID string      `json:"conversation_id"`
	OffsetCount    int32       `json:"offset_count"`
	LimitCount     interface{} `json:"limit_count"`
}

type ListContextItemsPageRow added in v0.46.0

type ListContextItemsPageRow struct {
	Ordinal                        int64              `json:"ordinal"`
	ItemType                       string             `json:"item_type"`
	EventType                      string             `json:"event_type"`
	Role                           string             `json:"role"`
	MessageID                      pgtype.Text        `json:"message_id"`
	MessageSeq                     pgtype.Int8        `json:"message_seq"`
	MessageRole                    pgtype.Text        `json:"message_role"`
	MessageEventType               pgtype.Text        `json:"message_event_type"`
	MessageContent                 pgtype.Text        `json:"message_content"`
	MessageTokenCount              pgtype.Int8        `json:"message_token_count"`
	MessageCreatedAt               pgtype.Timestamptz `json:"message_created_at"`
	SummaryID                      pgtype.Text        `json:"summary_id"`
	SummaryKind                    pgtype.Text        `json:"summary_kind"`
	SummaryDepth                   pgtype.Int8        `json:"summary_depth"`
	SummaryContent                 pgtype.Text        `json:"summary_content"`
	SummaryTokenCount              pgtype.Int8        `json:"summary_token_count"`
	SummaryEarliestAt              pgtype.Timestamptz `json:"summary_earliest_at"`
	SummaryLatestAt                pgtype.Timestamptz `json:"summary_latest_at"`
	SummaryDescendantCount         pgtype.Int8        `json:"summary_descendant_count"`
	SummaryDescendantTokenCount    pgtype.Int8        `json:"summary_descendant_token_count"`
	SummarySourceMessageTokenCount pgtype.Int8        `json:"summary_source_message_token_count"`
	SummaryCreatedAt               pgtype.Timestamptz `json:"summary_created_at"`
}

type ListConversationsAllParams added in v0.35.3

type ListConversationsAllParams struct {
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type ListConversationsByKindParams added in v0.34.0

type ListConversationsByKindParams struct {
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
	Kind    string      `json:"kind"`
}

type ListConversationsFilteredParams added in v0.46.0

type ListConversationsFilteredParams struct {
	UserID          pgtype.Text `json:"user_id"`
	AgentID         pgtype.Text `json:"agent_id"`
	IncludeArchived interface{} `json:"include_archived"`
	ExcludeInternal bool        `json:"exclude_internal"`
	Kind            pgtype.Text `json:"kind"`
	ProjectIDIsNull interface{} `json:"project_id_is_null"`
	ProjectID       pgtype.Text `json:"project_id"`
	Offset          int32       `json:"offset"`
	Limit           interface{} `json:"limit"`
}

type ListConversationsForReviewFilteredParams added in v0.46.0

type ListConversationsForReviewFilteredParams struct {
	AgentID         pgtype.Text `json:"agent_id"`
	Kind            pgtype.Text `json:"kind"`
	ProjectIDIsNull interface{} `json:"project_id_is_null"`
	ProjectID       pgtype.Text `json:"project_id"`
	Offset          int32       `json:"offset"`
	Limit           interface{} `json:"limit"`
}

type ListConversationsForReviewFilteredRow added in v0.60.0

type ListConversationsForReviewFilteredRow struct {
	CtxConversation CtxConversation `json:"ctx_conversation"`
	LatestSeq       int64           `json:"latest_seq"`
}

type ListConversationsParams added in v0.35.3

type ListConversationsParams struct {
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type ListDigestArticlesParams added in v0.30.0

type ListDigestArticlesParams struct {
	DigestID string `json:"digest_id"`
	Section  string `json:"section"`
}

type ListDigestsParams added in v0.30.0

type ListDigestsParams struct {
	UserID string `json:"user_id"`
	Limit  int32  `json:"limit"`
	Offset int32  `json:"offset"`
}

type ListEdgeWithUpstreamStateRow added in v0.49.4

type ListEdgeWithUpstreamStateRow struct {
	GoalID             string             `json:"goal_id"`
	UpstreamID         string             `json:"upstream_id"`
	EdgeKind           string             `json:"edge_kind"`
	OnFailure          string             `json:"on_failure"`
	WaivedAt           pgtype.Timestamptz `json:"waived_at"`
	WaivedByUser       pgtype.Text        `json:"waived_by_user"`
	WaiverReason       string             `json:"waiver_reason"`
	CreatedAt          time.Time          `json:"created_at"`
	UpstreamLifecycle  string             `json:"upstream_lifecycle"`
	UpstreamDoneReason string             `json:"upstream_done_reason"`
	UpstreamOutput     pgtype.Text        `json:"upstream_output"`
}

type ListExistingUserMessageContentParams added in v0.47.0

type ListExistingUserMessageContentParams struct {
	ConversationID string   `json:"conversation_id"`
	Contents       []string `json:"contents"`
}

type ListExpiredRunningGroupDispatchParams added in v0.43.0

type ListExpiredRunningGroupDispatchParams struct {
	Now        pgtype.Timestamptz `json:"now"`
	LimitCount int32              `json:"limit_count"`
}

type ListExpiredRunningGroupOutboxParams added in v0.43.0

type ListExpiredRunningGroupOutboxParams struct {
	Now        pgtype.Timestamptz `json:"now"`
	LimitCount int32              `json:"limit_count"`
}

type ListFactChangelogBySubjectPageParams added in v0.60.0

type ListFactChangelogBySubjectPageParams struct {
	UserID          string             `json:"user_id"`
	AgentID         string             `json:"agent_id"`
	Subject         pgtype.Text        `json:"subject"`
	CursorCreatedAt pgtype.Timestamptz `json:"cursor_created_at"`
	CursorID        pgtype.Text        `json:"cursor_id"`
	LimitCount      int32              `json:"limit_count"`
}

type ListFactChangelogBySubjectPageRow added in v0.60.0

type ListFactChangelogBySubjectPageRow struct {
	ID                  string      `json:"id"`
	UserID              string      `json:"user_id"`
	AgentID             string      `json:"agent_id"`
	SessionID           pgtype.Text `json:"session_id"`
	EntityID            pgtype.Text `json:"entity_id"`
	Scope               string      `json:"scope"`
	Action              string      `json:"action"`
	Source              string      `json:"source"`
	MemoryVersionBefore pgtype.Int8 `json:"memory_version_before"`
	MemoryVersionAfter  pgtype.Int8 `json:"memory_version_after"`
	BeforeText          pgtype.Text `json:"before_text"`
	AfterText           pgtype.Text `json:"after_text"`
	Metadata            pgtype.Text `json:"metadata"`
	CreatedAt           time.Time   `json:"created_at"`
}

type ListFactChangelogBySubjectParams added in v0.60.0

type ListFactChangelogBySubjectParams struct {
	UserID     string      `json:"user_id"`
	AgentID    string      `json:"agent_id"`
	Subject    pgtype.Text `json:"subject"`
	LimitCount int32       `json:"limit_count"`
}

type ListFactChangelogUpToVersionParams added in v0.60.0

type ListFactChangelogUpToVersionParams struct {
	UserID             string      `json:"user_id"`
	AgentID            string      `json:"agent_id"`
	MemoryVersionAfter pgtype.Int8 `json:"memory_version_after"`
}

type ListFailedInboxSchedulerRunsParams added in v0.46.0

type ListFailedInboxSchedulerRunsParams struct {
	UserID     pgtype.Text        `json:"user_id"`
	Since      pgtype.Timestamptz `json:"since"`
	AgentID    pgtype.Text        `json:"agent_id"`
	LimitCount int32              `json:"limit_count"`
}

type ListFailedInboxSchedulerRunsRow added in v0.46.0

type ListFailedInboxSchedulerRunsRow struct {
	RunID      string             `json:"run_id"`
	JobID      string             `json:"job_id"`
	AgentID    pgtype.Text        `json:"agent_id"`
	Name       string             `json:"name"`
	Error      string             `json:"error"`
	FinishedAt pgtype.Timestamptz `json:"finished_at"`
	StartedAt  time.Time          `json:"started_at"`
}

type ListFeedEntriesParams added in v0.43.0

type ListFeedEntriesParams struct {
	FeedID string      `json:"feed_id"`
	Status interface{} `json:"status"`
	Limit  int32       `json:"limit"`
}

type ListFeedsParams added in v0.43.0

type ListFeedsParams struct {
	UserID string `json:"user_id"`
	Offset int32  `json:"offset"`
	Limit  int32  `json:"limit"`
}

type ListGoalEventByGoalParams added in v0.60.0

type ListGoalEventByGoalParams struct {
	GoalID string `json:"goal_id"`
	Offset int32  `json:"offset"`
	Limit  int32  `json:"limit"`
}

type ListGoalForHealthScopeParams added in v0.60.0

type ListGoalForHealthScopeParams struct {
	SinceAt time.Time   `json:"since_at"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type ListGoalsByWorkflowParams added in v0.60.0

type ListGoalsByWorkflowParams struct {
	WorkflowID pgtype.Text `json:"workflow_id"`
	Limit      int32       `json:"limit"`
}

type ListGroupMessagesAfterSeqParams added in v0.42.0

type ListGroupMessagesAfterSeqParams struct {
	GroupID    string `json:"group_id"`
	MinSeq     int64  `json:"min_seq"`
	BatchLimit int32  `json:"batch_limit"`
}

type ListGroupMessagesBetweenSeqsParams added in v0.42.0

type ListGroupMessagesBetweenSeqsParams struct {
	GroupID   string `json:"group_id"`
	AfterSeq  int64  `json:"after_seq"`
	BeforeSeq int64  `json:"before_seq"`
}

type ListGroupMessagesPaginatedParams added in v0.43.0

type ListGroupMessagesPaginatedParams struct {
	GroupID     string `json:"group_id"`
	OffsetCount int32  `json:"offset_count"`
	LimitCount  int32  `json:"limit_count"`
}

type ListGroupsByUserParams added in v0.43.0

type ListGroupsByUserParams struct {
	UserID      pgtype.Text `json:"user_id"`
	OffsetCount int32       `json:"offset_count"`
	LimitCount  int32       `json:"limit_count"`
}

type ListGroupsByUserRow added in v0.46.0

type ListGroupsByUserRow struct {
	ID               string      `json:"id"`
	Platform         string      `json:"platform"`
	PlatformGroupID  string      `json:"platform_group_id"`
	PlatformThreadID string      `json:"platform_thread_id"`
	NextSeq          int64       `json:"next_seq"`
	CreatedAt        time.Time   `json:"created_at"`
	UpdatedAt        time.Time   `json:"updated_at"`
	GroupName        string      `json:"group_name"`
	CreatedByUserID  pgtype.Text `json:"created_by_user_id"`
	LastActive       time.Time   `json:"last_active"`
}

type ListGroupsWithPendingIngestRow added in v0.42.0

type ListGroupsWithPendingIngestRow struct {
	GroupID   string `json:"group_id"`
	CursorSeq int64  `json:"cursor_seq"`
	HeadSeq   int64  `json:"head_seq"`
}

type ListInboxGoalsParams added in v0.49.4

type ListInboxGoalsParams struct {
	UserID     string      `json:"user_id"`
	AgentID    pgtype.Text `json:"agent_id"`
	Since      time.Time   `json:"since"`
	LimitCount int32       `json:"limit_count"`
}

type ListInboxGoalsRow added in v0.49.4

type ListInboxGoalsRow struct {
	ID          string      `json:"id"`
	AgentID     string      `json:"agent_id"`
	ProjectID   pgtype.Text `json:"project_id"`
	Title       string      `json:"title"`
	Intent      string      `json:"intent"`
	Lifecycle   string      `json:"lifecycle"`
	BlockReason string      `json:"block_reason"`
	UpdatedAt   time.Time   `json:"updated_at"`
	CreatedAt   time.Time   `json:"created_at"`
}

type ListMCPServersByScopeParams added in v0.60.0

type ListMCPServersByScopeParams struct {
	Scope   string      `json:"scope"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type ListMCPServersForAgentContextParams added in v0.60.0

type ListMCPServersForAgentContextParams struct {
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
}

type ListMemoryChangelogPageParams added in v0.60.0

type ListMemoryChangelogPageParams struct {
	UserID          string             `json:"user_id"`
	AgentID         string             `json:"agent_id"`
	Scope           string             `json:"scope"`
	CursorCreatedAt pgtype.Timestamptz `json:"cursor_created_at"`
	CursorID        pgtype.Text        `json:"cursor_id"`
	LimitCount      int32              `json:"limit_count"`
}

type ListMemoryChangelogParams

type ListMemoryChangelogParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
	Scope   string `json:"scope"`
	Limit   int32  `json:"limit"`
}

type ListMessagesByIDsParams added in v0.41.0

type ListMessagesByIDsParams struct {
	ConversationID string   `json:"conversation_id"`
	MessageIds     []string `json:"message_ids"`
}

type ListMessagesByLogicalPageParams added in v0.41.0

type ListMessagesByLogicalPageParams struct {
	ConversationID string             `json:"conversation_id"`
	After          pgtype.Timestamptz `json:"after"`
	Before         pgtype.Timestamptz `json:"before"`
	Offset         int32              `json:"offset"`
	Limit          int32              `json:"limit"`
}

type ListMessagesByLogicalPageRow added in v0.41.0

type ListMessagesByLogicalPageRow struct {
	ID             string    `json:"id"`
	ConversationID string    `json:"conversation_id"`
	Seq            int64     `json:"seq"`
	Role           string    `json:"role"`
	EventType      string    `json:"event_type"`
	Content        string    `json:"content"`
	TokenCount     int64     `json:"token_count"`
	CreatedAt      time.Time `json:"created_at"`
}

type ListMessagesNeedingEmbeddingParams added in v0.50.3

type ListMessagesNeedingEmbeddingParams struct {
	Model string `json:"model"`
	Limit int32  `json:"limit"`
}

type ListMessagesNeedingEmbeddingRow added in v0.50.3

type ListMessagesNeedingEmbeddingRow struct {
	ID            string      `json:"id"`
	Content       string      `json:"content"`
	EmbeddedModel pgtype.Text `json:"embedded_model"`
	EmbeddedHash  []byte      `json:"embedded_hash"`
}

type ListOAuthAuthorizedAppsRow added in v0.60.0

type ListOAuthAuthorizedAppsRow struct {
	ClientID   string    `json:"client_id"`
	FamilyID   string    `json:"family_id"`
	Scopes     []string  `json:"scopes"`
	CreatedAt  time.Time `json:"created_at"`
	ClientName string    `json:"client_name"`
}

type ListPendingEntriesParams added in v0.43.0

type ListPendingEntriesParams struct {
	FeedID string `json:"feed_id"`
	Offset int32  `json:"offset"`
	Limit  int32  `json:"limit"`
}

type ListPendingGroupDispatchByMessageParams added in v0.43.0

type ListPendingGroupDispatchByMessageParams struct {
	GroupMessageID string             `json:"group_message_id"`
	Now            pgtype.Timestamptz `json:"now"`
}

type ListPendingGroupDispatchParams added in v0.43.0

type ListPendingGroupDispatchParams struct {
	Now        pgtype.Timestamptz `json:"now"`
	LimitCount int32              `json:"limit_count"`
}

type ListPendingGroupOutboxParams added in v0.43.0

type ListPendingGroupOutboxParams struct {
	Now        pgtype.Timestamptz `json:"now"`
	LimitCount int32              `json:"limit_count"`
}

type ListProjectsAllParams added in v0.34.0

type ListProjectsAllParams struct {
	AgentID string `json:"agent_id"`
	UserID  string `json:"user_id"`
}

type ListProjectsParams added in v0.34.0

type ListProjectsParams struct {
	AgentID string `json:"agent_id"`
	UserID  string `json:"user_id"`
}

type ListRecentGoalEventContextParams added in v0.60.0

type ListRecentGoalEventContextParams struct {
	GoalID string `json:"goal_id"`
	Limit  int32  `json:"limit"`
}

type ListRecentGroupMessagesBeforeSeqParams added in v0.43.0

type ListRecentGroupMessagesBeforeSeqParams struct {
	GroupID   string `json:"group_id"`
	BeforeSeq int64  `json:"before_seq"`
	MaxCount  int32  `json:"max_count"`
}

type ListRecentGroupMessagesParams added in v0.42.0

type ListRecentGroupMessagesParams struct {
	GroupID  string `json:"group_id"`
	MaxCount int32  `json:"max_count"`
}

type ListRecentlyForgottenReflectKnowledgeParams added in v0.60.0

type ListRecentlyForgottenReflectKnowledgeParams struct {
	UserID     string `json:"user_id"`
	AgentID    string `json:"agent_id"`
	LimitCount int32  `json:"limit_count"`
}

type ListRecentlyForgottenReflectKnowledgeRow added in v0.60.0

type ListRecentlyForgottenReflectKnowledgeRow struct {
	FactID                string      `json:"fact_id"`
	Content               string      `json:"content"`
	Version               int64       `json:"version"`
	DeprecatedChangelogID string      `json:"deprecated_changelog_id"`
	DeprecatedAt          time.Time   `json:"deprecated_at"`
	MemoryVersionAfter    pgtype.Int8 `json:"memory_version_after"`
	DeprecateMetadata     pgtype.Text `json:"deprecate_metadata"`
}

type ListReflectUsagePairsRow added in v0.60.0

type ListReflectUsagePairsRow struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type ListRemovedKnowledgeParams added in v0.60.0

type ListRemovedKnowledgeParams struct {
	UserID          string             `json:"user_id"`
	AgentID         string             `json:"agent_id"`
	NowAt           time.Time          `json:"now_at"`
	CursorTimestamp pgtype.Timestamptz `json:"cursor_timestamp"`
	CursorID        pgtype.Text        `json:"cursor_id"`
	LimitCount      int32              `json:"limit_count"`
}

type ListRemovedKnowledgeRow added in v0.60.0

type ListRemovedKnowledgeRow struct {
	ID                string          `json:"id"`
	Subject           string          `json:"subject"`
	Scope             string          `json:"scope"`
	UserID            string          `json:"user_id"`
	AgentID           string          `json:"agent_id"`
	Content           string          `json:"content"`
	Status            string          `json:"status"`
	Metadata          json.RawMessage `json:"metadata"`
	Supersedes        pgtype.Text     `json:"supersedes"`
	Version           int64           `json:"version"`
	Source            string          `json:"source"`
	CreatedAt         time.Time       `json:"created_at"`
	UpdatedAt         time.Time       `json:"updated_at"`
	DeprecatedAt      time.Time       `json:"deprecated_at"`
	DeprecateMetadata pgtype.Text     `json:"deprecate_metadata"`
}

type ListRootGoalParams added in v0.49.4

type ListRootGoalParams struct {
	UserID          pgtype.Text `json:"user_id"`
	AgentID         pgtype.Text `json:"agent_id"`
	ProjectID       pgtype.Text `json:"project_id"`
	WorkflowID      pgtype.Text `json:"workflow_id"`
	Lifecycle       pgtype.Text `json:"lifecycle"`
	Terminal        pgtype.Bool `json:"terminal"`
	Q               pgtype.Text `json:"q"`
	IncludeArchived bool        `json:"include_archived"`
	Offset          int32       `json:"offset"`
	Limit           int32       `json:"limit"`
}

type ListSchedJobRunsParams

type ListSchedJobRunsParams struct {
	JobID  string      `json:"job_id"`
	UserID pgtype.Text `json:"user_id"`
	Offset int32       `json:"offset"`
	Limit  int32       `json:"limit"`
}

type ListSchedulerJobByOwnerParams added in v0.60.0

type ListSchedulerJobByOwnerParams struct {
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
}

type ListSchedulerJobsByAgentParams added in v0.36.0

type ListSchedulerJobsByAgentParams struct {
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
}

type ListSharesByUserParams added in v0.38.0

type ListSharesByUserParams struct {
	UserID string `json:"user_id"`
	Limit  int32  `json:"limit"`
	Offset int32  `json:"offset"`
}

type ListSharesByUserRow added in v0.35.0

type ListSharesByUserRow struct {
	ID        string             `json:"id"`
	TokenHash string             `json:"token_hash"`
	UserID    string             `json:"user_id"`
	Title     string             `json:"title"`
	MediaType string             `json:"media_type"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
	CreatedAt time.Time          `json:"created_at"`
	UpdatedAt time.Time          `json:"updated_at"`
}

type ListSkillChangelogBySkillParams added in v0.60.0

type ListSkillChangelogBySkillParams struct {
	SkillID    string `json:"skill_id"`
	LimitCount int32  `json:"limit_count"`
}

type ListSkillsByScopeParams added in v0.48.0

type ListSkillsByScopeParams struct {
	Scope   string      `json:"scope"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type ListSkillsForAgentContextParams added in v0.36.0

type ListSkillsForAgentContextParams struct {
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
}

type ListSkillsForUserParams added in v0.36.0

type ListSkillsForUserParams struct {
	AgentIdsCsv pgtype.Text `json:"agent_ids_csv"`
	UserID      pgtype.Text `json:"user_id"`
}

type ListSkillsVisibleParams

type ListSkillsVisibleParams struct {
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
}

type ListStaleAttemptsParams added in v0.49.4

type ListStaleAttemptsParams struct {
	Now   pgtype.Timestamptz `json:"now"`
	Limit int32              `json:"limit"`
}

type ListStaleReflectKnowledgeForCuratorParams added in v0.60.0

type ListStaleReflectKnowledgeForCuratorParams struct {
	UserID      string    `json:"user_id"`
	AgentID     string    `json:"agent_id"`
	StaleBefore time.Time `json:"stale_before"`
}

type ListStaleReflectKnowledgeForCuratorRow added in v0.60.0

type ListStaleReflectKnowledgeForCuratorRow struct {
	FactID               string    `json:"fact_id"`
	UserID               string    `json:"user_id"`
	AgentID              string    `json:"agent_id"`
	LastUsedAt           time.Time `json:"last_used_at"`
	PairLatestActivityAt time.Time `json:"pair_latest_activity_at"`
}

type ListStaleReflectSkillsForCuratorParams added in v0.60.0

type ListStaleReflectSkillsForCuratorParams struct {
	StaleBefore       time.Time `json:"stale_before"`
	UserID            string    `json:"user_id"`
	AgentID           string    `json:"agent_id"`
	LowUseBefore      time.Time `json:"low_use_before"`
	LowUseMaxUseCount int64     `json:"low_use_max_use_count"`
}

type ListStaleReflectSkillsForCuratorRow added in v0.60.0

type ListStaleReflectSkillsForCuratorRow struct {
	SkillID              string    `json:"skill_id"`
	UserID               string    `json:"user_id"`
	AgentID              string    `json:"agent_id"`
	Version              int64     `json:"version"`
	UseCount             int64     `json:"use_count"`
	LastUsedAt           time.Time `json:"last_used_at"`
	PairLatestActivityAt time.Time `json:"pair_latest_activity_at"`
	Rule                 string    `json:"rule"`
}

type ListSummariesByIDsParams added in v0.41.0

type ListSummariesByIDsParams struct {
	ConversationID string   `json:"conversation_id"`
	SummaryIds     []string `json:"summary_ids"`
}

type ListSummariesNeedingEmbeddingParams added in v0.50.3

type ListSummariesNeedingEmbeddingParams struct {
	Model string `json:"model"`
	Limit int32  `json:"limit"`
}

type ListSummariesNeedingEmbeddingRow added in v0.50.3

type ListSummariesNeedingEmbeddingRow struct {
	ID            string      `json:"id"`
	Content       string      `json:"content"`
	EmbeddedModel pgtype.Text `json:"embedded_model"`
	EmbeddedHash  []byte      `json:"embedded_hash"`
}

type ListToolOverridesForAgentContextParams added in v0.60.0

type ListToolOverridesForAgentContextParams struct {
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
}

type ListUnreadArticlesOlderThanParams

type ListUnreadArticlesOlderThanParams struct {
	UserID string    `json:"user_id"`
	Cutoff time.Time `json:"cutoff"`
	Limit  int32     `json:"limit"`
}

type ListVaultEntriesByScopeParams added in v0.48.0

type ListVaultEntriesByScopeParams struct {
	Scope   string      `json:"scope"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type ListVaultEntriesForRuntimeParams added in v0.48.0

type ListVaultEntriesForRuntimeParams struct {
	RuntimeAgentID pgtype.Text `json:"runtime_agent_id"`
	UserID         pgtype.Text `json:"user_id"`
}

type ListWorkflowRunsParams added in v0.60.0

type ListWorkflowRunsParams struct {
	WorkflowID string `json:"workflow_id"`
	Offset     int32  `json:"offset"`
	Limit      int32  `json:"limit"`
}

type ListWorkflowRunsRow added in v0.60.0

type ListWorkflowRunsRow struct {
	ID              string          `json:"id"`
	WorkflowID      string          `json:"workflow_id"`
	WorkflowVersion int32           `json:"workflow_version"`
	IdempotencyKey  string          `json:"idempotency_key"`
	RootGoalID      pgtype.Text     `json:"root_goal_id"`
	Status          string          `json:"status"`
	Inputs          json.RawMessage `json:"inputs"`
	PlanHash        string          `json:"plan_hash"`
	CreatedAt       time.Time       `json:"created_at"`
	UpdatedAt       time.Time       `json:"updated_at"`
	RootLifecycle   pgtype.Text     `json:"root_lifecycle"`
	RootBlockReason pgtype.Text     `json:"root_block_reason"`
	RootDoneReason  pgtype.Text     `json:"root_done_reason"`
}

type ListWorkflowVersionsParams added in v0.60.0

type ListWorkflowVersionsParams struct {
	OwnerKind string      `json:"owner_kind"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
	Name      string      `json:"name"`
}

type ListWorkflowsParams added in v0.60.0

type ListWorkflowsParams struct {
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type MarkGroupDispatchCompletedParams added in v0.43.0

type MarkGroupDispatchCompletedParams struct {
	ID           string `json:"id"`
	AttemptCount int64  `json:"attempt_count"`
}

type MarkGroupDispatchFailedParams added in v0.43.0

type MarkGroupDispatchFailedParams struct {
	LastError    string `json:"last_error"`
	ID           string `json:"id"`
	AttemptCount int64  `json:"attempt_count"`
}

type MarkGroupOutboxCompletedParams added in v0.43.0

type MarkGroupOutboxCompletedParams struct {
	ID           string `json:"id"`
	AttemptCount int64  `json:"attempt_count"`
}

type MarkGroupOutboxFailedParams added in v0.43.0

type MarkGroupOutboxFailedParams struct {
	LastError    string `json:"last_error"`
	ID           string `json:"id"`
	AttemptCount int64  `json:"attempt_count"`
}

type McpServer added in v0.60.0

type McpServer struct {
	ID            string          `json:"id"`
	Scope         string          `json:"scope"`
	UserID        pgtype.Text     `json:"user_id"`
	AgentID       pgtype.Text     `json:"agent_id"`
	Name          string          `json:"name"`
	Url           string          `json:"url"`
	Transport     string          `json:"transport"`
	AuthType      string          `json:"auth_type"`
	CredentialRef string          `json:"credential_ref"`
	Enabled       bool            `json:"enabled"`
	Metadata      json.RawMessage `json:"metadata"`
	CreatedAt     time.Time       `json:"created_at"`
	UpdatedAt     time.Time       `json:"updated_at"`
}

type OauthAccessToken added in v0.60.0

type OauthAccessToken struct {
	ID              string             `json:"id"`
	PublicID        string             `json:"public_id"`
	TokenHash       string             `json:"token_hash"`
	Last4           string             `json:"last4"`
	ClientID        string             `json:"client_id"`
	UserID          string             `json:"user_id"`
	Scopes          []string           `json:"scopes"`
	RefreshFamilyID string             `json:"refresh_family_id"`
	ExpiresAt       time.Time          `json:"expires_at"`
	LastUsedAt      pgtype.Timestamptz `json:"last_used_at"`
	CreatedAt       time.Time          `json:"created_at"`
}

type OauthAuthorizationCode added in v0.60.0

type OauthAuthorizationCode struct {
	ID                  string             `json:"id"`
	CodeHash            string             `json:"code_hash"`
	ClientID            string             `json:"client_id"`
	UserID              string             `json:"user_id"`
	RedirectUri         string             `json:"redirect_uri"`
	Scopes              []string           `json:"scopes"`
	CodeChallenge       string             `json:"code_challenge"`
	CodeChallengeMethod string             `json:"code_challenge_method"`
	ExpiresAt           time.Time          `json:"expires_at"`
	ConsumedAt          pgtype.Timestamptz `json:"consumed_at"`
	CreatedAt           time.Time          `json:"created_at"`
}

type OauthClient added in v0.60.0

type OauthClient struct {
	ID               string             `json:"id"`
	ClientID         string             `json:"client_id"`
	Name             string             `json:"name"`
	ClientSecretHash string             `json:"client_secret_hash"`
	ClientType       string             `json:"client_type"`
	RedirectUris     []string           `json:"redirect_uris"`
	GrantTypes       []string           `json:"grant_types"`
	Scopes           []string           `json:"scopes"`
	OwnerUserID      string             `json:"owner_user_id"`
	DisabledAt       pgtype.Timestamptz `json:"disabled_at"`
	CreatedAt        time.Time          `json:"created_at"`
	UpdatedAt        time.Time          `json:"updated_at"`
}

type OauthRefreshFamily added in v0.60.0

type OauthRefreshFamily struct {
	ID        string             `json:"id"`
	UserID    string             `json:"user_id"`
	ClientID  string             `json:"client_id"`
	RevokedAt pgtype.Timestamptz `json:"revoked_at"`
	CreatedAt time.Time          `json:"created_at"`
}

type OauthRefreshToken added in v0.60.0

type OauthRefreshToken struct {
	ID           string             `json:"id"`
	PublicID     string             `json:"public_id"`
	TokenHash    string             `json:"token_hash"`
	ClientID     string             `json:"client_id"`
	UserID       string             `json:"user_id"`
	Scopes       []string           `json:"scopes"`
	FamilyID     string             `json:"family_id"`
	ReplacedByID pgtype.Text        `json:"replaced_by_id"`
	ConsumedAt   pgtype.Timestamptz `json:"consumed_at"`
	ExpiresAt    time.Time          `json:"expires_at"`
	CreatedAt    time.Time          `json:"created_at"`
}

type PersonalAccessToken added in v0.60.0

type PersonalAccessToken struct {
	ID         string             `json:"id"`
	PublicID   string             `json:"public_id"`
	UserID     string             `json:"user_id"`
	Name       string             `json:"name"`
	TokenHash  string             `json:"token_hash"`
	Last4      string             `json:"last4"`
	Scopes     []string           `json:"scopes"`
	ExpiresAt  pgtype.Timestamptz `json:"expires_at"`
	LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
	RevokedAt  pgtype.Timestamptz `json:"revoked_at"`
	CreatedAt  time.Time          `json:"created_at"`
	UpdatedAt  time.Time          `json:"updated_at"`
}

type Plugin added in v0.38.0

type Plugin struct {
	ID        string          `json:"id"`
	Kind      string          `json:"kind"`
	Name      string          `json:"name"`
	Enabled   bool            `json:"enabled"`
	Config    json.RawMessage `json:"config"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

type PluginOauthProvider added in v0.38.0

type PluginOauthProvider struct {
	ID              string    `json:"id"`
	ProviderID      string    `json:"provider_id"`
	ClientID        string    `json:"client_id"`
	ClientSecretEnc string    `json:"client_secret_enc"`
	RedirectUrl     string    `json:"redirect_url"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

type PluginOverride added in v0.38.0

type PluginOverride struct {
	PluginID           string      `json:"plugin_id"`
	Enabled            pgtype.Bool `json:"enabled"`
	SessionEnvVaultKey string      `json:"session_env_vault_key"`
	Config             string      `json:"config"`
	CreatedAt          time.Time   `json:"created_at"`
	UpdatedAt          time.Time   `json:"updated_at"`
}

type PluginState added in v0.38.0

type PluginState struct {
	PluginID  string          `json:"plugin_id"`
	ScopeKind string          `json:"scope_kind"`
	ScopeID   string          `json:"scope_id"`
	StateKey  string          `json:"state_key"`
	Value     json.RawMessage `json:"value"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

type Project added in v0.34.0

type Project struct {
	ID          string      `json:"id"`
	AgentID     string      `json:"agent_id"`
	UserID      string      `json:"user_id"`
	Name        string      `json:"name"`
	BaseDir     string      `json:"base_dir"`
	Description pgtype.Text `json:"description"`
	Archived    bool        `json:"archived"`
	CreatedAt   time.Time   `json:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
}

type PromoteAttemptParams added in v0.49.4

type PromoteAttemptParams struct {
	LeaseExpiresAt pgtype.Timestamptz `json:"lease_expires_at"`
	ID             string             `json:"id"`
}

type Provider added in v0.38.0

type Provider struct {
	ID        string          `json:"id"`
	Type      string          `json:"type"`
	Name      string          `json:"name"`
	Enabled   bool            `json:"enabled"`
	Config    json.RawMessage `json:"config"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
}

type ProviderModelsCache added in v0.60.0

type ProviderModelsCache struct {
	ProviderID string          `json:"provider_id"`
	Models     json.RawMessage `json:"models"`
	CreatedAt  time.Time       `json:"created_at"`
	UpdatedAt  time.Time       `json:"updated_at"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AcceptGoal added in v0.49.4

func (q *Queries) AcceptGoal(ctx context.Context, arg AcceptGoalParams) (int64, error)

func (*Queries) AddDigestArticle added in v0.30.0

func (q *Queries) AddDigestArticle(ctx context.Context, arg AddDigestArticleParams) error

func (*Queries) AddGroupMember added in v0.42.0

func (q *Queries) AddGroupMember(ctx context.Context, arg AddGroupMemberParams) (ChannelGroupMember, error)

func (*Queries) AdvanceMemorySnapshot

func (q *Queries) AdvanceMemorySnapshot(ctx context.Context, arg AdvanceMemorySnapshotParams) error

func (*Queries) AppendAcceptanceEvent added in v0.49.4

func (q *Queries) AppendAcceptanceEvent(ctx context.Context, arg AppendAcceptanceEventParams) (AgentGoalAcceptanceEvent, error)

Append-only ledger row: a deterministic check result or a judgment verdict. Never updated/deleted in normal operation. The natural key (goal, attempt, item, cache_key) is unique, so a re-submitted verdict or a re-run check on identical inputs is a no-op (DO NOTHING): appending is idempotent and returns pgx.ErrNoRows on the duplicate, which the caller swallows.

func (*Queries) AppendContextItem

func (q *Queries) AppendContextItem(ctx context.Context, arg AppendContextItemParams) error

func (*Queries) AppendGoalEvent added in v0.60.0

func (q *Queries) AppendGoalEvent(ctx context.Context, arg AppendGoalEventParams) (AgentGoalEvent, error)

Append-only goal timeline row. GoalService is the only writer.

func (*Queries) ArchiveGoal added in v0.49.4

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

func (*Queries) ArchiveProject added in v0.34.0

func (q *Queries) ArchiveProject(ctx context.Context, arg ArchiveProjectParams) error

func (*Queries) AssignUserAgent

func (q *Queries) AssignUserAgent(ctx context.Context, arg AssignUserAgentParams) error

func (*Queries) BlockGoal added in v0.49.4

func (q *Queries) BlockGoal(ctx context.Context, arg BlockGoalParams) (int64, error)

func (*Queries) BumpAgentMemoryVersion added in v0.60.0

func (q *Queries) BumpAgentMemoryVersion(ctx context.Context, arg BumpAgentMemoryVersionParams) (CtxAgentMemory, error)

func (*Queries) BumpGroupSeq added in v0.42.0

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

func (*Queries) CancelGoal added in v0.49.4

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

func (*Queries) ClaimExpiredGroupDispatch added in v0.43.0

func (q *Queries) ClaimExpiredGroupDispatch(ctx context.Context, arg ClaimExpiredGroupDispatchParams) (CtxGroupDispatch, error)

func (*Queries) ClaimExpiredGroupOutbox added in v0.43.0

func (q *Queries) ClaimExpiredGroupOutbox(ctx context.Context, arg ClaimExpiredGroupOutboxParams) (CtxGroupOutbox, error)

func (*Queries) ClaimGoal added in v0.49.4

func (q *Queries) ClaimGoal(ctx context.Context, arg ClaimGoalParams) (int64, error)

func (*Queries) ClaimPendingGroupDispatch added in v0.43.0

func (q *Queries) ClaimPendingGroupDispatch(ctx context.Context, arg ClaimPendingGroupDispatchParams) (CtxGroupDispatch, error)

func (*Queries) ClaimPendingGroupOutbox added in v0.43.0

func (q *Queries) ClaimPendingGroupOutbox(ctx context.Context, arg ClaimPendingGroupOutboxParams) (CtxGroupOutbox, error)

func (*Queries) ClaimWorkflowRun added in v0.60.0

func (q *Queries) ClaimWorkflowRun(ctx context.Context, arg ClaimWorkflowRunParams) (ClaimWorkflowRunRow, error)

ClaimWorkflowRun returns claimed=true for a new insert and false for an existing idempotency row. The no-op update keeps this a single round trip while preserving the existing row values for resume logic.

func (*Queries) ClearGoalActiveAttempt added in v0.49.4

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

func (*Queries) ClearUserAgentMemory added in v0.60.0

func (q *Queries) ClearUserAgentMemory(ctx context.Context, arg ClearUserAgentMemoryParams) error

Reset the durable memory columns without deleting the row, so the version clock stays monotonic for snapshot/changelog replay.

func (*Queries) ConsumeOAuthAuthorizationCode added in v0.60.0

func (q *Queries) ConsumeOAuthAuthorizationCode(ctx context.Context, codeHash string) (OauthAuthorizationCode, error)

Single-use exchange: mark consumed only if not already consumed. A second exchange of the same code returns no row, which the caller treats as reuse.

func (*Queries) ConsumeOAuthRefreshToken added in v0.60.0

func (q *Queries) ConsumeOAuthRefreshToken(ctx context.Context, arg ConsumeOAuthRefreshTokenParams) (OauthRefreshToken, error)

Rotation: mark the presented token consumed and point it at its replacement, only if it is still active. No row returned means it was already consumed (reuse), and the caller must revoke the whole family. Family-level revocation is checked separately at read time via GetOAuthRefreshTokenByPublicID.

func (*Queries) CountActiveKnowledge added in v0.60.0

func (q *Queries) CountActiveKnowledge(ctx context.Context, arg CountActiveKnowledgeParams) (int64, error)

func (*Queries) CountArticlesByStatus

func (q *Queries) CountArticlesByStatus(ctx context.Context, arg CountArticlesByStatusParams) (int64, error)

func (*Queries) CountBillableAttempts added in v0.60.0

func (q *Queries) CountBillableAttempts(ctx context.Context, arg CountBillableAttemptsParams) (int64, error)

Budget spent for execution/decomposition convergence. In-flight attempts count so a concurrent claim cannot overspend. Finished attempts count unless their failure class is one old refund path: environment, contract, or flaky. Queued reaps finalize as interrupted/flaky and are therefore not billable.

func (*Queries) CountDigests added in v0.30.0

func (q *Queries) CountDigests(ctx context.Context, userID string) (int64, error)

func (*Queries) CountEnabledSchedulerWorkflowJobs added in v0.60.0

func (q *Queries) CountEnabledSchedulerWorkflowJobs(ctx context.Context, workflowID string) (int64, error)

func (*Queries) CountGroupDispatchByMessage added in v0.43.0

func (q *Queries) CountGroupDispatchByMessage(ctx context.Context, groupMessageID string) (int64, error)

func (*Queries) CountGroupMembers added in v0.43.0

func (q *Queries) CountGroupMembers(ctx context.Context, groupID string) (int64, error)

func (*Queries) CountInflightAttemptsByRoot added in v0.49.4

func (q *Queries) CountInflightAttemptsByRoot(ctx context.Context, rootID string) (int64, error)

func (*Queries) CountInflightAttemptsByUser added in v0.49.4

func (q *Queries) CountInflightAttemptsByUser(ctx context.Context, userID string) (int64, error)

func (*Queries) CountNonTerminalGroupDispatchByMessage added in v0.47.0

func (q *Queries) CountNonTerminalGroupDispatchByMessage(ctx context.Context, groupMessageID string) (int64, error)

func (*Queries) CountRanReviewAttemptsForOutput added in v0.60.0

func (q *Queries) CountRanReviewAttemptsForOutput(ctx context.Context, arg CountRanReviewAttemptsForOutputParams) (int64, error)

Review attempts spent on the CURRENT needs_verdict episode: those created after the reviewed execution attempt (a later execution attempt starts a fresh episode) that actually ran (started_at set). A queued attempt reaped before it was promoted never ran and does not charge the budget, mirroring the billable budget predicate below. This is the agent-review budget; attempt_no is still assigned globally per purpose via GetMaxAttemptNo.

func (*Queries) CountRemovedKnowledge added in v0.60.0

func (q *Queries) CountRemovedKnowledge(ctx context.Context, arg CountRemovedKnowledgeParams) (int64, error)

func (*Queries) CountRootGoal added in v0.49.4

func (q *Queries) CountRootGoal(ctx context.Context, arg CountRootGoalParams) (int64, error)

CountRootGoal mirrors ListRootGoal's filter so a list's reported total is exact, and the active/history/archived header badges are three cheap counts that vary only their terminal/include_archived args.

func (*Queries) CountRunningSchedJobRuns

func (q *Queries) CountRunningSchedJobRuns(ctx context.Context, jobID string) (int64, error)

func (*Queries) CountStarredArticles

func (q *Queries) CountStarredArticles(ctx context.Context, userID string) (int64, error)

func (*Queries) CountWorkflowRuns added in v0.60.0

func (q *Queries) CountWorkflowRuns(ctx context.Context, workflowID string) (int64, error)

func (*Queries) CreateAgent

func (q *Queries) CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent, error)

func (*Queries) CreateArticle

func (q *Queries) CreateArticle(ctx context.Context, arg CreateArticleParams) (RecallyArticle, error)

func (*Queries) CreateAttempt added in v0.49.4

func (q *Queries) CreateAttempt(ctx context.Context, arg CreateAttemptParams) (AgentGoalAttempt, error)

func (*Queries) CreateAuthUserToken

func (q *Queries) CreateAuthUserToken(ctx context.Context, arg CreateAuthUserTokenParams) (AuthUserToken, error)

func (*Queries) CreateConversation

func (q *Queries) CreateConversation(ctx context.Context, arg CreateConversationParams) (CtxConversation, error)

func (*Queries) CreateDigest added in v0.30.0

func (q *Queries) CreateDigest(ctx context.Context, arg CreateDigestParams) (RecallyDigest, error)

func (*Queries) CreateEdge added in v0.49.4

func (q *Queries) CreateEdge(ctx context.Context, arg CreateEdgeParams) (AgentGoalEdge, error)

func (*Queries) CreateEmailSendDedup added in v0.60.0

func (q *Queries) CreateEmailSendDedup(ctx context.Context, arg CreateEmailSendDedupParams) (EmailSendDedup, error)

func (*Queries) CreateFeed added in v0.43.0

func (q *Queries) CreateFeed(ctx context.Context, arg CreateFeedParams) (RecallyFeed, error)

func (*Queries) CreateFeedEntry added in v0.43.0

func (q *Queries) CreateFeedEntry(ctx context.Context, arg CreateFeedEntryParams) (RecallyFeedEntry, error)

func (*Queries) CreateGoal added in v0.49.4

func (q *Queries) CreateGoal(ctx context.Context, arg CreateGoalParams) (AgentGoal, error)

func (*Queries) CreateGoalIfAbsent added in v0.60.0

func (q *Queries) CreateGoalIfAbsent(ctx context.Context, arg CreateGoalIfAbsentParams) (AgentGoal, error)

func (*Queries) CreateGroupDispatch added in v0.43.0

func (q *Queries) CreateGroupDispatch(ctx context.Context, arg CreateGroupDispatchParams) error

func (*Queries) CreateGroupMessage added in v0.42.0

func (q *Queries) CreateGroupMessage(ctx context.Context, arg CreateGroupMessageParams) (CtxGroupMessage, error)

func (*Queries) CreateGroupOutbox added in v0.43.0

func (q *Queries) CreateGroupOutbox(ctx context.Context, arg CreateGroupOutboxParams) (CtxGroupOutbox, error)

func (*Queries) CreateGroupState added in v0.42.0

func (q *Queries) CreateGroupState(ctx context.Context, arg CreateGroupStateParams) (CtxGroupState, error)

func (*Queries) CreateIngestError added in v0.42.0

func (q *Queries) CreateIngestError(ctx context.Context, arg CreateIngestErrorParams) error

func (*Queries) CreateMCPServer added in v0.60.0

func (q *Queries) CreateMCPServer(ctx context.Context, arg CreateMCPServerParams) (McpServer, error)

func (*Queries) CreateMemorySnapshot

func (q *Queries) CreateMemorySnapshot(ctx context.Context, arg CreateMemorySnapshotParams) (CtxAgentMemorySnapshot, error)

func (*Queries) CreateMessage

func (q *Queries) CreateMessage(ctx context.Context, arg CreateMessageParams) (CtxMessage, error)

func (*Queries) CreateMessagePart

func (q *Queries) CreateMessagePart(ctx context.Context, arg CreateMessagePartParams) error

func (*Queries) CreateOAuthAccessToken added in v0.60.0

func (q *Queries) CreateOAuthAccessToken(ctx context.Context, arg CreateOAuthAccessTokenParams) (OauthAccessToken, error)

func (*Queries) CreateOAuthAuthorizationCode added in v0.60.0

func (q *Queries) CreateOAuthAuthorizationCode(ctx context.Context, arg CreateOAuthAuthorizationCodeParams) (OauthAuthorizationCode, error)

func (*Queries) CreateOAuthClient added in v0.60.0

func (q *Queries) CreateOAuthClient(ctx context.Context, arg CreateOAuthClientParams) (OauthClient, error)

func (*Queries) CreateOAuthRefreshFamily added in v0.60.0

func (q *Queries) CreateOAuthRefreshFamily(ctx context.Context, arg CreateOAuthRefreshFamilyParams) (OauthRefreshFamily, error)

Open a new revocation family for a grant. Every refresh token in the rotation chain and every access token minted under the grant reference this row.

func (*Queries) CreateOAuthRefreshToken added in v0.60.0

func (q *Queries) CreateOAuthRefreshToken(ctx context.Context, arg CreateOAuthRefreshTokenParams) (OauthRefreshToken, error)

func (*Queries) CreatePersonalAccessToken added in v0.60.0

func (q *Queries) CreatePersonalAccessToken(ctx context.Context, arg CreatePersonalAccessTokenParams) (PersonalAccessToken, error)

func (*Queries) CreateProject added in v0.34.0

func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error)

func (*Queries) CreateProvider

func (q *Queries) CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error)

func (*Queries) CreateSchedJobRun

func (q *Queries) CreateSchedJobRun(ctx context.Context, arg CreateSchedJobRunParams) (SchedJobRun, error)

func (*Queries) CreateSchedulerJob

func (q *Queries) CreateSchedulerJob(ctx context.Context, arg CreateSchedulerJobParams) (SchedJob, error)

func (*Queries) CreateShare added in v0.35.0

func (q *Queries) CreateShare(ctx context.Context, arg CreateShareParams) (Share, error)

func (*Queries) CreateSkill

func (q *Queries) CreateSkill(ctx context.Context, arg CreateSkillParams) (Skill, error)

func (*Queries) CreateSummary

func (q *Queries) CreateSummary(ctx context.Context, arg CreateSummaryParams) error

func (*Queries) CreateWebChannelIfNotExists added in v0.43.0

func (q *Queries) CreateWebChannelIfNotExists(ctx context.Context, arg CreateWebChannelIfNotExistsParams) error

func (*Queries) CreateWorkflow added in v0.60.0

func (q *Queries) CreateWorkflow(ctx context.Context, arg CreateWorkflowParams) (AgentWorkflow, error)

func (*Queries) DeleteAgent

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

func (*Queries) DeleteAllContextItems

func (q *Queries) DeleteAllContextItems(ctx context.Context, conversationID string) error

func (*Queries) DeleteArticle

func (q *Queries) DeleteArticle(ctx context.Context, arg DeleteArticleParams) error

func (*Queries) DeleteAuthOAuthProvider added in v0.27.0

func (q *Queries) DeleteAuthOAuthProvider(ctx context.Context, providerID string) error

func (*Queries) DeleteChannel

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

func (*Queries) DeleteChatAgent

func (q *Queries) DeleteChatAgent(ctx context.Context, arg DeleteChatAgentParams) error

func (*Queries) DeleteContextItemsInRange

func (q *Queries) DeleteContextItemsInRange(ctx context.Context, arg DeleteContextItemsInRangeParams) error

func (*Queries) DeleteDigestArticles added in v0.30.0

func (q *Queries) DeleteDigestArticles(ctx context.Context, arg DeleteDigestArticlesParams) error

func (*Queries) DeleteEmailSendDedup added in v0.60.0

func (q *Queries) DeleteEmailSendDedup(ctx context.Context, arg DeleteEmailSendDedupParams) error

func (*Queries) DeleteExpiredEmailSendDedup added in v0.60.0

func (q *Queries) DeleteExpiredEmailSendDedup(ctx context.Context) error

func (*Queries) DeleteFeed added in v0.43.0

func (q *Queries) DeleteFeed(ctx context.Context, arg DeleteFeedParams) error

func (*Queries) DeleteGroupMemory added in v0.42.0

func (q *Queries) DeleteGroupMemory(ctx context.Context, groupID string) error

func (*Queries) DeleteGroupState added in v0.43.0

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

func (*Queries) DeleteKnowledgeUsage added in v0.60.0

func (q *Queries) DeleteKnowledgeUsage(ctx context.Context, factID string) error

func (*Queries) DeleteMCPServerByScope added in v0.60.0

func (q *Queries) DeleteMCPServerByScope(ctx context.Context, arg DeleteMCPServerByScopeParams) error

func (*Queries) DeleteManifestPluginOverride added in v0.38.0

func (q *Queries) DeleteManifestPluginOverride(ctx context.Context, pluginID string) error

func (*Queries) DeleteOldEntries added in v0.43.0

func (q *Queries) DeleteOldEntries(ctx context.Context, feedID string) error

func (*Queries) DeletePlugin

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

func (*Queries) DeletePluginStateEntry

func (q *Queries) DeletePluginStateEntry(ctx context.Context, arg DeletePluginStateEntryParams) error

func (*Queries) DeleteProject added in v0.34.0

func (q *Queries) DeleteProject(ctx context.Context, arg DeleteProjectParams) error

func (*Queries) DeleteProvider

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

func (*Queries) DeleteReflectOwnedUserAgentSkill added in v0.60.0

func (q *Queries) DeleteReflectOwnedUserAgentSkill(ctx context.Context, arg DeleteReflectOwnedUserAgentSkillParams) (Skill, error)

func (*Queries) DeleteSchedulerJob

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

func (*Queries) DeleteSetting

func (q *Queries) DeleteSetting(ctx context.Context, key string) error

func (*Queries) DeleteShareByUser added in v0.35.0

func (q *Queries) DeleteShareByUser(ctx context.Context, arg DeleteShareByUserParams) (int64, error)

func (*Queries) DeleteSkill

func (q *Queries) DeleteSkill(ctx context.Context, arg DeleteSkillParams) error

func (*Queries) DeleteSkillFile

func (q *Queries) DeleteSkillFile(ctx context.Context, arg DeleteSkillFileParams) error

func (*Queries) DeleteSkillUsage added in v0.60.0

func (q *Queries) DeleteSkillUsage(ctx context.Context, skillID string) error

func (*Queries) DeleteSystemSkill added in v0.35.3

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

func (*Queries) DeleteToolOverride added in v0.60.0

func (q *Queries) DeleteToolOverride(ctx context.Context, arg DeleteToolOverrideParams) error

func (*Queries) DeleteUserAgentMemory

func (q *Queries) DeleteUserAgentMemory(ctx context.Context, arg DeleteUserAgentMemoryParams) error

func (*Queries) DeleteVaultEntryByScope added in v0.48.0

func (q *Queries) DeleteVaultEntryByScope(ctx context.Context, arg DeleteVaultEntryByScopeParams) error

func (*Queries) DeleteWorkflow added in v0.60.0

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

func (*Queries) DeprecateFact added in v0.60.0

func (q *Queries) DeprecateFact(ctx context.Context, arg DeprecateFactParams) (Fact, error)

func (*Queries) DisableOAuthClient added in v0.60.0

func (q *Queries) DisableOAuthClient(ctx context.Context, arg DisableOAuthClientParams) (int64, error)

func (*Queries) ExtendRunningGroupDispatchLease added in v0.43.0

func (q *Queries) ExtendRunningGroupDispatchLease(ctx context.Context, arg ExtendRunningGroupDispatchLeaseParams) (int64, error)

func (*Queries) ExtendRunningGroupOutboxLease added in v0.43.0

func (q *Queries) ExtendRunningGroupOutboxLease(ctx context.Context, arg ExtendRunningGroupOutboxLeaseParams) (int64, error)

func (*Queries) FinalizeAttempt added in v0.49.4

func (q *Queries) FinalizeAttempt(ctx context.Context, arg FinalizeAttemptParams) (int64, error)

func (*Queries) GetActiveAttempt added in v0.49.4

func (q *Queries) GetActiveAttempt(ctx context.Context, arg GetActiveAttemptParams) (AgentGoalAttempt, error)

func (*Queries) GetActiveAuthUserTokenByHash

func (q *Queries) GetActiveAuthUserTokenByHash(ctx context.Context, tokenHash string) (AuthUserToken, error)

func (*Queries) GetActiveAutoAuthUserTokenByUser

func (q *Queries) GetActiveAutoAuthUserTokenByUser(ctx context.Context, userID string) (AuthUserToken, error)

expires_at is intentionally not filtered here: TokenService rotates at autoTokenRotateAfter (60 days), which is always before autoTokenTTL (90 days), so an auto token is replaced before it can expire. The Go layer handles time-based rotation rather than relying on the DB expiry column.

func (*Queries) GetAgent

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

func (*Queries) GetArticle

func (q *Queries) GetArticle(ctx context.Context, arg GetArticleParams) (RecallyArticle, error)

func (*Queries) GetArticleByCanonicalURL

func (q *Queries) GetArticleByCanonicalURL(ctx context.Context, arg GetArticleByCanonicalURLParams) (RecallyArticle, error)

func (*Queries) GetArticleContent added in v0.60.0

func (q *Queries) GetArticleContent(ctx context.Context, articleID string) (string, error)

func (*Queries) GetArticlesSavedThisWeek

func (q *Queries) GetArticlesSavedThisWeek(ctx context.Context, userID string) ([]RecallyArticle, error)

func (*Queries) GetAttempt added in v0.49.4

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

func (*Queries) GetAuthOAuthProvider added in v0.27.0

func (q *Queries) GetAuthOAuthProvider(ctx context.Context, providerID string) (PluginOauthProvider, error)

func (*Queries) GetAuthUser

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

func (*Queries) GetAuthUserTokenByHash

func (q *Queries) GetAuthUserTokenByHash(ctx context.Context, tokenHash string) (AuthUserToken, error)

func (*Queries) GetChannel

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

func (*Queries) GetChatAgent

func (q *Queries) GetChatAgent(ctx context.Context, arg GetChatAgentParams) (ChannelAgent, error)

func (*Queries) GetContextItemCount

func (q *Queries) GetContextItemCount(ctx context.Context, conversationID string) (int64, error)

func (*Queries) GetContextItems

func (q *Queries) GetContextItems(ctx context.Context, conversationID string) ([]CtxItem, error)

func (*Queries) GetContextMessageItems

func (q *Queries) GetContextMessageItems(ctx context.Context, conversationID string) ([]GetContextMessageItemsRow, error)

func (*Queries) GetContextStats added in v0.46.0

func (q *Queries) GetContextStats(ctx context.Context, conversationID string) (GetContextStatsRow, error)

func (*Queries) GetContextTokenCount

func (q *Queries) GetContextTokenCount(ctx context.Context, conversationID string) (int64, error)

func (*Queries) GetConversation

func (q *Queries) GetConversation(ctx context.Context, arg GetConversationParams) (CtxConversation, error)

func (*Queries) GetConversationAgentBySessionID added in v0.46.0

func (q *Queries) GetConversationAgentBySessionID(ctx context.Context, arg GetConversationAgentBySessionIDParams) (pgtype.Text, error)

func (*Queries) GetConversationBySessionID

func (q *Queries) GetConversationBySessionID(ctx context.Context, arg GetConversationBySessionIDParams) (CtxConversation, error)

func (*Queries) GetConversationForSessionAccess added in v0.60.0

func (q *Queries) GetConversationForSessionAccess(ctx context.Context, sessionID string) (CtxConversation, error)

Private PEP lookup: it obtains durable owner/executor facts before the SessionManager receives the resulting tenant scope. No transport may call it.

func (*Queries) GetConversationTimeBounds added in v0.46.0

func (q *Queries) GetConversationTimeBounds(ctx context.Context, conversationID string) (GetConversationTimeBoundsRow, error)

func (*Queries) GetDigestByDate added in v0.30.0

func (q *Queries) GetDigestByDate(ctx context.Context, arg GetDigestByDateParams) (RecallyDigest, error)

func (*Queries) GetEdge added in v0.49.4

func (q *Queries) GetEdge(ctx context.Context, arg GetEdgeParams) (AgentGoalEdge, error)

func (*Queries) GetEmailSendDedup added in v0.60.0

func (q *Queries) GetEmailSendDedup(ctx context.Context, arg GetEmailSendDedupParams) (EmailSendDedup, error)

func (*Queries) GetFact added in v0.60.0

func (q *Queries) GetFact(ctx context.Context, arg GetFactParams) (Fact, error)

func (*Queries) GetFactForUpdate added in v0.60.0

func (q *Queries) GetFactForUpdate(ctx context.Context, arg GetFactForUpdateParams) (Fact, error)

func (*Queries) GetFeed added in v0.43.0

func (q *Queries) GetFeed(ctx context.Context, arg GetFeedParams) (RecallyFeed, error)

func (*Queries) GetFeedByURL added in v0.43.0

func (q *Queries) GetFeedByURL(ctx context.Context, arg GetFeedByURLParams) (RecallyFeed, error)

func (*Queries) GetFeedEntry added in v0.43.0

func (q *Queries) GetFeedEntry(ctx context.Context, arg GetFeedEntryParams) (RecallyFeedEntry, error)

func (*Queries) GetFreshTailMessageIDs

func (q *Queries) GetFreshTailMessageIDs(ctx context.Context, arg GetFreshTailMessageIDsParams) ([]pgtype.Text, error)

func (*Queries) GetGoal added in v0.49.4

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

func (*Queries) GetGoalByIdempotencyKey added in v0.60.0

func (q *Queries) GetGoalByIdempotencyKey(ctx context.Context, arg GetGoalByIdempotencyKeyParams) (AgentGoal, error)

func (*Queries) GetGoalHealthReport added in v0.60.0

func (q *Queries) GetGoalHealthReport(ctx context.Context, arg GetGoalHealthReportParams) (json.RawMessage, error)

func (*Queries) GetGroupDispatch added in v0.43.0

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

func (*Queries) GetGroupLastActive added in v0.46.0

func (q *Queries) GetGroupLastActive(ctx context.Context, id string) (time.Time, error)

func (*Queries) GetGroupMember added in v0.42.0

func (q *Queries) GetGroupMember(ctx context.Context, arg GetGroupMemberParams) (ChannelGroupMember, error)

func (*Queries) GetGroupMemory added in v0.42.0

func (q *Queries) GetGroupMemory(ctx context.Context, groupID string) (CtxGroupMemory, error)

func (*Queries) GetGroupMessage added in v0.43.0

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

func (*Queries) GetGroupMessageByIdempotencyKey added in v0.42.0

func (q *Queries) GetGroupMessageByIdempotencyKey(ctx context.Context, idempotencyKey pgtype.Text) (CtxGroupMessage, error)

func (*Queries) GetGroupMessageByPlatformID added in v0.42.0

func (q *Queries) GetGroupMessageByPlatformID(ctx context.Context, arg GetGroupMessageByPlatformIDParams) (CtxGroupMessage, error)

func (*Queries) GetGroupOutbox added in v0.43.0

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

func (*Queries) GetGroupOutboxByMessage added in v0.43.0

func (q *Queries) GetGroupOutboxByMessage(ctx context.Context, groupMessageID string) (CtxGroupOutbox, error)

func (*Queries) GetGroupStateByID added in v0.43.0

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

func (*Queries) GetGroupStateByIDForUpdate added in v0.60.0

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

func (*Queries) GetGroupStateByTriple added in v0.42.0

func (q *Queries) GetGroupStateByTriple(ctx context.Context, arg GetGroupStateByTripleParams) (CtxGroupState, error)

func (*Queries) GetIngestCursor added in v0.42.0

func (q *Queries) GetIngestCursor(ctx context.Context, arg GetIngestCursorParams) (CtxGroupIngestCursor, error)

func (*Queries) GetKnowledgeUsageForUpdate added in v0.60.0

func (q *Queries) GetKnowledgeUsageForUpdate(ctx context.Context, arg GetKnowledgeUsageForUpdateParams) (KnowledgeUsage, error)

func (*Queries) GetLatestCuratorDeprecateFactChangelog added in v0.60.0

func (q *Queries) GetLatestCuratorDeprecateFactChangelog(ctx context.Context, arg GetLatestCuratorDeprecateFactChangelogParams) (CtxAgentMemoryChangelog, error)

func (*Queries) GetLatestQualifyingKnowledgeDeprecateChangelog added in v0.60.0

func (q *Queries) GetLatestQualifyingKnowledgeDeprecateChangelog(ctx context.Context, arg GetLatestQualifyingKnowledgeDeprecateChangelogParams) (CtxAgentMemoryChangelog, error)

func (*Queries) GetLatestWorkflowRun added in v0.60.0

func (q *Queries) GetLatestWorkflowRun(ctx context.Context, workflowID string) (AgentWorkflowRun, error)

func (*Queries) GetLatestWorkflowVersion added in v0.60.0

func (q *Queries) GetLatestWorkflowVersion(ctx context.Context, arg GetLatestWorkflowVersionParams) (int32, error)

func (*Queries) GetMCPServerByID added in v0.60.0

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

func (*Queries) GetMainConversationByProject added in v0.34.0

func (q *Queries) GetMainConversationByProject(ctx context.Context, arg GetMainConversationByProjectParams) (CtxConversation, error)

func (*Queries) GetManifestPluginOverride added in v0.38.0

func (q *Queries) GetManifestPluginOverride(ctx context.Context, pluginID string) (PluginOverride, error)

func (*Queries) GetMaxAcceptanceSeq added in v0.49.4

func (q *Queries) GetMaxAcceptanceSeq(ctx context.Context, goalID string) (int64, error)

Highest seq for a goal; -1 when no rows so next seq = result+1 = 0.

func (*Queries) GetMaxAttemptNo added in v0.49.4

func (q *Queries) GetMaxAttemptNo(ctx context.Context, arg GetMaxAttemptNoParams) (int64, error)

Highest attempt_no for a goal within one purpose; 0 when none exist. The next attempt_no is this + 1 (decomposition cannot derive it from attempt_count, which only tracks execution attempts).

func (*Queries) GetMaxContextOrdinal

func (q *Queries) GetMaxContextOrdinal(ctx context.Context, conversationID string) (int64, error)

func (*Queries) GetMaxSeq

func (q *Queries) GetMaxSeq(ctx context.Context, conversationID string) (int64, error)

func (*Queries) GetMemoryChangelogAtVersion

func (q *Queries) GetMemoryChangelogAtVersion(ctx context.Context, arg GetMemoryChangelogAtVersionParams) (CtxAgentMemoryChangelog, error)

func (*Queries) GetMemorySnapshot

func (q *Queries) GetMemorySnapshot(ctx context.Context, arg GetMemorySnapshotParams) (CtxAgentMemorySnapshot, error)

func (*Queries) GetMessage

func (q *Queries) GetMessage(ctx context.Context, arg GetMessageParams) (CtxMessage, error)

func (*Queries) GetMessageCount

func (q *Queries) GetMessageCount(ctx context.Context, conversationID string) (int64, error)

func (*Queries) GetMessageParts

func (q *Queries) GetMessageParts(ctx context.Context, messageID string) ([]CtxMessagePart, error)

func (*Queries) GetMessagePartsByMessages

func (q *Queries) GetMessagePartsByMessages(ctx context.Context, messageIds []string) ([]CtxMessagePart, error)

func (*Queries) GetMessageScoped added in v0.49.0

func (q *Queries) GetMessageScoped(ctx context.Context, arg GetMessageScopedParams) (GetMessageScopedRow, error)

Fetch one message in full by ID, scoped to (user_id, agent_id) across every session: the read-in-full companion to cross-session SearchMessages. Joins ctx_conversation for the same isolation filter plus provenance. Keep this doc comment ASCII; multibyte chars corrupt sqlc's query rewriter offsets.

func (*Queries) GetMessagesByConversation

func (q *Queries) GetMessagesByConversation(ctx context.Context, conversationID string) ([]CtxMessage, error)

func (*Queries) GetMessagesByConversationRange

func (q *Queries) GetMessagesByConversationRange(ctx context.Context, arg GetMessagesByConversationRangeParams) ([]CtxMessage, error)

func (*Queries) GetMessagesSince

func (q *Queries) GetMessagesSince(ctx context.Context, arg GetMessagesSinceParams) ([]CtxMessage, error)

func (*Queries) GetOAuthAccessTokenByPublicID added in v0.60.0

func (q *Queries) GetOAuthAccessTokenByPublicID(ctx context.Context, publicID string) (GetOAuthAccessTokenByPublicIDRow, error)

Joins the family so resolution fails closed on a revoked family without a per-row revoked flag: an access token is valid only while its family lives.

func (*Queries) GetOAuthClientByClientID added in v0.60.0

func (q *Queries) GetOAuthClientByClientID(ctx context.Context, clientID string) (OauthClient, error)

func (*Queries) GetOAuthRefreshTokenByPublicID added in v0.60.0

func (q *Queries) GetOAuthRefreshTokenByPublicID(ctx context.Context, publicID string) (GetOAuthRefreshTokenByPublicIDRow, error)

Joins the family so the caller sees family-level revocation without a second round-trip: a token whose family is revoked is dead even if its own row looks active.

func (*Queries) GetPersonalAccessTokenByPublicID added in v0.60.0

func (q *Queries) GetPersonalAccessTokenByPublicID(ctx context.Context, publicID string) (PersonalAccessToken, error)

Lookup key is the indexed public_id. Revoked/expired filtering is done in the resolver so it can emit a precise error; the row is returned regardless of state here.

func (*Queries) GetPlugin

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

func (*Queries) GetPluginStateEntry

func (q *Queries) GetPluginStateEntry(ctx context.Context, arg GetPluginStateEntryParams) (json.RawMessage, error)

func (*Queries) GetProject added in v0.34.0

func (q *Queries) GetProject(ctx context.Context, arg GetProjectParams) (Project, error)

func (*Queries) GetProjectByName added in v0.34.0

func (q *Queries) GetProjectByName(ctx context.Context, arg GetProjectByNameParams) (Project, error)

func (*Queries) GetProvider

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

func (*Queries) GetRequiredChildRollupCounts added in v0.60.0

func (q *Queries) GetRequiredChildRollupCounts(ctx context.Context, parentID string) (GetRequiredChildRollupCountsRow, error)

func (*Queries) GetSchedJobRun

func (q *Queries) GetSchedJobRun(ctx context.Context, arg GetSchedJobRunParams) (SchedJobRun, error)

func (*Queries) GetSchedulerJob

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

func (*Queries) GetSchedulerJobByIdempotencyKey added in v0.60.0

func (q *Queries) GetSchedulerJobByIdempotencyKey(ctx context.Context, arg GetSchedulerJobByIdempotencyKeyParams) (SchedJob, error)

func (*Queries) GetSetting

func (q *Queries) GetSetting(ctx context.Context, key string) (AppSetting, error)

func (*Queries) GetShareByTokenHash added in v0.35.0

func (q *Queries) GetShareByTokenHash(ctx context.Context, tokenHash string) (Share, error)

func (*Queries) GetSkill

func (q *Queries) GetSkill(ctx context.Context, arg GetSkillParams) (Skill, error)

func (*Queries) GetSkillByID added in v0.48.0

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

func (*Queries) GetSkillFile

func (q *Queries) GetSkillFile(ctx context.Context, arg GetSkillFileParams) (SkillFile, error)

func (*Queries) GetSkillForUpdate added in v0.60.0

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

func (*Queries) GetSkillUsageForUpdate added in v0.60.0

func (q *Queries) GetSkillUsageForUpdate(ctx context.Context, arg GetSkillUsageForUpdateParams) (SkillUsage, error)

func (*Queries) GetSummariesByConversation

func (q *Queries) GetSummariesByConversation(ctx context.Context, conversationID string) ([]CtxSummary, error)

func (*Queries) GetSummariesByDepth

func (q *Queries) GetSummariesByDepth(ctx context.Context, arg GetSummariesByDepthParams) ([]CtxSummary, error)

func (*Queries) GetSummary

func (q *Queries) GetSummary(ctx context.Context, arg GetSummaryParams) (CtxSummary, error)

func (*Queries) GetSummaryByID added in v0.38.0

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

func (*Queries) GetSummaryChildren

func (q *Queries) GetSummaryChildren(ctx context.Context, parentSummaryID string) ([]CtxSummary, error)

func (*Queries) GetSummaryMessageSeqRange added in v0.46.0

func (q *Queries) GetSummaryMessageSeqRange(ctx context.Context, summaryID string) (GetSummaryMessageSeqRangeRow, error)

func (*Queries) GetSummaryMessages

func (q *Queries) GetSummaryMessages(ctx context.Context, summaryID string) ([]CtxMessage, error)

func (*Queries) GetSummaryParents

func (q *Queries) GetSummaryParents(ctx context.Context, summaryID string) ([]CtxSummary, error)

func (*Queries) GetSystemAgentSkillByName added in v0.48.0

func (q *Queries) GetSystemAgentSkillByName(ctx context.Context, arg GetSystemAgentSkillByNameParams) (Skill, error)

func (*Queries) GetSystemSkillByName

func (q *Queries) GetSystemSkillByName(ctx context.Context, name string) (Skill, error)

func (*Queries) GetUserAgentMemory

func (q *Queries) GetUserAgentMemory(ctx context.Context, arg GetUserAgentMemoryParams) (CtxAgentMemory, error)

func (*Queries) GetUserAgentSkillByName added in v0.60.0

func (q *Queries) GetUserAgentSkillByName(ctx context.Context, arg GetUserAgentSkillByNameParams) (Skill, error)

func (*Queries) GetUserSkillByName

func (q *Queries) GetUserSkillByName(ctx context.Context, arg GetUserSkillByNameParams) (Skill, error)

func (*Queries) GetVaultEntryByScope added in v0.48.0

func (q *Queries) GetVaultEntryByScope(ctx context.Context, arg GetVaultEntryByScopeParams) (VaultEntry, error)

func (*Queries) GetVaultUser added in v0.38.0

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

GetVaultUser returns the age key fields for a user. Satisfies vault.UserKeyReader.

func (*Queries) GetWorkflow added in v0.60.0

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

func (*Queries) GetWorkflowRunByKey added in v0.60.0

func (q *Queries) GetWorkflowRunByKey(ctx context.Context, arg GetWorkflowRunByKeyParams) (AgentWorkflowRun, error)

func (*Queries) HasEligiblePairActivityAfter added in v0.60.0

func (q *Queries) HasEligiblePairActivityAfter(ctx context.Context, arg HasEligiblePairActivityAfterParams) (bool, error)

func (*Queries) HeartbeatAttempt added in v0.49.4

func (q *Queries) HeartbeatAttempt(ctx context.Context, arg HeartbeatAttemptParams) (int64, error)

func (*Queries) IncrementGoalBudgetBonus added in v0.60.0

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

func (*Queries) IncrementGoalFlakyCount added in v0.60.0

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

func (*Queries) InsertArticleContentIfAbsent added in v0.60.0

func (q *Queries) InsertArticleContentIfAbsent(ctx context.Context, arg InsertArticleContentIfAbsentParams) error

func (*Queries) InsertFact added in v0.60.0

func (q *Queries) InsertFact(ctx context.Context, arg InsertFactParams) (Fact, error)

func (*Queries) InsertMemoryChangelog

func (q *Queries) InsertMemoryChangelog(ctx context.Context, arg InsertMemoryChangelogParams) error

func (*Queries) InsertSkillChangelog added in v0.60.0

func (q *Queries) InsertSkillChangelog(ctx context.Context, arg InsertSkillChangelogParams) (SkillChangelog, error)

func (*Queries) IsIngestError added in v0.42.0

func (q *Queries) IsIngestError(ctx context.Context, arg IsIngestErrorParams) (bool, error)

func (*Queries) LinkSummaryToMessage

func (q *Queries) LinkSummaryToMessage(ctx context.Context, arg LinkSummaryToMessageParams) error

func (*Queries) LinkSummaryToParent

func (q *Queries) LinkSummaryToParent(ctx context.Context, arg LinkSummaryToParentParams) error

func (*Queries) ListAcceptanceEventByGoal added in v0.49.4

func (q *Queries) ListAcceptanceEventByGoal(ctx context.Context, goalID string) ([]AgentGoalAcceptanceEvent, error)

The projection fold: replay every event for a goal in seq order.

func (*Queries) ListAccessibleAgents added in v0.38.0

func (q *Queries) ListAccessibleAgents(ctx context.Context, userID string) ([]Agent, error)

func (*Queries) ListActiveFactsBySubject added in v0.60.0

func (q *Queries) ListActiveFactsBySubject(ctx context.Context, arg ListActiveFactsBySubjectParams) ([]Fact, error)

func (*Queries) ListActiveKnowledge added in v0.60.0

func (q *Queries) ListActiveKnowledge(ctx context.Context, arg ListActiveKnowledgeParams) ([]Fact, error)

func (*Queries) ListActiveKnowledgeContents added in v0.60.0

func (q *Queries) ListActiveKnowledgeContents(ctx context.Context, arg ListActiveKnowledgeContentsParams) ([]string, error)

func (*Queries) ListActiveReflectOwnedUserAgentSkills added in v0.60.0

func (q *Queries) ListActiveReflectOwnedUserAgentSkills(ctx context.Context, arg ListActiveReflectOwnedUserAgentSkillsParams) ([]Skill, error)

func (*Queries) ListAgentConversationLastActive added in v0.46.0

func (q *Queries) ListAgentConversationLastActive(ctx context.Context, userID pgtype.Text) ([]ListAgentConversationLastActiveRow, error)

func (*Queries) ListAgentUsers

func (q *Queries) ListAgentUsers(ctx context.Context, agentID string) ([]string, error)

func (*Queries) ListAgents

func (q *Queries) ListAgents(ctx context.Context) ([]Agent, error)

func (*Queries) ListAllSchedulerJobs added in v0.38.0

func (q *Queries) ListAllSchedulerJobs(ctx context.Context) ([]SchedJob, error)

func (*Queries) ListAllSkills

func (q *Queries) ListAllSkills(ctx context.Context) ([]Skill, error)

func (*Queries) ListArticles

func (q *Queries) ListArticles(ctx context.Context, arg ListArticlesParams) ([]RecallyArticle, error)

func (*Queries) ListArticlesMissingContent added in v0.60.0

func (q *Queries) ListArticlesMissingContent(ctx context.Context) ([]ListArticlesMissingContentRow, error)

Legacy articles whose body still lives only in a disk file (file_path set) and was never copied into recally_article_content. Startup eager-backfills these so bodies survive on hosts where the pod-local disk is gone. Keep ASCII.

func (*Queries) ListArticlesNeedingEmbedding added in v0.50.3

func (q *Queries) ListArticlesNeedingEmbedding(ctx context.Context, arg ListArticlesNeedingEmbeddingParams) ([]ListArticlesNeedingEmbeddingRow, error)

Backfill candidates for articles. Unlike messages, articles are mutable, so a row whose embedding predates the article's last update (e.updated_at < a.updated_at) is a candidate too; the writer then compares content_hash to skip non-content edits (e.g. marking read). content is title + summary, the fields worth embedding. Keep ASCII.

func (*Queries) ListArticlesSavedYesterday

func (q *Queries) ListArticlesSavedYesterday(ctx context.Context, userID string) ([]RecallyArticle, error)

func (*Queries) ListAttemptByGoal added in v0.49.4

func (q *Queries) ListAttemptByGoal(ctx context.Context, arg ListAttemptByGoalParams) ([]AgentGoalAttempt, error)

func (*Queries) ListAuthUsersByIDs added in v0.41.0

func (q *Queries) ListAuthUsersByIDs(ctx context.Context, ids []string) ([]AuthUser, error)

func (*Queries) ListChannels

func (q *Queries) ListChannels(ctx context.Context) ([]Channel, error)

func (*Queries) ListChannelsByType

func (q *Queries) ListChannelsByType(ctx context.Context, type_ string) ([]Channel, error)

func (*Queries) ListChatAgents

func (q *Queries) ListChatAgents(ctx context.Context) ([]ChannelAgent, error)

func (*Queries) ListContextItemsPage added in v0.46.0

func (q *Queries) ListContextItemsPage(ctx context.Context, arg ListContextItemsPageParams) ([]ListContextItemsPageRow, error)

func (*Queries) ListConversations

func (q *Queries) ListConversations(ctx context.Context, arg ListConversationsParams) ([]CtxConversation, error)

func (*Queries) ListConversationsAll

func (q *Queries) ListConversationsAll(ctx context.Context, arg ListConversationsAllParams) ([]CtxConversation, error)

func (*Queries) ListConversationsByKind added in v0.34.0

func (q *Queries) ListConversationsByKind(ctx context.Context, arg ListConversationsByKindParams) ([]CtxConversation, error)

func (*Queries) ListConversationsFiltered added in v0.46.0

func (q *Queries) ListConversationsFiltered(ctx context.Context, arg ListConversationsFilteredParams) ([]CtxConversation, error)

func (*Queries) ListConversationsForReviewByAgent added in v0.40.0

func (q *Queries) ListConversationsForReviewByAgent(ctx context.Context, agentID pgtype.Text) ([]CtxConversation, error)

Ownerless legacy rows (NULL/empty user_id) are excluded: review is user-scoped and such rows were never review candidates.

func (*Queries) ListConversationsForReviewFiltered added in v0.46.0

Ownerless legacy rows (NULL/empty user_id) are excluded: review is user-scoped and such rows were never review candidates.

func (*Queries) ListDecomposableComposites added in v0.50.0

func (q *Queries) ListDecomposableComposites(ctx context.Context, limit int32) ([]AgentGoal, error)

Composites awaiting autonomous decomposition: freshly created (draft), not planned yet, and not workflow roots. A workflow root carries workflow_id and is materialized only by workflow replay; nested workflow composites do not carry workflow_id and remain planner-eligible when their sub-plan is not frozen.

func (*Queries) ListDigestArticles added in v0.30.0

func (q *Queries) ListDigestArticles(ctx context.Context, arg ListDigestArticlesParams) ([]RecallyArticle, error)

func (*Queries) ListDigests added in v0.30.0

func (q *Queries) ListDigests(ctx context.Context, arg ListDigestsParams) ([]RecallyDigest, error)

func (*Queries) ListDispatchableLeaves added in v0.49.4

func (q *Queries) ListDispatchableLeaves(ctx context.Context, limit int32) ([]AgentGoal, error)

func (*Queries) ListEdgeByGoal added in v0.49.4

func (q *Queries) ListEdgeByGoal(ctx context.Context, goalID string) ([]AgentGoalEdge, error)

func (*Queries) ListEdgeWithUpstreamState added in v0.49.4

func (q *Queries) ListEdgeWithUpstreamState(ctx context.Context, goalID string) ([]ListEdgeWithUpstreamStateRow, error)

func (*Queries) ListEnabledAgents

func (q *Queries) ListEnabledAgents(ctx context.Context) ([]Agent, error)

func (*Queries) ListEnabledPlugins

func (q *Queries) ListEnabledPlugins(ctx context.Context) ([]Plugin, error)

func (*Queries) ListEnabledProviders

func (q *Queries) ListEnabledProviders(ctx context.Context) ([]Provider, error)

func (*Queries) ListExistingUserMessageContent added in v0.47.0

func (q *Queries) ListExistingUserMessageContent(ctx context.Context, arg ListExistingUserMessageContentParams) ([]string, error)

func (*Queries) ListExpiredRunningGroupDispatch added in v0.43.0

func (q *Queries) ListExpiredRunningGroupDispatch(ctx context.Context, arg ListExpiredRunningGroupDispatchParams) ([]CtxGroupDispatch, error)

func (*Queries) ListExpiredRunningGroupOutbox added in v0.43.0

func (q *Queries) ListExpiredRunningGroupOutbox(ctx context.Context, arg ListExpiredRunningGroupOutboxParams) ([]CtxGroupOutbox, error)

func (*Queries) ListFactChangelogBySubject added in v0.60.0

func (q *Queries) ListFactChangelogBySubject(ctx context.Context, arg ListFactChangelogBySubjectParams) ([]CtxAgentMemoryChangelog, error)

func (*Queries) ListFactChangelogBySubjectPage added in v0.60.0

func (*Queries) ListFactChangelogUpToVersion added in v0.60.0

func (q *Queries) ListFactChangelogUpToVersion(ctx context.Context, arg ListFactChangelogUpToVersionParams) ([]CtxAgentMemoryChangelog, error)

func (*Queries) ListFailedInboxSchedulerRuns added in v0.46.0

func (q *Queries) ListFailedInboxSchedulerRuns(ctx context.Context, arg ListFailedInboxSchedulerRunsParams) ([]ListFailedInboxSchedulerRunsRow, error)

func (*Queries) ListFeedEntries added in v0.43.0

func (q *Queries) ListFeedEntries(ctx context.Context, arg ListFeedEntriesParams) ([]RecallyFeedEntry, error)

func (*Queries) ListFeeds added in v0.43.0

func (q *Queries) ListFeeds(ctx context.Context, arg ListFeedsParams) ([]RecallyFeed, error)

func (*Queries) ListGoalByRoot added in v0.49.4

func (q *Queries) ListGoalByRoot(ctx context.Context, rootID string) ([]AgentGoal, error)

func (*Queries) ListGoalChildren added in v0.49.4

func (q *Queries) ListGoalChildren(ctx context.Context, parentID pgtype.Text) ([]AgentGoal, error)

func (*Queries) ListGoalEventByGoal added in v0.60.0

func (q *Queries) ListGoalEventByGoal(ctx context.Context, arg ListGoalEventByGoalParams) ([]AgentGoalEvent, error)

func (*Queries) ListGoalForHealthScope added in v0.60.0

func (q *Queries) ListGoalForHealthScope(ctx context.Context, arg ListGoalForHealthScopeParams) ([]AgentGoal, error)

ListGoalForHealthScope returns every goal (roots AND children) in the health report's window and user/agent scope so the Access PEP can authorize each row before aggregating; it mirrors the scoped_goal CTE of GetGoalHealthReport.

func (*Queries) ListGoalSubtree added in v0.49.4

func (q *Queries) ListGoalSubtree(ctx context.Context, id string) ([]AgentGoal, error)

func (*Queries) ListGoalsBlockedNeedsVerdict added in v0.60.0

func (q *Queries) ListGoalsBlockedNeedsVerdict(ctx context.Context, limit int32) ([]AgentGoal, error)

Goals parked blocked(needs_verdict): a required judgment item has no valid verdict. The dispatcher (scanAndReview) drives an agent reviewer for any with a pending authority=agent item (contract section 10.13); the rest await a human. Both leaf and composite goals can carry an authored judgment contract.

func (*Queries) ListGoalsByWorkflow added in v0.60.0

func (q *Queries) ListGoalsByWorkflow(ctx context.Context, arg ListGoalsByWorkflowParams) ([]AgentGoal, error)

func (*Queries) ListGroupMembers added in v0.42.0

func (q *Queries) ListGroupMembers(ctx context.Context, groupID string) ([]ChannelGroupMember, error)

func (*Queries) ListGroupMessagesAfterSeq added in v0.42.0

func (q *Queries) ListGroupMessagesAfterSeq(ctx context.Context, arg ListGroupMessagesAfterSeqParams) ([]CtxGroupMessage, error)

func (*Queries) ListGroupMessagesBetweenSeqs added in v0.42.0

func (q *Queries) ListGroupMessagesBetweenSeqs(ctx context.Context, arg ListGroupMessagesBetweenSeqsParams) ([]CtxGroupMessage, error)

func (*Queries) ListGroupMessagesPaginated added in v0.43.0

func (q *Queries) ListGroupMessagesPaginated(ctx context.Context, arg ListGroupMessagesPaginatedParams) ([]CtxGroupMessage, error)

func (*Queries) ListGroupsByAgent added in v0.42.0

func (q *Queries) ListGroupsByAgent(ctx context.Context, agentID string) ([]ChannelGroupMember, error)

func (*Queries) ListGroupsByReplyChannel added in v0.42.0

func (q *Queries) ListGroupsByReplyChannel(ctx context.Context, replyChannelID string) ([]ChannelGroupMember, error)

func (*Queries) ListGroupsByUser added in v0.43.0

func (q *Queries) ListGroupsByUser(ctx context.Context, arg ListGroupsByUserParams) ([]ListGroupsByUserRow, error)

func (*Queries) ListGroupsWithPendingIngest added in v0.42.0

func (q *Queries) ListGroupsWithPendingIngest(ctx context.Context, pipeline string) ([]ListGroupsWithPendingIngestRow, error)

func (*Queries) ListInboxGoals added in v0.49.4

func (q *Queries) ListInboxGoals(ctx context.Context, arg ListInboxGoalsParams) ([]ListInboxGoalsRow, error)

func (*Queries) ListInflightAttemptsByGoal added in v0.60.0

func (q *Queries) ListInflightAttemptsByGoal(ctx context.Context, goalID string) ([]AgentGoalAttempt, error)

Every queued/running attempt for a goal regardless of purpose. Cancel uses this to finalize ALL in-flight work: only execution attempts are pointed by active_attempt_id, so decomposition/review attempts would otherwise outlive the cancel and later be reaped against a terminal goal.

func (*Queries) ListMCPServersByScope added in v0.60.0

func (q *Queries) ListMCPServersByScope(ctx context.Context, arg ListMCPServersByScopeParams) ([]McpServer, error)

ListMCPServersByScope returns every registration in exactly one scope/owner bucket, for management (list/delete) operations.

func (*Queries) ListMCPServersForAgentContext added in v0.60.0

func (q *Queries) ListMCPServersForAgentContext(ctx context.Context, arg ListMCPServersForAgentContextParams) ([]McpServer, error)

ListMCPServersForAgentContext returns the visible, enabled registrations for one (user, agent), ordered most-specific-first so a name-dedup downstream keeps the effective server: user_agent > user > system_agent > system.

func (*Queries) ListManifestPluginOverrides added in v0.38.0

func (q *Queries) ListManifestPluginOverrides(ctx context.Context) ([]PluginOverride, error)

func (*Queries) ListMemoryChangelog

func (q *Queries) ListMemoryChangelog(ctx context.Context, arg ListMemoryChangelogParams) ([]CtxAgentMemoryChangelog, error)

func (*Queries) ListMemoryChangelogPage added in v0.60.0

func (q *Queries) ListMemoryChangelogPage(ctx context.Context, arg ListMemoryChangelogPageParams) ([]CtxAgentMemoryChangelog, error)

func (*Queries) ListMessagesByIDs added in v0.41.0

func (q *Queries) ListMessagesByIDs(ctx context.Context, arg ListMessagesByIDsParams) ([]CtxMessage, error)

func (*Queries) ListMessagesByLogicalPage added in v0.41.0

func (q *Queries) ListMessagesByLogicalPage(ctx context.Context, arg ListMessagesByLogicalPageParams) ([]ListMessagesByLogicalPageRow, error)

Keep this logical-message boundary in sync with serializeDBMessages in internal/server/sessions.go: consecutive assistant rows render as one response message, so SQL pagination must count them as one too.

func (*Queries) ListMessagesNeedingEmbedding added in v0.50.3

func (q *Queries) ListMessagesNeedingEmbedding(ctx context.Context, arg ListMessagesNeedingEmbeddingParams) ([]ListMessagesNeedingEmbeddingRow, error)

Backfill candidates: messages with no embedding, or one produced by a different model (a model switch invalidates the old vector space). Messages are immutable, so a row whose model already matches is never stale and is not returned. embedded_model/embedded_hash carry existing provenance so the writer can skip rows already current. Keep ASCII.

func (*Queries) ListOAuthAuthorizedApps added in v0.60.0

func (q *Queries) ListOAuthAuthorizedApps(ctx context.Context, userID string) ([]ListOAuthAuthorizedAppsRow, error)

One row per client the user has an active grant for: the current (unconsumed, unexpired) refresh token of each non-revoked family. The user-facing "authorized apps" list.

func (*Queries) ListOAuthClientByOwner added in v0.60.0

func (q *Queries) ListOAuthClientByOwner(ctx context.Context, ownerUserID string) ([]OauthClient, error)

func (*Queries) ListPendingEntries added in v0.43.0

func (q *Queries) ListPendingEntries(ctx context.Context, arg ListPendingEntriesParams) ([]RecallyFeedEntry, error)

func (*Queries) ListPendingGroupDispatch added in v0.43.0

func (q *Queries) ListPendingGroupDispatch(ctx context.Context, arg ListPendingGroupDispatchParams) ([]CtxGroupDispatch, error)

func (*Queries) ListPendingGroupDispatchByMessage added in v0.43.0

func (q *Queries) ListPendingGroupDispatchByMessage(ctx context.Context, arg ListPendingGroupDispatchByMessageParams) ([]CtxGroupDispatch, error)

func (*Queries) ListPendingGroupOutbox added in v0.43.0

func (q *Queries) ListPendingGroupOutbox(ctx context.Context, arg ListPendingGroupOutboxParams) ([]CtxGroupOutbox, error)

func (*Queries) ListPersonalAccessTokenByUser added in v0.60.0

func (q *Queries) ListPersonalAccessTokenByUser(ctx context.Context, userID string) ([]PersonalAccessToken, error)

func (*Queries) ListPluginOverrides added in v0.38.0

func (q *Queries) ListPluginOverrides(ctx context.Context) ([]Plugin, error)

func (*Queries) ListPlugins

func (q *Queries) ListPlugins(ctx context.Context) ([]Plugin, error)

func (*Queries) ListPluginsByKind

func (q *Queries) ListPluginsByKind(ctx context.Context, kind string) ([]Plugin, error)

func (*Queries) ListProjects added in v0.34.0

func (q *Queries) ListProjects(ctx context.Context, arg ListProjectsParams) ([]Project, error)

func (*Queries) ListProjectsAll added in v0.34.0

func (q *Queries) ListProjectsAll(ctx context.Context, arg ListProjectsAllParams) ([]Project, error)

func (*Queries) ListProviderModelsCache added in v0.60.0

func (q *Queries) ListProviderModelsCache(ctx context.Context) ([]ProviderModelsCache, error)

func (*Queries) ListProviders

func (q *Queries) ListProviders(ctx context.Context) ([]Provider, error)

func (*Queries) ListRecentGoalEventContext added in v0.60.0

func (q *Queries) ListRecentGoalEventContext(ctx context.Context, arg ListRecentGoalEventContextParams) ([]AgentGoalEvent, error)

Recent context events that matter to a new attempt prompt.

func (*Queries) ListRecentGroupMessages added in v0.42.0

func (q *Queries) ListRecentGroupMessages(ctx context.Context, arg ListRecentGroupMessagesParams) ([]CtxGroupMessage, error)

func (*Queries) ListRecentGroupMessagesBeforeSeq added in v0.43.0

func (q *Queries) ListRecentGroupMessagesBeforeSeq(ctx context.Context, arg ListRecentGroupMessagesBeforeSeqParams) ([]CtxGroupMessage, error)

func (*Queries) ListRecentlyForgottenReflectKnowledge added in v0.60.0

func (*Queries) ListReflectUsagePairs added in v0.60.0

func (q *Queries) ListReflectUsagePairs(ctx context.Context) ([]ListReflectUsagePairsRow, error)

func (*Queries) ListRemovedKnowledge added in v0.60.0

func (q *Queries) ListRemovedKnowledge(ctx context.Context, arg ListRemovedKnowledgeParams) ([]ListRemovedKnowledgeRow, error)

func (*Queries) ListRollupCandidates added in v0.49.4

func (q *Queries) ListRollupCandidates(ctx context.Context, limit int32) ([]AgentGoal, error)

func (*Queries) ListRootGoal added in v0.49.4

func (q *Queries) ListRootGoal(ctx context.Context, arg ListRootGoalParams) ([]AgentGoal, error)

Root goals (goals: parent_id IS NULL) for a user, scoped to an agent and narrowed by lifecycle / terminal-ness / project / workflow / free-text. Every narg is optional: NULL matches all. terminal: false = active (non-terminal) only, true = history (done) only, NULL = both.

func (*Queries) ListSchedJobRuns

func (q *Queries) ListSchedJobRuns(ctx context.Context, arg ListSchedJobRunsParams) ([]SchedJobRun, error)

func (*Queries) ListSchedulerJobByOwner added in v0.60.0

func (q *Queries) ListSchedulerJobByOwner(ctx context.Context, arg ListSchedulerJobByOwnerParams) ([]SchedJob, error)

func (*Queries) ListSchedulerJobs

func (q *Queries) ListSchedulerJobs(ctx context.Context) ([]SchedJob, error)

func (*Queries) ListSchedulerJobsByAgent added in v0.36.0

func (q *Queries) ListSchedulerJobsByAgent(ctx context.Context, arg ListSchedulerJobsByAgentParams) ([]SchedJob, error)

func (*Queries) ListSettings

func (q *Queries) ListSettings(ctx context.Context) ([]AppSetting, error)

func (*Queries) ListSharesByUser added in v0.35.0

func (q *Queries) ListSharesByUser(ctx context.Context, arg ListSharesByUserParams) ([]ListSharesByUserRow, error)

func (*Queries) ListSkillChangelogBySkill added in v0.60.0

func (q *Queries) ListSkillChangelogBySkill(ctx context.Context, arg ListSkillChangelogBySkillParams) ([]SkillChangelog, error)

func (*Queries) ListSkillFiles

func (q *Queries) ListSkillFiles(ctx context.Context, skillID string) ([]SkillFile, error)

func (*Queries) ListSkillsByScope added in v0.48.0

func (q *Queries) ListSkillsByScope(ctx context.Context, arg ListSkillsByScopeParams) ([]Skill, error)

func (*Queries) ListSkillsForAdmin added in v0.36.0

func (q *Queries) ListSkillsForAdmin(ctx context.Context, userID pgtype.Text) ([]Skill, error)

func (*Queries) ListSkillsForAgentContext added in v0.36.0

func (q *Queries) ListSkillsForAgentContext(ctx context.Context, arg ListSkillsForAgentContextParams) ([]Skill, error)

ListSkillsForAgentContext returns the visible skills for one (user, agent), ordered most-specific-first so a name-dedup downstream keeps the effective skill: user_agent > user > system_agent > system.

func (*Queries) ListSkillsForUser added in v0.36.0

func (q *Queries) ListSkillsForUser(ctx context.Context, arg ListSkillsForUserParams) ([]Skill, error)

func (*Queries) ListSkillsVisible

func (q *Queries) ListSkillsVisible(ctx context.Context, arg ListSkillsVisibleParams) ([]Skill, error)

ListSkillsVisible returns the effective skill set for a (user, agent) context, ordered most-specific-first so a name-dedup keeps the highest-precedence skill: user_agent > user > system_agent > system.

func (*Queries) ListStaleAttempts added in v0.49.4

func (q *Queries) ListStaleAttempts(ctx context.Context, arg ListStaleAttemptsParams) ([]AgentGoalAttempt, error)

Lease-expired attempts whose lease is a liveness signal. An attempt heartbeated by a River worker (every execution attempt, and an autonomous decomposition attempt) carries a forward-moving lease, so an expired lease means a genuine orphan. Interactive decomposition attempts (planned in a session, never enqueued/heartbeated) carry a NULL lease and are skipped by the IS NOT NULL guard, so the reaper never bounces an active composite back to draft mid-planning.

func (*Queries) ListStaleReflectKnowledgeForCurator added in v0.60.0

The activity gate intentionally means "at least one non-archived conversation had activity after this item was last used"; it does not assert recent activity relative to the curator run time.

func (*Queries) ListStaleReflectSkillsForCurator added in v0.60.0

The same activity gate applies here: at least one non-archived conversation had activity after the skill was last used.

func (*Queries) ListSummariesByIDs added in v0.41.0

func (q *Queries) ListSummariesByIDs(ctx context.Context, arg ListSummariesByIDsParams) ([]CtxSummary, error)

func (*Queries) ListSummariesNeedingEmbedding added in v0.50.3

func (q *Queries) ListSummariesNeedingEmbedding(ctx context.Context, arg ListSummariesNeedingEmbeddingParams) ([]ListSummariesNeedingEmbeddingRow, error)

Backfill candidates for summaries; see ListMessagesNeedingEmbedding. Summary content is immutable, so missing or model-mismatch are the only cases. ASCII.

func (*Queries) ListSummaryParentsBySummaryIDs added in v0.46.0

func (q *Queries) ListSummaryParentsBySummaryIDs(ctx context.Context, summaryIds []string) ([]CtxSummaryParent, error)

func (*Queries) ListToolOverridesForAgentContext added in v0.60.0

func (q *Queries) ListToolOverridesForAgentContext(ctx context.Context, arg ListToolOverridesForAgentContextParams) ([]ToolOverride, error)

ListToolOverridesForAgentContext returns rows visible to one user and agent.

func (*Queries) ListUnreadArticlesOlderThan

func (q *Queries) ListUnreadArticlesOlderThan(ctx context.Context, arg ListUnreadArticlesOlderThanParams) ([]RecallyArticle, error)

func (*Queries) ListUserAgentMemoriesByUser

func (q *Queries) ListUserAgentMemoriesByUser(ctx context.Context, userID string) ([]CtxAgentMemory, error)

func (*Queries) ListUserAgents

func (q *Queries) ListUserAgents(ctx context.Context, userID string) ([]string, error)

func (*Queries) ListVaultEntriesByScope added in v0.48.0

func (q *Queries) ListVaultEntriesByScope(ctx context.Context, arg ListVaultEntriesByScopeParams) ([]VaultEntry, error)

func (*Queries) ListVaultEntriesForRuntime added in v0.48.0

func (q *Queries) ListVaultEntriesForRuntime(ctx context.Context, arg ListVaultEntriesForRuntimeParams) ([]VaultEntry, error)

Keep this precedence in sync with vault.Service.LoadEnvForAgent's merge loop.

func (*Queries) ListWorkflowRuns added in v0.60.0

func (q *Queries) ListWorkflowRuns(ctx context.Context, arg ListWorkflowRunsParams) ([]ListWorkflowRunsRow, error)

ListWorkflowRuns joins the root goal so the API can report the run's outcome (goal lifecycle) alongside the instantiation status. LEFT JOIN: a claimed run has no root goal yet.

func (*Queries) ListWorkflowVersions added in v0.60.0

func (q *Queries) ListWorkflowVersions(ctx context.Context, arg ListWorkflowVersionsParams) ([]AgentWorkflow, error)

func (*Queries) ListWorkflows added in v0.60.0

func (q *Queries) ListWorkflows(ctx context.Context, arg ListWorkflowsParams) ([]AgentWorkflow, error)

func (*Queries) ListZombieGoals added in v0.60.0

func (q *Queries) ListZombieGoals(ctx context.Context, limit int32) ([]AgentGoal, error)

Liveness backstop: non-terminal goals parked in a state nothing drives. Two classes:

  1. A pending composite: the dispatcher claims pending LEAVES and decomposes DRAFT composites, so nothing ever picks a composite out of pending. The transition table rejects writing this state; the scan catches legacy rows and out-of-band writes.
  2. An active goal with no active attempt pointer and no queued/running attempt, where activity cannot come from anywhere else: a leaf is only active while claimed, and an UNPLANNED active composite is only active while its decomposition attempt runs. A planned active composite is excluded -- the rollup drives it off its children.

The updated_at grace keeps a row mid-transition in another tx from reading as a zombie.

func (*Queries) LockConversationForWrite added in v0.50.0

func (q *Queries) LockConversationForWrite(ctx context.Context, conversationID string) error

Transaction-scoped advisory lock serializing per-conversation context writes: the message seq + context-item ordinal allocation in Append, and the compaction writeback that rewrites context items. Those are GetMax->++->insert under Read Committed, which PostgreSQL runs in parallel across writers (and nodes); the in-process striped mutex only serializes within one process. Held until the enclosing tx ends. The 'ctxconv:' prefix keeps unrelated entities out of this conversation's slot in the shared 64-bit lock space.

func (*Queries) LockGoalForWrite added in v0.50.0

func (q *Queries) LockGoalForWrite(ctx context.Context, goalID string) error

Transaction-scoped advisory lock serializing read-modify-write sequence allocation for one goal. The acceptance ledger seq and attempt_no are each GetMax->+1->insert under Read Committed, which PostgreSQL runs in parallel across writers (and nodes): without this, two writers read the same max and compute the same next value, silently duplicating the acceptance seq (no unique backstop) or colliding on the attempt_no unique index. Held until the enclosing tx ends. The 'goal:' prefix keeps unrelated entities out of this goal's slot in the shared 64-bit lock space (matching AdvisoryXactLock / LockSchedJobForRun).

func (*Queries) LockSchedJobForRun added in v0.50.0

func (q *Queries) LockSchedJobForRun(ctx context.Context, jobID string) error

Transaction-scoped advisory lock keyed on a hash of the job ID. Held until the enclosing transaction ends, it serializes concurrent tryStartJobRun calls for the same job so the running-run check and insert below are atomic under Read Committed without a schema-level unique constraint. hashtextextended maps the text id straight to the 64-bit key pg_advisory_xact_lock expects (matching AdvisoryXactLock); a hash collision only serializes two unrelated jobs occasionally, which is harmless.

func (*Queries) MarkGoalPlanned added in v0.50.0

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

The materialize fence (CAS): stamp planned_at exactly once. A second concurrent materialize gets 0 rows and must treat it as an idempotent no-op, so children are never double-created. Replaces the old materialized revision unique index.

func (*Queries) MarkGroupDispatchCompleted added in v0.43.0

func (q *Queries) MarkGroupDispatchCompleted(ctx context.Context, arg MarkGroupDispatchCompletedParams) (int64, error)

func (*Queries) MarkGroupDispatchFailed added in v0.43.0

func (q *Queries) MarkGroupDispatchFailed(ctx context.Context, arg MarkGroupDispatchFailedParams) (int64, error)

func (*Queries) MarkGroupOutboxCompleted added in v0.43.0

func (q *Queries) MarkGroupOutboxCompleted(ctx context.Context, arg MarkGroupOutboxCompletedParams) (int64, error)

func (*Queries) MarkGroupOutboxFailed added in v0.43.0

func (q *Queries) MarkGroupOutboxFailed(ctx context.Context, arg MarkGroupOutboxFailedParams) (int64, error)

func (*Queries) ProbeCheckCache added in v0.49.4

func (q *Queries) ProbeCheckCache(ctx context.Context, cacheKey string) (AgentGoalAcceptanceEvent, error)

Check-result cache hit: the latest passing deterministic result for a cache_key. Returns pgx.ErrNoRows on a forced miss (no cached pass).

func (*Queries) PromoteAttempt added in v0.49.4

func (q *Queries) PromoteAttempt(ctx context.Context, arg PromoteAttemptParams) (int64, error)

func (*Queries) RecordSchedulerJobRun

func (q *Queries) RecordSchedulerJobRun(ctx context.Context, arg RecordSchedulerJobRunParams) error

func (*Queries) RefreshSkillUsageOnReflectPatch added in v0.60.0

func (q *Queries) RefreshSkillUsageOnReflectPatch(ctx context.Context, arg RefreshSkillUsageOnReflectPatchParams) error

func (*Queries) RemoveGroupMember added in v0.42.0

func (q *Queries) RemoveGroupMember(ctx context.Context, arg RemoveGroupMemberParams) error

func (*Queries) RemoveUserAgent

func (q *Queries) RemoveUserAgent(ctx context.Context, arg RemoveUserAgentParams) error

func (*Queries) RequeueGroupDispatch added in v0.43.0

func (q *Queries) RequeueGroupDispatch(ctx context.Context, arg RequeueGroupDispatchParams) (int64, error)

func (*Queries) RequeueGroupOutbox added in v0.43.0

func (q *Queries) RequeueGroupOutbox(ctx context.Context, arg RequeueGroupOutboxParams) (int64, error)

func (*Queries) ResolveSkill

func (q *Queries) ResolveSkill(ctx context.Context, arg ResolveSkillParams) (Skill, error)

ResolveSkill returns the single effective skill for a name in a (user, agent) context. Precedence: user_agent > user > system_agent > system.

func (*Queries) RestoreKnowledgeFact added in v0.60.0

func (q *Queries) RestoreKnowledgeFact(ctx context.Context, arg RestoreKnowledgeFactParams) (Fact, error)

func (*Queries) RestoreReflectWorldFact added in v0.60.0

func (q *Queries) RestoreReflectWorldFact(ctx context.Context, arg RestoreReflectWorldFactParams) (Fact, error)

func (*Queries) RevokeAuthUserToken

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

func (*Queries) RevokeOAuthAuthorizationCodesForUserClient added in v0.60.0

func (q *Queries) RevokeOAuthAuthorizationCodesForUserClient(ctx context.Context, arg RevokeOAuthAuthorizationCodesForUserClientParams) (int64, error)

Burn any outstanding (unconsumed) codes when a user revokes a grant, so a code issued seconds before the revoke cannot be exchanged into a fresh grant.

func (*Queries) RevokeOAuthRefreshFamiliesForUserClient added in v0.60.0

func (q *Queries) RevokeOAuthRefreshFamiliesForUserClient(ctx context.Context, arg RevokeOAuthRefreshFamiliesForUserClientParams) (int64, error)

User-initiated per-client revoke: kill every family the user holds for a client. One UPDATE covers all the client's access + refresh tokens.

func (*Queries) RevokeOAuthRefreshFamily added in v0.60.0

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

Kill one family: reuse detection or a single-grant revoke. Access and refresh tokens in the family fail closed at resolve time by joining revoked_at.

func (*Queries) RevokePersonalAccessToken added in v0.60.0

func (q *Queries) RevokePersonalAccessToken(ctx context.Context, arg RevokePersonalAccessTokenParams) (int64, error)

func (*Queries) RevokePersonalAccessTokenByUser added in v0.60.0

func (q *Queries) RevokePersonalAccessTokenByUser(ctx context.Context, userID string) (int64, error)

Cascade-revoke all of a user's PATs (e.g. on account deactivation).

func (*Queries) RotateAuthUserToken

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

func (*Queries) SearchArticleEmbeddings added in v0.50.3

func (q *Queries) SearchArticleEmbeddings(ctx context.Context, arg SearchArticleEmbeddingsParams) ([]SearchArticleEmbeddingsRow, error)

Vector KNN over article embeddings, scoped to user_id (articles carry user_id directly, no conversation join). WHERE model pins the vector space; ORDER BY the <=> operator drives the HNSW cosine index. score is cosine similarity (1 - distance), higher is better. saved_at, id break ties. Keep ASCII.

func (*Queries) SearchArticles

func (q *Queries) SearchArticles(ctx context.Context, arg SearchArticlesParams) ([]SearchArticlesRow, error)

Multi-field BM25 search over title/summary/tags/author via pg_search. Each field is matched with paradedb.match, which tokenizes the raw user text with the jieba tokenizer (dictionary + statistical CJK word segmentation, CJK matches natively with no fallback tier) and never errors on punctuation. Per-field relevance is weighted natively with paradedb.boost (title 3x, tags 2x, summary/author 1x): boost scales each field's BM25 contribution to the row score, so a title hit outranks a tags hit outranks a body/author hit, with no CASE multiplier on the whole row. snippet highlights the title. match is raw user text. saved_at, id break score ties deterministically so identical queries return a stable order.

func (*Queries) SearchMessageEmbeddings added in v0.50.3

func (q *Queries) SearchMessageEmbeddings(ctx context.Context, arg SearchMessageEmbeddingsParams) ([]SearchMessageEmbeddingsRow, error)

Vector KNN over message embeddings, scoped to (user_id, agent_id) across every session like SearchMessages. WHERE model pins the query to a single vector space so a vector produced by a different model never matches; ORDER BY the <=> operator lets the HNSW cosine index drive the scan. score is cosine similarity (1 - distance), higher is better, matching the BM25 lane's score orientation for fusion. created_at, id break ties deterministically.

func (*Queries) SearchMessages

func (q *Queries) SearchMessages(ctx context.Context, arg SearchMessagesParams) ([]SearchMessagesRow, error)

Spans every conversation of the current (user_id, agent_id) so memory recall survives across sessions. Joins ctx_conversation to pin the scope and surface provenance (session_id, title). Global ORDER BY score + LIMIT keeps the best matches across the merged corpus, not per-conversation truncations. Lexical ranking is pg_search BM25; paradedb.match tokenizes the raw user text with the jieba tokenizer (dictionary + statistical CJK word segmentation, so CJK matches natively with no fallback tier) and never errors on punctuation or query-syntax characters. The match arg is the raw user text. Multi-term queries are OR'd and ranked by BM25, which sinks weak partial matches below strong full matches. created_at, id break score ties deterministically: cross-source RRF uses each row's rank, so a stable order keeps the same query from reshuffling the merge.

func (*Queries) SearchSummaries

func (q *Queries) SearchSummaries(ctx context.Context, arg SearchSummariesParams) ([]SearchSummariesRow, error)

Spans every conversation of the current (user_id, agent_id); see SearchMessages. Lexical ranking is pg_search BM25; paradedb.match tokenizes the raw user text with the jieba tokenizer (dictionary + statistical CJK word segmentation, CJK matches natively) and never errors on punctuation. The match arg is the raw user text. Stable score tie-break (see SearchMessages): content time, then id, so the per-source rank that cross-source RRF consumes is deterministic.

func (*Queries) SearchSummaryEmbeddings added in v0.50.3

func (q *Queries) SearchSummaryEmbeddings(ctx context.Context, arg SearchSummaryEmbeddingsParams) ([]SearchSummaryEmbeddingsRow, error)

Vector KNN over summary embeddings; mirror of SearchMessageEmbeddings (same space + scope guards, cosine similarity score). Tie-break by content time then id. Keep ASCII.

func (*Queries) SeedProvider

func (q *Queries) SeedProvider(ctx context.Context, arg SeedProviderParams) error

func (*Queries) SetAttemptGaps added in v0.49.4

func (q *Queries) SetAttemptGaps(ctx context.Context, arg SetAttemptGapsParams) error

func (*Queries) SetAttemptRepairRounds added in v0.60.0

func (q *Queries) SetAttemptRepairRounds(ctx context.Context, arg SetAttemptRepairRoundsParams) error

func (*Queries) SetGoalAcceptanceState added in v0.49.4

func (q *Queries) SetGoalAcceptanceState(ctx context.Context, arg SetGoalAcceptanceStateParams) (int64, error)

func (*Queries) SetGoalPlan added in v0.50.0

func (q *Queries) SetGoalPlan(ctx context.Context, arg SetGoalPlanParams) error

Write a composite's decomposition plan (children + edges). Set by a decomposition attempt before materialize; for review_policy='human' the plan sits here while the goal is blocked(needs_plan_approval) until a human acts.

func (*Queries) SetGroupDispatchResultMessage added in v0.47.0

func (q *Queries) SetGroupDispatchResultMessage(ctx context.Context, arg SetGroupDispatchResultMessageParams) (int64, error)

func (*Queries) SetSchedJobRunRootGoal added in v0.60.0

func (q *Queries) SetSchedJobRunRootGoal(ctx context.Context, arg SetSchedJobRunRootGoalParams) error

func (*Queries) SetWorkflowRunRoot added in v0.60.0

func (q *Queries) SetWorkflowRunRoot(ctx context.Context, arg SetWorkflowRunRootParams) (int64, error)

func (*Queries) SetWorkflowRunStatus added in v0.60.0

func (q *Queries) SetWorkflowRunStatus(ctx context.Context, arg SetWorkflowRunStatusParams) error

func (*Queries) StampGoalWorkflow added in v0.60.0

func (q *Queries) StampGoalWorkflow(ctx context.Context, arg StampGoalWorkflowParams) error

Mark composite children whose sub-plan is frozen by a workflow. The decomposition dispatcher filters workflow_id IS NULL, so stamped children are never picked up for autonomous replanning between walk transactions. Runs in the same tx as the parent layer materialize so the exclusion is atomic.

func (*Queries) SubmitAttempt added in v0.49.4

func (q *Queries) SubmitAttempt(ctx context.Context, arg SubmitAttemptParams) (int64, error)

func (*Queries) TouchKnowledgeUsage added in v0.60.0

func (q *Queries) TouchKnowledgeUsage(ctx context.Context, arg TouchKnowledgeUsageParams) error

func (*Queries) TouchReflectSkillRuntimeUse added in v0.60.0

func (q *Queries) TouchReflectSkillRuntimeUse(ctx context.Context, arg TouchReflectSkillRuntimeUseParams) (int64, error)

func (*Queries) TransitionGoalLifecycle added in v0.49.4

func (q *Queries) TransitionGoalLifecycle(ctx context.Context, arg TransitionGoalLifecycleParams) (int64, error)

func (*Queries) UnarchiveGoal added in v0.49.4

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

func (*Queries) UpdateAgent

func (q *Queries) UpdateAgent(ctx context.Context, arg UpdateAgentParams) error

func (*Queries) UpdateArticle

func (q *Queries) UpdateArticle(ctx context.Context, arg UpdateArticleParams) (RecallyArticle, error)

func (*Queries) UpdateAuthUserTokenLastUsed

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

func (*Queries) UpdateConversationArchived

func (q *Queries) UpdateConversationArchived(ctx context.Context, arg UpdateConversationArchivedParams) error

func (*Queries) UpdateConversationBootstrapped

func (q *Queries) UpdateConversationBootstrapped(ctx context.Context, arg UpdateConversationBootstrappedParams) error

func (*Queries) UpdateConversationInfoBySessionID added in v0.46.0

func (q *Queries) UpdateConversationInfoBySessionID(ctx context.Context, arg UpdateConversationInfoBySessionIDParams) error

func (*Queries) UpdateConversationKindProject added in v0.34.0

func (q *Queries) UpdateConversationKindProject(ctx context.Context, arg UpdateConversationKindProjectParams) error

func (*Queries) UpdateConversationLastActive

func (q *Queries) UpdateConversationLastActive(ctx context.Context, arg UpdateConversationLastActiveParams) error

func (*Queries) UpdateConversationTitle

func (q *Queries) UpdateConversationTitle(ctx context.Context, arg UpdateConversationTitleParams) error

func (*Queries) UpdateConversationTitleBySessionID

func (q *Queries) UpdateConversationTitleBySessionID(ctx context.Context, arg UpdateConversationTitleBySessionIDParams) error

func (*Queries) UpdateFeed added in v0.43.0

func (q *Queries) UpdateFeed(ctx context.Context, arg UpdateFeedParams) (RecallyFeed, error)

func (*Queries) UpdateFeedEntry added in v0.43.0

func (q *Queries) UpdateFeedEntry(ctx context.Context, arg UpdateFeedEntryParams) (RecallyFeedEntry, error)

func (*Queries) UpdateGoalIntent added in v0.49.4

func (q *Queries) UpdateGoalIntent(ctx context.Context, arg UpdateGoalIntentParams) error

func (*Queries) UpdateGroupName added in v0.43.0

func (q *Queries) UpdateGroupName(ctx context.Context, arg UpdateGroupNameParams) (CtxGroupState, error)

func (*Queries) UpdateMCPServerByScope added in v0.60.0

func (q *Queries) UpdateMCPServerByScope(ctx context.Context, arg UpdateMCPServerByScopeParams) (McpServer, error)

func (*Queries) UpdateMCPServerEnabled added in v0.60.0

func (q *Queries) UpdateMCPServerEnabled(ctx context.Context, arg UpdateMCPServerEnabledParams) error

func (*Queries) UpdateManagedSkill added in v0.60.0

func (q *Queries) UpdateManagedSkill(ctx context.Context, arg UpdateManagedSkillParams) (Skill, error)

func (*Queries) UpdateOAuthAccessTokenLastUsed added in v0.60.0

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

func (*Queries) UpdateOAuthClientSecret added in v0.60.0

func (q *Queries) UpdateOAuthClientSecret(ctx context.Context, arg UpdateOAuthClientSecretParams) (int64, error)

func (*Queries) UpdatePersonalAccessTokenLastUsed added in v0.60.0

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

Throttled to at most one write per 5 minutes, mirroring auth_user_token, so a hot token does not write the row on every API request.

func (*Queries) UpdateProject added in v0.34.0

func (q *Queries) UpdateProject(ctx context.Context, arg UpdateProjectParams) (Project, error)

func (*Queries) UpdateProvider

func (q *Queries) UpdateProvider(ctx context.Context, arg UpdateProviderParams) error

func (*Queries) UpdateReflectOwnedUserAgentSkill added in v0.60.0

func (q *Queries) UpdateReflectOwnedUserAgentSkill(ctx context.Context, arg UpdateReflectOwnedUserAgentSkillParams) (Skill, error)

func (*Queries) UpdateSchedJobRun

func (q *Queries) UpdateSchedJobRun(ctx context.Context, arg UpdateSchedJobRunParams) error

func (*Queries) UpdateSchedulerJob

func (q *Queries) UpdateSchedulerJob(ctx context.Context, arg UpdateSchedulerJobParams) error

func (*Queries) UpdateSkillMetadata

func (q *Queries) UpdateSkillMetadata(ctx context.Context, arg UpdateSkillMetadataParams) error

func (*Queries) UpdateSystemSkillMetadata added in v0.35.3

func (q *Queries) UpdateSystemSkillMetadata(ctx context.Context, arg UpdateSystemSkillMetadataParams) error

func (*Queries) UpdateUserActive added in v0.38.0

func (q *Queries) UpdateUserActive(ctx context.Context, arg UpdateUserActiveParams) error

func (*Queries) UpdateUserRole added in v0.38.0

func (q *Queries) UpdateUserRole(ctx context.Context, arg UpdateUserRoleParams) error

func (*Queries) UpsertAgentConstraints

func (q *Queries) UpsertAgentConstraints(ctx context.Context, arg UpsertAgentConstraintsParams) (CtxAgentMemory, error)

func (*Queries) UpsertAgentSoul

func (q *Queries) UpsertAgentSoul(ctx context.Context, arg UpsertAgentSoulParams) error

func (*Queries) UpsertAgentSoulVersioned

func (q *Queries) UpsertAgentSoulVersioned(ctx context.Context, arg UpsertAgentSoulVersionedParams) (CtxAgentMemory, error)

func (*Queries) UpsertArticleContent added in v0.60.0

func (q *Queries) UpsertArticleContent(ctx context.Context, arg UpsertArticleContentParams) error

func (*Queries) UpsertArticleEmbedding added in v0.50.3

func (q *Queries) UpsertArticleEmbedding(ctx context.Context, arg UpsertArticleEmbeddingParams) error

Semantic-search vector for one article; see UpsertMessageEmbedding. Keep ASCII.

func (*Queries) UpsertAuthOAuthProvider added in v0.27.0

func (q *Queries) UpsertAuthOAuthProvider(ctx context.Context, arg UpsertAuthOAuthProviderParams) error

func (*Queries) UpsertChannel

func (q *Queries) UpsertChannel(ctx context.Context, arg UpsertChannelParams) error

func (*Queries) UpsertChatAgent

func (q *Queries) UpsertChatAgent(ctx context.Context, arg UpsertChatAgentParams) error

func (*Queries) UpsertDigest added in v0.30.0

func (q *Queries) UpsertDigest(ctx context.Context, arg UpsertDigestParams) (RecallyDigest, error)

func (*Queries) UpsertGroupMemoryVersioned added in v0.42.0

func (q *Queries) UpsertGroupMemoryVersioned(ctx context.Context, arg UpsertGroupMemoryVersionedParams) (CtxGroupMemory, error)

func (*Queries) UpsertIngestCursor added in v0.42.0

func (q *Queries) UpsertIngestCursor(ctx context.Context, arg UpsertIngestCursorParams) error

func (*Queries) UpsertKnowledgeUsage added in v0.60.0

func (q *Queries) UpsertKnowledgeUsage(ctx context.Context, arg UpsertKnowledgeUsageParams) error

func (*Queries) UpsertManifestPluginOverride added in v0.38.0

func (q *Queries) UpsertManifestPluginOverride(ctx context.Context, arg UpsertManifestPluginOverrideParams) error

func (*Queries) UpsertMessageEmbedding added in v0.50.3

func (q *Queries) UpsertMessageEmbedding(ctx context.Context, arg UpsertMessageEmbeddingParams) error

Write or replace the semantic-search vector for one message. model is the vector-space key every KNN query must filter on; content_hash is the hash of the embedded text so a later pass can spot rows whose source content changed. Keep this comment ASCII (sqlc rewriter offsets).

func (*Queries) UpsertPlugin

func (q *Queries) UpsertPlugin(ctx context.Context, arg UpsertPluginParams) error

func (*Queries) UpsertPluginStateEntry

func (q *Queries) UpsertPluginStateEntry(ctx context.Context, arg UpsertPluginStateEntryParams) error

func (*Queries) UpsertProfileEntries added in v0.42.0

func (q *Queries) UpsertProfileEntries(ctx context.Context, arg UpsertProfileEntriesParams) (CtxAgentMemory, error)

func (*Queries) UpsertProviderModelsCache added in v0.60.0

func (q *Queries) UpsertProviderModelsCache(ctx context.Context, arg UpsertProviderModelsCacheParams) error

Replace the fetched model IDs for one provider; other providers are untouched.

func (*Queries) UpsertSetting

func (q *Queries) UpsertSetting(ctx context.Context, arg UpsertSettingParams) error

func (*Queries) UpsertSkillFile

func (q *Queries) UpsertSkillFile(ctx context.Context, arg UpsertSkillFileParams) error

func (*Queries) UpsertSkillUsageOnReflectCreate added in v0.60.0

func (q *Queries) UpsertSkillUsageOnReflectCreate(ctx context.Context, arg UpsertSkillUsageOnReflectCreateParams) error

func (*Queries) UpsertSummaryEmbedding added in v0.50.3

func (q *Queries) UpsertSummaryEmbedding(ctx context.Context, arg UpsertSummaryEmbeddingParams) error

Semantic-search vector for one summary; see UpsertMessageEmbedding. Keep ASCII.

func (*Queries) UpsertToolOverride added in v0.60.0

func (q *Queries) UpsertToolOverride(ctx context.Context, arg UpsertToolOverrideParams) (ToolOverride, error)

func (*Queries) UpsertUserAgentMemory

func (q *Queries) UpsertUserAgentMemory(ctx context.Context, arg UpsertUserAgentMemoryParams) error

func (*Queries) UpsertUserAgentMemoryVersioned

func (q *Queries) UpsertUserAgentMemoryVersioned(ctx context.Context, arg UpsertUserAgentMemoryVersionedParams) (CtxAgentMemory, error)

func (*Queries) UpsertVaultEntryByScope added in v0.48.0

func (q *Queries) UpsertVaultEntryByScope(ctx context.Context, arg UpsertVaultEntryByScopeParams) (VaultEntry, error)

func (*Queries) WaiveEdge added in v0.49.4

func (q *Queries) WaiveEdge(ctx context.Context, arg WaiveEdgeParams) error

func (*Queries) WithTx

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

type RecallyArticle added in v0.38.0

type RecallyArticle struct {
	ID           string             `json:"id"`
	UserID       string             `json:"user_id"`
	AgentID      pgtype.Text        `json:"agent_id"`
	Url          string             `json:"url"`
	CanonicalUrl string             `json:"canonical_url"`
	SourceType   string             `json:"source_type"`
	Title        string             `json:"title"`
	Author       string             `json:"author"`
	Summary      string             `json:"summary"`
	Tags         string             `json:"tags"`
	Status       string             `json:"status"`
	Starred      bool               `json:"starred"`
	FilePath     string             `json:"file_path"`
	Metadata     json.RawMessage    `json:"metadata"`
	PublishedAt  pgtype.Timestamptz `json:"published_at"`
	SavedAt      time.Time          `json:"saved_at"`
	ReadAt       pgtype.Timestamptz `json:"read_at"`
	CreatedAt    time.Time          `json:"created_at"`
	UpdatedAt    time.Time          `json:"updated_at"`
}

type RecallyArticleContent added in v0.60.0

type RecallyArticleContent struct {
	ArticleID string    `json:"article_id"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type RecallyArticleEmbedding added in v0.50.0

type RecallyArticleEmbedding struct {
	ArticleID   string             `json:"article_id"`
	Model       string             `json:"model"`
	ContentHash []byte             `json:"content_hash"`
	Embedding   pgvector_go.Vector `json:"embedding"`
	CreatedAt   time.Time          `json:"created_at"`
	UpdatedAt   time.Time          `json:"updated_at"`
}

type RecallyDigest added in v0.30.0

type RecallyDigest struct {
	ID                   string          `json:"id"`
	UserID               string          `json:"user_id"`
	Date                 string          `json:"date"`
	Narrative            string          `json:"narrative"`
	SavedYesterdayCount  int64           `json:"saved_yesterday_count"`
	UnreadCount          int64           `json:"unread_count"`
	ReadCount            int64           `json:"read_count"`
	ArchivedCount        int64           `json:"archived_count"`
	StarredCount         int64           `json:"starred_count"`
	WorthRevisitingCount int64           `json:"worth_revisiting_count"`
	TotalArticles        int64           `json:"total_articles"`
	TopTags              json.RawMessage `json:"top_tags"`
	CreatedAt            time.Time       `json:"created_at"`
	UpdatedAt            time.Time       `json:"updated_at"`
}

type RecallyDigestArticle added in v0.30.0

type RecallyDigestArticle struct {
	DigestID  string `json:"digest_id"`
	ArticleID string `json:"article_id"`
	Section   string `json:"section"`
	Position  int64  `json:"position"`
}

type RecallyFeed added in v0.43.0

type RecallyFeed struct {
	ID            string             `json:"id"`
	UserID        string             `json:"user_id"`
	AgentID       pgtype.Text        `json:"agent_id"`
	Url           string             `json:"url"`
	Kind          string             `json:"kind"`
	Metadata      json.RawMessage    `json:"metadata"`
	Title         string             `json:"title"`
	Description   string             `json:"description"`
	CheckInterval string             `json:"check_interval"`
	LastCheckedAt pgtype.Timestamptz `json:"last_checked_at"`
	LastEtag      string             `json:"last_etag"`
	LastModified  string             `json:"last_modified"`
	Enabled       bool               `json:"enabled"`
	CreatedAt     time.Time          `json:"created_at"`
	UpdatedAt     time.Time          `json:"updated_at"`
}

type RecallyFeedEntry added in v0.43.0

type RecallyFeedEntry struct {
	ID           string             `json:"id"`
	FeedID       string             `json:"feed_id"`
	Guid         string             `json:"guid"`
	Url          string             `json:"url"`
	Title        string             `json:"title"`
	Status       string             `json:"status"`
	ArticleID    pgtype.Text        `json:"article_id"`
	Attempts     int64              `json:"attempts"`
	ErrorMsg     string             `json:"error_msg"`
	DiscoveredAt time.Time          `json:"discovered_at"`
	ProcessedAt  pgtype.Timestamptz `json:"processed_at"`
}

type RecordSchedulerJobRunParams

type RecordSchedulerJobRunParams struct {
	LastRunAt pgtype.Timestamptz `json:"last_run_at"`
	LastError string             `json:"last_error"`
	UpdatedAt time.Time          `json:"updated_at"`
	ID        string             `json:"id"`
}

type RefreshSkillUsageOnReflectPatchParams added in v0.60.0

type RefreshSkillUsageOnReflectPatchParams struct {
	SkillID string `json:"skill_id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type RemoveGroupMemberParams added in v0.42.0

type RemoveGroupMemberParams struct {
	GroupID string `json:"group_id"`
	AgentID string `json:"agent_id"`
}

type RemoveUserAgentParams

type RemoveUserAgentParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type RequeueGroupDispatchParams added in v0.43.0

type RequeueGroupDispatchParams struct {
	NextAttemptAt pgtype.Timestamptz `json:"next_attempt_at"`
	LastError     string             `json:"last_error"`
	ID            string             `json:"id"`
	AttemptCount  int64              `json:"attempt_count"`
}

type RequeueGroupOutboxParams added in v0.43.0

type RequeueGroupOutboxParams struct {
	NextAttemptAt pgtype.Timestamptz `json:"next_attempt_at"`
	LastError     string             `json:"last_error"`
	ID            string             `json:"id"`
	AttemptCount  int64              `json:"attempt_count"`
}

type ResolveSkillParams

type ResolveSkillParams struct {
	Name    string      `json:"name"`
	AgentID pgtype.Text `json:"agent_id"`
	UserID  pgtype.Text `json:"user_id"`
}

type RestoreKnowledgeFactParams added in v0.60.0

type RestoreKnowledgeFactParams struct {
	ID      string `json:"id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type RestoreReflectWorldFactParams added in v0.60.0

type RestoreReflectWorldFactParams struct {
	ID      string `json:"id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type RevokeOAuthAuthorizationCodesForUserClientParams added in v0.60.0

type RevokeOAuthAuthorizationCodesForUserClientParams struct {
	UserID   string `json:"user_id"`
	ClientID string `json:"client_id"`
}

type RevokeOAuthRefreshFamiliesForUserClientParams added in v0.60.0

type RevokeOAuthRefreshFamiliesForUserClientParams struct {
	UserID   string `json:"user_id"`
	ClientID string `json:"client_id"`
}

type RevokePersonalAccessTokenParams added in v0.60.0

type RevokePersonalAccessTokenParams struct {
	ID     string `json:"id"`
	UserID string `json:"user_id"`
}

type SchedJob

type SchedJob struct {
	ID             string             `json:"id"`
	OwnerKind      string             `json:"owner_kind"`
	ExecScope      string             `json:"exec_scope"`
	PluginID       string             `json:"plugin_id"`
	JobKey         string             `json:"job_key"`
	RuntimeName    string             `json:"runtime_name"`
	Name           string             `json:"name"`
	Description    string             `json:"description"`
	ScheduleCron   string             `json:"schedule_cron"`
	ScheduleEvery  string             `json:"schedule_every"`
	ScheduleAt     string             `json:"schedule_at"`
	Message        string             `json:"message"`
	Payload        json.RawMessage    `json:"payload"`
	SessionMode    string             `json:"session_mode"`
	Enabled        bool               `json:"enabled"`
	AgentID        pgtype.Text        `json:"agent_id"`
	UserID         pgtype.Text        `json:"user_id"`
	CreatedAt      time.Time          `json:"created_at"`
	UpdatedAt      time.Time          `json:"updated_at"`
	LastRunAt      pgtype.Timestamptz `json:"last_run_at"`
	LastError      string             `json:"last_error"`
	DispatchKind   string             `json:"dispatch_kind"`
	IdempotencyKey pgtype.Text        `json:"idempotency_key"`
}

type SchedJobRun

type SchedJobRun struct {
	ID         string             `json:"id"`
	JobID      string             `json:"job_id"`
	SessionID  string             `json:"session_id"`
	Status     string             `json:"status"`
	StartedAt  time.Time          `json:"started_at"`
	FinishedAt pgtype.Timestamptz `json:"finished_at"`
	Error      string             `json:"error"`
	Output     string             `json:"output"`
	UserID     pgtype.Text        `json:"user_id"`
	RootGoalID pgtype.Text        `json:"root_goal_id"`
}

type SearchArticleEmbeddingsParams added in v0.50.3

type SearchArticleEmbeddingsParams struct {
	Query  pgvector_go.Vector `json:"query"`
	Model  string             `json:"model"`
	UserID string             `json:"user_id"`
	Limit  int32              `json:"limit"`
}

type SearchArticleEmbeddingsRow added in v0.50.3

type SearchArticleEmbeddingsRow struct {
	RecallyArticle RecallyArticle `json:"recally_article"`
	Score          float64        `json:"score"`
}

type SearchArticlesParams

type SearchArticlesParams struct {
	Match  string `json:"match"`
	UserID string `json:"user_id"`
	Limit  int32  `json:"limit"`
}

type SearchArticlesRow added in v0.46.0

type SearchArticlesRow struct {
	RecallyArticle RecallyArticle `json:"recally_article"`
	Snippet        string         `json:"snippet"`
	Score          float64        `json:"score"`
}

type SearchMessageEmbeddingsParams added in v0.50.3

type SearchMessageEmbeddingsParams struct {
	Query   pgvector_go.Vector `json:"query"`
	Model   string             `json:"model"`
	UserID  pgtype.Text        `json:"user_id"`
	AgentID pgtype.Text        `json:"agent_id"`
	Limit   int32              `json:"limit"`
}

type SearchMessageEmbeddingsRow added in v0.50.3

type SearchMessageEmbeddingsRow struct {
	ID                string      `json:"id"`
	ConversationID    string      `json:"conversation_id"`
	Seq               int64       `json:"seq"`
	Role              string      `json:"role"`
	EventType         string      `json:"event_type"`
	Content           string      `json:"content"`
	TokenCount        int64       `json:"token_count"`
	CreatedAt         time.Time   `json:"created_at"`
	SessionID         string      `json:"session_id"`
	ConversationTitle pgtype.Text `json:"conversation_title"`
	Score             float64     `json:"score"`
}

type SearchMessagesParams

type SearchMessagesParams struct {
	Match   string      `json:"match"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
	Limit   int32       `json:"limit"`
}

type SearchMessagesRow added in v0.46.0

type SearchMessagesRow struct {
	ID                string      `json:"id"`
	ConversationID    string      `json:"conversation_id"`
	Seq               int64       `json:"seq"`
	Role              string      `json:"role"`
	EventType         string      `json:"event_type"`
	Content           string      `json:"content"`
	TokenCount        int64       `json:"token_count"`
	CreatedAt         time.Time   `json:"created_at"`
	SessionID         string      `json:"session_id"`
	ConversationTitle pgtype.Text `json:"conversation_title"`
	Snippet           string      `json:"snippet"`
	Score             float64     `json:"score"`
}

type SearchSummariesParams

type SearchSummariesParams struct {
	Match   string      `json:"match"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
	Limit   int32       `json:"limit"`
}

type SearchSummariesRow added in v0.46.0

type SearchSummariesRow struct {
	ID                      string             `json:"id"`
	ConversationID          string             `json:"conversation_id"`
	Kind                    string             `json:"kind"`
	Depth                   int64              `json:"depth"`
	Content                 string             `json:"content"`
	TokenCount              int64              `json:"token_count"`
	EarliestAt              pgtype.Timestamptz `json:"earliest_at"`
	LatestAt                pgtype.Timestamptz `json:"latest_at"`
	DescendantCount         int64              `json:"descendant_count"`
	DescendantTokenCount    int64              `json:"descendant_token_count"`
	SourceMessageTokenCount int64              `json:"source_message_token_count"`
	CreatedAt               time.Time          `json:"created_at"`
	SessionID               string             `json:"session_id"`
	ConversationTitle       pgtype.Text        `json:"conversation_title"`
	Snippet                 string             `json:"snippet"`
	Score                   float64            `json:"score"`
}

type SearchSummaryEmbeddingsParams added in v0.50.3

type SearchSummaryEmbeddingsParams struct {
	Query   pgvector_go.Vector `json:"query"`
	Model   string             `json:"model"`
	UserID  pgtype.Text        `json:"user_id"`
	AgentID pgtype.Text        `json:"agent_id"`
	Limit   int32              `json:"limit"`
}

type SearchSummaryEmbeddingsRow added in v0.50.3

type SearchSummaryEmbeddingsRow struct {
	ID                      string             `json:"id"`
	ConversationID          string             `json:"conversation_id"`
	Kind                    string             `json:"kind"`
	Depth                   int64              `json:"depth"`
	Content                 string             `json:"content"`
	TokenCount              int64              `json:"token_count"`
	EarliestAt              pgtype.Timestamptz `json:"earliest_at"`
	LatestAt                pgtype.Timestamptz `json:"latest_at"`
	DescendantCount         int64              `json:"descendant_count"`
	DescendantTokenCount    int64              `json:"descendant_token_count"`
	SourceMessageTokenCount int64              `json:"source_message_token_count"`
	CreatedAt               time.Time          `json:"created_at"`
	SessionID               string             `json:"session_id"`
	ConversationTitle       pgtype.Text        `json:"conversation_title"`
	Score                   float64            `json:"score"`
}

type SeedProviderParams

type SeedProviderParams struct {
	ID      string          `json:"id"`
	Type    string          `json:"type"`
	Name    string          `json:"name"`
	Enabled bool            `json:"enabled"`
	Config  json.RawMessage `json:"config"`
}

type SetAttemptGapsParams added in v0.49.4

type SetAttemptGapsParams struct {
	Gaps json.RawMessage `json:"gaps"`
	ID   string          `json:"id"`
}

type SetAttemptRepairRoundsParams added in v0.60.0

type SetAttemptRepairRoundsParams struct {
	RepairRounds int32  `json:"repair_rounds"`
	ID           string `json:"id"`
}

type SetGoalAcceptanceStateParams added in v0.49.4

type SetGoalAcceptanceStateParams struct {
	AcceptanceState string `json:"acceptance_state"`
	AcceptanceSeq   int64  `json:"acceptance_seq"`
	ID              string `json:"id"`
}

type SetGoalPlanParams added in v0.50.0

type SetGoalPlanParams struct {
	Plan json.RawMessage `json:"plan"`
	ID   string          `json:"id"`
}

type SetGroupDispatchResultMessageParams added in v0.47.0

type SetGroupDispatchResultMessageParams struct {
	ResultMessageID string `json:"result_message_id"`
	ID              string `json:"id"`
	AttemptCount    int64  `json:"attempt_count"`
}

type SetSchedJobRunRootGoalParams added in v0.60.0

type SetSchedJobRunRootGoalParams struct {
	RootGoalID pgtype.Text `json:"root_goal_id"`
	ID         string      `json:"id"`
	JobID      string      `json:"job_id"`
}

type SetWorkflowRunRootParams added in v0.60.0

type SetWorkflowRunRootParams struct {
	RootGoalID pgtype.Text `json:"root_goal_id"`
	PlanHash   string      `json:"plan_hash"`
	ID         string      `json:"id"`
}

type SetWorkflowRunStatusParams added in v0.60.0

type SetWorkflowRunStatusParams struct {
	Status string `json:"status"`
	ID     string `json:"id"`
}

type Share added in v0.35.0

type Share struct {
	ID        string             `json:"id"`
	TokenHash string             `json:"token_hash"`
	UserID    string             `json:"user_id"`
	Title     string             `json:"title"`
	MediaType string             `json:"media_type"`
	Content   []byte             `json:"content"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
	CreatedAt time.Time          `json:"created_at"`
	UpdatedAt time.Time          `json:"updated_at"`
}

type Skill

type Skill struct {
	ID                     string          `json:"id"`
	Scope                  string          `json:"scope"`
	UserID                 pgtype.Text     `json:"user_id"`
	AgentID                pgtype.Text     `json:"agent_id"`
	Name                   string          `json:"name"`
	Description            string          `json:"description"`
	Status                 string          `json:"status"`
	DisableModelInvocation bool            `json:"disable_model_invocation"`
	Metadata               json.RawMessage `json:"metadata"`
	CreatedAt              time.Time       `json:"created_at"`
	UpdatedAt              time.Time       `json:"updated_at"`
	Version                int64           `json:"version"`
}

type SkillChangelog added in v0.60.0

type SkillChangelog struct {
	ID            string          `json:"id"`
	SkillID       string          `json:"skill_id"`
	UserID        pgtype.Text     `json:"user_id"`
	AgentID       pgtype.Text     `json:"agent_id"`
	Scope         string          `json:"scope"`
	Action        string          `json:"action"`
	VersionBefore pgtype.Int8     `json:"version_before"`
	VersionAfter  int64           `json:"version_after"`
	Metadata      json.RawMessage `json:"metadata"`
	CreatedAt     time.Time       `json:"created_at"`
}

type SkillFile

type SkillFile struct {
	SkillID string `json:"skill_id"`
	Path    string `json:"path"`
	Content string `json:"content"`
}

type SkillUsage added in v0.60.0

type SkillUsage struct {
	SkillID    string    `json:"skill_id"`
	UserID     string    `json:"user_id"`
	AgentID    string    `json:"agent_id"`
	UseCount   int64     `json:"use_count"`
	LastUsedAt time.Time `json:"last_used_at"`
	CreatedAt  time.Time `json:"created_at"`
}

type StampGoalWorkflowParams added in v0.60.0

type StampGoalWorkflowParams struct {
	WorkflowID      string   `json:"workflow_id"`
	WorkflowVersion int32    `json:"workflow_version"`
	Ids             []string `json:"ids"`
}

type SubmitAttemptParams added in v0.49.4

type SubmitAttemptParams struct {
	Evidence json.RawMessage `json:"evidence"`
	Output   json.RawMessage `json:"output"`
	ID       string          `json:"id"`
}

type ToolOverride added in v0.60.0

type ToolOverride struct {
	ID        string      `json:"id"`
	ToolName  string      `json:"tool_name"`
	Scope     string      `json:"scope"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
	Enabled   bool        `json:"enabled"`
	CreatedAt time.Time   `json:"created_at"`
	UpdatedAt time.Time   `json:"updated_at"`
}

type TouchKnowledgeUsageParams added in v0.60.0

type TouchKnowledgeUsageParams struct {
	FactID  string `json:"fact_id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type TouchReflectSkillRuntimeUseParams added in v0.60.0

type TouchReflectSkillRuntimeUseParams struct {
	SkillID string `json:"skill_id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type TransitionGoalLifecycleParams added in v0.49.4

type TransitionGoalLifecycleParams struct {
	ToLifecycle   string `json:"to_lifecycle"`
	DoneReason    string `json:"done_reason"`
	BlockReason   string `json:"block_reason"`
	ID            string `json:"id"`
	FromLifecycle string `json:"from_lifecycle"`
}

type UpdateAgentParams

type UpdateAgentParams struct {
	Name                 string          `json:"name"`
	Model                string          `json:"model"`
	ModelThinking        string          `json:"model_thinking"`
	ModelStrong          string          `json:"model_strong"`
	ModelStrongThinking  string          `json:"model_strong_thinking"`
	ModelFast            string          `json:"model_fast"`
	ModelFastThinking    string          `json:"model_fast_thinking"`
	SystemPrompt         string          `json:"system_prompt"`
	Soul                 string          `json:"soul"`
	Workspace            string          `json:"workspace"`
	Sandbox              json.RawMessage `json:"sandbox"`
	EnabledBuiltinSkills json.RawMessage `json:"enabled_builtin_skills"`
	Scope                string          `json:"scope"`
	Enabled              bool            `json:"enabled"`
	ID                   string          `json:"id"`
}

type UpdateArticleParams

type UpdateArticleParams struct {
	Title       string             `json:"title"`
	Author      string             `json:"author"`
	Summary     string             `json:"summary"`
	Tags        string             `json:"tags"`
	Status      string             `json:"status"`
	Starred     bool               `json:"starred"`
	FilePath    string             `json:"file_path"`
	Metadata    json.RawMessage    `json:"metadata"`
	PublishedAt pgtype.Timestamptz `json:"published_at"`
	ReadAt      pgtype.Timestamptz `json:"read_at"`
	ID          string             `json:"id"`
	UserID      string             `json:"user_id"`
}

type UpdateConversationArchivedParams

type UpdateConversationArchivedParams struct {
	Archived  bool        `json:"archived"`
	SessionID string      `json:"session_id"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
}

type UpdateConversationBootstrappedParams added in v0.35.3

type UpdateConversationBootstrappedParams struct {
	ID      string      `json:"id"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type UpdateConversationInfoBySessionIDParams added in v0.46.0

type UpdateConversationInfoBySessionIDParams struct {
	Title     pgtype.Text `json:"title"`
	Archived  bool        `json:"archived"`
	Kind      pgtype.Text `json:"kind"`
	ProjectID pgtype.Text `json:"project_id"`
	GroupID   pgtype.Text `json:"group_id"`
	SessionID string      `json:"session_id"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
}

type UpdateConversationKindProjectParams added in v0.34.0

type UpdateConversationKindProjectParams struct {
	Kind      string      `json:"kind"`
	ProjectID pgtype.Text `json:"project_id"`
	SessionID string      `json:"session_id"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
}

type UpdateConversationLastActiveParams added in v0.35.3

type UpdateConversationLastActiveParams struct {
	SessionID string      `json:"session_id"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
}

type UpdateConversationTitleBySessionIDParams

type UpdateConversationTitleBySessionIDParams struct {
	Title     pgtype.Text `json:"title"`
	SessionID string      `json:"session_id"`
	UserID    pgtype.Text `json:"user_id"`
	AgentID   pgtype.Text `json:"agent_id"`
}

type UpdateConversationTitleParams

type UpdateConversationTitleParams struct {
	Title   pgtype.Text `json:"title"`
	ID      string      `json:"id"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type UpdateFeedEntryParams added in v0.43.0

type UpdateFeedEntryParams struct {
	Status    string      `json:"status"`
	ArticleID pgtype.Text `json:"article_id"`
	ErrorMsg  string      `json:"error_msg"`
	ID        string      `json:"id"`
	FeedID    string      `json:"feed_id"`
}

type UpdateFeedParams added in v0.43.0

type UpdateFeedParams struct {
	Title         string             `json:"title"`
	Description   string             `json:"description"`
	Metadata      json.RawMessage    `json:"metadata"`
	CheckInterval string             `json:"check_interval"`
	LastCheckedAt pgtype.Timestamptz `json:"last_checked_at"`
	LastEtag      string             `json:"last_etag"`
	LastModified  string             `json:"last_modified"`
	Enabled       bool               `json:"enabled"`
	ID            string             `json:"id"`
	UserID        string             `json:"user_id"`
}

type UpdateGoalIntentParams added in v0.49.4

type UpdateGoalIntentParams struct {
	Title              string          `json:"title"`
	Intent             string          `json:"intent"`
	AcceptanceContract json.RawMessage `json:"acceptance_contract"`
	ConvergencePolicy  json.RawMessage `json:"convergence_policy"`
	ReviewPolicy       string          `json:"review_policy"`
	Priority           string          `json:"priority"`
	ID                 string          `json:"id"`
}

type UpdateGroupNameParams added in v0.43.0

type UpdateGroupNameParams struct {
	GroupName string `json:"group_name"`
	ID        string `json:"id"`
}

type UpdateMCPServerByScopeParams added in v0.60.0

type UpdateMCPServerByScopeParams struct {
	NewScope      string      `json:"new_scope"`
	NewUserID     pgtype.Text `json:"new_user_id"`
	NewAgentID    pgtype.Text `json:"new_agent_id"`
	Name          string      `json:"name"`
	Url           string      `json:"url"`
	Transport     string      `json:"transport"`
	AuthType      string      `json:"auth_type"`
	CredentialRef string      `json:"credential_ref"`
	Enabled       bool        `json:"enabled"`
	ID            string      `json:"id"`
	Scope         string      `json:"scope"`
	UserID        pgtype.Text `json:"user_id"`
	AgentID       pgtype.Text `json:"agent_id"`
}

type UpdateMCPServerEnabledParams added in v0.60.0

type UpdateMCPServerEnabledParams struct {
	Enabled bool        `json:"enabled"`
	ID      string      `json:"id"`
	Scope   string      `json:"scope"`
	UserID  pgtype.Text `json:"user_id"`
	AgentID pgtype.Text `json:"agent_id"`
}

type UpdateManagedSkillParams added in v0.60.0

type UpdateManagedSkillParams struct {
	Description            string          `json:"description"`
	Status                 string          `json:"status"`
	DisableModelInvocation bool            `json:"disable_model_invocation"`
	Metadata               json.RawMessage `json:"metadata"`
	ID                     string          `json:"id"`
}

type UpdateOAuthClientSecretParams added in v0.60.0

type UpdateOAuthClientSecretParams struct {
	ClientID         string `json:"client_id"`
	ClientSecretHash string `json:"client_secret_hash"`
	OwnerUserID      string `json:"owner_user_id"`
}

type UpdateProjectParams added in v0.34.0

type UpdateProjectParams struct {
	Name        string      `json:"name"`
	Description pgtype.Text `json:"description"`
	BaseDir     string      `json:"base_dir"`
	ID          string      `json:"id"`
	UserID      string      `json:"user_id"`
}

type UpdateProviderParams

type UpdateProviderParams struct {
	Type    string          `json:"type"`
	Name    string          `json:"name"`
	Enabled bool            `json:"enabled"`
	Config  json.RawMessage `json:"config"`
	ID      string          `json:"id"`
}

type UpdateReflectOwnedUserAgentSkillParams added in v0.60.0

type UpdateReflectOwnedUserAgentSkillParams struct {
	Description            string          `json:"description"`
	Status                 string          `json:"status"`
	DisableModelInvocation bool            `json:"disable_model_invocation"`
	Metadata               json.RawMessage `json:"metadata"`
	ID                     string          `json:"id"`
	UserID                 string          `json:"user_id"`
	AgentID                string          `json:"agent_id"`
	ExpectedVersion        int64           `json:"expected_version"`
}

type UpdateSchedJobRunParams

type UpdateSchedJobRunParams struct {
	Status     string             `json:"status"`
	FinishedAt pgtype.Timestamptz `json:"finished_at"`
	Error      string             `json:"error"`
	Output     string             `json:"output"`
	ID         string             `json:"id"`
	JobID      string             `json:"job_id"`
}

type UpdateSchedulerJobParams

type UpdateSchedulerJobParams struct {
	OwnerKind     string             `json:"owner_kind"`
	ExecScope     string             `json:"exec_scope"`
	PluginID      string             `json:"plugin_id"`
	JobKey        string             `json:"job_key"`
	RuntimeName   string             `json:"runtime_name"`
	Name          string             `json:"name"`
	Description   string             `json:"description"`
	ScheduleCron  string             `json:"schedule_cron"`
	ScheduleEvery string             `json:"schedule_every"`
	ScheduleAt    string             `json:"schedule_at"`
	Message       string             `json:"message"`
	Payload       json.RawMessage    `json:"payload"`
	DispatchKind  string             `json:"dispatch_kind"`
	SessionMode   string             `json:"session_mode"`
	Enabled       bool               `json:"enabled"`
	AgentID       pgtype.Text        `json:"agent_id"`
	UserID        pgtype.Text        `json:"user_id"`
	UpdatedAt     time.Time          `json:"updated_at"`
	LastRunAt     pgtype.Timestamptz `json:"last_run_at"`
	LastError     string             `json:"last_error"`
	ID            string             `json:"id"`
}

type UpdateSkillMetadataParams

type UpdateSkillMetadataParams struct {
	Description            string          `json:"description"`
	Status                 string          `json:"status"`
	DisableModelInvocation bool            `json:"disable_model_invocation"`
	Metadata               json.RawMessage `json:"metadata"`
	ID                     string          `json:"id"`
	AgentID                pgtype.Text     `json:"agent_id"`
	UserID                 pgtype.Text     `json:"user_id"`
}

type UpdateSystemSkillMetadataParams added in v0.35.3

type UpdateSystemSkillMetadataParams struct {
	Description            string          `json:"description"`
	Status                 string          `json:"status"`
	DisableModelInvocation bool            `json:"disable_model_invocation"`
	Metadata               json.RawMessage `json:"metadata"`
	ID                     string          `json:"id"`
}

type UpdateUserActiveParams added in v0.38.0

type UpdateUserActiveParams struct {
	IsActive bool   `json:"is_active"`
	ID       string `json:"id"`
}

type UpdateUserRoleParams added in v0.38.0

type UpdateUserRoleParams struct {
	Role string `json:"role"`
	ID   string `json:"id"`
}

type UpsertAgentConstraintsParams

type UpsertAgentConstraintsParams struct {
	UserID      string          `json:"user_id"`
	AgentID     string          `json:"agent_id"`
	Constraints json.RawMessage `json:"constraints"`
}

type UpsertAgentSoulParams

type UpsertAgentSoulParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
	Soul    string `json:"soul"`
}

type UpsertAgentSoulVersionedParams

type UpsertAgentSoulVersionedParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
	Soul    string `json:"soul"`
}

type UpsertArticleContentParams added in v0.60.0

type UpsertArticleContentParams struct {
	ArticleID string `json:"article_id"`
	Content   string `json:"content"`
}

type UpsertArticleEmbeddingParams added in v0.50.3

type UpsertArticleEmbeddingParams struct {
	ArticleID   string             `json:"article_id"`
	Model       string             `json:"model"`
	ContentHash []byte             `json:"content_hash"`
	Embedding   pgvector_go.Vector `json:"embedding"`
}

type UpsertAuthOAuthProviderParams added in v0.27.0

type UpsertAuthOAuthProviderParams struct {
	ID              string `json:"id"`
	ProviderID      string `json:"provider_id"`
	ClientID        string `json:"client_id"`
	ClientSecretEnc string `json:"client_secret_enc"`
	RedirectUrl     string `json:"redirect_url"`
}

type UpsertChannelParams

type UpsertChannelParams struct {
	ID      string      `json:"id"`
	Name    string      `json:"name"`
	Type    string      `json:"type"`
	AgentID pgtype.Text `json:"agent_id"`
	Enabled bool        `json:"enabled"`
	Config  string      `json:"config"`
}

type UpsertChatAgentParams

type UpsertChatAgentParams struct {
	ChannelID string `json:"channel_id"`
	Platform  string `json:"platform"`
	ChatID    string `json:"chat_id"`
	AgentID   string `json:"agent_id"`
}

type UpsertDigestParams added in v0.30.0

type UpsertDigestParams struct {
	ID                   string          `json:"id"`
	UserID               string          `json:"user_id"`
	Date                 string          `json:"date"`
	Narrative            string          `json:"narrative"`
	SavedYesterdayCount  int64           `json:"saved_yesterday_count"`
	UnreadCount          int64           `json:"unread_count"`
	ReadCount            int64           `json:"read_count"`
	ArchivedCount        int64           `json:"archived_count"`
	StarredCount         int64           `json:"starred_count"`
	WorthRevisitingCount int64           `json:"worth_revisiting_count"`
	TotalArticles        int64           `json:"total_articles"`
	TopTags              json.RawMessage `json:"top_tags"`
}

type UpsertGroupMemoryVersionedParams added in v0.42.0

type UpsertGroupMemoryVersionedParams struct {
	GroupID string `json:"group_id"`
	Content string `json:"content"`
}

type UpsertIngestCursorParams added in v0.42.0

type UpsertIngestCursorParams struct {
	GroupID  string `json:"group_id"`
	Pipeline string `json:"pipeline"`
	LastSeq  int64  `json:"last_seq"`
}

type UpsertKnowledgeUsageParams added in v0.60.0

type UpsertKnowledgeUsageParams struct {
	FactID  string `json:"fact_id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type UpsertManifestPluginOverrideParams added in v0.38.0

type UpsertManifestPluginOverrideParams struct {
	PluginID           string      `json:"plugin_id"`
	Enabled            pgtype.Bool `json:"enabled"`
	SessionEnvVaultKey string      `json:"session_env_vault_key"`
	Config             string      `json:"config"`
}

type UpsertMessageEmbeddingParams added in v0.50.3

type UpsertMessageEmbeddingParams struct {
	MessageID   string             `json:"message_id"`
	Model       string             `json:"model"`
	ContentHash []byte             `json:"content_hash"`
	Embedding   pgvector_go.Vector `json:"embedding"`
}

type UpsertPluginParams

type UpsertPluginParams struct {
	ID      string          `json:"id"`
	Kind    string          `json:"kind"`
	Name    string          `json:"name"`
	Enabled bool            `json:"enabled"`
	Config  json.RawMessage `json:"config"`
}

type UpsertPluginStateEntryParams

type UpsertPluginStateEntryParams struct {
	PluginID  string          `json:"plugin_id"`
	ScopeKind string          `json:"scope_kind"`
	ScopeID   string          `json:"scope_id"`
	StateKey  string          `json:"state_key"`
	Value     json.RawMessage `json:"value"`
}

type UpsertProfileEntriesParams added in v0.42.0

type UpsertProfileEntriesParams struct {
	UserID         string          `json:"user_id"`
	AgentID        string          `json:"agent_id"`
	ProfileEntries json.RawMessage `json:"profile_entries"`
}

type UpsertProviderModelsCacheParams added in v0.60.0

type UpsertProviderModelsCacheParams struct {
	ProviderID string          `json:"provider_id"`
	Models     json.RawMessage `json:"models"`
}

type UpsertSettingParams

type UpsertSettingParams struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type UpsertSkillFileParams

type UpsertSkillFileParams struct {
	SkillID string `json:"skill_id"`
	Path    string `json:"path"`
	Content string `json:"content"`
}

type UpsertSkillUsageOnReflectCreateParams added in v0.60.0

type UpsertSkillUsageOnReflectCreateParams struct {
	SkillID string `json:"skill_id"`
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
}

type UpsertSummaryEmbeddingParams added in v0.50.3

type UpsertSummaryEmbeddingParams struct {
	SummaryID   string             `json:"summary_id"`
	Model       string             `json:"model"`
	ContentHash []byte             `json:"content_hash"`
	Embedding   pgvector_go.Vector `json:"embedding"`
}

type UpsertToolOverrideParams added in v0.60.0

type UpsertToolOverrideParams struct {
	ToolName string      `json:"tool_name"`
	Scope    string      `json:"scope"`
	UserID   pgtype.Text `json:"user_id"`
	AgentID  pgtype.Text `json:"agent_id"`
	Enabled  bool        `json:"enabled"`
}

type UpsertUserAgentMemoryParams

type UpsertUserAgentMemoryParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
	Content string `json:"content"`
}

type UpsertUserAgentMemoryVersionedParams

type UpsertUserAgentMemoryVersionedParams struct {
	UserID  string `json:"user_id"`
	AgentID string `json:"agent_id"`
	Content string `json:"content"`
}

type UpsertVaultEntryByScopeParams added in v0.48.0

type UpsertVaultEntryByScopeParams struct {
	ID          string      `json:"id"`
	Scope       string      `json:"scope"`
	UserID      pgtype.Text `json:"user_id"`
	AgentID     pgtype.Text `json:"agent_id"`
	Name        string      `json:"name"`
	Ciphertext  string      `json:"ciphertext"`
	Description pgtype.Text `json:"description"`
}

type VaultEntry

type VaultEntry struct {
	ID          string      `json:"id"`
	Scope       string      `json:"scope"`
	UserID      pgtype.Text `json:"user_id"`
	AgentID     pgtype.Text `json:"agent_id"`
	Name        string      `json:"name"`
	Ciphertext  string      `json:"ciphertext"`
	CreatedAt   time.Time   `json:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
	Description pgtype.Text `json:"description"`
}

type VaultUser added in v0.38.0

type VaultUser struct {
	AgePublicKey  string
	AgePrivateKey string
}

VaultUser holds the age key fields the vault service needs from a user record.

type WaiveEdgeParams added in v0.49.4

type WaiveEdgeParams struct {
	WaivedByUser pgtype.Text `json:"waived_by_user"`
	WaiverReason string      `json:"waiver_reason"`
	GoalID       string      `json:"goal_id"`
	UpstreamID   string      `json:"upstream_id"`
}

Jump to

Keyboard shortcuts

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